From df72b3302386803758e3a4c57721b175d1d33cd0 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Fri, 31 May 2024 15:11:26 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=88=86=E8=B4=A6=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E5=88=86=E4=B8=BA=E9=AA=91=E8=A1=8C=E8=B4=B9=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E8=B4=B9=202.=20=E4=BF=AE=E6=94=B9=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E5=9B=B4=E6=A0=8F=E6=97=B6=E5=88=A0=E9=99=A4=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/impl/CallbackServiceImpl.java | 13 ++++++++++--- .../service/impl/EtOperatingAreaServiceImpl.java | 8 +++++--- .../main/java/com/ruoyi/system/task/EtTask.java | 16 +++++++++++++--- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java index 5513a61..9470d35 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java @@ -196,6 +196,7 @@ public class CallbackServiceImpl implements CallbackService { TimerTask task = new TimerTask() { @Override public void run() { + logger.info("【微信支付回调】开始请求分账------------"); // 请求分账 List receivers = new ArrayList<>(); // 获取到合伙人的openid @@ -203,14 +204,20 @@ public class CallbackServiceImpl implements CallbackService { sysUser.setUserType("03"); sysUser.setAreaId(area.getAreaId()); List sysUsers = userMapper.selectUserList(sysUser); - BigDecimal totalFee = order.getTotalFee(); + BigDecimal dividendAmount = BigDecimal.ZERO; for (SysUser sysUser1 : sysUsers){ AsUser asUser1 = userService.selectUserById(sysUser1.getAppUserId()); if(asUser1!=null && asUser1.getWxopenid()!=null){ CreateOrderReceiver receiver = new CreateOrderReceiver(); receiver.setType(ReceiverType.PERSONAL_OPENID.name()); receiver.setAccount(asUser1.getWxopenid()); - BigDecimal multiply = totalFee.multiply(new BigDecimal(sysUser1.getDividendProportion()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(100)); + String dividendItem = sysUser1.getDividendItem(); + if(dividendItem.contains("1")){ + dividendAmount.add(order.getRidingFee().add(order.getAppointmentFee()));//1-骑行费(骑行费+预约费) + }else if(dividendItem.contains("2")){ + dividendAmount.add(order.getManageFee().add(order.getManageFee()));//2-调度费(调度费+管理费) + } + BigDecimal multiply = dividendAmount.multiply(new BigDecimal(sysUser1.getDividendProportion()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(100)); logger.info(sysUser1.getUserName()+"分账比例:"+sysUser1.getDividendProportion()+"%,分账金额:"+multiply); receiver.setAmount(multiply.longValue()); receiver.setDescription("系统自动分账"); @@ -226,7 +233,7 @@ public class CallbackServiceImpl implements CallbackService { } } }; - timer.schedule(task, new Date(System.currentTimeMillis() + 30000)); + timer.schedule(task, new Date(System.currentTimeMillis() + 30000));// 30秒后发起分账 }else if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_APPOINTMENT)){ logger.info("【微信支付回调】取消预约支付"); // 2-取消预约支付 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 03f2405..a9b495d 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 @@ -138,12 +138,14 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl