1. 分账金额分为骑行费,调度费
2. 修改电子围栏时删除了
This commit is contained in:
parent
94e4f9d58f
commit
df72b33023
|
@ -196,6 +196,7 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
TimerTask task = new TimerTask() {
|
TimerTask task = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
logger.info("【微信支付回调】开始请求分账------------");
|
||||||
// 请求分账
|
// 请求分账
|
||||||
List<CreateOrderReceiver> receivers = new ArrayList<>();
|
List<CreateOrderReceiver> receivers = new ArrayList<>();
|
||||||
// 获取到合伙人的openid
|
// 获取到合伙人的openid
|
||||||
|
@ -203,14 +204,20 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
sysUser.setUserType("03");
|
sysUser.setUserType("03");
|
||||||
sysUser.setAreaId(area.getAreaId());
|
sysUser.setAreaId(area.getAreaId());
|
||||||
List<SysUser> sysUsers = userMapper.selectUserList(sysUser);
|
List<SysUser> sysUsers = userMapper.selectUserList(sysUser);
|
||||||
BigDecimal totalFee = order.getTotalFee();
|
BigDecimal dividendAmount = BigDecimal.ZERO;
|
||||||
for (SysUser sysUser1 : sysUsers){
|
for (SysUser sysUser1 : sysUsers){
|
||||||
AsUser asUser1 = userService.selectUserById(sysUser1.getAppUserId());
|
AsUser asUser1 = userService.selectUserById(sysUser1.getAppUserId());
|
||||||
if(asUser1!=null && asUser1.getWxopenid()!=null){
|
if(asUser1!=null && asUser1.getWxopenid()!=null){
|
||||||
CreateOrderReceiver receiver = new CreateOrderReceiver();
|
CreateOrderReceiver receiver = new CreateOrderReceiver();
|
||||||
receiver.setType(ReceiverType.PERSONAL_OPENID.name());
|
receiver.setType(ReceiverType.PERSONAL_OPENID.name());
|
||||||
receiver.setAccount(asUser1.getWxopenid());
|
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);
|
logger.info(sysUser1.getUserName()+"分账比例:"+sysUser1.getDividendProportion()+"%,分账金额:"+multiply);
|
||||||
receiver.setAmount(multiply.longValue());
|
receiver.setAmount(multiply.longValue());
|
||||||
receiver.setDescription("系统自动分账");
|
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)){
|
}else if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_APPOINTMENT)){
|
||||||
logger.info("【微信支付回调】取消预约支付");
|
logger.info("【微信支付回调】取消预约支付");
|
||||||
// 2-取消预约支付
|
// 2-取消预约支付
|
||||||
|
|
|
@ -138,12 +138,14 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl<EtOperatingAreaMappe
|
||||||
Geometry geometry = GeoUtils.toGeometry(boundaryStr);
|
Geometry geometry = GeoUtils.toGeometry(boundaryStr);
|
||||||
String wkt = GeoUtils.wkt(geometry);
|
String wkt = GeoUtils.wkt(geometry);
|
||||||
etOperatingArea.setBoundary(wkt);
|
etOperatingArea.setBoundary(wkt);
|
||||||
etAreaRuleMapper.deleteAreaRuleByAreaId(etOperatingArea.getAreaId());
|
|
||||||
int i = dao.updateById(etOperatingArea);
|
int i = dao.updateById(etOperatingArea);
|
||||||
Long[] ruleIds = etOperatingArea.getRuleIds();
|
Long[] ruleIds = etOperatingArea.getRuleIds();
|
||||||
if(ObjectUtil.isNotNull(ruleIds)){
|
if(ObjectUtil.isNotNull(ruleIds)){
|
||||||
for (Long ruleId:ruleIds){
|
etAreaRuleMapper.deleteAreaRuleByAreaId(etOperatingArea.getAreaId());
|
||||||
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
if(ObjectUtil.isNotNull(ruleIds)){
|
||||||
|
for (Long ruleId:ruleIds){
|
||||||
|
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.system.task;
|
package com.ruoyi.system.task;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.constant.ServiceConstants;
|
import com.ruoyi.common.constant.ServiceConstants;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
@ -93,9 +94,18 @@ public class EtTask {
|
||||||
etDividendDetail.setTotalAmount(order1.getTotalFee());
|
etDividendDetail.setTotalAmount(order1.getTotalFee());
|
||||||
etDividendDetail.setCreateTime(DateUtils.getNowDate());
|
etDividendDetail.setCreateTime(DateUtils.getNowDate());
|
||||||
etDividendDetail.setDividendProportion(user.getDividendProportion());
|
etDividendDetail.setDividendProportion(user.getDividendProportion());
|
||||||
// todo 分账金额是骑行费,还是调度费,看分账项目
|
String dividendItem = user.getDividendItem();
|
||||||
etDividendDetail.setDividendAmount(order1.getTotalFee().multiply(new BigDecimal(user.getDividendProportion()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP)));
|
// todo 分账金额是骑行费,还是调度费,看分账项目 分账项目:1-骑行费(骑行费+预约费);2-调度费(调度费+管理费)
|
||||||
etDividendDetail.setDividendItem(user.getDividendItem());
|
BigDecimal dividendAmount = BigDecimal.ZERO;
|
||||||
|
if(dividendItem.contains("1")){
|
||||||
|
dividendAmount.add(order1.getRidingFee().add(order1.getAppointmentFee()));//1-骑行费(骑行费+预约费)
|
||||||
|
}else if(dividendItem.contains("2")){
|
||||||
|
dividendAmount.add(order1.getManageFee().add(order1.getManageFee()));//2-调度费(调度费+管理费)
|
||||||
|
}
|
||||||
|
BigDecimal divide = new BigDecimal(user.getDividendProportion()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
etDividendDetail.setDividendAmount(dividendAmount.multiply(divide));
|
||||||
|
etDividendDetail.setDividendItem(dividendItem);
|
||||||
|
log.info("保存分账明细 === " + JSON.toJSONString(etDividendDetail));
|
||||||
int i = dividendDetailService.insertEtDividendDetail(etDividendDetail);
|
int i = dividendDetailService.insertEtDividendDetail(etDividendDetail);
|
||||||
if(i==0){
|
if(i==0){
|
||||||
throw new ServiceException("保存分账明细失败");
|
throw new ServiceException("保存分账明细失败");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user