Commit a6597bfb authored by fangxinjiang's avatar fangxinjiang

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

parents f5e87c6b 6221c062
...@@ -1431,6 +1431,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1431,6 +1431,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
BigDecimal actualMoney;
actualMoney = detail.getActualPremium();
if (StringUtils.isNotBlank(success.getInvoiceNo())){ if (StringUtils.isNotBlank(success.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo()); detail.setInvoiceNo(success.getInvoiceNo());
//如果发票号不为空,将替换类型的发票号也全部更新 //如果发票号不为空,将替换类型的发票号也全部更新
...@@ -1625,27 +1627,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1625,27 +1627,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.updateById(detail); this.updateById(detail);
detailList.add(detail); detailList.add(detail);
try { try {
if (detail.getBuyType() != CommonConstants.FOUR_INT) { if (detail.getBuyType() != CommonConstants.FOUR_INT &&
if (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0) { CommonConstants.ONE_INT == detail.getSettleType()) {
//判断是否存在当月的商险收入数据 if (new BigDecimal(success.getActualPremium()).compareTo(actualMoney) != 0) {
TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setSourceId(detail.getId());
R<TIncomeDetailReturnVo> detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS
&& detailInfoList.getData().getDetailList().size() > 0) {
//生成红冲数据
for (TIncomeDetail detailInfo : detailInfoList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detailInfo, detail1);
detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detailInfo.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detailInfo);
}
}
//生成收入数据
createInsuranceInfo(detail);
} else {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
List<TSettleDomainSelectVo> settleDomainR = null; List<TSettleDomainSelectVo> settleDomainR = null;
...@@ -1666,37 +1650,75 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1666,37 +1650,75 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 含有商险,则计算收入 // 含有商险,则计算收入
if (settleDomain.getMrSettleType().equals(CommonConstants.TWO_STRING)) { if (settleDomain.getMrSettleType().equals(CommonConstants.TWO_STRING)) {
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem() if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem()
.contains(CommonConstants.THREE_STRING)) { .contains(CommonConstants.THREE_STRING) && CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
if (CommonConstants.ONE_STRING.equals(settleDomain.getManagementType())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getManagementType())) {
gMoney = BigDecimalUtils.safeMultiply(detail.getActualPremium(), gMoney = BigDecimalUtils.safeMultiply(actualMoney,
settleDomain.getManagementFee().divide(new BigDecimal("100"), settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP)); CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
isBl = true; isBl = true;
} }
} else if (Common.isNotNull(settleDomain.getRiskServerItem()) && settleDomain.getRiskServerItem() //判断是否存在当月的商险收入数据
.contains(CommonConstants.THREE_STRING)) { TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setSourceId(detail.getId());
if (isBl) {
incomeDetail.setMoney(gMoney);
}else {
incomeDetail.setMoney(actualMoney);
}
incomeDetail.setFeeType(CommonConstants.ONE_STRING);
//判断是否存在当月的商险收入数据
R<TIncomeDetailReturnVo> detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS
&& detailInfoList.getData().getDetailList().size() > 0) {
//生成红冲数据
for (TIncomeDetail detailInfo : detailInfoList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detailInfo, detail1);
detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detailInfo.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1);
break;
}
}
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && settleDomain.getRiskServerItem()
.contains(CommonConstants.THREE_STRING) && CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
if (CommonConstants.ONE_STRING.equals(settleDomain.getRiskFundType())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getRiskFundType())) {
gMoney = BigDecimalUtils.safeMultiply(detail.getActualPremium(), gMoney = BigDecimalUtils.safeMultiply(actualMoney,
settleDomain.getRiskFundFee().divide(new BigDecimal("100"), settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP)); CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
isBl = true; isBl = true;
} }
//判断是否存在当月的商险收入数据
TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setSourceId(detail.getId());
incomeDetail.setFeeType(CommonConstants.TWO_STRING);
if (isBl) {
incomeDetail.setMoney(gMoney);
}else {
incomeDetail.setMoney(actualMoney);
}
//判断是否存在当月的商险收入数据
R<TIncomeDetailReturnVo> detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS
&& detailInfoList.getData().getDetailList().size() > 0) {
//生成红冲数据
for (TIncomeDetail detailInfo : detailInfoList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detailInfo, detail1);
detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detailInfo.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1);
break;
}
}
} }
} }
} }
//判断是否存在当月的商险收入数据 //生成收入数据
TIncomeDetail incomeDetail = new TIncomeDetail(); createInsuranceInfo(detail);
incomeDetail.setSourceId(detail.getId());
if (isBl) {
incomeDetail.setMoney(gMoney);
}else {
incomeDetail.setMoney(detail.getActualPremium());
}
R<TIncomeDetailReturnVo> detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailInfoList) && detailInfoList.getData().getDetailList().size() == 0) {
//生成收入数据
createInsuranceInfo(detail);
}
} }
} }
}catch (Exception e){ }catch (Exception e){
...@@ -6074,6 +6096,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6074,6 +6096,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//判断是否存在当月的商险收入数据 //判断是否存在当月的商险收入数据
Boolean isExist = false; Boolean isExist = false;
List<TIncomeDetail> incomeDetailList = new ArrayList<>();
TIncomeDetail incomeDetail = new TIncomeDetail(); TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setEmpIdcard(insuranceDetail.getEmpIdcardNo()); incomeDetail.setEmpIdcard(insuranceDetail.getEmpIdcardNo());
incomeDetail.setCreateMonth(DateUtil.getYearAndMonth(insuranceDetail.getHandledTime(),0)); incomeDetail.setCreateMonth(DateUtil.getYearAndMonth(insuranceDetail.getHandledTime(),0));
...@@ -6082,15 +6105,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6082,15 +6105,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail); R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS
&& detailList.getData().getDetailList().size() > 0){ && detailList.getData().getDetailList().size() > 0){
incomeDetailList = detailList.getData().getDetailList();
isExist = true; isExist = true;
} }
//预估或者实缴保费 //预估或者实缴保费
BigDecimal fee; BigDecimal fee;
if (CommonConstants.ONE_STRING.equals(insuranceDetail.getSettleType())) { if (CommonConstants.ONE_INT == insuranceDetail.getSettleType()) {
fee = insuranceDetail.getEstimatePremium();
} else {
fee = insuranceDetail.getActualPremium(); fee = insuranceDetail.getActualPremium();
} else {
fee = insuranceDetail.getEstimatePremium();
} }
//判断是否为按人次收费 //判断是否为按人次收费
...@@ -6104,7 +6128,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6104,7 +6128,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
//预估模式只有按人次和人数收费 //预估模式只有按人次和人数收费
if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
isSum = 1; if (Common.isNotNull(incomeDetailList)) {
for (TIncomeDetail incomeDetailSum: incomeDetailList) {
if (!(incomeDetailSum.getSourceId().equals(insuranceDetail.getId()) &&
CommonConstants.ONE_STRING.equals(incomeDetailSum.getFeeType()) &&
CommonConstants.ONE_STRING.equals(incomeDetailSum.getMrSettleType()))) {
isSum = 1;
break;
}
}
}
} }
if (!isExist || isSum == 1) { if (!isExist || isSum == 1) {
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.ONE_STRING, createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.ONE_STRING,
...@@ -6112,12 +6145,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6112,12 +6145,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settleDomain.getManagementFee()); settleDomain.getManagementFee());
} }
} else { } else {
BigDecimal gMoney = BigDecimal.ZERO; BigDecimal gMoney;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) { if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee(); gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee(); gMoney = settleDomain.getManagementFee();
isSum = 2; if (Common.isNotNull(incomeDetailList)) {
for (TIncomeDetail incomeDetailSum: incomeDetailList) {
if (incomeDetailSum.getSourceId().equals(insuranceDetail.getId()) &&
CommonConstants.ONE_STRING.equals(incomeDetailSum.getFeeType()) &&
CommonConstants.TWO_STRING.equals(incomeDetailSum.getMrSettleType()) &&
CommonConstants.THREE_STRING.equals(incomeDetailSum.getFeeMode())) {
isSum = 6;
break;
} else {
isSum = 2;
}
}
}
} else { } else {
isSum = 2; isSum = 2;
gMoney = BigDecimalUtils.safeMultiply(fee, settleDomain.getManagementFee().divide( gMoney = BigDecimalUtils.safeMultiply(fee, settleDomain.getManagementFee().divide(
...@@ -6133,32 +6178,54 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6133,32 +6178,54 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isNotNull(settleDomain.getRiskServerItem()) && settleDomain.getRiskServerItem() if (Common.isNotNull(settleDomain.getRiskServerItem()) && settleDomain.getRiskServerItem()
.contains(CommonConstants.THREE_STRING)) { .contains(CommonConstants.THREE_STRING)) {
//预估模式 //预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) && if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) { if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
isSum = 3; if (Common.isNotNull(incomeDetailList)) {
} for (TIncomeDetail incomeDetailSum: incomeDetailList) {
if (!isExist || isSum == 3) { if (!(incomeDetailSum.getSourceId().equals(insuranceDetail.getId()) &&
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING, CommonConstants.TWO_STRING.equals(incomeDetailSum.getFeeType()) &&
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), CommonConstants.ONE_STRING.equals(incomeDetailSum.getMrSettleType()))) {
settleDomain.getRiskFundFee()); isSum = 3;
} break;
} 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.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
isSum = 4;
} else {
isSum = 4;
money = BigDecimalUtils.safeMultiply(fee, settleDomain.getRiskFundFee().divide(
new BigDecimal("100"), CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist || isSum == 4) { if (!isExist || isSum == 3) {
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), money); settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
settleDomain.getRiskFundFee());
}
} 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();
if (Common.isNotNull(incomeDetailList)) {
for (TIncomeDetail incomeDetailSum: incomeDetailList) {
if (incomeDetailSum.getSourceId().equals(insuranceDetail.getId()) &&
CommonConstants.TWO_STRING.equals(incomeDetailSum.getFeeType()) &&
CommonConstants.TWO_STRING.equals(incomeDetailSum.getMrSettleType()) &&
CommonConstants.THREE_STRING.equals(incomeDetailSum.getFeeMode())) {
isSum = 5;
break;
} else {
isSum = 4;
}
}
}
} else {
isSum = 4;
money = BigDecimalUtils.safeMultiply(fee, settleDomain.getRiskFundFee().divide(
new BigDecimal("100"), CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist || isSum == 4) {
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), money);
}
} }
} }
} }
......
...@@ -1589,7 +1589,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1589,7 +1589,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.eq(TIncomeDetail::getEmpIdcard, library.getEmpIdcard()) .eq(TIncomeDetail::getEmpIdcard, library.getEmpIdcard())
.eq(TIncomeDetail::getDeptId, library.getSettleDomainId()) .eq(TIncomeDetail::getDeptId, library.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING) .eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING)
.eq(TIncomeDetail::getPayMonth, library.getSocialPayMonth())); .eq(TIncomeDetail::getPayMonth, library.getSocialPayMonth())
.eq(TIncomeDetail::getMrSettleType, CommonConstants.ONE_STRING));
if (Common.isNotNull(updateList)) { if (Common.isNotNull(updateList)) {
for (TIncomeDetail upd : updateList) { for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail(); TIncomeDetail detail = new TIncomeDetail();
...@@ -1627,7 +1628,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1627,7 +1628,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard()) .eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
.eq(TIncomeDetail::getDeptId,library.getSettleDomainId()) .eq(TIncomeDetail::getDeptId,library.getSettleDomainId())
.eq(TIncomeDetail::getSourceType,CommonConstants.TWO_STRING) .eq(TIncomeDetail::getSourceType,CommonConstants.TWO_STRING)
.eq(TIncomeDetail::getPayMonth,library.getProvidentPayMonth())); .eq(TIncomeDetail::getPayMonth,library.getProvidentPayMonth())
.eq(TIncomeDetail::getMrSettleType, CommonConstants.ONE_STRING));
if (Common.isNotNull(updateList)) { if (Common.isNotNull(updateList)) {
for (TIncomeDetail upd : updateList) { for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail(); TIncomeDetail detail = new TIncomeDetail();
......
...@@ -296,6 +296,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -296,6 +296,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
detail.setEmpIdcard(tIncomeDetail.getEmpIdcard()); detail.setEmpIdcard(tIncomeDetail.getEmpIdcard());
detail.setDeptId(tIncomeDetail.getDeptId()); detail.setDeptId(tIncomeDetail.getDeptId());
List<TIncomeDetail> detailList = tIncomeDetailService.getTIncomeDetailList(detail); List<TIncomeDetail> detailList = tIncomeDetailService.getTIncomeDetailList(detail);
tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail);
// 不存在,直接新增 // 不存在,直接新增
if (incomeList == null || incomeList.isEmpty()) { if (incomeList == null || incomeList.isEmpty()) {
BeanUtil.copyProperties(tIncomeDetail, income); BeanUtil.copyProperties(tIncomeDetail, income);
...@@ -307,8 +310,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -307,8 +310,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
income.setId(CommonConstants.NULL);
tIncomeDetailService.save(tIncomeDetail);
} else { } else {
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
...@@ -333,6 +334,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -333,6 +334,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
idMap.put(sendBack,income.getId()); idMap.put(sendBack,income.getId());
} }
} }
this.updateById(income);
} else { } else {
// 判断,比例,直接加 // 判断,比例,直接加
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) { if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) {
...@@ -345,7 +347,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -345,7 +347,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else { } else {
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
...@@ -370,6 +371,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -370,6 +371,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
idMap.put(sendBack,income.getId()); idMap.put(sendBack,income.getId());
} }
} }
this.updateById(income);
} else { } else {
Map<String, Integer> numMap = new HashMap<>(); Map<String, Integer> numMap = new HashMap<>();
Map<String, Integer> incomeMap = new HashMap<>(); Map<String, Integer> incomeMap = new HashMap<>();
...@@ -421,7 +423,40 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -421,7 +423,40 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if (CommonConstants.ZERO_STRING.equals(tIncomeDetail.getRedData())) { if (CommonConstants.ZERO_STRING.equals(tIncomeDetail.getRedData())) {
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) == null 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) { || incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) <= CommonConstants.ZERO_INT) {
this.saveIncome(tIncomeDetail); 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);
} 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());
}
}
this.updateById(income);
} }
} else { } else {
// 红冲判断:当本类型是最大值,才可以红冲 // 红冲判断:当本类型是最大值,才可以红冲
...@@ -435,7 +470,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -435,7 +470,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else { } else {
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
...@@ -460,6 +494,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -460,6 +494,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
idMap.put(sendBack,income.getId()); idMap.put(sendBack,income.getId());
} }
} }
this.updateById(income);
} }
} }
} else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) { } else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
...@@ -477,7 +512,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -477,7 +512,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else { } else {
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
...@@ -502,6 +536,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -502,6 +536,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
idMap.put(sendBack,income.getId()); idMap.put(sendBack,income.getId());
} }
} }
this.updateById(income);
} }
} else { } else {
if (this.redDateJudge(tIncomeDetail, numMap)) { if (this.redDateJudge(tIncomeDetail, numMap)) {
...@@ -514,7 +549,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -514,7 +549,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else { } else {
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
...@@ -539,6 +573,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -539,6 +573,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
idMap.put(sendBack,income.getId()); idMap.put(sendBack,income.getId());
} }
} }
this.updateById(income);
} }
} }
} else { } else {
...@@ -559,7 +594,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -559,7 +594,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
tIncomeDetailService.save(tIncomeDetail);
} else { } else {
if (map.get(sendBack) > 0) { if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1; int i = map.get(sendBack) + 1;
...@@ -584,6 +618,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -584,6 +618,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
idMap.put(sendBack,income.getId()); idMap.put(sendBack,income.getId());
} }
} }
this.updateById(income);
} }
} else { } else {
// 3金额-人次 // 3金额-人次
......
...@@ -2791,6 +2791,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2791,6 +2791,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimal sumMoney = BigDecimal.ZERO; BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : exitIncome) { for (TIncomeDetail income : exitIncome) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney); sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney);
if (paymentInfo.getId().equals(income.getSourceId())) {
exitFlag = true;
}
}
if (exitFlag) {
continue;
} }
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) { if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
exitFlag = true; exitFlag = true;
......
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