Commit cb92410b authored by huyuchen's avatar huyuchen

商险优化修改

parent 6329fa73
...@@ -1806,6 +1806,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1806,6 +1806,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceSettle settle; TInsuranceSettle settle;
TInsurancePolicy one; TInsurancePolicy one;
BigDecimal bigDecimalAct; BigDecimal bigDecimalAct;
R<TIncomeDetailReturnVo> detailInfoList;
for (InsuranceRegisterParam success : listSuccess) { for (InsuranceRegisterParam success : listSuccess) {
long d1 = System.currentTimeMillis(); long d1 = System.currentTimeMillis();
//登记保单保费 //登记保单保费
...@@ -1814,7 +1815,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1814,7 +1815,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
actualMoney = detail.getActualPremium(); actualMoney = detail.getActualPremium();
boolean booleanInvoiceNo = false; boolean booleanInvoiceNo = false;
if (StringUtils.isNotBlank(success.getInvoiceNo())){ if (StringUtils.isNotBlank(success.getInvoiceNo())){
if (Common.isEmpty(detail.getInvoiceNo()) || success.getInvoiceNo().equals(detail.getInvoiceNo())) { if (Common.isEmpty(detail.getInvoiceNo()) || !success.getInvoiceNo().equals(detail.getInvoiceNo())) {
booleanInvoiceNo = true; booleanInvoiceNo = true;
} }
detail.setInvoiceNo(success.getInvoiceNo()); detail.setInvoiceNo(success.getInvoiceNo());
...@@ -1843,7 +1844,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1843,7 +1844,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
boolean booleanPolicyNo = false; boolean booleanPolicyNo = false;
if (StringUtils.isNotBlank(success.getPolicyNo())){ if (StringUtils.isNotBlank(success.getPolicyNo())){
if (Common.isEmpty(detail.getPolicyNo()) || success.getPolicyNo().equals(detail.getPolicyNo())) { if (Common.isEmpty(detail.getPolicyNo()) || !success.getPolicyNo().equals(detail.getPolicyNo())) {
booleanPolicyNo = true; booleanPolicyNo = true;
} }
detail.setPolicyNo(success.getPolicyNo()); detail.setPolicyNo(success.getPolicyNo());
...@@ -1954,12 +1955,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1954,12 +1955,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId()); settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()) { if (Optional.ofNullable(settle).isPresent()) {
//如果当前实缴信息未推送,则新增实缴单推送 //如果当前实缴信息未推送,则新增实缴单推送
if (StringUtils.isNotBlank(success.getInvoiceNo())) {
detail.setInvoiceNo(success.getInvoiceNo());
}
if (StringUtils.isNotBlank(success.getPolicyNo())) {
detail.setPolicyNo(success.getPolicyNo());
}
doJointInsuranceTask.asynchronousEkpInfo(detail,settle,CommonConstants.FOUR_INT); doJointInsuranceTask.asynchronousEkpInfo(detail,settle,CommonConstants.FOUR_INT);
} }
} }
...@@ -1997,7 +1992,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1997,7 +1992,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
incomeDetail.setFeeType(CommonConstants.ONE_STRING); incomeDetail.setFeeType(CommonConstants.ONE_STRING);
//判断是否存在当月的商险收入数据 //判断是否存在当月的商险收入数据
R<TIncomeDetailReturnVo> detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail); detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS
&& !detailInfoList.getData().getDetailList().isEmpty()) { && !detailInfoList.getData().getDetailList().isEmpty()) {
//生成红冲数据 //生成红冲数据
...@@ -2030,7 +2025,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2030,7 +2025,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
incomeDetail.setMoney(actualMoney); incomeDetail.setMoney(actualMoney);
} }
//判断是否存在当月的商险收入数据 //判断是否存在当月的商险收入数据
R<TIncomeDetailReturnVo> detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail); detailInfoList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS if (Common.isNotNull(detailInfoList) && detailInfoList.getCode() == CommonConstants.SUCCESS
&& !detailInfoList.getData().getDetailList().isEmpty()) { && !detailInfoList.getData().getDetailList().isEmpty()) {
//生成红冲数据 //生成红冲数据
...@@ -3481,7 +3476,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3481,7 +3476,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
InsuranceRegisterParam param; InsuranceRegisterParam param;
SettleVo settleVo; SettleVo settleVo;
List<TInsuranceEkp> ekpList;
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
param = distinctList.get(i); param = distinctList.get(i);
// 必填校验 // 必填校验
...@@ -3588,7 +3583,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3588,7 +3583,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceEkp> ekpLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceEkp> ekpLambdaQueryWrapper = new LambdaQueryWrapper<>();
ekpLambdaQueryWrapper.eq(TInsuranceEkp :: getDetailId,detail.getId()).eq(TInsuranceEkp ::getResendFlag,CommonConstants.ZERO_INT); ekpLambdaQueryWrapper.eq(TInsuranceEkp :: getDetailId,detail.getId()).eq(TInsuranceEkp ::getResendFlag,CommonConstants.ZERO_INT);
List<TInsuranceEkp> ekpList = tInsuranceEkpService.list(ekpLambdaQueryWrapper); ekpList = tInsuranceEkpService.list(ekpLambdaQueryWrapper);
if(CollectionUtils.isNotEmpty(ekpList)){ if(CollectionUtils.isNotEmpty(ekpList)){
param.setErrorMessage(InsurancesConstants.EKP_SEND_ERROR); param.setErrorMessage(InsurancesConstants.EKP_SEND_ERROR);
continue; continue;
...@@ -3671,49 +3666,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3671,49 +3666,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isNotNull(detail.getActualPremium())) { if (Common.isNotNull(detail.getActualPremium())) {
booleanActualPremium = StringUtils.isNotBlank(param.getActualPremium()) && detail.getActualPremium().compareTo(new BigDecimal(param.getActualPremium())) != 0; booleanActualPremium = StringUtils.isNotBlank(param.getActualPremium()) && detail.getActualPremium().compareTo(new BigDecimal(param.getActualPremium())) != 0;
} }
//如果当前为合并结算 if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
if (CommonConstants.ZERO_INT == detail.getSettleType() && StringUtils.isNotBlank(detail.getDefaultSettleId())){
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo)){
//保费更新,保单号,发票号不更新
if(booleanActualPremium && !booleanPolicyNo && !booleanInvoiceNo){
if ( InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
continue;
}
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
continue;
}
}
//保单号,发票号更新时
if(!booleanPolicyNo || !booleanInvoiceNo){
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getEstimateStatus()) || InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
continue;
}
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getEstimateStatus()) || InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
}
}
}
}
} else if (CommonConstants.ONE_INT == detail.getSettleType() && StringUtils.isNotBlank(detail.getDefaultSettleId())){
//如果当前为单独结算,判断实缴有没有结算
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId()); settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){ if (Optional.ofNullable(settle).isPresent()){
settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId()); settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo) && booleanActualPremium && !booleanPolicyNo && !booleanInvoiceNo){ if(!Common.isEmpty(settleVo) && (booleanActualPremium || booleanPolicyNo || booleanInvoiceNo)){
//判断实缴是否结算中 //保费更新或者保单号发票号更新
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())) { if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())) {
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED); param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
continue; continue;
} }
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())) { if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())) {
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED); param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
continue;
} }
} }
} }
......
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