This commit is contained in:
邱贞招 2024-06-27 15:56:12 +08:00
parent 5bffa21acc
commit e90cad2ab9
5 changed files with 28 additions and 8 deletions

View File

@ -230,7 +230,7 @@ geo:
key: 834f1f029671d84272554528311ff0f1
et:
# 手续费 4/1000 千分之几
handlingCharge: 4
handlingCharge: 5.4
verifyUrl: https://zidv2.market.alicloudapi.com/idcheck/Post
appcode: 32b6c6445b1a42ed862dd4202392c47d
repairAdmin: wx

View File

@ -216,6 +216,11 @@ public interface EtOrderMapper
*/
EtOrder selectLatestOrder(EtOrder etOrder);
/**
* 最近一笔订单
*/
List<EtOrder> selectLatestOrderList(EtOrder etOrder);
/**
* 预约未完成订单处理
*/

View File

@ -172,10 +172,8 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
}
//正在进行中的订单
EtOrder order = new EtOrder();
order.setType(ServiceConstants.ORDER_TYPE_RIDING);
order.setStatus(ServiceConstants.ORDER_STATUS_RIDING);
order.setSn(asDevice.getSn());
List<EtOrder> etOrders = etOrderMapper.selectEtOrderList(order);
List<EtOrder> etOrders = etOrderMapper.selectLatestOrderList(order);
asDevice.setEtOrders(etOrders);
return asDevice;
}

View File

@ -468,6 +468,11 @@ public class CallbackServiceImpl implements CallbackService {
capitalFlow.setType(type);
capitalFlow.setBusType(busType);
capitalFlow.setAmount(order.getPayFee());
logger.info("【微信支付回调--保存资金流水记录】 获取到配置手续费==============handlingCharge====================="+handlingCharge);
BigDecimal bigDecimal = new BigDecimal(handlingCharge).divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP);
logger.info("【微信支付回调--保存资金流水记录】 转换后手续费==============bigDecimal====================="+bigDecimal);
BigDecimal multiply = bigDecimal.multiply(order.getTotalFee());
logger.info("【微信支付回调--保存资金流水记录】 计算出的手续费==============multiply====================="+multiply);
if(busType.equals(ServiceConstants.ORDER_TYPE_DEPOSIT) || busType.equals(ServiceConstants.ORDER_TYPE_DEPOSIT_REFUND)){
capitalFlow.setOperatorDividend(BigDecimal.ZERO);
capitalFlow.setPartnerDividend(BigDecimal.ZERO);
@ -494,19 +499,18 @@ public class CallbackServiceImpl implements CallbackService {
if(type.equals(ServiceConstants.FLOW_TYPE_INCOME)){
capitalFlow.setPartnerDividend(partnerDividend);
capitalFlow.setOperatorDividend(operatorDividend);
capitalFlow.setOperatorBalance(sysDept.getBalance().add(operatorDividend));
capitalFlow.setOperatorBalance(sysDept.getBalance().add(operatorDividend).subtract(multiply));
deptService.changeDeptBalance(operatorDividend,sysDept.getDeptId());
logger.info("【微信支付回调--保存资金流水记录】 ==============收入=====================");
}else{
capitalFlow.setPartnerDividend(partnerDividend.negate());
capitalFlow.setOperatorDividend(operatorDividend.negate());
capitalFlow.setOperatorBalance(sysDept.getBalance().subtract(operatorDividend));
capitalFlow.setOperatorBalance(sysDept.getBalance().subtract(operatorDividend).subtract(multiply));
deptService.changeDeptBalance(operatorDividend.negate(),sysDept.getDeptId());
logger.info("【微信支付回调--保存资金流水记录】 ==============支出=====================");
}
}
BigDecimal bigDecimal = new BigDecimal(handlingCharge).divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP);
capitalFlow.setHandlingCharge(bigDecimal.multiply(order.getTotalFee()));//手续费
capitalFlow.setHandlingCharge(multiply);//手续费
capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX);
capitalFlow.setCreateTime(DateUtils.getNowDate());
logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow));

View File

@ -379,6 +379,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM et_order
<where>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="sn != null"> and sn = #{sn}</if>
and type = 1
</where>
ORDER BY create_time DESC
LIMIT 1
</select>
<select id="selectLatestOrderList" resultMap="EtOrderResult">
SELECT *
FROM et_order
<where>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="sn != null"> and sn = #{sn}</if>
and type = 1
</where>
ORDER BY create_time DESC