Commit 4ec4186c authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/develop' into develop

parents f50328f2 38182755
......@@ -29,11 +29,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
......@@ -538,21 +535,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.saveIncome(tIncomeDetail);
}
} else {
Integer myNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer socialNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer fundNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer insureNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer salaryNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return this.saveIncome(tIncomeDetail);
}
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
}
} else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
// 商险。收费方式:2金额-人数
......@@ -563,21 +547,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.saveIncome(tIncomeDetail);
}
} else {
Integer myNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer socialNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer fundNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer insureNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer salaryNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return this.saveIncome(tIncomeDetail);
}
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
}
} else {
// 各个模式累加逻辑:
......@@ -600,6 +570,43 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return true;
}
/**
* @Description: 红冲判断
* @Author: hgw
* @Date: 2022/9/7 17:27
* @return: boolean
**/
private boolean redDateJudge(TIncomeDetail tIncomeDetail, Map<String, Integer> numMap) {
Integer socialNum = CommonConstants.ZERO_INT;
Integer fundNum = CommonConstants.ZERO_INT;
Integer insureNum = CommonConstants.ZERO_INT;
Integer salaryNum = CommonConstants.ZERO_INT;
Integer myNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
if (!CommonConstants.ONE_STRING.equals(tIncomeDetail.getSourceType())) {
socialNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
if (!CommonConstants.TWO_STRING.equals(tIncomeDetail.getSourceType())) {
fundNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
if (!CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
insureNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
if (!CommonConstants.FOUR_STRING.equals(tIncomeDetail.getSourceType())) {
salaryNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return true;
}
return false;
}
private int ifNullToZero(Integer num) {
if (num == null) {
return CommonConstants.ZERO_INT;
......@@ -627,21 +634,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.saveIncome(tIncomeDetail);
}
} else {
Integer myNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer socialNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer fundNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer insureNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer salaryNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return this.saveIncome(tIncomeDetail);
}
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment