diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java index 1db370a..4d18278 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java @@ -5,15 +5,15 @@ import com.ruoyi.system.domain.EtCapitalFlow; /** * 资金流水Mapper接口 - * + * * @author 邱贞招 * @date 2024-05-24 */ -public interface EtCapitalFlowMapper +public interface EtCapitalFlowMapper { /** * 查询资金流水 - * + * * @param flowId 资金流水主键 * @return 资金流水 */ @@ -21,7 +21,7 @@ public interface EtCapitalFlowMapper /** * 查询资金流水列表 - * + * * @param etCapitalFlow 资金流水 * @return 资金流水集合 */ @@ -29,7 +29,7 @@ public interface EtCapitalFlowMapper /** * 新增资金流水 - * + * * @param etCapitalFlow 资金流水 * @return 结果 */ @@ -37,7 +37,7 @@ public interface EtCapitalFlowMapper /** * 修改资金流水 - * + * * @param etCapitalFlow 资金流水 * @return 结果 */ @@ -45,7 +45,7 @@ public interface EtCapitalFlowMapper /** * 删除资金流水 - * + * * @param flowId 资金流水主键 * @return 结果 */ @@ -53,9 +53,11 @@ public interface EtCapitalFlowMapper /** * 批量删除资金流水 - * + * * @param flowIds 需要删除的数据主键集合 * @return 结果 */ public int deleteEtCapitalFlowByFlowIds(Long[] flowIds); + + EtCapitalFlow selectEtCapitalFlowByOutTradeNo(String outTradeNo); } diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java index c537db2..a0922ef 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java @@ -5,23 +5,31 @@ import com.ruoyi.system.domain.EtCapitalFlow; /** * 资金流水Service接口 - * + * * @author 邱贞招 * @date 2024-05-24 */ -public interface IEtCapitalFlowService +public interface IEtCapitalFlowService { /** * 查询资金流水 - * + * * @param flowId 资金流水主键 * @return 资金流水 */ public EtCapitalFlow selectEtCapitalFlowByFlowId(Long flowId); + /** + * 根据第三方交易单号查询资金流水 + * + * @param outTradeNo 第三方交易单号 + * @return 资金流水 + */ + public EtCapitalFlow selectEtCapitalFlowByOutTradeNo(String outTradeNo); + /** * 查询资金流水列表 - * + * * @param etCapitalFlow 资金流水 * @return 资金流水集合 */ @@ -29,7 +37,7 @@ public interface IEtCapitalFlowService /** * 新增资金流水 - * + * * @param etCapitalFlow 资金流水 * @return 结果 */ @@ -37,7 +45,7 @@ public interface IEtCapitalFlowService /** * 修改资金流水 - * + * * @param etCapitalFlow 资金流水 * @return 结果 */ @@ -45,7 +53,7 @@ public interface IEtCapitalFlowService /** * 批量删除资金流水 - * + * * @param flowIds 需要删除的资金流水主键集合 * @return 结果 */ @@ -53,7 +61,7 @@ public interface IEtCapitalFlowService /** * 删除资金流水信息 - * + * * @param flowId 资金流水主键 * @return 结果 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index 325619e..18718a8 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -453,7 +453,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i String finalOrderNo = orderNo; Boolean execute = transactionTemplate.execute(e -> { /** 2.发送命令*/ - sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN,"编号开锁"); +// sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN,"编号开锁"); /** 3.更新车辆状态*/ asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN); asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_IN_USING); @@ -942,13 +942,8 @@ public class AsDeviceServiceImpl extends ServiceImpl i //根据订单的开始时间和还车时间计算出在第几个计费周期,在第一个计费周期内,并没有超过封顶费用,则根据规则算出骑行费, Integer cycle = null; - Date startTime; + Date startTime = order.getUnlockTime(); Date endTime = order.getReturnTime(); - if(ObjectUtil.isNull(order.getAppointmentFee()) || order.getAppointmentFee().compareTo(BigDecimal.ZERO) == 0){//没有预约 - startTime = order.getUnlockTime(); - }else{//有预约 - startTime = order.getAppointmentStartTime(); - } String chargingCycle = rule.getChargingCycle(); String chargingCycleValue = rule.getChargingCycleValue(); @@ -1060,12 +1055,13 @@ public class AsDeviceServiceImpl extends ServiceImpl i if(ObjectUtils.isNotEmpty(returnTime) && ObjectUtils.isNotEmpty(unlockTime)){ if(minutes sysUsers = sysUserService.selectUserList(sysUser); + List 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); BigDecimal partnerDividend = order.getTotalFee().multiply(decimal); - BigDecimal operatorDividend = order.getTotalFee().subtract(capitalFlow.getPartnerDividend()); + BigDecimal operatorDividend = order.getTotalFee().subtract(partnerDividend); if(type.equals(ServiceConstants.FLOW_TYPE_INCOME)){ capitalFlow.setPartnerDividend(partnerDividend); capitalFlow.setOperatorDividend(operatorDividend); diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java index 86d5d97..eee94bd 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java @@ -10,19 +10,19 @@ import com.ruoyi.system.service.IEtCapitalFlowService; /** * 资金流水Service业务层处理 - * + * * @author 邱贞招 * @date 2024-05-24 */ @Service -public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService +public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService { @Autowired private EtCapitalFlowMapper etCapitalFlowMapper; /** * 查询资金流水 - * + * * @param flowId 资金流水主键 * @return 资金流水 */ @@ -32,9 +32,20 @@ public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService return etCapitalFlowMapper.selectEtCapitalFlowByFlowId(flowId); } + /** + * 根据第三方交易单号查询资金流水 + * + * @param outTradeNo 第三方交易单号 + * @return 资金流水 + */ + @Override + public EtCapitalFlow selectEtCapitalFlowByOutTradeNo(String outTradeNo) { + return etCapitalFlowMapper.selectEtCapitalFlowByOutTradeNo(outTradeNo); + } + /** * 查询资金流水列表 - * + * * @param etCapitalFlow 资金流水 * @return 资金流水 */ @@ -46,7 +57,7 @@ public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService /** * 新增资金流水 - * + * * @param etCapitalFlow 资金流水 * @return 结果 */ @@ -59,7 +70,7 @@ public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService /** * 修改资金流水 - * + * * @param etCapitalFlow 资金流水 * @return 结果 */ @@ -71,7 +82,7 @@ public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService /** * 批量删除资金流水 - * + * * @param flowIds 需要删除的资金流水主键 * @return 结果 */ @@ -83,7 +94,7 @@ public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService /** * 删除资金流水信息 - * + * * @param flowId 资金流水主键 * @return 结果 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOperatingAreaServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOperatingAreaServiceImpl.java index df035c3..03f2405 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOperatingAreaServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOperatingAreaServiceImpl.java @@ -141,8 +141,10 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl - + @@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + + insert into et_capital_flow @@ -104,9 +108,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from et_capital_flow where flow_id in + delete from et_capital_flow where flow_id in #{flowId} - \ No newline at end of file +