提成问题

This commit is contained in:
mx 2024-12-02 14:33:27 +08:00
parent 5e932d56af
commit 90f0929c62
2 changed files with 24 additions and 15 deletions

View File

@ -264,7 +264,7 @@ public class CalSalaryBatch {
*/
private BigDecimal calSalary(List<PsContractBusinessVo> businessVo, Map<String, BigDecimal> configMap, Map<String, BigDecimal> costMap){
String cbStr = "0.0";
BigDecimal rateStr = new BigDecimal(configMap ==null || configMap.isEmpty() ? "0" : "100");
BigDecimal minRate = new BigDecimal(configMap ==null || configMap.isEmpty() ? "0" : "100");
configMap = CollectionUtils.isEmpty(configMap) ? new HashMap<>() : configMap;
costMap = CollectionUtils.isEmpty(costMap) ? new HashMap<>() : costMap;
@ -272,8 +272,8 @@ public class CalSalaryBatch {
for (BigDecimal value : configMap.values()) {
if (value.doubleValue() < rateStr.doubleValue()){
rateStr = value;
if (value.doubleValue() < minRate.doubleValue()){
minRate = value;
}
}
@ -282,13 +282,22 @@ public class CalSalaryBatch {
//如果详情没有填写金额的话按照详情中最低的提成比例进行计算按照详情算
if(item.getDetailVoList().get(0).getAmount() == null
|| BigDecimal.ZERO.compareTo(item.getDetailVoList().get(0).getAmount()) == 0){
BigDecimal rate = rateStr;
BigDecimal rate = null;
BigDecimal cost = new BigDecimal(cbStr);
for (PsContractBusinessDetailVo detail : item.getDetailVoList()){
BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) == null ? new BigDecimal("0.1") : configMap.get(detail.getBusinessProject());
rate = rate.compareTo(rateConfig) < 0 ? rate : rateConfig;
// BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) ;
// if (rateConfig != null){
// if (rate == null || rate.compareTo(rateConfig) < 0){
// rate = rateConfig;
// }
// }
cost = cost.add(costMap.get(detail.getBusinessProject()) == null ? new BigDecimal(cbStr) : costMap.get(detail.getBusinessProject()));
}
if (rate == null){
rate = minRate;
}
//服务类型金额 - 成本
BigDecimal amount = item.getBusinessAmount() == null ? new BigDecimal(0) : item.getBusinessAmount().subtract(cost);
// ×比例
@ -297,7 +306,7 @@ public class CalSalaryBatch {
}else{//按照类型算
for (PsContractBusinessDetailVo detail : item.getDetailVoList()){
//比例
BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) == null ? rateStr : configMap.get(detail.getBusinessProject());
BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) == null ? minRate : configMap.get(detail.getBusinessProject());
rateConfig = rateConfig.multiply(new BigDecimal("0.01"));
//成本
BigDecimal rateCost = costMap.get(detail.getBusinessProject()) == null ? new BigDecimal(cbStr) : costMap.get(detail.getBusinessProject());

View File

@ -636,16 +636,16 @@ public class PsTaskServiceImpl implements IPsTaskService {
lqw.in(bo.getExtendList() != null && !bo.getExtendList().isEmpty(),"main.extend", bo.getExtendList());
lqw.like(StringUtils.isNotBlank(bo.getContractCode()), "main.contract_code", bo.getContractCode());
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), "com.company_name", bo.getCompanyName());//公司名称
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), "scom.company_name", bo.getCompanyName());//公司名称
lqw.like(StringUtils.isNotBlank(bo.getServiceCompanyName()), "scom.company_name", bo.getServiceCompanyName());//公司名称
lqw.like(StringUtils.isNotBlank(bo.getCustomerNum()), "com.customer_num", bo.getCustomerNum());//纳税人识别号
lqw.eq(StringUtils.isNotBlank(bo.getCustomerCert()), "com.customer_cert", bo.getCustomerCert());//纳税人资格
// lqw.like(StringUtils.isNotBlank(bo.getCustomerNum()), "com.customer_num", bo.getCustomerNum());//纳税人识别号
// lqw.eq(StringUtils.isNotBlank(bo.getCustomerCert()), "com.customer_cert", bo.getCustomerCert());//纳税人资格
lqw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "usr.nick_name", bo.getCustomManagerName());//销售经理姓名
lqw.like(StringUtils.isNotBlank(bo.getCompanyAdress()), "com.company_adress", bo.getCompanyAdress());//公司地址
lqw.like(StringUtils.isNotBlank(bo.getMobile()), "com.legal_person_phone", bo.getMobile());//法人手机号
lqw.like(StringUtils.isNotBlank(bo.getIdNo()), "com.legal_person_idcard", bo.getIdNo());//法人身份证
lqw.like(StringUtils.isNotBlank(bo.getName()), "com.legal_person_name", bo.getName());//法人姓名
// lqw.like(StringUtils.isNotBlank(bo.getCompanyAdress()), "com.company_adress", bo.getCompanyAdress());//公司地址
// lqw.like(StringUtils.isNotBlank(bo.getMobile()), "com.legal_person_phone", bo.getMobile());//法人手机号
// lqw.like(StringUtils.isNotBlank(bo.getIdNo()), "com.legal_person_idcard", bo.getIdNo());//法人身份证
// lqw.like(StringUtils.isNotBlank(bo.getName()), "com.legal_person_name", bo.getName());//法人姓名
lqw.like(StringUtils.isNotBlank(bo.getCustomName()), "scom.contact_person_name", bo.getCustomName());//客户姓名
lqw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "scom.contact_person_phone", bo.getCustomMobile());//客户电话
lqw.eq(StringUtils.isNotBlank(bo.getCustomScene()), "con.custom_scene", bo.getCustomScene());//是否到达现场
@ -666,7 +666,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
.or()
.likeLeft("cus.custom_mobile", bo.getAppKeyWord())
.or()
.exists("com.company_name", bo.getAppKeyWord())
.exists("scom.company_name", bo.getAppKeyWord())
);