Commit 5ab9c052 authored by fangxinjiang's avatar fangxinjiang

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

parents 29fffed7 71ef381e
...@@ -57,6 +57,14 @@ public interface TIncomeService extends IService<TIncome> { ...@@ -57,6 +57,14 @@ public interface TIncomeService extends IService<TIncome> {
**/ **/
boolean saveDetail(TIncomeDetail tIncomeDetail); boolean saveDetail(TIncomeDetail tIncomeDetail);
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: huyc
* @Date: 2022/9/9 11:42
* @return:
**/
void saveBathDetail(List<TIncomeDetail> tIncomeDetail);
void pushDetail(); void pushDetail();
} }
...@@ -4029,7 +4029,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4029,7 +4029,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
//判断是否存在当月的社保或公积金收入数据 //判断是否存在当月的公积金收入数据
Boolean isExist = false; Boolean isExist = false;
TIncomeDetail incomeDetail = new TIncomeDetail(); TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setEmpIdcard(library.getEmpIdcard()); incomeDetail.setEmpIdcard(library.getEmpIdcard());
...@@ -4047,6 +4047,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4047,6 +4047,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
int isSum = 0;
if (Common.isNotNull(settleDomain)) { if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入 // 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem() if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem()
...@@ -4067,11 +4068,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4067,11 +4068,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee(); gMoney = settleDomain.getManagementFee();
} else { } else {
isSum = 1;
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(), gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getManagementFee().divide(new BigDecimal("100"), settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP)); CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist) { if (!isExist || isSum == 1) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney); settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney);
} }
...@@ -4093,14 +4095,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4093,14 +4095,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
BigDecimal money = BigDecimal.ZERO; BigDecimal money = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) { if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else { } else {
isSum = 2;
money = BigDecimalUtils.safeMultiply(library.getSumAll(), money = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"), settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP)); CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist) { if (!isExist || isSum == 2) {
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), money); settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), money);
} }
......
...@@ -2183,22 +2183,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2183,22 +2183,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
isSaveAndUpdate = true; isSaveAndUpdate = true;
} }
if ((Common.isNotNull(socialFundInfo.getSocialId()) //社保收入
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) || CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
|| (Common.isNotNull(socialFundInfo.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus()))) {
//获取所有的预估数据 //获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null; List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard) .eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain()) .eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
.and(obj -> obj .in(TForecastLibrary::getSocialPayMonth, payMonthList));
.in(TForecastLibrary::getSocialPayMonth, payMonthList)
.or()
.in(TForecastLibrary::getProvidentPayMonth, payMonthList))
);
if (Common.isNotNull(librarySocialInfoList)) { if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library : librarySocialInfoList) { for (TForecastLibrary library : librarySocialInfoList) {
...@@ -2207,6 +2202,25 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2207,6 +2202,25 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
} }
//公积金收入
if (Common.isNotNull(socialFundInfo.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus())) {
//获取所有的预估数据
List<TForecastLibrary> libraryFundInfoList = null;
libraryFundInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getProvidentPayMonth, payMonthList));
if (Common.isNotNull(libraryFundInfoList)) {
for (TForecastLibrary library : libraryFundInfoList) {
//办理成功生成收入
createIncomeInfo(library);
}
}
}
if (isSaveAndUpdate) { if (isSaveAndUpdate) {
return R.ok(null, "执行成功!"); return R.ok(null, "执行成功!");
} else { } else {
...@@ -2288,6 +2302,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2288,6 +2302,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) { public void initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>(); Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TForecastLibrary library : unPushInfo) { for (TForecastLibrary library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2520,6 +2535,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2520,6 +2535,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (map.get(body) > 0) { if (map.get(body) > 0) {
int i = map.get(body) + 1; int i = map.get(body) + 1;
map.put(body,i); map.put(body,i);
idMap.put(body,library.getId());
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
...@@ -2531,31 +2547,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2531,31 +2547,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
error.setLinkId(library.getId()); error.setLinkId(library.getId());
error.setTitle(key); error.setTitle(key);
error.setNums(map.get(key)); error.setNums(map.get(key));
tSendEkpErrorService.saveError(error); tSendEkpErrorService.save(error);
} }
break; break;
} }
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else { } else {
map.put(body,1); map.put(body,1);
TSendEkpError error = new TSendEkpError(); idMap.put(body,library.getId());
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
} }
} }
} }
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setTitle(key);
error.setLinkId(idMap.get(key));
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
//更新推送状态 //更新推送状态
if (Common.isNotNull(pushList)) { if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
...@@ -2565,6 +2576,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2565,6 +2576,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void initEkpPushFundParam(List<TForecastLibrary> unPushInfo) { public void initEkpPushFundParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>(); Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TForecastLibrary library : unPushInfo) { for (TForecastLibrary library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2693,6 +2705,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2693,6 +2705,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (map.get(body) > 0) { if (map.get(body) > 0) {
int i = map.get(body) + 1; int i = map.get(body) + 1;
map.put(body,i); map.put(body,i);
idMap.put(body,library.getId());
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
...@@ -2704,31 +2717,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2704,31 +2717,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
error.setLinkId(library.getId()); error.setLinkId(library.getId());
error.setTitle(key); error.setTitle(key);
error.setNums(map.get(key)); error.setNums(map.get(key));
tSendEkpErrorService.saveError(error); tSendEkpErrorService.save(error);
} }
break; break;
} }
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else { } else {
map.put(body,1); map.put(body,1);
TSendEkpError error = new TSendEkpError(); idMap.put(body,library.getId());
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
} }
} }
} }
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(idMap.get(key));
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
//更新推送状态 //更新推送状态
if (Common.isNotNull(pushList)) { if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
...@@ -2780,6 +2788,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2780,6 +2788,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
int isSum = 0;
if (Common.isNotNull(settleDomain)) { if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入 // 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING) if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
...@@ -2800,11 +2809,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2800,11 +2809,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee(); gMoney = settleDomain.getManagementFee();
} else { } else {
isSum = 1;
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(), gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getManagementFee().divide(new BigDecimal("100"), settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP)); CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist) { if (!isExist || isSum == 1) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, sourceType); gMoney, sourceType);
...@@ -2828,14 +2838,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2828,14 +2838,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
BigDecimal money; BigDecimal money;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) { if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else { } else {
isSum = 2;
money = BigDecimalUtils.safeMultiply(library.getSumAll(), money = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"), settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP)); CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist) { if (!isExist || isSum == 2) {
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, sourceType); money, sourceType);
......
...@@ -275,12 +275,344 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -275,12 +275,344 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
} }
} }
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: hgw
* @Date: 2022/8/31 16:34
* @return: boolean
**/
@Override
public void saveBathDetail(List<TIncomeDetail> tIncomeDetailList) {
Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TIncomeDetail tIncomeDetail : tIncomeDetailList) {
// 获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
TIncome income = new TIncome();
income.setEmpIdcard(tIncomeDetail.getEmpIdcard());
income.setDeptId(tIncomeDetail.getDeptId());
List<TIncome> incomeList = baseMapper.getTIncomeList(income);
TIncomeDetail detail = new TIncomeDetail();
detail.setEmpIdcard(tIncomeDetail.getEmpIdcard());
detail.setDeptId(tIncomeDetail.getDeptId());
List<TIncomeDetail> detailList = tIncomeDetailService.getTIncomeDetailList(detail);
// 不存在,直接新增
if (incomeList == null || incomeList.isEmpty()) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
income.setId(CommonConstants.NULL);
tIncomeDetailService.save(tIncomeDetail);
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
break;
}
} else {
map.put(sendBack,1);
idMap.put(sendBack,income.getId());
}
}
} else {
// 判断,比例,直接加
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
break;
}
} else {
map.put(sendBack,1);
idMap.put(sendBack,income.getId());
}
}
} else {
Map<String, Integer> numMap = new HashMap<>();
Map<String, Integer> incomeMap = new HashMap<>();
// 商险Map
Map<String, Integer> insureMap = new HashMap<>();
Integer nums;
Integer insureNums;
for (TIncomeDetail detail1 : detailList) {
nums = numMap.get(detail1.getPayMonth() + CommonConstants.DOWN_LINE_STRING + detail1.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + detail1.getFeeType());
if (Common.isEmpty(nums)) {
nums = CommonConstants.ZERO_INT;
}
if (CommonConstants.ONE_STRING.equals(detail1.getRedData())) {
nums--;
} else {
nums++;
}
numMap.put(detail1.getPayMonth() + CommonConstants.DOWN_LINE_STRING + detail1.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + detail1.getFeeType(), nums);
}
for (TIncome income1 : incomeList) {
nums = incomeMap.get(income1.getPayMonth() + CommonConstants.DOWN_LINE_STRING + income1.getFeeType());
if (Common.isEmpty(nums)) {
nums = CommonConstants.ZERO_INT;
}
if (CommonConstants.ONE_STRING.equals(income1.getRedData())) {
nums--;
} else {
nums++;
}
incomeMap.put(income1.getPayMonth() + CommonConstants.DOWN_LINE_STRING + income1.getFeeType(), nums);
insureNums = insureMap.get(income1.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + income1.getFeeType());
if (Common.isEmpty(insureNums)) {
insureNums = CommonConstants.ZERO_INT;
}
if (CommonConstants.ONE_STRING.equals(income1.getRedData())) {
insureNums--;
} else {
insureNums++;
}
insureMap.put(income1.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + income1.getFeeType(), insureNums);
}
// 金额人数、人次,需要判重
// 社保、公积金(收入来源:1社保2公积金3商险4薪资)
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getSourceType())
|| CommonConstants.TWO_STRING.equals(tIncomeDetail.getSourceType())) {
if (CommonConstants.ZERO_STRING.equals(tIncomeDetail.getRedData())) {
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) == null
|| incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) <= CommonConstants.ZERO_INT) {
this.saveIncome(tIncomeDetail);
}
} else {
// 红冲判断:当本类型是最大值,才可以红冲
if (this.redDateJudge(tIncomeDetail, numMap)) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
break;
}
} else {
map.put(sendBack,1);
idMap.put(sendBack,income.getId());
}
}
}
}
} else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
// 商险。收费方式:2金额-人数
if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) {
if (CommonConstants.ZERO_STRING.equals(tIncomeDetail.getRedData())) {
if (insureMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) == null
|| insureMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) <= CommonConstants.ZERO_INT) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
break;
}
} else {
map.put(sendBack,1);
idMap.put(sendBack,income.getId());
}
}
}
} else {
if (this.redDateJudge(tIncomeDetail, numMap)) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
break;
}
} else {
map.put(sendBack,1);
idMap.put(sendBack,income.getId());
}
}
}
}
} else {
// 各个模式累加逻辑:
this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
}
} else {
// 薪资。收费方式:2金额-人数
if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) {
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) == null
|| incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) <= CommonConstants.ZERO_INT) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
break;
}
} else {
map.put(sendBack,1);
idMap.put(sendBack,income.getId());
}
}
}
} else {
// 3金额-人次
// 各个模式累加逻辑:
this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
}
}
}
}
}
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(idMap.get(key));
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
}
@Override @Override
public void pushDetail() { public void pushDetail() {
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda() List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING));
String sendBack; String sendBack;
Map<String,Integer> map = new HashMap<>(); Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
//收入更新 //收入更新
List<TIncome> updateList = new ArrayList<>(); List<TIncome> updateList = new ArrayList<>();
for (TIncome income : list) { for (TIncome income : list) {
...@@ -299,6 +631,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -299,6 +631,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
map.put(sendBack,i); map.put(sendBack,i);
idMap.put(sendBack,income.getId());
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
baseMapper.updateIncomeById(updateList); baseMapper.updateIncomeById(updateList);
...@@ -310,31 +643,26 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -310,31 +643,26 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
error.setLinkId(income.getId()); error.setLinkId(income.getId());
error.setTitle(key); error.setTitle(key);
error.setNums(map.get(key)); error.setNums(map.get(key));
tSendEkpErrorService.saveError(error); tSendEkpErrorService.save(error);
} }
break; break;
} }
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else { } else {
map.put(sendBack,1); map.put(sendBack,1);
TSendEkpError error = new TSendEkpError(); idMap.put(sendBack,income.getId());
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(1);
tSendEkpErrorService.saveError(error);
} }
} }
} }
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(idMap.get(key));
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
baseMapper.updateIncomeById(updateList); baseMapper.updateIncomeById(updateList);
} }
...@@ -687,5 +1015,4 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -687,5 +1015,4 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return true; return true;
} }
} }
...@@ -2257,6 +2257,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2257,6 +2257,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
LocalDateTimeUtils.getDayStart(LocalDateTime.now())) LocalDateTimeUtils.getDayStart(LocalDateTime.now()))
.isNotNull(TPaymentInfo::getSocialId)); .isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
List<TPaymentInfo> updateList = new ArrayList<>();
for (TPaymentInfo paymentInfo: sumList) { for (TPaymentInfo paymentInfo: sumList) {
//获取员工当前缴纳月总合计 //获取员工当前缴纳月总合计
List<TPaymentInfo> payInfoList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda() List<TPaymentInfo> payInfoList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
...@@ -2270,9 +2271,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2270,9 +2271,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (sumSocial.compareTo(BigDecimal.ZERO) == CommonConstants.ZERO_INT) { if (sumSocial.compareTo(BigDecimal.ZERO) == CommonConstants.ZERO_INT) {
continue; continue;
} }
//生成收入 updateList.add(paymentInfo);
createIncomeInfo(paymentInfo,CommonConstants.ONE_STRING);
} }
//生成收入
createIncomeInfo(updateList,CommonConstants.ONE_STRING);
} }
} }
...@@ -2283,10 +2285,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2283,10 +2285,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
LocalDateTimeUtils.getDayStart(LocalDateTime.now())) LocalDateTimeUtils.getDayStart(LocalDateTime.now()))
.isNotNull(TPaymentInfo::getFundId)); .isNotNull(TPaymentInfo::getFundId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
for (TPaymentInfo paymentInfo: sumList) { //生成公积金收入
//生成公积金收入 createIncomeInfo(sumList,CommonConstants.TWO_STRING);
createIncomeInfo(paymentInfo,CommonConstants.TWO_STRING);
}
} }
} }
...@@ -2304,6 +2304,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2304,6 +2304,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) { public void initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>(); Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TPaymentInfo library:unPushInfo) { for (TPaymentInfo library:unPushInfo) {
//获取项目信息 //获取项目信息
...@@ -2542,6 +2543,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2542,6 +2543,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}else { }else {
if (map.get(body) > 0) { if (map.get(body) > 0) {
int i = map.get(body) + 1; int i = map.get(body) + 1;
idMap.put(body,library.getId());
map.put(body,i); map.put(body,i);
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
...@@ -2554,31 +2556,26 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2554,31 +2556,26 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
error.setLinkId(library.getId()); error.setLinkId(library.getId());
error.setTitle(key); error.setTitle(key);
error.setNums(map.get(key)); error.setNums(map.get(key));
tSendEkpErrorService.saveError(error); tSendEkpErrorService.save(error);
} }
break; break;
} }
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else { } else {
map.put(body,1); map.put(body,1);
TSendEkpError error = new TSendEkpError(); idMap.put(body,library.getId());
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
} }
} }
} }
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(idMap.get(key));
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
//更新推送状态 //更新推送状态
if (Common.isNotNull(pushList)) { if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
...@@ -2588,6 +2585,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2588,6 +2585,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void initEkpPushFundParam(List<TPaymentInfo> unPushInfo) { public void initEkpPushFundParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>(); Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TPaymentInfo library:unPushInfo) { for (TPaymentInfo library:unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2718,6 +2716,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2718,6 +2716,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (map.get(body) > 0) { if (map.get(body) > 0) {
int i = map.get(body) + 1; int i = map.get(body) + 1;
map.put(body,i); map.put(body,i);
idMap.put(body,library.getId());
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
...@@ -2729,159 +2728,162 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2729,159 +2728,162 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
error.setLinkId(library.getId()); error.setLinkId(library.getId());
error.setTitle(key); error.setTitle(key);
error.setNums(map.get(key)); error.setNums(map.get(key));
tSendEkpErrorService.saveError(error); tSendEkpErrorService.save(error);
} }
break; break;
} }
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else { } else {
map.put(body,1); map.put(body,1);
TSendEkpError error = new TSendEkpError(); idMap.put(body,library.getId());
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
} }
} }
} }
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(idMap.get(key));
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
//更新推送状态 //更新推送状态
if (Common.isNotNull(pushList)) { if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
} }
} }
public void createIncomeInfo(TPaymentInfo paymentInfo,String socialFundFlag) { public void createIncomeInfo(List<TPaymentInfo> updateList,String socialFundFlag) {
//获取项目信息 List<TIncomeDetail> detailList = new ArrayList<>();
TSettleDomain settleDomain = new TSettleDomain(); for (TPaymentInfo paymentInfo : updateList) {
List<TSettleDomainSelectVo> settleDomainR = null; //获取项目信息
R<TSettleDomainListVo> listVo = null; TSettleDomain settleDomain = new TSettleDomain();
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(paymentInfo.getSettleDomainId()); List<TSettleDomainSelectVo> settleDomainR = null;
if (Common.isNotNull(listVo)) { R<TSettleDomainListVo> listVo = null;
TSettleDomainListVo tSettleDomainListVo = listVo.getData(); listVo = archivesDaprUtil.selectSettleDomainSelectVoById(paymentInfo.getSettleDomainId());
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) { if (Common.isNotNull(listVo)) {
settleDomainR = tSettleDomainListVo.getListSelectVO(); TSettleDomainListVo tSettleDomainListVo = listVo.getData();
for (TSettleDomainSelectVo vo :settleDomainR) { if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
BeanUtils.copyProperties(vo,settleDomain); settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo : settleDomainR) {
BeanUtils.copyProperties(vo, settleDomain);
}
} }
} }
}
Boolean exitFlag = false;
List<TIncomeDetail> exitIncome = new ArrayList<>();
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING));
} else {
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getProvidentPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING));
}
if (Common.isNotNull(exitIncome)) {
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : exitIncome) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(),sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
exitFlag = true;
}
}
if (Common.isNotNull(settleDomain)) { Boolean exitFlag = false;
// 含有社保,则计算收入 List<TIncomeDetail> exitIncome = new ArrayList<>();
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING) if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING) exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
&& CommonConstants.TWO_STRING.equals(socialFundFlag)))) { .eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
//预估模式 .eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) { .eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { .eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING));
//预估模式只有按人次和人数收费 } else {
if (!exitFlag) { exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING, .eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), .eq(TIncomeDetail::getPayMonth, paymentInfo.getProvidentPayMonth())
settleDomain.getManagementFee(), socialFundFlag); .eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
} .eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING));
} else { }
BigDecimal gMoney = BigDecimal.ZERO; if (Common.isNotNull(exitIncome)) {
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) { BigDecimal sumMoney = BigDecimal.ZERO;
gMoney = settleDomain.getManagementFee(); for (TIncomeDetail income : exitIncome) {
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney);
gMoney = settleDomain.getManagementFee(); }
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
exitFlag = true;
}
}
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag)))) {
//预估模式
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
//预估模式只有按人次和人数收费
if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee(), socialFundFlag, detailList);
}
} else { } else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) { BigDecimal gMoney;
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
settleDomain.getManagementFee().divide(new BigDecimal("100"), gMoney = settleDomain.getManagementFee();
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP)); } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else { } else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(), isSum = 1;
settleDomain.getManagementFee().divide(new BigDecimal("100"), if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP)); gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
}
if (!exitFlag || isSum == 1) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag, detailList);
} }
}
if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag);
} }
} }
} }
} if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING) && CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING) && CommonConstants.TWO_STRING.equals(socialFundFlag)))) {
&& CommonConstants.TWO_STRING.equals(socialFundFlag)))) { //预估模式
//预估模式 if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) &&
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) && CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
settleDomain.getRiskFundFee(), socialFundFlag);
}
} else {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
BigDecimal money = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
money = settleDomain.getRiskFundFee();
} else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
}
}
if (!exitFlag) { if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag); settleDomain.getRiskFundFee(), socialFundFlag, detailList);
}
} else {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
BigDecimal money;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else {
isSum = 2;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
}
if (!exitFlag || isSum == 2) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag, detailList);
}
} }
} }
} }
} }
} }
incomeService.saveBathDetail(detailList);
} }
public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType, public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType,
String charges, String feeMode, BigDecimal money,String sourceType) { String charges, String feeMode, BigDecimal money,String sourceType,
List<TIncomeDetail> detailList) {
//生成收入数据 //生成收入数据
TIncomeDetail detail = new TIncomeDetail(); TIncomeDetail detail = new TIncomeDetail();
detail.setCreateTime(DateUtil.getCurrentDateTime()); detail.setCreateTime(DateUtil.getCurrentDateTime());
...@@ -2910,7 +2912,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2910,7 +2912,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
detail.setMrSettleType(settleDomain.getMrSettleType()); detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL); detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING); detail.setRedData(CommonConstants.ZERO_STRING);
incomeService.saveDetail(detail); detailList.add(detail);
} }
public String dateStringInsert(String month) { public String dateStringInsert(String month) {
......
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