demand: 1.定时任务批量更新新提成统计某月统计数据为空时不会更新金额bug修复 2.根据单号重新计算提成增加校验问题件及支付方式相关场景

committer: heyu
This commit is contained in:
aike 2025-06-05 14:17:16 +08:00
parent 6d06ca6fcc
commit b220c5a40a

View File

@ -314,6 +314,16 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
// 先删除该运单已经计算的提成
emisCommissionDtlMapper.deleteEmisCommissionDtlByBillCode(billCode);
if ("6".equals(waybill.getPaymentType())) {
return;
}
if (waybill.getProblemType() != null) {
if (173 == waybill.getProblemType() || 170 == waybill.getProblemType()
|| 151 == waybill.getProblemType()) {
return;
}
}
// 计算每个岗位的提成方案
/*
网点客服 1
@ -382,6 +392,40 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
try {
// 获取统计数据
List<EmisCommissionProfit> listProfit=emisCommissionProfitMapper.selectProfitStatList(empName,billMonth);
// 如果指定了empName,需要处理该员工在数据库中存在但listProfit中不存在的月份记录
if(StringUtils.isNotEmpty(empName)) {
// 查询数据库中该员工的所有月份记录
EmisCommissionProfit queryParam = new EmisCommissionProfit();
queryParam.setEmpName(empName);
if(StringUtils.isNotEmpty(billMonth)) {
queryParam.setBillMonth(billMonth);
}
List<EmisCommissionProfit> existingProfits = emisCommissionProfitMapper.selectEmisCommissionProfitList(queryParam);
// 遍历现有记录,检查是否在新统计中存在
for(EmisCommissionProfit existingProfit : existingProfits) {
boolean found = false;
for(EmisCommissionProfit newProfit : listProfit) {
if(existingProfit.getEmpName().equals(newProfit.getEmpName())
&& existingProfit.getBillMonth().equals(newProfit.getBillMonth())) {
found = true;
break;
}
}
// 如果在新统计中不存在,则添加一条金额为0的记录
if(!found) {
EmisCommissionProfit zeroProfit = new EmisCommissionProfit();
zeroProfit.setEmpName(existingProfit.getEmpName());
zeroProfit.setBillMonth(existingProfit.getBillMonth());
zeroProfit.setMoney(BigDecimal.ZERO);
zeroProfit.setMonthMoney(BigDecimal.ZERO);
listProfit.add(zeroProfit);
}
}
}
// 更新或插入提成记录
for (EmisCommissionProfit profitItem:listProfit) {
// 查询是否有数据,没有则插入
int isExists=emisCommissionProfitMapper.checkUnique(profitItem);