1. 资金流水中增加一个字段,车辆型号

This commit is contained in:
邱贞招 2024-08-29 21:05:31 +08:00
parent b6272765cb
commit 428cc5ea64
7 changed files with 49 additions and 9 deletions

View File

@ -1169,7 +1169,7 @@ public class AppVerifyController extends BaseController
} }
// 当前有骑行中的订单 // 当前有骑行中的订单
EtOrder currentOrder = etOrderService.getCurrentOrder(newDevice.getSn()); EtOrder currentOrder = etOrderService.getCurrentOrder(newDevice.getSn());
if(ObjectUtil.isNotNull(currentOrder)){ if(ObjectUtil.isNotNull(currentOrder) && !currentOrder.getOrderNo().equals(orderNo)){
return error("当前车辆有骑行中的订单,请换车"); return error("当前车辆有骑行中的订单,请换车");
} }
//低电量不得骑行判断 //低电量不得骑行判断

View File

@ -89,4 +89,11 @@ public class EtCapitalFlow extends BaseEntity
@TableField(exist = false) @TableField(exist = false)
private String[] typeList; private String[] typeList;
/** 型号id */
private Long modelId;
/** 型号 */
@TableField(exist = false)
private String model;
} }

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.AsDevice; import com.ruoyi.system.domain.AsDevice;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -69,6 +71,7 @@ public interface AsDeviceMapper extends BaseMapper<AsDevice>
* @param asDevice 设备 * @param asDevice 设备
* @return 结果 * @return 结果
*/ */
@Log(title = "修改设备", businessType = BusinessType.UPDATE)
public int updateAsDevice(AsDevice asDevice); public int updateAsDevice(AsDevice asDevice);
/** /**

View File

@ -971,7 +971,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
Boolean inOrderBySn = etOrderService.isInOrderBySn(sn);//有进行中的订单跳过 Boolean inOrderBySn = etOrderService.isInOrderBySn(sn);//有进行中的订单跳过
if(!inOrderBySn){ if(!inOrderBySn){
AsDevice asDevice = asDeviceMapper.selectAsDeviceBySn(sn); AsDevice asDevice = asDeviceMapper.selectAsDeviceBySn(sn);
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//车辆解禁
int device = asDeviceMapper.updateAsDevice(asDevice); int device = asDeviceMapper.updateAsDevice(asDevice);
if(device==0){ if(device==0){
log.info("车辆解禁状态失败"); log.info("车辆解禁状态失败");
@ -1455,7 +1455,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_TEMPORARILY_LOCK); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_TEMPORARILY_LOCK);
}else{ }else{
if(!asDevice.getStatus().equals(ServiceConstants.VEHICLE_STATUS_NOT_LISTING)){ if(!asDevice.getStatus().equals(ServiceConstants.VEHICLE_STATUS_NOT_LISTING)){
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//管理员锁车
} }
} }
asDevice.setIsAdminUnlocking("0"); asDevice.setIsAdminUnlocking("0");
@ -1487,7 +1487,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_TEMPORARILY_LOCK); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_TEMPORARILY_LOCK);
}else{ }else{
if(!asDevice.getStatus().equals(ServiceConstants.VEHICLE_STATUS_NOT_LISTING)){ if(!asDevice.getStatus().equals(ServiceConstants.VEHICLE_STATUS_NOT_LISTING)){
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//管理员锁车
} }
} }
asDevice.setIsAdminUnlocking("0"); asDevice.setIsAdminUnlocking("0");
@ -1602,7 +1602,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
throw new ServiceException("【车辆超时预约】:更新订单状态失败"); throw new ServiceException("【车辆超时预约】:更新订单状态失败");
} }
// 改变车辆状态 // 改变车辆状态
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//定时取消预约
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN); asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN);
int device = asDeviceMapper.updateAsDevice(asDevice); int device = asDeviceMapper.updateAsDevice(asDevice);
if(device==0){ if(device==0){
@ -1644,7 +1644,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
if(i==0){ if(i==0){
throw new ServiceException("【取消预约】:更新订单失败"); throw new ServiceException("【取消预约】:更新订单失败");
} }
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//取消预约
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN); asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN);
int device = asDeviceMapper.updateAsDevice(asDevice); int device = asDeviceMapper.updateAsDevice(asDevice);
if(device==0){ if(device==0){
@ -1777,7 +1777,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
} }
if(ObjectUtil.isNotNull(device)){ if(ObjectUtil.isNotNull(device)){
/** 4. 更新车辆状态*/ /** 4. 更新车辆状态*/
device.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); device.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//还车
device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE); device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
int deviceUpdate = asDeviceMapper.updateAsDevice(device); int deviceUpdate = asDeviceMapper.updateAsDevice(device);
if(deviceUpdate==0){ if(deviceUpdate==0){

View File

@ -124,6 +124,9 @@ public class CallbackServiceImpl implements CallbackService {
@Autowired @Autowired
private CallbackService callbackService; private CallbackService callbackService;
@Resource
private EtModelMapper etModelMapper;
@Value("${aliyun.accessKeyId}") @Value("${aliyun.accessKeyId}")
private String accessKeyId; private String accessKeyId;
@ -684,6 +687,10 @@ public class CallbackServiceImpl implements CallbackService {
} }
capitalFlow.setPayType(payType); capitalFlow.setPayType(payType);
capitalFlow.setCreateTime(DateUtils.getNowDate()); capitalFlow.setCreateTime(DateUtils.getNowDate());
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
if (device != null) {
capitalFlow.setModelId(device.getModelId());
}
logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
if(i==0){ if(i==0){
@ -731,6 +738,10 @@ public class CallbackServiceImpl implements CallbackService {
} }
capitalFlow.setPayType(payType); capitalFlow.setPayType(payType);
capitalFlow.setCreateTime(DateUtils.getNowDate()); capitalFlow.setCreateTime(DateUtils.getNowDate());
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
if (device != null) {
capitalFlow.setModelId(device.getModelId());
}
logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
if(i==0){ if(i==0){
@ -843,6 +854,10 @@ public class CallbackServiceImpl implements CallbackService {
} }
capitalFlow.setPayType(payType); capitalFlow.setPayType(payType);
capitalFlow.setCreateTime(DateUtils.getNowDate()); capitalFlow.setCreateTime(DateUtils.getNowDate());
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
if (device != null) {
capitalFlow.setModelId(device.getModelId());
}
logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
if(i==0){ if(i==0){
@ -890,6 +905,10 @@ public class CallbackServiceImpl implements CallbackService {
} }
capitalFlow.setPayType(payType); capitalFlow.setPayType(payType);
capitalFlow.setCreateTime(order.getPayTime()); capitalFlow.setCreateTime(order.getPayTime());
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
if (device != null) {
capitalFlow.setModelId(device.getModelId());
}
logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
if(i==0){ if(i==0){
@ -953,6 +972,10 @@ public class CallbackServiceImpl implements CallbackService {
} }
capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX); capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX);
capitalFlow.setCreateTime(DateUtils.getNowDate()); capitalFlow.setCreateTime(DateUtils.getNowDate());
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
if (device != null) {
capitalFlow.setModelId(device.getModelId());
}
logger.info("【保存资金流水】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); logger.info("【保存资金流水】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
return i; return i;
@ -1010,6 +1033,10 @@ public class CallbackServiceImpl implements CallbackService {
} }
capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX); capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX);
capitalFlow.setCreateTime(DateUtils.getNowDate()); capitalFlow.setCreateTime(DateUtils.getNowDate());
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
if (device != null) {
capitalFlow.setModelId(device.getModelId());
}
logger.info("【保存资金流水】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); logger.info("【保存资金流水】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));
int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow);
return i; return i;

View File

@ -1835,7 +1835,7 @@ public class EtOrderServiceImpl implements IEtOrderService
} }
Boolean execute = transactionTemplate.execute(e -> { Boolean execute = transactionTemplate.execute(e -> {
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE); asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//换车关锁
asDevice.setIsAdminUnlocking("0"); asDevice.setIsAdminUnlocking("0");
int device = asDeviceMapper.updateAsDevice(asDevice); int device = asDeviceMapper.updateAsDevice(asDevice);
if(device==0){ if(device==0){

View File

@ -50,12 +50,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
cf.partner_dividend, cf.partner_dividend,
cf.pay_type, cf.pay_type,
cf.create_time, cf.create_time,
a.area_name a.area_name,
m.model
FROM FROM
et_capital_flow cf et_capital_flow cf
LEFT JOIN et_operating_area a ON a.area_id = cf.area_id LEFT JOIN et_operating_area a ON a.area_id = cf.area_id
LEFT JOIN et_area_dept ad ON ad.area_id = cf.area_id LEFT JOIN et_area_dept ad ON ad.area_id = cf.area_id
LEFT JOIN sys_dept d ON d.dept_id = ad.dept_id LEFT JOIN sys_dept d ON d.dept_id = ad.dept_id
LEFT JOIN et_model m ON m.model_id = cf.model_id
WHERE WHERE
1 = 1 1 = 1
<if test="areaId != null "> and cf.area_id = #{areaId}</if> <if test="areaId != null "> and cf.area_id = #{areaId}</if>
@ -71,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operatorDividend != null "> and cf.operator_dividend = #{operatorDividend}</if> <if test="operatorDividend != null "> and cf.operator_dividend = #{operatorDividend}</if>
<if test="operatorBalance != null "> and cf.operator_balance = #{operatorBalance}</if> <if test="operatorBalance != null "> and cf.operator_balance = #{operatorBalance}</if>
<if test="partnerDividend != null "> and cf.partner_dividend = #{partnerDividend}</if> <if test="partnerDividend != null "> and cf.partner_dividend = #{partnerDividend}</if>
<if test="modelId != null "> and cf.model_id = #{modelId}</if>
<if test="payType != null and payType != ''"> and cf.pay_type = #{payType}</if> <if test="payType != null and payType != ''"> and cf.pay_type = #{payType}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND cf.create_time &gt;= #{params.beginTime} AND cf.create_time &gt;= #{params.beginTime}