Compare commits
2 Commits
545dc266e0
...
91433732dc
| Author | SHA1 | Date | |
|---|---|---|---|
| 91433732dc | |||
| 3ddba90fc2 |
|
|
@ -131,7 +131,7 @@ public class AppController extends BaseController
|
|||
public TableDataInfo list(EtParkingArea etParkingArea)
|
||||
{
|
||||
etParkingArea.setStatus("0");
|
||||
startPage();
|
||||
// startPage();
|
||||
List<EtParkingArea> list = etParkingAreaService.selectEtParkingAreaList(etParkingArea);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -383,4 +383,20 @@ public class AppController extends BaseController
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询版本并更新
|
||||
*/
|
||||
@GetMapping("/queryVersion")
|
||||
public AjaxResult queryVersion(String sn)
|
||||
{
|
||||
if(StrUtil.isNotBlank(sn)){
|
||||
return AjaxResult.success(asDeviceService.updateVersion(sn));
|
||||
}
|
||||
List<AsDevice> asDevices = asDeviceService.selectAsDeviceList(new AsDevice());
|
||||
for (AsDevice asDevice:asDevices) {
|
||||
asDeviceService.updateVersion(asDevice.getSn());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ruoyi.common.constant.ServiceConstants;
|
|||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.AsUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
|
|
@ -91,9 +92,12 @@ public class AppVerifyController extends BaseController
|
|||
@Resource
|
||||
private EtOrderMapper etOrderMapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
|
||||
/**
|
||||
* 故障上报
|
||||
|
|
@ -733,6 +737,7 @@ public class AppVerifyController extends BaseController
|
|||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
@Log(title = "实名认证", businessType = BusinessType.AUTHENTICATION)
|
||||
@GetMapping("/user/authentication")
|
||||
public AjaxResult partnerBillList(AuthenticationVo authenticationVo)
|
||||
{
|
||||
|
|
@ -777,6 +782,7 @@ public class AppVerifyController extends BaseController
|
|||
/**
|
||||
* sn和mac号绑定
|
||||
*/
|
||||
@Log(title = "设备绑定", businessType = BusinessType.BAND)
|
||||
@PostMapping("/band")
|
||||
public AjaxResult bandSn(String sn,String mac)
|
||||
{
|
||||
|
|
@ -842,11 +848,12 @@ public class AppVerifyController extends BaseController
|
|||
public AjaxResult getAreaList()
|
||||
{
|
||||
AsUser asUser = getLoginUser().getAsUser();
|
||||
logger.info("获取到当前app登录用户:【{}】", JSON.toJSON(asUser));
|
||||
if(ObjectUtil.isNull(asUser.getSysUserId())){
|
||||
throw new RuntimeException("用户【"+asUser.getUserName()+"】未绑定系统用户");
|
||||
AsUser asUser1 = asUserMapper.selectUserById(asUser.getUserId());
|
||||
logger.info("获取到当前app登录用户:【{}】", JSON.toJSON(asUser1));
|
||||
if(ObjectUtil.isNull(asUser1.getSysUserId())){
|
||||
throw new RuntimeException("用户【"+asUser1.getUserName()+"】未绑定系统用户");
|
||||
}
|
||||
SysUser sysUser = userService.selectUserById(asUser.getSysUserId());
|
||||
SysUser sysUser = userService.selectUserById(asUser1.getSysUserId());
|
||||
Long deptId;
|
||||
if(sysUser.isAdmin()){
|
||||
deptId = null;
|
||||
|
|
@ -858,9 +865,44 @@ public class AppVerifyController extends BaseController
|
|||
return success(longs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据token获取运营商信息
|
||||
*/
|
||||
@GetMapping("/getDept")
|
||||
public AjaxResult getDept()
|
||||
{
|
||||
AsUser asUser = getLoginUser().getAsUser();
|
||||
logger.info("获取到当前app登录用户:【{}】", JSON.toJSON(asUser));
|
||||
if(ObjectUtil.isNull(asUser.getSysUserId())){
|
||||
throw new RuntimeException("用户【"+asUser.getUserName()+"】未绑定系统用户");
|
||||
}
|
||||
SysUser sysUser = userService.selectUserById(asUser.getSysUserId());
|
||||
Long deptId;
|
||||
SysDept sysDept = null;
|
||||
if(!sysUser.isAdmin()){
|
||||
deptId = sysUser.getDeptId();
|
||||
sysDept = deptService.selectDeptById(deptId);
|
||||
logger.info("根据token获取运营商信息:【{}】", JSON.toJSON(sysDept));
|
||||
}
|
||||
return success(sysDept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定APP用户
|
||||
*/
|
||||
@Log(title = "绑定APP用户", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/bandAppUser")
|
||||
public AjaxResult bandAppUser(@RequestBody SysUser user)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
user.setUserId(loginUser.getAsUser().getSysUserId());
|
||||
return toAjax(userService.bandAppUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重启设备
|
||||
*/
|
||||
@Log(title = "重启设备", businessType = BusinessType.REBOOT)
|
||||
@PostMapping("/device/reboot")
|
||||
public AjaxResult reboot(String sn)
|
||||
{
|
||||
|
|
@ -871,4 +913,79 @@ public class AppVerifyController extends BaseController
|
|||
Boolean i =asDeviceService.reboot(sn);
|
||||
return success(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存视频地址
|
||||
*/
|
||||
@Log(title = "保存视频", businessType = BusinessType.VIDEO)
|
||||
@PutMapping("/order/saveVideoUrl")
|
||||
public AjaxResult saveVideoUrl(@RequestBody EtOrder etOrder)
|
||||
{
|
||||
logger.info("【订单保存视频请求参数】:{}", JSON.toJSON(etOrder));
|
||||
//根据订单号查询订单信息
|
||||
EtOrder etOrder1 = etOrderService.selectEtOrderByOrderNo(etOrder.getOrderNo());
|
||||
if(ObjectUtil.isNull(etOrder1)){
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
if(!ServiceConstants.ORDER_TYPE_RIDING.equals(etOrder1.getType())){
|
||||
throw new ServiceException("保存视频失败,类型必须是骑行订单");
|
||||
}
|
||||
return toAjax(etOrderService.updateEtOrderByOrderNo(etOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 还车审核通过
|
||||
* 改状态,退押金
|
||||
*/
|
||||
@Transactional
|
||||
@Log(title = "还车审核通过", businessType = BusinessType.PASSAUDIT)
|
||||
@PostMapping("/passAudit/{orderNo}")
|
||||
public AjaxResult passAudit(@PathVariable("orderNo") String orderNo)
|
||||
{
|
||||
logger.info("还车审核通过请求:【{}】", orderNo);
|
||||
EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo);
|
||||
if(ObjectUtil.isNotNull(order)){
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
return toAjax(etOrderService.passAudit(order));
|
||||
}else{
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆有损坏
|
||||
*/
|
||||
@Log(title = "车辆有损坏", businessType = BusinessType.DAMAGED)
|
||||
@PutMapping("/order/damaged")
|
||||
public AjaxResult edit(@RequestBody EtOrder etOrder)
|
||||
{
|
||||
return toAjax(etOrderService.updateEtOrderByOrderNo(etOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 官方审核通过
|
||||
*/
|
||||
@Log(title = "官方审核通过", businessType = BusinessType.AUTHORITYPASS)
|
||||
@PutMapping("/authoritypass/{orderNo}")
|
||||
public AjaxResult authoritypass(@PathVariable("orderNo") String orderNo)
|
||||
{
|
||||
logger.info("官方审核通过请求:【{}】", orderNo);
|
||||
EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo);
|
||||
if(ObjectUtil.isNotNull(order)){
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
return toAjax(etOrderService.authoritypass(order));
|
||||
}else{
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审核
|
||||
*/
|
||||
@Log(title = "提交审核", businessType = BusinessType.SUBMITAUDIT)
|
||||
@PutMapping("/order/submitAudit")
|
||||
public AjaxResult edit2(@RequestBody EtOrder etOrder)
|
||||
{
|
||||
return toAjax(etOrderService.updateEtOrderByOrderNo(etOrder));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ public class ReceiveController {
|
|||
@Autowired
|
||||
private ScheduledExecutorService scheduledExecutorService;
|
||||
|
||||
@Autowired
|
||||
private IEtOnlineLogService etOnlineLogService;
|
||||
|
||||
private final Object lock = new Object();
|
||||
|
||||
|
||||
|
|
@ -216,7 +219,7 @@ public class ReceiveController {
|
|||
String noRidingOutage = area.getNoRidingOutage();
|
||||
if (noRidingOutage.equals("1") && value.getStatus() != 3 && !isAdminUnlocking.equals("1")) { // 禁行区内断电
|
||||
log.info("禁行区内断电命令--SN:" + device.getSn());
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_QLOSE+IotConstants.COMMAND_FREQUENCY_5, "禁行区内断电");
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_QLOSE+IotConstants.COMMAND_FREQUENCY_5, "禁行区内断电",null);
|
||||
device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||
int updateAsDevice = asDeviceService.updateAsDevice(device);
|
||||
if (updateAsDevice > 0) {
|
||||
|
|
@ -228,7 +231,7 @@ public class ReceiveController {
|
|||
boolean inPolygon = asDeviceService.isNoRidingAreaWithTolerance(device.getSn(), device.getAreaId(),20);
|
||||
if (inPolygon) {
|
||||
log.info("距离禁行区20米内发送警告命令--SN:" + device.getSn());
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_PLAY2, "距离禁行区20米内");
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_PLAY2, "距离禁行区20米内",null);
|
||||
}
|
||||
}
|
||||
/** 3.超出运营区外断电*/
|
||||
|
|
@ -239,14 +242,14 @@ public class ReceiveController {
|
|||
if(inPolygon){
|
||||
//在20米范围内,发报警
|
||||
log.info("超出运营区30米内发送警告命令--SN:" + device.getSn());
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_PLAY3, "超出运营区30米内");
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_PLAY3, "超出运营区30米内",null);
|
||||
}else{
|
||||
//超出运营区外断电
|
||||
String isAdminUnlocking = device.getIsAdminUnlocking();// 是否管理员开锁
|
||||
String areaOutOutage = area.getAreaOutOutage();
|
||||
if (areaOutOutage.equals("1") && value.getStatus() != 3 && !isAdminUnlocking.equals("1")) { // 超出营运区断电
|
||||
log.info("超出营运区断电命令--SN:" + device.getSn());
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_QLOSE+IotConstants.COMMAND_FREQUENCY_5, "超出营运区断电");
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_QLOSE+IotConstants.COMMAND_FREQUENCY_5, "超出营运区断电",null);
|
||||
device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||
int updateAsDevice = asDeviceService.updateAsDevice(device);
|
||||
if (updateAsDevice > 0) {
|
||||
|
|
@ -259,7 +262,7 @@ public class ReceiveController {
|
|||
Boolean inOrderBySn = etOrderService.isInOrderBySn(device.getSn());
|
||||
if (inOrderBySn && ServiceConstants.VEHICLE_STATUS_IN_USING.equals(device.getStatus()) && ServiceConstants.LOCK_STATUS_CLOSE.equals(device.getLockStatus())) { // 有正在骑行的订单,给车辆上电
|
||||
log.info("返回营运区上电,有正在骑行的订单,给车辆上电--SN:" + device.getSn());
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_5, "返回营运区上电");
|
||||
asDeviceService.sendCommand(device.getMac(), Token.getToken(), IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_5, "返回营运区上电",null);
|
||||
// 更新车辆状态和锁状态
|
||||
/** 3.更新车辆状态*/
|
||||
device.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN);
|
||||
|
|
@ -383,7 +386,7 @@ public class ReceiveController {
|
|||
if(StrUtil.isNotBlank(verStr)){
|
||||
device.setVersion(verStr);
|
||||
}
|
||||
//开异步线程保存回调参数
|
||||
//开异步线程:1.更新在线状态 2.记录在线、离线日志
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
if(device.getOnlineStatus().equals(ServiceConstants.VEHICLE_STATUS_OFFLINE)){
|
||||
log.info("【接收onenet推送】异步更新在线状态"+JSON.toJSONString(device));
|
||||
|
|
@ -392,6 +395,17 @@ public class ReceiveController {
|
|||
if(i>0){
|
||||
log.info("【接收onenet推送】异步保存在线状态成功");
|
||||
}
|
||||
EtOnlineLog etOnlineLog = new EtOnlineLog();
|
||||
etOnlineLog.setMac(device.getMac());
|
||||
etOnlineLog.setSn(device.getSn());
|
||||
etOnlineLog.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_ONLINE);
|
||||
etOnlineLog.setLongitude(device.getLongitude());
|
||||
etOnlineLog.setLatitude(device.getLatitude());
|
||||
etOnlineLog.setCreateTime(DateUtils.getNowDate());
|
||||
int i1 = etOnlineLogService.insertEtOnlineLog(etOnlineLog);
|
||||
if(i1>0){
|
||||
log.info("【接收onenet推送】异步保存在线日志成功");
|
||||
}
|
||||
}
|
||||
}, 0, TimeUnit.SECONDS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.EtOnlineLog;
|
||||
import com.ruoyi.system.service.IEtOnlineLogService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 在线/离线日志Controller
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-07-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/onlineLog")
|
||||
public class EtOnlineLogController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEtOnlineLogService etOnlineLogService;
|
||||
|
||||
/**
|
||||
* 查询在线/离线日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:onlineLog:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EtOnlineLog etOnlineLog)
|
||||
{
|
||||
startPage();
|
||||
List<EtOnlineLog> list = etOnlineLogService.selectEtOnlineLogList(etOnlineLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出在线/离线日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:onlineLog:export')")
|
||||
@Log(title = "在线/离线日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EtOnlineLog etOnlineLog)
|
||||
{
|
||||
List<EtOnlineLog> list = etOnlineLogService.selectEtOnlineLogList(etOnlineLog);
|
||||
ExcelUtil<EtOnlineLog> util = new ExcelUtil<EtOnlineLog>(EtOnlineLog.class);
|
||||
util.exportExcel(response, list, "在线/离线日志数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取在线/离线日志详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:onlineLog:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(etOnlineLogService.selectEtOnlineLogById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增在线/离线日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:onlineLog:add')")
|
||||
@Log(title = "在线/离线日志", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EtOnlineLog etOnlineLog)
|
||||
{
|
||||
return toAjax(etOnlineLogService.insertEtOnlineLog(etOnlineLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改在线/离线日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:onlineLog:edit')")
|
||||
@Log(title = "在线/离线日志", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EtOnlineLog etOnlineLog)
|
||||
{
|
||||
return toAjax(etOnlineLogService.updateEtOnlineLog(etOnlineLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除在线/离线日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:onlineLog:remove')")
|
||||
@Log(title = "在线/离线日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(etOnlineLogService.deleteEtOnlineLogByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -123,6 +123,25 @@ public class EtOrderController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 还车审核通过
|
||||
* 改状态,退押金
|
||||
*/
|
||||
@Transactional
|
||||
@Log(title = "还车审核通过", businessType = BusinessType.PASSAUDIT)
|
||||
@PostMapping("/passAudit/{orderNo}")
|
||||
public AjaxResult passAudit(@PathVariable("orderNo") String orderNo)
|
||||
{
|
||||
logger.info("还车审核通过请求:【{}】", orderNo);
|
||||
EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo);
|
||||
if(ObjectUtil.isNotNull(order)){
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
return toAjax(etOrderService.passAudit(order));
|
||||
}else{
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详细信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class EtParkingAreaController extends BaseController
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(EtParkingArea etParkingArea)
|
||||
{
|
||||
startPage();
|
||||
// startPage();
|
||||
List<EtParkingArea> list = etParkingAreaService.selectEtParkingAreaList(etParkingArea);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.core.domain.entity.AsUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.system.domain.EtOperatingArea;
|
||||
import com.ruoyi.system.service.*;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
|
@ -76,6 +77,8 @@ public class SysUserController extends BaseController
|
|||
@PutMapping("/bandAppUser")
|
||||
public AjaxResult bandAppUser(@RequestBody SysUser user)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
user.setUserId(loginUser.getUserId());
|
||||
return toAjax(userService.bandAppUser(user));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -153,6 +153,10 @@ public class HttpStatus
|
|||
*/
|
||||
public static final String ERROR_CODE_DEVICE_NOT_ONLINE = "10421";
|
||||
|
||||
/**
|
||||
* 错误码 请求超时
|
||||
*/
|
||||
public static final String ERROR_CODE_TIMEOUT = "10500";
|
||||
/**
|
||||
* 错误码 新增设备失败:设备已存在
|
||||
*/
|
||||
|
|
@ -206,6 +210,10 @@ public class HttpStatus
|
|||
* 错误码 设备不在线
|
||||
*/
|
||||
public static final String ERROR_CODE_DEVICE_NOT_ONLINE_MSG = "设备不在线";
|
||||
/**
|
||||
* 错误码 请求超时
|
||||
*/
|
||||
public static final String ERROR_CODE_TIMEOUT_MSG = "请求超时";
|
||||
|
||||
/**----------------------------IOT错误码end----------------------------*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class ServiceConstants {
|
|||
/**----------------------------支付场景end----------------------------*/
|
||||
|
||||
/**----------------------------订单状态start----------------------------*/
|
||||
/** 订单状态:0-预约中,1-取消预约,2-开始骑行,3-结束 4-订单结束*/
|
||||
/** 订单状态:0-预约中,1-取消预约,2-开始骑行,3-结束 4-订单结束 5-待审核 6-车辆有损坏 */
|
||||
/**
|
||||
* 订单状态:0-预约中
|
||||
*/
|
||||
|
|
@ -86,6 +86,16 @@ public class ServiceConstants {
|
|||
*/
|
||||
public static final String ORDER_STATUS_ORDER_END = "4";
|
||||
|
||||
/**
|
||||
* 订单状态:5-待审核
|
||||
*/
|
||||
public static final String ORDER_STATUS_TO_BE_AUDIT = "5";
|
||||
|
||||
/**
|
||||
* 订单状态:6-车辆有损坏
|
||||
*/
|
||||
public static final String ORDER_STATUS_DAMAGED = "6";
|
||||
|
||||
/**----------------------------订单状态end----------------------------*/
|
||||
|
||||
/**----------------------------支付状态start----------------------------*/
|
||||
|
|
@ -158,6 +168,11 @@ public class ServiceConstants {
|
|||
*/
|
||||
public static final String VEHICLE_STATUS_TEMPORARILY_LOCK = "4";
|
||||
|
||||
/**
|
||||
* 车辆状态: 6-调度中
|
||||
*/
|
||||
public static final String VEHICLE_STATUS_SCHEDULING = "6";
|
||||
|
||||
/**
|
||||
* 车辆状态: 8-下线 禁用
|
||||
*/
|
||||
|
|
@ -549,4 +564,28 @@ public class ServiceConstants {
|
|||
public static final String IS_DEPOSIT_DEDUCTION = "1";
|
||||
/**----------------------------是否押金抵扣end----------------------------*/
|
||||
|
||||
/**----------------------------所属人类型start----------------------------*/
|
||||
/** 所属人类型:1-运营商;2-合伙人 */
|
||||
/**
|
||||
* 所属人类型:1-运营商
|
||||
*/
|
||||
public static final String OWNER_TYPE_OPERATOR = "1";
|
||||
/**
|
||||
* 所属人类型:2-合伙人
|
||||
*/
|
||||
public static final String OWNER_TYPE_PARTNER = "2";
|
||||
/**----------------------------所属人类型end----------------------------*/
|
||||
|
||||
/**----------------------------还车是否拍照审核start----------------------------*/
|
||||
/** 还车是否拍照审核:0-否;1-是 */
|
||||
/**
|
||||
* 还车是否拍照审核:否
|
||||
*/
|
||||
public static final String RETURN_VERIFY_NO = "0";
|
||||
/**
|
||||
* 还车是否拍照审核:是
|
||||
*/
|
||||
public static final String RETURN_VERIFY_YES = "1";
|
||||
/**----------------------------还车是否拍照审核end----------------------------*/
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ public class SysDept extends BaseEntity
|
|||
/** 是否开启分账 */
|
||||
private String isProfitSharing;
|
||||
|
||||
/** 是否有独立支付账户 */
|
||||
private String separateAccount;
|
||||
|
||||
/** 是否使用创享电动车小程序 */
|
||||
private String isUsePlatformApp;
|
||||
|
||||
|
|
@ -103,6 +106,14 @@ public class SysDept extends BaseEntity
|
|||
/** 退款回调地址 */
|
||||
private String refundNotifyUrl;
|
||||
|
||||
public String getSeparateAccount() {
|
||||
return separateAccount;
|
||||
}
|
||||
|
||||
public void setSeparateAccount(String separateAccount) {
|
||||
this.separateAccount = separateAccount;
|
||||
}
|
||||
|
||||
public String getHandlingCharge() {
|
||||
return handlingCharge;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -58,6 +59,10 @@ public class SysUser extends BaseEntity
|
|||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 余额 */
|
||||
@Excel(name = "余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
|
@ -124,6 +129,14 @@ public class SysUser extends BaseEntity
|
|||
/** app用户id,用于分账或提现 */
|
||||
private Long appUserId;
|
||||
|
||||
public BigDecimal getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(BigDecimal balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public Long getAppUserId() {
|
||||
return appUserId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,6 +77,25 @@ public enum BusinessType
|
|||
*/
|
||||
DEDUCTION,
|
||||
|
||||
/**
|
||||
* 还车审核通过
|
||||
*/
|
||||
PASSAUDIT,
|
||||
|
||||
/**
|
||||
* 车辆有损坏
|
||||
*/
|
||||
DAMAGED,
|
||||
|
||||
/**
|
||||
* 提交审核
|
||||
*/
|
||||
SUBMITAUDIT,
|
||||
|
||||
/**
|
||||
* 还车审核通过
|
||||
*/
|
||||
AUTHORITYPASS,
|
||||
/**
|
||||
* 提现
|
||||
*/
|
||||
|
|
@ -127,4 +146,22 @@ public enum BusinessType
|
|||
* 出仓
|
||||
*/
|
||||
STASH,
|
||||
/**
|
||||
* 保存视频
|
||||
*/
|
||||
VIDEO,
|
||||
/**
|
||||
* 重启设备
|
||||
*/
|
||||
REBOOT,
|
||||
|
||||
/**
|
||||
* 绑定
|
||||
*/
|
||||
BAND,
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
AUTHENTICATION,
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.ruoyi.common.utils.onenet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@lombok.Data
|
||||
public class Data {
|
||||
private int count;
|
||||
private List<Datastream> devices;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.common.utils.onenet;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DataPointRes {
|
||||
private int code;
|
||||
private com.ruoyi.common.utils.onenet.Data data;
|
||||
private String msg;
|
||||
@JSONField(name = "request_id")
|
||||
private String requestId;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.common.utils.onenet;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Datapoint {
|
||||
|
||||
private String at;
|
||||
|
||||
private String id;
|
||||
|
||||
private Object value;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.ruoyi.common.utils.onenet;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DatapointValue {
|
||||
|
||||
private List<Ds> dsArray;
|
||||
private int jiaoshui_qiangdu;
|
||||
private nextDs next_ds;
|
||||
private Mc mc;
|
||||
private Set set;
|
||||
private Tr tr;
|
||||
private int turan_show;
|
||||
|
||||
|
||||
// 定时器列表 Ds
|
||||
@Data
|
||||
public static class Ds {
|
||||
private int hour;//时
|
||||
private int min;//分
|
||||
private Boolean once; //是否单次,false为循环浇水,true为单次
|
||||
private int sec;//浇水时长(单位秒)
|
||||
private Boolean sw;// 开关
|
||||
private int week;//周转成二进制 bit0位开始为周一 0110 (week&1<<0) 1<<1 1<<2 00000110
|
||||
private int id;
|
||||
}
|
||||
|
||||
// 内部类 Mc 脉冲
|
||||
@Data
|
||||
public static class Mc {
|
||||
private int jg_sec;//间隔时间
|
||||
private int js_sec;//启动时间
|
||||
private Boolean kaiguan; //开关 普通模式情况下获取的是ds.js_sec的时间
|
||||
|
||||
}
|
||||
|
||||
// 内部类 Set 设置
|
||||
@Data
|
||||
public static class Set {
|
||||
private Boolean kaiguan;
|
||||
private int xp_min;
|
||||
}
|
||||
|
||||
// 内部类 Tr 土壤
|
||||
@Data
|
||||
public static class Tr {
|
||||
private int end_sd;
|
||||
private Boolean kaiguan;
|
||||
private int start_sd;
|
||||
|
||||
}
|
||||
|
||||
//下次浇水时间
|
||||
@Data
|
||||
public static class nextDs {
|
||||
private int hour;
|
||||
private int min;
|
||||
private int sec;
|
||||
private Boolean sw;//定时总开关,先根据总开关判断定时功能是否关闭,如果打开,再判断定时数组中有没有有效的定时器
|
||||
private int week;//周转成二进制 bit0位开始为周一 0110 (week&1<<0) 1<<1 1<<2 00000110
|
||||
private String date;//日期
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.common.utils.onenet;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Datastream {
|
||||
|
||||
private List<Datapoint> datastreams;
|
||||
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
}
|
||||
|
|
@ -37,6 +37,8 @@ public class IotUtil {
|
|||
return HttpStatus.ERROR_CODE_DEVICE_EVENT_HISTORY_DATA_QUERY_FAIL_MSG;
|
||||
}else if(HttpStatus.ERROR_CODE_DEVICE_OPERATE_RECORD_QUERY_FAIL.equals(code)){
|
||||
return HttpStatus.ERROR_CODE_DEVICE_OPERATE_RECORD_QUERY_FAIL_MSG;
|
||||
}else if(HttpStatus.ERROR_CODE_TIMEOUT.equals(code)){
|
||||
return HttpStatus.ERROR_CODE_TIMEOUT_MSG;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 资金流水对象 et_capital_flow
|
||||
|
|
@ -29,6 +27,15 @@ public class EtCapitalFlow extends BaseEntity
|
|||
@Excel(name = "区域名称")
|
||||
private String areaName;
|
||||
|
||||
@Excel(name = "所属人id")
|
||||
private String owner;
|
||||
|
||||
@Excel(name = "所属人")
|
||||
private Long ownerId;
|
||||
|
||||
@Excel(name = "所属人类型")
|
||||
private String ownerType;
|
||||
|
||||
/** 关联订单号 */
|
||||
@Excel(name = "关联订单号")
|
||||
private String orderNo;
|
||||
|
|
|
|||
|
|
@ -44,5 +44,20 @@ public class EtCommandLog extends BaseEntity
|
|||
@Excel(name = "响应")
|
||||
private String result;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
private String longitude;
|
||||
|
||||
/** 纬度 */
|
||||
@Excel(name = "纬度")
|
||||
private String latitude;
|
||||
|
||||
/** 回调状态 */
|
||||
@Excel(name = "回调状态")
|
||||
private String callStatus;
|
||||
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
|
@ -28,6 +29,11 @@ public class EtFeeRule extends BaseEntity
|
|||
@Excel(name = "运营区id")
|
||||
private Long areaId;
|
||||
|
||||
/** 运营区 */
|
||||
@Excel(name = "运营区")
|
||||
@TableField(exist = false)
|
||||
private EtOperatingArea area;
|
||||
|
||||
/** 运营商 */
|
||||
@Excel(name = "运营商")
|
||||
private String deptName;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 在线/离线日志对象 et_online_log
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-07-13
|
||||
*/
|
||||
@Data
|
||||
public class EtOnlineLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@Excel(name = "主键")
|
||||
private Long id;
|
||||
|
||||
/** MAC */
|
||||
@Excel(name = "MAC")
|
||||
private String mac;
|
||||
|
||||
/** SN */
|
||||
@Excel(name = "SN")
|
||||
private String sn;
|
||||
|
||||
/** 在线状态 */
|
||||
@Excel(name = "在线状态")
|
||||
private String onlineStatus;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
private String longitude;
|
||||
|
||||
/** 纬度 */
|
||||
@Excel(name = "纬度")
|
||||
private String latitude;
|
||||
|
||||
}
|
||||
|
|
@ -207,4 +207,7 @@ public class EtOperatingArea extends BaseEntityPlus implements Serializable
|
|||
|
||||
/** 是否开启押金抵扣:0-否;1-是 */
|
||||
private String isDepositDeduction;
|
||||
|
||||
/** 还车是否拍照审核:0-否;1-是 */
|
||||
private String returnVerify;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,4 +235,15 @@ public class EtOrder extends BaseEntity
|
|||
@TableField(exist = false)
|
||||
private String isDepositDeduction;
|
||||
|
||||
/** 还车视频 */
|
||||
@Excel(name = "还车视频")
|
||||
private String videoUrl;
|
||||
|
||||
/** 扣除金额 */
|
||||
@Excel(name = "扣除金额")
|
||||
private String deductionAmount;
|
||||
|
||||
/** 音频文件 */
|
||||
@Excel(name = "音频文件")
|
||||
private String audioFiles;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,4 +36,10 @@ public class DeviceNumVo {
|
|||
/** 调度设备 */
|
||||
private Integer dispatchNum;
|
||||
|
||||
/** 仓库设备 */
|
||||
private Integer inStashNum;
|
||||
|
||||
/** 运营中 */
|
||||
private Integer inOperation;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.EtOnlineLog;
|
||||
|
||||
/**
|
||||
* 在线/离线日志Mapper接口
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-07-13
|
||||
*/
|
||||
public interface EtOnlineLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询在线/离线日志
|
||||
*
|
||||
* @param id 在线/离线日志主键
|
||||
* @return 在线/离线日志
|
||||
*/
|
||||
public EtOnlineLog selectEtOnlineLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询在线/离线日志列表
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 在线/离线日志集合
|
||||
*/
|
||||
public List<EtOnlineLog> selectEtOnlineLogList(EtOnlineLog etOnlineLog);
|
||||
|
||||
/**
|
||||
* 新增在线/离线日志
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEtOnlineLog(EtOnlineLog etOnlineLog);
|
||||
|
||||
/**
|
||||
* 修改在线/离线日志
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEtOnlineLog(EtOnlineLog etOnlineLog);
|
||||
|
||||
/**
|
||||
* 删除在线/离线日志
|
||||
*
|
||||
* @param id 在线/离线日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEtOnlineLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除在线/离线日志
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEtOnlineLogByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.AsUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
|
|
@ -134,4 +134,12 @@ public interface SysUserMapper
|
|||
* @return
|
||||
*/
|
||||
void bandAppUser(@Param("appUserId") Long appUserId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 更改余额
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
void changeUserBalance(@Param("amount")BigDecimal amount, @Param("userId")Long userId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.system.domain.EtOperatingArea;
|
||||
import com.ruoyi.system.domain.EtOrder;
|
||||
|
||||
|
|
@ -29,9 +30,11 @@ public interface CallbackService {
|
|||
* @param order 订单
|
||||
* @param type 类型
|
||||
* @param busType 业务类型
|
||||
* @param ownerType 所属人类型
|
||||
* @param user 合伙人对象
|
||||
* @return void
|
||||
*/
|
||||
public void capitalFlowRecords(EtOrder order, String type, String busType);
|
||||
public void capitalFlowRecords(EtOrder order, String type, String busType, String ownerType, SysUser user);
|
||||
|
||||
/**
|
||||
* 分红处理
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.utils.onenet.DataPointRes;
|
||||
import com.ruoyi.common.utils.onenet.ResponseVo;
|
||||
import com.ruoyi.system.domain.AsDevice;
|
||||
import com.ruoyi.system.domain.EtOperatingArea;
|
||||
|
|
@ -150,12 +151,17 @@ public interface IAsDeviceService extends IService<AsDevice>
|
|||
/**
|
||||
* 发送命令
|
||||
*/
|
||||
public void sendCommand(String mac, String token,String command,String type);
|
||||
public void sendCommand(String mac, String token,String command,String type,String orderNo);
|
||||
|
||||
/**
|
||||
* 发送命令(带响应)
|
||||
*/
|
||||
public ResponseVo sendCommandWithResp(String mac, String token, String command, String type);
|
||||
public ResponseVo sendCommandWithResp(String mac, String token, String command, String type,String orderNo);
|
||||
|
||||
/**
|
||||
* 查询数据点
|
||||
*/
|
||||
public DataPointRes historyDatapoints(String mac, String token);
|
||||
|
||||
/**
|
||||
* 响铃寻车
|
||||
|
|
@ -327,6 +333,11 @@ public interface IAsDeviceService extends IService<AsDevice>
|
|||
*/
|
||||
IsInParkingAreaVo isInParkingArea(String longitude, String latitude,String areaId,String sn);
|
||||
|
||||
/**
|
||||
* 查询版本并更新
|
||||
*/
|
||||
boolean updateVersion(String sn);
|
||||
|
||||
// /**
|
||||
// * 是否靠近运营区边界
|
||||
// */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.EtOnlineLog;
|
||||
|
||||
/**
|
||||
* 在线/离线日志Service接口
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-07-13
|
||||
*/
|
||||
public interface IEtOnlineLogService
|
||||
{
|
||||
/**
|
||||
* 查询在线/离线日志
|
||||
*
|
||||
* @param id 在线/离线日志主键
|
||||
* @return 在线/离线日志
|
||||
*/
|
||||
public EtOnlineLog selectEtOnlineLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询在线/离线日志列表
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 在线/离线日志集合
|
||||
*/
|
||||
public List<EtOnlineLog> selectEtOnlineLogList(EtOnlineLog etOnlineLog);
|
||||
|
||||
/**
|
||||
* 新增在线/离线日志
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEtOnlineLog(EtOnlineLog etOnlineLog);
|
||||
|
||||
/**
|
||||
* 修改在线/离线日志
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEtOnlineLog(EtOnlineLog etOnlineLog);
|
||||
|
||||
/**
|
||||
* 批量删除在线/离线日志
|
||||
*
|
||||
* @param ids 需要删除的在线/离线日志主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEtOnlineLogByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除在线/离线日志信息
|
||||
*
|
||||
* @param id 在线/离线日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEtOnlineLogById(Long id);
|
||||
}
|
||||
|
|
@ -191,4 +191,14 @@ public interface IEtOrderService
|
|||
* 押金抵扣
|
||||
*/
|
||||
int deduction(EtOrder etOrder);
|
||||
|
||||
/**
|
||||
* 还车审核通过
|
||||
*/
|
||||
boolean passAudit(EtOrder etOrder);
|
||||
|
||||
/**
|
||||
* 官方审核通过
|
||||
*/
|
||||
boolean authoritypass(EtOrder etOrder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,20 +12,14 @@ import com.ruoyi.common.constant.HttpStatus;
|
|||
import com.ruoyi.common.constant.IotConstants;
|
||||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.AsUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.CommonUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.common.utils.map.GeoUtils;
|
||||
import com.ruoyi.common.utils.onenet.CreateDeviceVo;
|
||||
import com.ruoyi.common.utils.onenet.IotUtil;
|
||||
import com.ruoyi.common.utils.onenet.ResponseVo;
|
||||
import com.ruoyi.common.utils.onenet.Token;
|
||||
import com.ruoyi.common.utils.onenet.*;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import com.ruoyi.system.domain.*;
|
||||
import com.ruoyi.system.domain.response.OrderResponse;
|
||||
|
|
@ -103,9 +97,12 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
@Resource
|
||||
private EtOrderMapper etOrderMapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private EtCommandLogMapper etCommandLogMapper;
|
||||
|
||||
@Autowired
|
||||
private IEtOnlineLogService etOnlineLogService;
|
||||
|
||||
@Value(value = "${iot.iotUrl}")
|
||||
private String iotUrl;
|
||||
|
||||
|
|
@ -127,7 +124,30 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
@Override
|
||||
public AsDevice selectAsDeviceByDeviceId(Long deviceId)
|
||||
{
|
||||
return asDeviceMapper.selectAsDeviceByDeviceId(deviceId);
|
||||
AsDevice device = asDeviceMapper.selectAsDeviceByDeviceId(deviceId);
|
||||
String status = device.getStatus();
|
||||
if(ObjectUtil.isNotNull(status)){
|
||||
String typeName = sysDictDataService.selectDictLabel("as_device_status", status);
|
||||
device.setStatusStr(typeName);
|
||||
if(status.equals(ServiceConstants.VEHICLE_STATUS_NOT_BAND) && ObjectUtil.isNotNull(device.getAreaId())){
|
||||
device.setStatus(ServiceConstants.VEHICLE_STATUS_NOT_LISTING);
|
||||
int i = asDeviceMapper.updateAsDevice(device);
|
||||
}
|
||||
}
|
||||
Long areaId = device.getAreaId();
|
||||
if (ObjectUtil.isNotNull(areaId) && areaId!=0){
|
||||
EtOperatingArea etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId);
|
||||
device.setAreaName(etOperatingArea.getAreaName());
|
||||
}
|
||||
if(ObjectUtil.isNotNull(areaId) && areaId!=0){
|
||||
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
|
||||
//https://dianche.chuantewulian.cn?sn=https://dche.ccttiot.com?sn=3000900
|
||||
device.setQrText(sysDept.getDomain()+"?sn="+device.getSn());
|
||||
device.setDeptName(sysDept.getDeptName());
|
||||
}else{
|
||||
device.setQrText("");
|
||||
}
|
||||
return device;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -455,8 +475,12 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
wrapper.between("remaining_power", Integer.parseInt(powerStart), Integer.parseInt(powerEnd));
|
||||
}
|
||||
if(StrUtil.isNotBlank(status)){
|
||||
if(StrUtil.equals(status,"-0")){
|
||||
wrapper.ne("status","0");
|
||||
}else{
|
||||
wrapper.in("status",status);
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotBlank(onlineStatus)){
|
||||
wrapper.in("online_status",onlineStatus);
|
||||
}
|
||||
|
|
@ -495,6 +519,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
Integer ridingNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_IN_USING,areaId);
|
||||
deviceNumVo.setRidingNum(ridingNum);//骑行中
|
||||
|
||||
Integer inOperation = setInOperationNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_NOT_LISTING,areaId);
|
||||
deviceNumVo.setInOperation(inOperation);//投放中
|
||||
|
||||
Integer temporarilyLockNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_TEMPORARILY_LOCK,areaId);
|
||||
deviceNumVo.setTemporarilyLockNum(temporarilyLockNum);//临时锁车
|
||||
|
||||
|
|
@ -504,8 +531,12 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
Integer normalNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_NORMAL,areaId);
|
||||
deviceNumVo.setNormalNum(normalNum);//正常待租
|
||||
|
||||
Integer inStashNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_NOT_LISTING,areaId);
|
||||
deviceNumVo.setInStashNum(inStashNum);
|
||||
|
||||
QueryWrapper<AsDevice> wrapperForOffline = new QueryWrapper<>();
|
||||
wrapperForOffline.eq("online_status","0");//在线状态:0-不在线;1-在线
|
||||
wrapperForOffline.ne("status","0");//
|
||||
if(StrUtil.isNotBlank(powerStart) && StrUtil.isNotBlank(powerEnd)){
|
||||
wrapperForOffline.between("remaining_power",Integer.parseInt(powerStart),Integer.parseInt(powerEnd));
|
||||
}
|
||||
|
|
@ -541,7 +572,18 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
wrapper.eq("area_id",areaId);
|
||||
}
|
||||
return asDeviceMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
private Integer setInOperationNum(String powerStart, String powerEnd,String status,String areaId) {
|
||||
QueryWrapper<AsDevice> wrapper = new QueryWrapper<>();
|
||||
wrapper.ne("status",status);
|
||||
if(StrUtil.isNotBlank(powerStart) && StrUtil.isNotBlank(powerEnd)){
|
||||
wrapper.between("remaining_power", Integer.parseInt(powerStart),Integer.parseInt(powerEnd));
|
||||
}
|
||||
if(StrUtil.isNotBlank(areaId)){
|
||||
wrapper.eq("area_id",areaId);
|
||||
}
|
||||
return asDeviceMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -571,9 +613,8 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String finalOrderNo = orderNo;
|
||||
if(!"true".equals(orderVo.getIsBluetooth())){
|
||||
/** 2.发送命令*/
|
||||
ResponseVo responseVo = sendCommandWithResp(asDevice.getMac(), token, IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_5, "编号开锁");
|
||||
ResponseVo responseVo = sendCommandWithResp(asDevice.getMac(), token, IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_5, "编号开锁", finalOrderNo);
|
||||
if(responseVo.getCode() != 0){
|
||||
// asynchronousUpdateOnlineStatus(asDevice.getMac());
|
||||
throw new ServiceException("【扫码/编号开锁骑行】发送开锁命令失败");
|
||||
}
|
||||
}else{
|
||||
|
|
@ -642,8 +683,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_20,"管理员开锁");
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_20,"管理员开锁",null);
|
||||
asDevice.setIsAdminUnlocking("1");
|
||||
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_SCHEDULING);
|
||||
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN);
|
||||
int i = asDeviceMapper.updateAsDevice(asDevice);
|
||||
if(i>0){
|
||||
|
|
@ -666,8 +708,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 2.发送命令*/
|
||||
sendCommand(mac, token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_20,"管理员开锁");
|
||||
sendCommand(mac, token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_20,"管理员开锁",null);
|
||||
asDevice.setIsAdminUnlocking("1");
|
||||
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_SCHEDULING);
|
||||
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN);
|
||||
int i = asDeviceMapper.updateAsDevice(asDevice);
|
||||
if(i>0){
|
||||
|
|
@ -805,14 +848,14 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
@Transactional
|
||||
@Override
|
||||
/** 发送命令*/
|
||||
public void sendCommand(String mac, String token,String command,String type) {
|
||||
public void sendCommand(String mac, String token,String command,String type,String orderNo) {
|
||||
String param = "device_name=" + mac + "&product_id=" + productId +"&timeout=" + timeout;
|
||||
String sendUrl = iotUrl+ IotConstants.ADDS_COMMAND + "?"+param;
|
||||
String result = HttpUtils.sendPostWithToken(sendUrl, command, token);
|
||||
log.info("【"+type+"】===>IOT请求调用结果:【{}】",result);
|
||||
JSONObject paramsObj = JSON.parseObject(result);
|
||||
String code = paramsObj.getString("code");
|
||||
asynchronousSaveLog(sendUrl,command,mac,result,type);
|
||||
asynchronousSaveLog(sendUrl,command,mac,result,type,orderNo);
|
||||
//记录命令
|
||||
if (!HttpStatus.IOT_SUCCESS.equals(code))
|
||||
{
|
||||
|
|
@ -834,12 +877,22 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
log.info("【接收onenet推送】异步保存在线状态成功");
|
||||
}
|
||||
}
|
||||
|
||||
EtOnlineLog etOnlineLog = new EtOnlineLog();
|
||||
etOnlineLog.setMac(device.getMac());
|
||||
etOnlineLog.setSn(device.getSn());
|
||||
etOnlineLog.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_OFFLINE);
|
||||
etOnlineLog.setLongitude(device.getLongitude());
|
||||
etOnlineLog.setLatitude(device.getLatitude());
|
||||
etOnlineLog.setCreateTime(DateUtils.getNowDate());
|
||||
int i1 = etOnlineLogService.insertEtOnlineLog(etOnlineLog);
|
||||
if(i1>0){
|
||||
log.info("【接收onenet推送】异步保存在线日志成功");
|
||||
}
|
||||
}, 0, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
/* 异步保存发送命令日志*/
|
||||
private void asynchronousSaveLog(String url,String command,String mac,String result,String type) {
|
||||
private void asynchronousSaveLog(String url,String command,String mac,String result,String type,String orderNo) {
|
||||
//异步保存发送命令日志
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
EtCommandLog etCommandLog = new EtCommandLog();
|
||||
|
|
@ -847,9 +900,16 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
etCommandLog.setCommand(command);
|
||||
etCommandLog.setType(type);
|
||||
etCommandLog.setMac(mac);
|
||||
etCommandLog.setSn(asDeviceMapper.selectAsDeviceByMac(mac).getSn());
|
||||
AsDevice device = asDeviceMapper.selectAsDeviceByMac(mac);
|
||||
etCommandLog.setSn(device.getSn());
|
||||
etCommandLog.setResult(result);
|
||||
etCommandLog.setLongitude(device.getLongitude());
|
||||
etCommandLog.setLatitude(device.getLatitude());
|
||||
etCommandLog.setCreateTime(DateUtils.getNowDate());
|
||||
JSONObject paramsObj = JSON.parseObject(result);
|
||||
String code = paramsObj.getString("code");
|
||||
etCommandLog.setCallStatus(code);
|
||||
etCommandLog.setOrderNo(orderNo);
|
||||
int i = etCommandLogMapper.insertEtCommandLog(etCommandLog);
|
||||
if(i>0){
|
||||
log.info("【发送命令】异步保存发送命令日志");
|
||||
|
|
@ -859,7 +919,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
|
||||
@Override
|
||||
/** 发送命令*/
|
||||
public ResponseVo sendCommandWithResp(String mac, String token,String command,String type) {
|
||||
public ResponseVo sendCommandWithResp(String mac, String token,String command,String type,String orderNo) {
|
||||
String param = "device_name=" + mac + "&product_id=" + productId +"&timeout=" + timeout;
|
||||
String sendUrl = iotUrl+ IotConstants.ADDS_COMMAND + "?"+param;
|
||||
String result = HttpUtils.sendPostWithToken(sendUrl, command, token);
|
||||
|
|
@ -868,10 +928,20 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
if(responseVo.getCode() != 0){
|
||||
asynchronousUpdateOnlineStatus(mac);
|
||||
}
|
||||
asynchronousSaveLog(sendUrl,command,mac,result,type);
|
||||
asynchronousSaveLog(sendUrl,command,mac,result,type,orderNo);
|
||||
return JSON.parseObject(result,ResponseVo.class);
|
||||
}
|
||||
|
||||
/** 查询数据点*/
|
||||
@Override
|
||||
public DataPointRes historyDatapoints(String mac, String token) {
|
||||
String param = "device_name=" + mac + "&product_id=" + productId +"&timeout=" + timeout;
|
||||
String sendUrl = iotUrl+ IotConstants.ADDS_CURRENT_DATAPOINTS + "?"+param;
|
||||
String result = HttpUtils.sendGetWithToken(sendUrl, null, token);
|
||||
log.info("【查询数据点】===>IOT请求调用结果:【{}】",result);
|
||||
return JSON.parseObject(result,DataPointRes.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 响铃寻车
|
||||
* @param sn
|
||||
|
|
@ -885,7 +955,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_PLAY1,"响铃寻车");
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_PLAY1,"响铃寻车",null);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("响铃寻车失败");
|
||||
|
|
@ -905,7 +975,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_PLAY1,"重启设备");
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_PLAY1,"重启设备",null);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("重启设备失败");
|
||||
|
|
@ -924,7 +994,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 2.发送命令*/
|
||||
sendCommand(mac, token,IotConstants.COMMAND_REBOOT,"重启设备");
|
||||
sendCommand(mac, token,IotConstants.COMMAND_REBOOT,"重启设备",null);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("重启设备失败");
|
||||
|
|
@ -943,7 +1013,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 2.发送命令*/
|
||||
sendCommand(mac, token,IotConstants.COMMAND_PLAY1,"响铃寻车");
|
||||
sendCommand(mac, token,IotConstants.COMMAND_PLAY1,"响铃寻车",null);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("响铃寻车失败");
|
||||
|
|
@ -968,7 +1038,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String token = Token.getToken();
|
||||
if(!"true".equals(isBluetooth)){
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_LLOSE+IotConstants.COMMAND_FREQUENCY_3600,"临时锁车");
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_LLOSE+IotConstants.COMMAND_FREQUENCY_3600,"临时锁车",orderNo);
|
||||
}else{
|
||||
asDevice.setLongitude(lon);
|
||||
asDevice.setLatitude(lat);
|
||||
|
|
@ -1005,8 +1075,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
if(StrUtil.isBlank(sn))throw new ServiceException("sn不能为空");
|
||||
AsDevice asDevice = asDeviceMapper.selectAsDeviceBySn(sn);
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), Token.getToken(),IotConstants.COMMAND_CLOSE+IotConstants.COMMAND_FREQUENCY_3600,"管理员锁车");
|
||||
sendCommand(asDevice.getMac(), Token.getToken(),IotConstants.COMMAND_CLOSE+IotConstants.COMMAND_FREQUENCY_3600,"管理员锁车",null);
|
||||
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);
|
||||
asDevice.setIsAdminUnlocking("0");
|
||||
int device = asDeviceMapper.updateAsDevice(asDevice);
|
||||
if(device==0){
|
||||
|
|
@ -1028,8 +1099,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
if(StrUtil.isBlank(mac))throw new ServiceException("mac不能为空");
|
||||
AsDevice asDevice = asDeviceMapper.selectAsDeviceByMac(mac);
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), Token.getToken(),IotConstants.COMMAND_CLOSE+IotConstants.COMMAND_FREQUENCY_3600,"管理员锁车");
|
||||
sendCommand(asDevice.getMac(), Token.getToken(),IotConstants.COMMAND_CLOSE+IotConstants.COMMAND_FREQUENCY_3600,"管理员锁车",null);
|
||||
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);
|
||||
asDevice.setIsAdminUnlocking("0");
|
||||
int device = asDeviceMapper.updateAsDevice(asDevice);
|
||||
if(device==0){
|
||||
|
|
@ -1057,7 +1129,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
String finalSn = sn;
|
||||
if(!"true".equals(isBluetooth)){
|
||||
/** 2.发送命令*/
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_5,"临时解锁");
|
||||
sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_5,"临时解锁",orderNo);
|
||||
}else{
|
||||
asDevice.setLongitude(lon);
|
||||
asDevice.setLatitude(lat);
|
||||
|
|
@ -1269,7 +1341,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
if(ServiceConstants.RETURN_TYPE_NORMAL.equals(returnType)){
|
||||
if(!"true".equals(isBluetooth)){
|
||||
/** 2. 车辆远程关锁*/
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "还车关锁");
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "还车关锁",orderNo);
|
||||
if(responseVo.getCode()!=0){
|
||||
log.info("【还车关锁】远程关锁失败");
|
||||
throw new ServiceException("远程关锁失败");
|
||||
|
|
@ -1293,7 +1365,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
device.setLastTime(DateUtils.getNowDate());
|
||||
}
|
||||
}else{
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "还车关锁");
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "辅助还车关锁",orderNo);
|
||||
if(responseVo.getCode()!=0){
|
||||
log.info("【还车关锁】远程关锁失败");
|
||||
}
|
||||
|
|
@ -1825,7 +1897,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
@Override
|
||||
public boolean isOnline(String sn) {
|
||||
AsDevice device = asDeviceMapper.selectAsDeviceBySn(sn);
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), Token.getToken(), "111", "是否在线");
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), Token.getToken(), "111", "是否在线",null);
|
||||
if(responseVo.getCode() == 0){
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1900,6 +1972,49 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
return isInParkingAreaVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询版本并更新
|
||||
*/
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public boolean updateVersion(String sn) {
|
||||
AsDevice device = asDeviceMapper.selectAsDeviceBySn(sn);
|
||||
if(device!=null){
|
||||
String version = device.getVersion();
|
||||
if(StrUtil.isBlank(version)){
|
||||
String token = Token.getToken();
|
||||
DataPointRes datapoints = historyDatapoints(asDeviceMapper.selectAsDeviceBySn(sn).getMac(), token);
|
||||
if(datapoints.getCode() == 0){
|
||||
Data data = datapoints.getData();
|
||||
List<Datastream> datastreams = data.getDevices();
|
||||
for (Datastream datastream: datastreams) {
|
||||
List<Datapoint> datapointList = datastream.getDatastreams();
|
||||
if(ObjectUtil.isNotNull(datapointList)){
|
||||
for (Datapoint datapoint:datapointList) {
|
||||
if(datapoint.getId().equals(IotConstants.ONENET_VER)){
|
||||
Integer value = (Integer)datapoint.getValue();
|
||||
log.info("【查询数据点】===>获取到版本值:【{}】", value);
|
||||
if(value != null){
|
||||
AsDevice device1 = new AsDevice();
|
||||
device1.setVersion(value.toString());
|
||||
device1.setSn(sn);
|
||||
if(asDeviceMapper.updateAsDeviceBySn(device1) > 0){
|
||||
log.info("【查询数据点】===>更新版本成功");
|
||||
return true;
|
||||
}else{
|
||||
log.info("【查询数据点】===>更新版本失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sn和mac号绑定
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
@Resource
|
||||
private EtCallbackLogMapper callbackLogMapper;
|
||||
|
||||
@Autowired
|
||||
private CallbackService callbackService;
|
||||
|
||||
// @Value("${et.handlingCharge}")
|
||||
// private String handlingCharge;
|
||||
|
||||
|
|
@ -169,20 +172,25 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_RIDING)){
|
||||
logger.info("【微信支付回调】骑行支付");
|
||||
// 1-骑行支付 关锁
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
order.setMark("骑行支付");
|
||||
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//还车后车辆正常运营
|
||||
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||
|
||||
// 新增资金流水记录
|
||||
capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING);
|
||||
logger.info("=================【微信支付回调】11111111==================");
|
||||
// 还车结算___小时后自动退押金---创建一个定时器TimerTask,计算出退还时间后,执行退款操作
|
||||
EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(order.getAreaId());
|
||||
order.setMark("骑行支付");
|
||||
logger.info("=================【微信支付回调】11111111==================");
|
||||
if(ServiceConstants.RETURN_VERIFY_YES.equals(area.getReturnVerify())){
|
||||
logger.info("【微信支付回调】还车-----需要-----拍照审核");
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_AUDIT);//如果还车需要拍照审核,状态为待审核
|
||||
}else{
|
||||
logger.info("【微信支付回调】还车-----不需要-----拍照审核");
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
// 还车结算___小时后自动退押金---创建一个定时器TimerTask,计算出退还时间后,执行退款操作
|
||||
logger.info("=================【微信支付回调】22222222==================");
|
||||
// 退还押金处理
|
||||
refundDeposit(area.getDeposit(), order, asUser);
|
||||
logger.info("=================【微信支付回调】33333333==================");
|
||||
}
|
||||
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//还车后车辆正常运营
|
||||
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||
// 新增资金流水记录
|
||||
capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING,ServiceConstants.OWNER_TYPE_OPERATOR,null);
|
||||
// 24小时后发起分账
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
// 请求分账处理
|
||||
|
|
@ -323,6 +331,7 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
if(i==0){
|
||||
throw new ServiceException("保存分账明细失败");
|
||||
}
|
||||
// callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING,ServiceConstants.OWNER_TYPE_PARTNER,sysUser1);
|
||||
}
|
||||
}else{
|
||||
logger.info("=================【微信支付回调】合伙人【{}】已禁用或已过期合作期==================",sysUser1.getUserName());
|
||||
|
|
@ -458,17 +467,18 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
* 资金流水记录
|
||||
* */
|
||||
@Override
|
||||
public void capitalFlowRecords(EtOrder order,String type,String busType) {
|
||||
// if(ObjectUtil.isNotNull(etCapitalFlowService.selectEtCapitalFlowByOutTradeNo(order.getOutTradeNo()))){
|
||||
// return;
|
||||
// }
|
||||
SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId());
|
||||
public void capitalFlowRecords(EtOrder order,String type,String busType,String ownerType,SysUser user) {
|
||||
EtCapitalFlow capitalFlow = new EtCapitalFlow();
|
||||
if(ownerType.equals(ServiceConstants.OWNER_TYPE_OPERATOR)){//运营商
|
||||
SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId());
|
||||
capitalFlow.setAreaId(order.getAreaId());
|
||||
capitalFlow.setOrderNo(order.getOrderNo());
|
||||
capitalFlow.setOutTradeNo(order.getOutTradeNo());
|
||||
capitalFlow.setType(type);
|
||||
capitalFlow.setBusType(busType);
|
||||
capitalFlow.setOwnerType(ownerType);
|
||||
capitalFlow.setOwnerId(sysDept.getDeptId());
|
||||
capitalFlow.setOwner(sysDept.getDeptName());
|
||||
capitalFlow.setAmount(order.getPayFee());
|
||||
String handlingCharge1 = sysDept.getHandlingCharge();
|
||||
logger.info("【微信支付回调--保存资金流水记录】 获取到配置手续费==============handlingCharge=====================:"+handlingCharge1);
|
||||
|
|
@ -534,6 +544,82 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
}else {
|
||||
logger.info("【微信支付回调】保存资金流水记录成功");
|
||||
}
|
||||
}else{
|
||||
capitalFlow.setAreaId(order.getAreaId());
|
||||
capitalFlow.setOrderNo(order.getOrderNo());
|
||||
capitalFlow.setOutTradeNo(order.getOutTradeNo());
|
||||
capitalFlow.setType(type);
|
||||
capitalFlow.setBusType(busType);
|
||||
capitalFlow.setOwnerType(ownerType);
|
||||
capitalFlow.setOwnerId(user.getUserId());
|
||||
capitalFlow.setOwner(user.getUserName());
|
||||
capitalFlow.setAmount(order.getPayFee());
|
||||
// String handlingCharge1 = sysDept.getHandlingCharge();
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 获取到配置手续费==============handlingCharge=====================:"+handlingCharge1);
|
||||
// BigDecimal bigDecimal = new BigDecimal(handlingCharge1).divide(new BigDecimal(1000), 6, BigDecimal.ROUND_HALF_UP);
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 转换后手续费==============bigDecimal=====================:"+bigDecimal);
|
||||
// BigDecimal handlingCharge = bigDecimal.multiply(order.getPayFee()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 计算出的手续费==============handlingCharge=====================:"+handlingCharge);
|
||||
// BigDecimal serviceFeeScale = new BigDecimal(sysDept.getPlatformServiceFee()).divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP);
|
||||
// BigDecimal platformServiceFee = serviceFeeScale.multiply(order.getPayFee());
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 计算出的平台服务费==============platformServiceFee=====================:"+platformServiceFee);
|
||||
// capitalFlow.setPlatformServiceFee(platformServiceFee);
|
||||
// capitalFlow.setHandlingCharge(handlingCharge);//手续费
|
||||
if(busType.equals(ServiceConstants.ORDER_TYPE_WITHDRAW)){//提现,需要手续费,不需要平台服务费
|
||||
BigDecimal separateAccountFee = order.getPayFee();
|
||||
capitalFlow.setPartnerDividend(BigDecimal.ZERO);
|
||||
capitalFlow.setPlatformServiceFee(BigDecimal.ZERO);
|
||||
capitalFlow.setOperatorDividend(separateAccountFee.negate());
|
||||
capitalFlow.setOperatorBalance(user.getBalance().subtract(separateAccountFee));
|
||||
userMapper.changeUserBalance(separateAccountFee.negate(),user.getUserId());
|
||||
logger.info("【保存资金流水记录】 ==============支出=====================:");
|
||||
}else{
|
||||
logger.info("【微信支付回调--保存资金流水记录】 ==============业务类型=====================:"+busType);
|
||||
// BigDecimal partnerDividend = BigDecimal.ZERO;
|
||||
// BigDecimal separateAccountFee = order.getPayFee().subtract(handlingCharge).subtract(platformServiceFee);
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 ==============扣掉手续费和服务费之后的金额,这个金额拿来分账=====================:"+separateAccountFee);
|
||||
// BigDecimal operatorDividend = separateAccountFee;
|
||||
// if(sysDept.getIsProfitSharing().equals("true")){//需要分账
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 ==============需要分账====================="+sysDept.getIsProfitSharing());
|
||||
// //获取所有合伙人列表
|
||||
// SysUser sysUser = new SysUser();
|
||||
// sysUser.setUserType("03");
|
||||
// sysUser.setAreaId(order.getAreaId());
|
||||
// List<SysUser> sysUsers = userMapper.selectUserList(sysUser);
|
||||
// double totalDividendProportion = sysUsers.stream()
|
||||
// .mapToDouble(SysUser::getDividendProportion)
|
||||
// .sum();//算出总的分成比例
|
||||
// BigDecimal decimal = new BigDecimal(totalDividendProportion).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
|
||||
// partnerDividend = operatorDividend.multiply(decimal);
|
||||
// operatorDividend = operatorDividend.subtract(partnerDividend);
|
||||
// }
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 ==============partnerDividend=====================:"+partnerDividend);
|
||||
// logger.info("【微信支付回调--保存资金流水记录】 ==============operatorDividend=====================:"+operatorDividend);
|
||||
BigDecimal operatorDividend = order.getPayFee();
|
||||
if(type.equals(ServiceConstants.FLOW_TYPE_INCOME)){
|
||||
capitalFlow.setPartnerDividend(BigDecimal.ZERO);
|
||||
capitalFlow.setOperatorDividend(BigDecimal.ZERO);
|
||||
capitalFlow.setOperatorBalance(user.getBalance().add(operatorDividend));
|
||||
userMapper.changeUserBalance(operatorDividend,user.getUserId());
|
||||
logger.info("【微信支付回调--保存资金流水记录】 ==============收入=====================:");
|
||||
}else{
|
||||
capitalFlow.setPartnerDividend(BigDecimal.ZERO);
|
||||
capitalFlow.setOperatorDividend(BigDecimal.ZERO);
|
||||
capitalFlow.setOperatorBalance(user.getBalance().subtract(order.getPayFee()));
|
||||
userMapper.changeUserBalance(operatorDividend.negate(),user.getUserId());
|
||||
logger.info("【微信支付回调--保存资金流水记录】 ==============支出=====================:");
|
||||
}
|
||||
}
|
||||
capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX);
|
||||
capitalFlow.setCreateTime(DateUtils.getNowDate());
|
||||
logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
|
||||
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
|
||||
if(i==0){
|
||||
throw new ServiceException("保存资金流水记录失败");
|
||||
}else {
|
||||
logger.info("【微信支付回调】保存资金流水记录成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.ruoyi.common.annotation.DataScope;
|
|||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.service.IAsUserService;
|
||||
import com.ruoyi.system.service.IEtOperatingAreaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.EtFeeRuleMapper;
|
||||
|
|
@ -25,6 +25,9 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
|||
@Autowired
|
||||
private EtFeeRuleMapper etFeeRuleMapper;
|
||||
|
||||
@Autowired
|
||||
private IEtOperatingAreaService etOperatingAreaService;
|
||||
|
||||
/**
|
||||
* 查询收费方式
|
||||
*
|
||||
|
|
@ -34,7 +37,9 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
|||
@Override
|
||||
public EtFeeRule selectEtFeeRuleByRuleId(Long ruleId)
|
||||
{
|
||||
return etFeeRuleMapper.selectEtFeeRuleByRuleId(ruleId);
|
||||
EtFeeRule etFeeRule = etFeeRuleMapper.selectEtFeeRuleByRuleId(ruleId);
|
||||
etFeeRule.setArea(etOperatingAreaService.selectEtOperatingAreaByAreaId(etFeeRule.getAreaId()));
|
||||
return etFeeRule;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public class EtModelServiceImpl implements IEtModelService
|
|||
Integer quantityByPercentage = CommonUtil.getElectricQuantityByPercentage(lowBatteryReminder, etModel.getFullVoltage(), etModel.getLowVoltage());
|
||||
String lowVoltageCommand = IotConstants.COMMAND_BAT + quantityByPercentage * 10 + "@";
|
||||
log.info("发送低电压命令:" + lowVoltageCommand);
|
||||
asDeviceService.sendCommand(asDevice.getMac(), Token.getToken(), lowVoltageCommand,"发送低电压播报");
|
||||
asDeviceService.sendCommand(asDevice.getMac(), Token.getToken(), lowVoltageCommand,"发送低电压播报",null);
|
||||
}
|
||||
}
|
||||
return i;
|
||||
|
|
@ -173,7 +173,7 @@ public class EtModelServiceImpl implements IEtModelService
|
|||
Integer quantityByPercentage = CommonUtil.getElectricQuantityByPercentage(lowBatteryReminder, etModel.getFullVoltage(), etModel.getLowVoltage());
|
||||
String lowVoltageCommand = IotConstants.COMMAND_BAT + quantityByPercentage * 10 + "@";
|
||||
log.info("发送低电压命令:" + lowVoltageCommand);
|
||||
ResponseVo responseVo = asDeviceService.sendCommandWithResp(asDevice.getMac(), Token.getToken(), lowVoltageCommand,"发送低电压播报");
|
||||
ResponseVo responseVo = asDeviceService.sendCommandWithResp(asDevice.getMac(), Token.getToken(), lowVoltageCommand,"发送低电压播报",null);
|
||||
if(responseVo.getCode()!=0){
|
||||
log.info("【还车关锁】设备【{}】远程关锁失败", asDevice.getMac());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.EtOnlineLogMapper;
|
||||
import com.ruoyi.system.domain.EtOnlineLog;
|
||||
import com.ruoyi.system.service.IEtOnlineLogService;
|
||||
|
||||
/**
|
||||
* 在线/离线日志Service业务层处理
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-07-13
|
||||
*/
|
||||
@Service
|
||||
public class EtOnlineLogServiceImpl implements IEtOnlineLogService
|
||||
{
|
||||
@Autowired
|
||||
private EtOnlineLogMapper etOnlineLogMapper;
|
||||
|
||||
/**
|
||||
* 查询在线/离线日志
|
||||
*
|
||||
* @param id 在线/离线日志主键
|
||||
* @return 在线/离线日志
|
||||
*/
|
||||
@Override
|
||||
public EtOnlineLog selectEtOnlineLogById(Long id)
|
||||
{
|
||||
return etOnlineLogMapper.selectEtOnlineLogById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询在线/离线日志列表
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 在线/离线日志
|
||||
*/
|
||||
@Override
|
||||
public List<EtOnlineLog> selectEtOnlineLogList(EtOnlineLog etOnlineLog)
|
||||
{
|
||||
return etOnlineLogMapper.selectEtOnlineLogList(etOnlineLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增在线/离线日志
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEtOnlineLog(EtOnlineLog etOnlineLog)
|
||||
{
|
||||
etOnlineLog.setCreateTime(DateUtils.getNowDate());
|
||||
return etOnlineLogMapper.insertEtOnlineLog(etOnlineLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改在线/离线日志
|
||||
*
|
||||
* @param etOnlineLog 在线/离线日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEtOnlineLog(EtOnlineLog etOnlineLog)
|
||||
{
|
||||
return etOnlineLogMapper.updateEtOnlineLog(etOnlineLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除在线/离线日志
|
||||
*
|
||||
* @param ids 需要删除的在线/离线日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEtOnlineLogByIds(Long[] ids)
|
||||
{
|
||||
return etOnlineLogMapper.deleteEtOnlineLogByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除在线/离线日志信息
|
||||
*
|
||||
* @param id 在线/离线日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEtOnlineLogById(Long id)
|
||||
{
|
||||
return etOnlineLogMapper.deleteEtOnlineLogById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -404,7 +404,7 @@ public class EtOrderServiceImpl implements IEtOrderService
|
|||
/** 退款剩余押金*/
|
||||
Refund refund = wxPayService.refund(depositOrder, "押金抵扣退款",afterDeductionFee,IdUtils.getOrderNo("ref"));
|
||||
/** 2.记录退款表 创建退款对象*/
|
||||
depositOrder.setReason("押金提现");
|
||||
depositOrder.setReason("押金抵扣退款");
|
||||
EtRefund refund1= createRefund(depositOrder, afterDeductionFee, null, null, null, null, refund.getOutRefundNo(),ServiceConstants.REFUND_TYPE_DEPOSIT);
|
||||
int i = etRefundService.insertEtRefund(refund1);
|
||||
if(i == 0){
|
||||
|
|
@ -426,6 +426,91 @@ public class EtOrderServiceImpl implements IEtOrderService
|
|||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 还车审核通过
|
||||
* 1.更新订单状态为订单结束
|
||||
* 2.退押金
|
||||
* 3.创建退款记录
|
||||
* 4.更新用户余额
|
||||
*/
|
||||
@Override
|
||||
public boolean passAudit(EtOrder etOrder) {
|
||||
/** 1.更新订单状态为订单结束*/
|
||||
etOrder.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
int updateEtOrder = etOrderMapper.updateEtOrder(etOrder);
|
||||
if(updateEtOrder == 0){
|
||||
throw new ServiceException("还车审核失败,更新订单失败");
|
||||
}
|
||||
/** 2.退押金*/
|
||||
EtOrder depositOrder = getDepositOrder(etOrder.getUserId());
|
||||
BigDecimal deposit = depositOrder.getTotalFee();
|
||||
// Refund refund = wxPayService.refund(depositOrder, "还车审核通过后退押金",deposit,IdUtils.getOrderNo("ref"));
|
||||
/** 3.记录退款表 创建退款对象*/
|
||||
// depositOrder.setReason("还车审核通过后退押金");
|
||||
// EtRefund refund1= createRefund(depositOrder, deposit, null, null, null, null, refund.getOutRefundNo(),ServiceConstants.REFUND_TYPE_DEPOSIT);
|
||||
// int i = etRefundService.insertEtRefund(refund1);
|
||||
// if(i == 0){
|
||||
// log.info("【还车审核通过】保存退款对象失败");
|
||||
// throw new ServiceException("【还车审核通过】,保存退款对象失败");
|
||||
// }
|
||||
/** 4.更新用户余额*/
|
||||
AsUser asUser = asUserService.selectUserById(depositOrder.getUserId());
|
||||
if(asUser!=null){
|
||||
// 更新用户并更新缓存
|
||||
asUser.setBalance(BigDecimal.ZERO);
|
||||
if (asUserService.updateUserProfile(asUser) > 0)
|
||||
{
|
||||
log.info("【还车审核通过】更新用户信息成功:"+ JSON.toJSON(asUser));
|
||||
}else{
|
||||
throw new ServiceException("【还车审核通过】,更新用户信息失败");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 官方审核通过
|
||||
* 1.更新订单状态为订单结束
|
||||
* 2.退押金
|
||||
* 3.创建退款记录
|
||||
* 4.更新用户余额
|
||||
*/
|
||||
@Override
|
||||
public boolean authoritypass(EtOrder etOrder) {
|
||||
/** 1.更新订单状态为订单结束*/
|
||||
etOrder.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
int updateEtOrder = etOrderMapper.updateEtOrder(etOrder);
|
||||
if(updateEtOrder == 0){
|
||||
throw new ServiceException("还车审核失败,更新订单失败");
|
||||
}
|
||||
/** 2.退剩余押金 = 押金 - 扣除金额*/
|
||||
EtOrder depositOrder = getDepositOrder(etOrder.getUserId());
|
||||
BigDecimal residualDeposit = depositOrder.getTotalFee().subtract(new BigDecimal(etOrder.getDeductionAmount()));
|
||||
Refund refund = wxPayService.refund(depositOrder, "还车审核通过后退押金",residualDeposit,IdUtils.getOrderNo("ref"));
|
||||
/** 3.记录退款表 创建退款对象*/
|
||||
depositOrder.setReason("还车审核通过后退押金");
|
||||
EtRefund refund1= createRefund(depositOrder, residualDeposit, null, null, null, null, refund.getOutRefundNo(),ServiceConstants.REFUND_TYPE_DEPOSIT);
|
||||
int i = etRefundService.insertEtRefund(refund1);
|
||||
if(i == 0){
|
||||
log.info("【还车审核通过】保存退款对象失败");
|
||||
throw new ServiceException("【还车审核通过】,保存退款对象失败");
|
||||
}
|
||||
/** 4.更新用户余额*/
|
||||
AsUser asUser = asUserService.selectUserById(depositOrder.getUserId());
|
||||
if(asUser!=null){
|
||||
// 更新用户并更新缓存
|
||||
asUser.setBalance(BigDecimal.ZERO);
|
||||
if (asUserService.updateUserProfile(asUser) > 0)
|
||||
{
|
||||
log.info("【还车审核通过】更新用户信息成功:"+ JSON.toJSON(asUser));
|
||||
}else{
|
||||
throw new ServiceException("【还车审核通过】,更新用户信息失败");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private EtOrder getDepositOrder(Long userId) {
|
||||
EtOrder depositOrder = new EtOrder();
|
||||
depositOrder.setUserId(userId);
|
||||
|
|
@ -1060,7 +1145,7 @@ public class EtOrderServiceImpl implements IEtOrderService
|
|||
}
|
||||
// 新增资金流水记录
|
||||
etOrder1.setPayFee(refundAmount);
|
||||
callbackService.capitalFlowRecords(etOrder1,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants. ORDER_TYPE_RIDING_REFUND);
|
||||
callbackService.capitalFlowRecords(etOrder1,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_RIDING_REFUND,ServiceConstants.OWNER_TYPE_OPERATOR,null);
|
||||
//todo 更新订单的payFee = totalFee - refundAmount
|
||||
String outRefundNo = IdUtils.getOrderNo("ref");
|
||||
/** 2.记录退款表 创建退款对象*/
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public class EtWithdrawServiceImpl implements IEtWithdrawService
|
|||
}
|
||||
order.setAreaId(longs.get(0));
|
||||
//记录资金流水
|
||||
callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_WITHDRAW);
|
||||
callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_WITHDRAW,ServiceConstants.OWNER_TYPE_OPERATOR,null);
|
||||
}
|
||||
}
|
||||
return etWithdrawMapper.updateEtWithdraw(etWithdraw);
|
||||
|
|
|
|||
|
|
@ -699,8 +699,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
*/
|
||||
@Override
|
||||
public int bandAppUser(SysUser user) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
user.setUserId(loginUser.getUserId());
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="modelId != null">model_id = #{modelId},</if>
|
||||
<if test="vehicleNum != null">vehicle_num = #{vehicleNum},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="activationTime != null">activation_time = #{activationTime},</if>
|
||||
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="EtCapitalFlow" id="EtCapitalFlowResult">
|
||||
<result property="flowId" column="flow_id" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="owner" column="owner" />
|
||||
<result property="ownerId" column="owner_id" />
|
||||
<result property="ownerType" column="owner_type" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="outTradeNo" column="out_trade_no" />
|
||||
|
|
@ -30,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
cf.flow_id,
|
||||
cf.area_id,
|
||||
cf.owner,
|
||||
cf.owner_id,
|
||||
cf.owner_type,
|
||||
cf.order_no,
|
||||
cf.out_trade_no,
|
||||
cf.type,
|
||||
|
|
@ -86,6 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="flowId != null">flow_id,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="owner != null">owner,</if>
|
||||
<if test="ownerId != null">owner_id,</if>
|
||||
<if test="ownerType != null">owner_type,</if>
|
||||
<if test="orderNo != null">order_no,</if>
|
||||
<if test="outTradeNo != null">out_trade_no,</if>
|
||||
<if test="type != null">type,</if>
|
||||
|
|
@ -102,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="flowId != null">#{flowId},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="owner != null">#{owner},</if>
|
||||
<if test="ownerId != null">#{ownerId},</if>
|
||||
<if test="ownerType != null">#{ownerType},</if>
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
<if test="outTradeNo != null">#{outTradeNo},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
|
|
@ -121,6 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update et_capital_flow
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="owner != null">owner = #{owner},</if>
|
||||
<if test="ownerId != null">owner_id = #{ownerId},</if>
|
||||
<if test="ownerType != null">owner_type = #{ownerType},</if>
|
||||
<if test="orderNo != null">order_no = #{orderNo},</if>
|
||||
<if test="outTradeNo != null">out_trade_no = #{outTradeNo},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="mac" column="mac" />
|
||||
<result property="sn" column="sn" />
|
||||
<result property="result" column="result" />
|
||||
<result property="longitude" column="longitude" />
|
||||
<result property="latitude" column="latitude" />
|
||||
<result property="callStatus" column="call_status" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEtCommandLogVo">
|
||||
select id, url, command, type, mac, sn, result, create_time from et_command_log
|
||||
select id, url, command, type, mac, sn, result, longitude, latitude, call_status, create_time, order_no from et_command_log
|
||||
</sql>
|
||||
|
||||
<select id="selectEtCommandLogList" parameterType="EtCommandLog" resultMap="EtCommandLogResult">
|
||||
|
|
@ -28,6 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sn != null and sn != ''"> and sn like concat('%', #{sn}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type like concat('%', #{type}, '%')</if>
|
||||
<if test="result != null and result != ''"> and result like concat('%', #{result}, '%')</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
|
||||
<if test="callStatus != null and callStatus != ''"> and call_status = #{callStatus}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
|
@ -46,6 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="mac != null">mac,</if>
|
||||
<if test="sn != null">sn,</if>
|
||||
<if test="result != null">result,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
<if test="longitude != null">longitude,</if>
|
||||
<if test="callStatus != null">call_status,</if>
|
||||
<if test="orderNo != null">order_no,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -55,6 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="mac != null">#{mac},</if>
|
||||
<if test="sn != null">#{sn},</if>
|
||||
<if test="result != null">#{result},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="callStatus != null">#{callStatus},</if>
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -68,6 +82,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="sn != null">sn = #{sn},</if>
|
||||
<if test="result != null">result = #{result},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="callStatus != null">call_status = #{callStatus},</if>
|
||||
<if test="orderNo != null">order_no = #{orderNo},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -50,8 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectEtFeeRuleByRuleId" parameterType="Long" resultMap="EtFeeRuleResult">
|
||||
<include refid="selectEtFeeRuleVo"/>
|
||||
where is_deleted = 0 rule_id = #{ruleId}
|
||||
select r.rule_id, r.dept_id, r.dept_id, r.`name`, r.`explain`,ar.`area_id`,
|
||||
r.status, r.auto_refund_deposit, r.order_exceed_minutes, r.order_exceed_warn,
|
||||
r.free_ride_time, r.rental_unit, r.riding_rule, r.riding_rule_json, r.charging_cycle, r.charging_cycle_value,
|
||||
r.capped_amount, r.instructions, r.create_by, r.create_time from et_fee_rule r
|
||||
left join et_area_rule ar on ar.rule_id = r.rule_id
|
||||
where r.is_deleted = 0 and r.rule_id = #{ruleId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectEtFeeRuleByRuleIdIncludeDelete" parameterType="Long" resultMap="EtFeeRuleResult">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.EtOnlineLogMapper">
|
||||
|
||||
<resultMap type="EtOnlineLog" id="EtOnlineLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mac" column="mac" />
|
||||
<result property="sn" column="sn" />
|
||||
<result property="onlineStatus" column="online_status" />
|
||||
<result property="longitude" column="longitude" />
|
||||
<result property="latitude" column="latitude" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEtOnlineLogVo">
|
||||
select id, mac, sn, online_status, longitude, latitude, create_time from et_online_log
|
||||
</sql>
|
||||
|
||||
<select id="selectEtOnlineLogList" parameterType="EtOnlineLog" resultMap="EtOnlineLogResult">
|
||||
<include refid="selectEtOnlineLogVo"/>
|
||||
<where>
|
||||
<if test="mac != null and mac != ''"> and mac like concat('%', #{mac}, '%')</if>
|
||||
<if test="sn != null and sn != ''"> and sn like concat('%', #{sn}, '%')</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEtOnlineLogById" parameterType="Long" resultMap="EtOnlineLogResult">
|
||||
<include refid="selectEtOnlineLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEtOnlineLog" parameterType="EtOnlineLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into et_online_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mac != null">mac,</if>
|
||||
<if test="sn != null">sn,</if>
|
||||
<if test="onlineStatus != null">online_status,</if>
|
||||
<if test="longitude != null">longitude,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mac != null">#{mac},</if>
|
||||
<if test="sn != null">#{sn},</if>
|
||||
<if test="onlineStatus != null">#{onlineStatus},</if>
|
||||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEtOnlineLog" parameterType="EtOnlineLog">
|
||||
update et_online_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="sn != null">sn = #{sn},</if>
|
||||
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEtOnlineLogById" parameterType="Long">
|
||||
delete from et_online_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEtOnlineLogByIds" parameterType="String">
|
||||
delete from et_online_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -51,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="servicePhone3" column="service_phone3" />
|
||||
<result property="customService" column="custom_service" />
|
||||
<result property="isDepositDeduction" column="is_deposit_deduction" />
|
||||
<result property="returnVerify" column="return_verify" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEtOperatingAreaVo">
|
||||
|
|
@ -61,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
no_riding_outage, authentication, msg_switch, undercharge, error, cast(agreement as char) as agreement, deposit,
|
||||
outage, appointment_service_fee, dispatch_fee, vehicle_management_fee, timeout_minutes,
|
||||
auto_replacement_order, area_time_start, area_time_end, area_out_return, parking_return, service_name1, service_name2,
|
||||
service_name3, service_phone1, service_phone2, service_phone3, custom_service, is_deposit_deduction from et_operating_area
|
||||
service_name3, service_phone1, service_phone2, service_phone3, custom_service, is_deposit_deduction, return_verify from et_operating_area
|
||||
</sql>
|
||||
|
||||
<select id="selectEtOperatingAreaList" parameterType="EtOperatingArea" resultMap="EtOperatingAreaResult">
|
||||
|
|
@ -72,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
a.no_riding_outage, a.authentication, a.msg_switch, a.undercharge, a.error, a.agreement, a.deposit,
|
||||
a.outage, a.appointment_service_fee, a.dispatch_fee, a.vehicle_management_fee, a.timeout_minutes,
|
||||
a.auto_replacement_order, a.area_time_start, a.area_time_end, a.area_out_return, a.parking_return,
|
||||
a.service_name1, a.service_name2, a.service_name3, a.service_phone1, a.service_phone2, a.service_phone3, a.custom_service, a.is_deposit_deduction from et_operating_area a
|
||||
a.service_name1, a.service_name2, a.service_name3, a.service_phone1, a.service_phone2, a.service_phone3, a.custom_service, a.is_deposit_deduction,a.return_verify from et_operating_area a
|
||||
left join et_area_dept ad on ad.area_id = a.area_id
|
||||
left join sys_dept d on d.dept_id = ad.dept_id
|
||||
where 1 = 1
|
||||
|
|
|
|||
|
|
@ -40,13 +40,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="tripRouteStr" column="trip_route_str" />
|
||||
<result property="cycle" column="cycle" />
|
||||
<result property="depositDeduction" column="deposit_deduction" />
|
||||
<result property="videoUrl" column="video_url" />
|
||||
<result property="deductionAmount" column="deduction_amount" />
|
||||
<result property="audioFiles" column="audio_files" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEtOrderVo">
|
||||
select order_id, area_id, order_no, out_trade_no, user_id, rule_id,
|
||||
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
|
||||
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
|
||||
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time, rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction from et_order
|
||||
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
|
||||
rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction,video_url,deduction_amount,audio_files from et_order
|
||||
</sql>
|
||||
|
||||
<select id="selectEtOrderList" parameterType="EtOrder" resultMap="EtOrderResult">
|
||||
|
|
@ -88,7 +92,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
o.rule_end_time,
|
||||
o.return_type,
|
||||
AsText(o.trip_route),
|
||||
o.trip_route_str
|
||||
o.trip_route_str,
|
||||
o.video_url,
|
||||
o.deduction_amount,
|
||||
o.audio_files
|
||||
FROM
|
||||
et_order o
|
||||
LEFT JOIN
|
||||
|
|
@ -149,6 +156,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
o.pay_time,
|
||||
o.paid,
|
||||
o.pay_type,
|
||||
o.video_url,
|
||||
o.deduction_amount,
|
||||
o.audio_files,
|
||||
o.type, COALESCE(o.total_fee, 0) AS total_fee,
|
||||
COALESCE(o.pay_fee, 0) AS pay_fee,
|
||||
COALESCE(o.dispatch_fee, 0) AS dispatch_fee,
|
||||
|
|
@ -560,6 +570,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tripRouteStr != null">trip_route_str = #{tripRouteStr},</if>
|
||||
<if test="cycle != null">cycle = #{cycle},</if>
|
||||
<if test="depositDeduction != null">deposit_deduction = #{depositDeduction},</if>
|
||||
<if test="videoUrl != null">video_url = #{videoUrl},</if>
|
||||
<if test="deductionAmount != null">deduction_amount = #{deductionAmount},</if>
|
||||
<if test="audioFiles != null">audio_files = #{audioFiles},</if>
|
||||
</trim>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
|
|
@ -597,6 +610,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tripRoute != null">trip_route = GeomFromText(#{tripRoute}),</if>
|
||||
<if test="tripRouteStr != null">trip_route_str = #{tripRouteStr},</if>
|
||||
<if test="cycle != null">cycle = #{cycle},</if>
|
||||
<if test="depositDeduction != null">deposit_deduction = #{depositDeduction},</if>
|
||||
<if test="videoUrl != null">video_url = #{videoUrl},</if>
|
||||
<if test="deductionAmount != null">deduction_amount = #{deductionAmount},</if>
|
||||
<if test="audioFiles != null">audio_files = #{audioFiles},</if>
|
||||
</trim>
|
||||
where order_no = #{orderNo}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="platformServiceFee" column="platform_service_fee" />
|
||||
<result property="handlingCharge" column="handling_charge" />
|
||||
<result property="isProfitSharing" column="is_profit_sharing" />
|
||||
<result property="separateAccount" column="separate_account" />
|
||||
<result property="isUsePlatformApp" column="is_use_platform_app" />
|
||||
<result property="domain" column="domain" />
|
||||
<result property="appid" column="appid" />
|
||||
|
|
@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name,
|
||||
d.order_num, d.leader, d.phone, d.email, d.status,
|
||||
d.del_flag,d.platform_service_fee, d.handling_charge, d.is_profit_sharing, d.domain, d.is_use_platform_app, d.appid, d.app_name, d.balance, d.app_secret,
|
||||
d.del_flag,d.platform_service_fee, d.handling_charge, d.is_profit_sharing, d.separate_account, d.domain, d.is_use_platform_app, d.appid, d.app_name, d.balance, d.app_secret,
|
||||
d.merchant_id, d.api_v3_key, d.notify_url, d.private_key_path,d.merchant_serial_number,d.refund_notify_url,
|
||||
d.create_by, d.create_time
|
||||
from sys_dept d
|
||||
|
|
@ -78,7 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,d.platform_service_fee, d.handling_charge, d.is_profit_sharing,d.domain,d.is_use_platform_app, d.appid, d.app_name, d.balance, d.app_secret,
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,d.platform_service_fee, d.handling_charge,
|
||||
d.is_profit_sharing,d.domain,d.is_use_platform_app, d.appid, d.app_name, d.balance, d.app_secret,d.balance,d.separate_account,
|
||||
d.merchant_id, d.api_v3_key, d.notify_url, d.private_key_path,d.merchant_serial_number,d.refund_notify_url,
|
||||
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
||||
from sys_dept d
|
||||
|
|
@ -127,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="platformServiceFee != null and platformServiceFee != ''">platform_service_fee,</if>
|
||||
<if test="handlingCharge != null and handlingCharge != ''">handling_charge,</if>
|
||||
<if test="isProfitSharing != null and isProfitSharing != ''">is_profit_sharing,</if>
|
||||
<if test="separateAccount != null and separateAccount != ''">separate_account,</if>
|
||||
<if test="isUsePlatformApp != null and isUsePlatformApp != ''">is_use_platform_app,</if>
|
||||
<if test="domain != null and domain != ''">domain,</if>
|
||||
<if test="appid != null and appid != ''">appid,</if>
|
||||
|
|
@ -183,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="platformServiceFee != null and platformServiceFee != ''">platform_service_fee = #{platformServiceFee},</if>
|
||||
<if test="handlingCharge != null and handlingCharge != ''">handling_charge = #{handlingCharge},</if>
|
||||
<if test="isProfitSharing != null and isProfitSharing != ''">is_profit_sharing = #{isProfitSharing},</if>
|
||||
<if test="separateAccount != null and separateAccount != ''">separate_account = #{separateAccount},</if>
|
||||
<if test="isUsePlatformApp != null and isUsePlatformApp != ''">is_use_platform_app = #{isUsePlatformApp},</if>
|
||||
<if test="domain != null and domain != ''">domain = #{domain},</if>
|
||||
<if test="appid != null and appid != ''">appid = #{appid},</if>
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="operIp != null and operIp != ''">
|
||||
AND oper_ip like concat('%', #{operIp}, '%')
|
||||
<if test="operParam != null and operParam != ''">
|
||||
AND oper_param like concat('%', #{operParam}, '%')
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
AND title like concat('%', #{title}, '%')
|
||||
|
|
|
|||
|
|
@ -257,4 +257,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="changeUserBalance">
|
||||
update sys_user set balance = balance + #{amount} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user