Commit 42750155 authored by hongguangwu's avatar hongguangwu

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

parents 87f616d9 fbf6b6ef
...@@ -158,7 +158,7 @@ public class TInsuranceEkp implements Serializable { ...@@ -158,7 +158,7 @@ public class TInsuranceEkp implements Serializable {
/** /**
* EKP推送类型 * EKP推送类型
*/ */
@Schema(description = "1推送预估费用,2推送实缴费用,3变更结算月,4推送作废信息,5推送红冲信息,6投保退回红冲,7变更保单保费") @Schema(description = "推送类型(1推送预估费用,2推送实缴费用,3变更结算信息,4推送作废信息,5推送预估红冲信息,6推送实缴红冲信息)")
private Integer pushType; private Integer pushType;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -168,7 +168,7 @@ public class EkpInteractiveParam implements Serializable { ...@@ -168,7 +168,7 @@ public class EkpInteractiveParam implements Serializable {
/** /**
* EKP推送类型 * EKP推送类型
*/ */
@Schema(description = "1推送预估费用,2推送实缴费用,3变更结算月,4推送作废信息,5推送红冲信息,6投保退回红冲,7变更保单保费") @Schema(description = "1推送预估费用,2推送实缴费用,3变更结算月,4推送作废信息,5推送预估红冲信息,6投保退回红冲,7变更保单保费,8推送实缴红冲信息")
private Integer pushType; private Integer pushType;
/** /**
......
...@@ -181,7 +181,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -181,7 +181,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public IPage<InsuranceListVO> getInsuranceListPage(Page<InsuranceListVO> page, InsuranceListParam param) { public IPage<InsuranceListVO> getInsuranceListPage(Page<InsuranceListVO> page, InsuranceListParam param) {
//todo 根据登录人获取数据权限
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> deptNoList = getDeptNoList(user); List<String> deptNoList = getDeptNoList(user);
IPage<InsuranceListVO> insuranceList = new Page<>(); IPage<InsuranceListVO> insuranceList = new Page<>();
...@@ -210,7 +209,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -210,7 +209,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public List<InsuranceListVO> getInsuranceList(InsuranceListParam param) { public List<InsuranceListVO> getInsuranceList(InsuranceListParam param) {
//todo 根据登录人获取数据权限
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user); List<String> deptList = getDeptNoList(user);
List<InsuranceListVO> insuranceList = new ArrayList<>(); List<InsuranceListVO> insuranceList = new ArrayList<>();
...@@ -239,7 +237,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -239,7 +237,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) { public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) {
//todo 根据登录人获取数据权限
IPage<InsuranceListVO> iPage = new Page<>(); IPage<InsuranceListVO> iPage = new Page<>();
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String regionSQL = getRegionSQL(user); String regionSQL = getRegionSQL(user);
...@@ -851,7 +848,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -851,7 +848,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R<List<InsuranceExportListVO>> getInsuranceExportList(InsuranceExportListParam param) { public R<List<InsuranceExportListVO>> getInsuranceExportList(InsuranceExportListParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<InsuranceExportListVO> insuranceExportList = new ArrayList<>(); List<InsuranceExportListVO> insuranceExportList = new ArrayList<>();
//todo 根据登录人获取数据权限
String regionSQL = getRegionSQL(user); String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL); param.setRegionSql(regionSQL);
if(StringUtils.isBlank(regionSQL)){ if(StringUtils.isBlank(regionSQL)){
...@@ -1373,7 +1369,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1373,7 +1369,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
); );
if (StringUtils.isNotBlank(success.getInvoiceNo())){ if (StringUtils.isNotBlank(success.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo()); detail.setInvoiceNo(success.getInvoiceNo());
//如果发票号不为空,将替换类型的发票号也全部更新 //如果发票号不为空,将替换类型的发票号也全部更新
List<TInsuranceReplace> list = tInsuranceReplaceService.list(Wrappers.<TInsuranceReplace>query().lambda() List<TInsuranceReplace> list = tInsuranceReplaceService.list(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getOriginInsuranceDetailId, detail.getId())); .eq(TInsuranceReplace::getOriginInsuranceDetailId, detail.getId()));
...@@ -1404,15 +1399,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1404,15 +1399,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
//如果保费不为空
if (StringUtils.isNotBlank(success.getActualPremium())){ if (StringUtils.isNotBlank(success.getActualPremium())){
//判断推送金额是否一致,不一致才推送ekp Integer settleType = detail.getSettleType();
if (detail.getActualPremium() == null || (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0)){ String defaultSettleId = detail.getDefaultSettleId();
// todo 判断是否推送过ekp,没推送过调新增接口,推送过调更新接口 //如果当前保单为合并结算
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){ if(settleType == CommonConstants.ZERO_INT){
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId()); if(StringUtils.isNotBlank(defaultSettleId)){
if(!Common.isEmpty(settleVo) && InsurancesConstants.SETTLE_ZERO.equals(settleVo.getActualStatus())){ TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId()); if(Optional.ofNullable(settle).isPresent()){
if (Optional.ofNullable(settle).isPresent()){ //如果当前实缴信息未推送,则新增实缴单推送
if(settle.getIsActualPush() == CommonConstants.ZERO_INT){
//保费存储
settle.setActualPremium(new BigDecimal(success.getActualPremium()));
settle.setIsActualPush(CommonConstants.ZERO_INT);
settle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(settle);
//调EKP新增实际保费
detail.setActualPremium(new BigDecimal(success.getActualPremium()));
threadPool.execute(() ->{
String s = pushEstimate(detail, CommonConstants.TWO_INT);
//如果推送成功则更改推送状态
if(StringUtils.isNotBlank(s)){
settle.setActualPushTime(LocalDateTime.now());
settle.setIsActualPush(CommonConstants.ONE_INT);
tInsuranceSettleService.updateById(settle);
}
});
}
//如果当前实缴信息已推送,且金额与本次不一致,则推送实缴更新
if(settle.getIsActualPush() == CommonConstants.ONE_INT
&& (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0)){
//推送保费更新
settle.setActualPremium(new BigDecimal(success.getActualPremium())); settle.setActualPremium(new BigDecimal(success.getActualPremium()));
settle.setIsActualPush(CommonConstants.ZERO_INT); settle.setIsActualPush(CommonConstants.ZERO_INT);
settle.setUpdateTime(LocalDateTime.now()); settle.setUpdateTime(LocalDateTime.now());
...@@ -1427,9 +1445,52 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1427,9 +1445,52 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.updateById(settle); tInsuranceSettleService.updateById(settle);
} }
}); });
}else if(settle.getIsActualPush() == CommonConstants.ONE_INT
&& (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) == 0)){
//推送保费更新
settle.setActualPremium(new BigDecimal(success.getActualPremium()));
settle.setIsActualPush(CommonConstants.ZERO_INT);
settle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(settle);
//调EKP更新实际保费
detail.setActualPremium(new BigDecimal(success.getActualPremium()));
threadPool.execute(() ->{
String s = pushEstimate(detail,CommonConstants.FOUR_INT);
if(StringUtils.isNotBlank(s)){
settle.setActualPushTime(LocalDateTime.now());
settle.setIsActualPush(CommonConstants.ONE_INT);
tInsuranceSettleService.updateById(settle);
}
});
} }
} }
}else { }
}
//如果当前保单为单独结算
if(settleType == CommonConstants.ZERO_INT){
//推送过实缴信息且金额与本次不一致,则推送更新
if(StringUtils.isNotBlank(defaultSettleId)
&& (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0)){
//推送保费更新
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
settle.setActualPremium(new BigDecimal(success.getActualPremium()));
settle.setIsActualPush(CommonConstants.ZERO_INT);
settle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(settle);
//调EKP更新实际保费
detail.setActualPremium(new BigDecimal(success.getActualPremium()));
threadPool.execute(() ->{
String s = pushEstimate(detail,CommonConstants.FOUR_INT);
if(StringUtils.isNotBlank(s)){
settle.setActualPushTime(LocalDateTime.now());
settle.setIsActualPush(CommonConstants.ONE_INT);
tInsuranceSettleService.updateById(settle);
}
});
}
//未推送过实缴信息,则推送新增
if(StringUtils.isBlank(defaultSettleId)){
//保费存储 //保费存储
TInsuranceSettle settle = new TInsuranceSettle(); TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId()); settle.setInsDetailId(detail.getId());
...@@ -1455,6 +1516,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1455,6 +1516,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
String invoiceNo = success.getInvoiceNo();
String policyNo = success.getPolicyNo();
boolean booleanInvoiceNo = StringUtils.isNotBlank(invoiceNo) && !invoiceNo.equals(detail.getInvoiceNo());
boolean booleanPolicyNo = StringUtils.isNotBlank(policyNo) && !policyNo.equals(detail.getPolicyNo());
//如果当前保费为空,且保单号或发票号不一样
if(StringUtils.isBlank(success.getActualPremium()) && (!booleanInvoiceNo || !booleanPolicyNo)){
if(StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if(Optional.ofNullable(settle).isPresent()){
//如果当前实缴信息未推送,则新增实缴单推送
threadPool.execute(() ->{
if(StringUtils.isNotBlank(invoiceNo)){
detail.setInvoiceNo(invoiceNo);
}
if(StringUtils.isNotBlank(policyNo)){
detail.setPolicyNo(policyNo);
}
String s = pushEstimate(detail, CommonConstants.FOUR_INT);
//如果推送成功则更改推送状态
if(StringUtils.isNotBlank(s)){
settle.setActualPushTime(LocalDateTime.now());
settle.setIsActualPush(CommonConstants.ONE_INT);
tInsuranceSettleService.updateById(settle);
}
});
}
}
}
//可以改成批量更新 //可以改成批量更新
this.updateById(detail); this.updateById(detail);
detailList.add(detail); detailList.add(detail);
...@@ -2615,7 +2704,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2615,7 +2704,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param); listResult.add(param);
...@@ -2753,22 +2841,72 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2753,22 +2841,72 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){ //保单号是否更新
boolean booleanPolicyNo = StringUtils.isNotBlank(param.getPolicyNo()) && !param.getPolicyNo().equals(detail.getPolicyNo());
//发票号是否更新
boolean booleanInvoiceNo = StringUtils.isNotBlank(param.getInvoiceNo()) && !param.getInvoiceNo().equals(detail.getInvoiceNo());
//保费是否更新
boolean booleanActualPremium = StringUtils.isNotBlank(param.getActualPremium()) && detail.getActualPremium().compareTo(new BigDecimal(param.getActualPremium())) != 0;
//如果当前为合并结算
if (CommonConstants.ZERO_INT == detail.getSettleType() && StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId()); TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){ if (Optional.ofNullable(settle).isPresent()){
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId()); SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo)){ if(!Common.isEmpty(settleVo)){
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){ String estimateStatus = settleVo.getEstimateStatus();
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED); String actualStatus = settleVo.getActualStatus();
listResult.add(param); //保费更新,保单号,发票号不更新
continue; if(booleanActualPremium && !booleanPolicyNo && !booleanInvoiceNo){
if ( InsurancesConstants.SETTLE_TWO.equals(actualStatus)){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (InsurancesConstants.SETTLE_ONE.equals(actualStatus)){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
listResult.add(param);
continue;
}
} }
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){ //
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED); if(!booleanPolicyNo || !booleanInvoiceNo){
listResult.add(param); if (InsurancesConstants.SETTLE_TWO.equals(estimateStatus) || InsurancesConstants.SETTLE_TWO.equals(actualStatus)){
continue; param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (InsurancesConstants.SETTLE_ONE.equals(estimateStatus) || InsurancesConstants.SETTLE_ONE.equals(actualStatus)){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
listResult.add(param);
continue;
}
} }
} }
}
}
//如果当前为单独结算,判断实缴有没有结算
if (CommonConstants.ONE_INT == detail.getSettleType() && StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo)){
String actualStatus = settleVo.getActualStatus();
//判断实缴是否结算中
if(booleanActualPremium && !booleanPolicyNo && !booleanInvoiceNo){
if ( InsurancesConstants.SETTLE_TWO.equals(actualStatus)){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (InsurancesConstants.SETTLE_ONE.equals(actualStatus)){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
listResult.add(param);
continue;
}
}
}
} }
} }
} }
...@@ -2996,7 +3134,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2996,7 +3134,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) { public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) {
//todo 根据登录人获取其项目权限列表
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user); List<String> deptList = getDeptNoList(user);
IPage<InsuredListVo> insuranceList = new Page<>(); IPage<InsuredListVo> insuranceList = new Page<>();
...@@ -3033,7 +3170,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3033,7 +3170,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public List<InsuredListVo> getInsuredList(InsuredParam param) { public List<InsuredListVo> getInsuredList(InsuredParam param) {
//todo 根据登录人获取其项目权限列表
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user); List<String> deptList = getDeptNoList(user);
List<InsuredListVo> insuredList = new ArrayList<>(); List<InsuredListVo> insuredList = new ArrayList<>();
...@@ -3072,7 +3208,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3072,7 +3208,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param) { public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param) {
//todo 根据登录人获取其项目权限列表
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user); List<String> deptList = getDeptNoList(user);
if (CollectionUtils.isEmpty(deptList)){ if (CollectionUtils.isEmpty(deptList)){
...@@ -3110,6 +3245,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3110,6 +3245,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) { public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> deptNoList = getDeptNoList(user); List<String> deptNoList = getDeptNoList(user);
List<InsuranceRefundListVo> pageList = new ArrayList<>();
if(CollectionUtils.isEmpty(deptNoList)){
return pageList;
}
param.setDeptNoList(deptNoList); param.setDeptNoList(deptNoList);
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param); List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){ if (CollectionUtils.isNotEmpty(insuranceRefundList)){
...@@ -3183,7 +3322,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3183,7 +3322,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){ public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList; List<RefundExportListVo> refundExportList;
//todo 根据登录人获取数据权限
String regionSQL = getRegionSQL(user); String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL); param.setRegionSql(regionSQL);
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集 //如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
...@@ -3559,6 +3697,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3559,6 +3697,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为单独结算 //变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) { if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP //推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING); interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
...@@ -3567,6 +3706,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3567,6 +3706,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setDeptNo(success.getNewDeptNo()); interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName()); interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
String pushResult = eKPInsuranceUtil.sendToEkp(interactiveParam); String pushResult = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(pushResult)){ if (StringUtils.isNotBlank(pushResult)){
newInsuranceSettle.setActualPushTime(LocalDateTime.now()); newInsuranceSettle.setActualPushTime(LocalDateTime.now());
...@@ -3581,6 +3721,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3581,6 +3721,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为合并结算 //变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) { if (CommonConstants.ZERO_INT == newSettleType) {
//先推送预估,再推送实际 //先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3622,6 +3763,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3622,6 +3763,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为单独结算 //变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) { if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP //推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING); interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
...@@ -3644,6 +3786,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3644,6 +3786,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为合并结算 //变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) { if (CommonConstants.ZERO_INT == newSettleType) {
//先推送预估,再推送实际 //先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3704,6 +3847,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3704,6 +3847,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId()); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
update(updateWrapper); update(updateWrapper);
//推送结算信息至EKP //推送结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3776,6 +3920,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3776,6 +3920,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00")); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
update(updateWrapper); update(updateWrapper);
//推送新的结算信息至EKP,推实际保费 //推送新的结算信息至EKP,推实际保费
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING); interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3800,6 +3945,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3800,6 +3945,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更为合并结算 //变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){ if (CommonConstants.ZERO_INT == newSettleType){
// 推送新的结算信息 // 推送新的结算信息
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3842,6 +3988,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3842,6 +3988,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam); String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(deleteBody)){ if(StringUtils.isNotBlank(deleteBody)){
//先推送预估,再推送实际 //先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3882,6 +4029,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3882,6 +4029,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如果预估和实缴均未推送 //如果预估和实缴均未推送
if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){ if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//先推送预估,再推送实际 //先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3944,6 +4092,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3944,6 +4092,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更为合并结算 //变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){ if (CommonConstants.ZERO_INT == newSettleType){
//新增新的结算信息 //新增新的结算信息
newInsuranceSettle.setInsDetailId(insuranceDetailId); newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType); newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
...@@ -3956,6 +4105,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3956,6 +4105,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId()); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper); update(updateWrapper);
//推送新的结算信息至EKP //推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -3981,6 +4131,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3981,6 +4131,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
}else{ }else{
//推送新的结算信息至EKP //推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
...@@ -5146,7 +5297,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5146,7 +5297,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R getDeptListByUser(){ public R getDeptListByUser(){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
//根据当前登录人获取其拥有的项目列表权限 //根据当前登录人获取其拥有的项目列表权限
// TODO: 2022/8/5
List<String> deptNoList = getDeptNoList(user); List<String> deptNoList = getDeptNoList(user);
List<Dept> deptList = new ArrayList<>(16); List<Dept> deptList = new ArrayList<>(16);
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(deptNoList); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(deptNoList);
...@@ -5298,6 +5448,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5298,6 +5448,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link List< String>} * @return {@link List< String>}
*/ */
public List<String> getDeptNoList(YifuUser user){ public List<String> getDeptNoList(YifuUser user){
//todo 根据登录人获取其项目权限列表
List<String> deptList = new ArrayList<>(16); List<String> deptList = new ArrayList<>(16);
String id = user.getId(); String id = user.getId();
//周日琴12,徐燕13 //周日琴12,徐燕13
...@@ -5336,6 +5487,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5336,6 +5487,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link String} * @return {@link String}
*/ */
public String getRegionSQL(YifuUser user){ public String getRegionSQL(YifuUser user){
//todo 根据登录人获取其办理地SQL
String id = user.getId(); String id = user.getId();
String sql ; String sql ;
//user_id=14, 合肥办理1 //user_id=14, 合肥办理1
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil; import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants; import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
...@@ -61,101 +62,178 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T ...@@ -61,101 +62,178 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
List<TInsuranceEkp> successLit = new ArrayList<>(); List<TInsuranceEkp> successLit = new ArrayList<>();
if (CollectionUtils.isNotEmpty(ekpRefundList)){ if (CollectionUtils.isNotEmpty(ekpRefundList)){
for (TInsuranceEkp tInsuranceEkp : ekpRefundList) { for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
//结算信息 TInsuranceDetail byId = tInsuranceDetailService.getById(tInsuranceEkp.getDetailId());
SettleVo settleVo = tInsuranceDetailService.getInsuranceDetailSettleStatus(tInsuranceEkp.getDetailId(), tInsuranceEkp.getDefaultSettleId()); String defaultSettleId = byId.getDefaultSettleId();
//实缴结算状态 if (tInsuranceEkp.getDefaultSettleId().equals(defaultSettleId)){
String actualStatus = settleVo.getActualStatus(); //ekp结算信息
//预缴结算状态 SettleVo settleVo = tInsuranceDetailService.getInsuranceDetailSettleStatus(tInsuranceEkp.getDetailId(), tInsuranceEkp.getDefaultSettleId());
String estimateStatus = settleVo.getEstimateStatus(); //商险结算信息
Integer pushType = tInsuranceEkp.getPushType(); TInsuranceSettle insuranceSettle = tInsuranceSettleService.getById(tInsuranceEkp.getDefaultSettleId());
LambdaQueryWrapper<TInsuranceSettle> queryWrapper = new LambdaQueryWrapper<>(); //预估推送状态
queryWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId()); Integer isEstimatePush = insuranceSettle.getIsEstimatePush();
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(queryWrapper); //实缴推送状态
//如果当前需要重发预估保费的数据已发送,则过滤掉执行下一条数据 Integer isActualPush = insuranceSettle.getIsActualPush();
if(CommonConstants.ONE_INT == pushType && CommonConstants.ONE_INT == insuranceSettle.getIsEstimatePush()){ //实缴结算状态
tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT); String actualStatus = settleVo.getActualStatus();
failList.add(tInsuranceEkp); //预缴结算状态
continue; String estimateStatus = settleVo.getEstimateStatus();
} Integer pushType = tInsuranceEkp.getPushType();
//如果当前需要重发实际保费的数据已发送,则过滤掉执行下一条数据 //如果当前需要重发预估保费的数据已发送,则过滤掉执行下一条数据
if(CommonConstants.TWO_INT == pushType && CommonConstants.ONE_INT == insuranceSettle.getIsActualPush()){ if(CommonConstants.ONE_INT == pushType && CommonConstants.ONE_INT == isEstimatePush){
tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT); tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT);
failList.add(tInsuranceEkp); failList.add(tInsuranceEkp);
continue; continue;
}
EkpInteractiveParam ekpParam = new EkpInteractiveParam();
BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
if(actualStatus.equals(InsurancesConstants.SETTLE_ZERO)){
String s = ekpInsuranceUtil.sendToEkp(ekpParam);
//如果发送成功
if (StringUtils.isNotBlank(s)){
//预估则更新预估保费
if(CommonConstants.ONE_INT == pushType){
LambdaUpdateWrapper<TInsuranceSettle> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle :: getIsEstimatePush,CommonConstants.ONE_INT)
.set(TInsuranceSettle :: getEstimatePushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
}
//预估则更新预估保费
if(CommonConstants.TWO_INT == pushType){
LambdaUpdateWrapper<TInsuranceSettle> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle :: getIsActualPush,CommonConstants.ONE_INT)
.set(TInsuranceSettle :: getActualPushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
}
//结算月则变更结算月
if(CommonConstants.THREE_INT == pushType){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getId,tInsuranceEkp.getDetailId())
.set(TInsuranceDetail :: getSettleMonth,tInsuranceEkp.getSettleMonth())
.set(TInsuranceDetail :: getUpdateTime, LocalDateTime.now());
tInsuranceDetailService.update(updateWrapper);
}
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
successLit.add(tInsuranceEkp);
}else{
break;
} }
//如果当前需要重发实际保费的数据已发送,则过滤掉执行下一条数据
}else{ if(CommonConstants.TWO_INT == pushType && CommonConstants.ONE_INT == isActualPush){
//如果为作废信息,已结算和结算中发送红冲数据 tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT);
if(CommonConstants.FOUR_INT == pushType){ failList.add(tInsuranceEkp);
//预估保费 continue;
BigDecimal estimatePremium = ekpParam.getEstimatePremium(); }
//实际保费 EkpInteractiveParam ekpParam = new EkpInteractiveParam();
BigDecimal actualPremium = ekpParam.getActualPremium(); BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
if(!BigDecimalUtils.isNullOrZero(estimatePremium)){ //如果预估未结算
ekpParam.setEstimatePremium(estimatePremium.negate()); LambdaUpdateWrapper<TInsuranceSettle> updateWrapper = new LambdaUpdateWrapper<>();
} String s = null;
if(!BigDecimalUtils.isNullOrZero(actualPremium)){ if(InsurancesConstants.SETTLE_ZERO.equals(estimateStatus)){
ekpParam.setActualPremium(actualPremium.negate()); //实缴未结算
if(InsurancesConstants.SETTLE_ZERO.equals(actualStatus)){
//如果是新增预估保费,则推送预估保费新增
if(CommonConstants.ONE_INT == pushType){
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)){
updateWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle :: getIsEstimatePush,CommonConstants.ONE_INT)
.set(TInsuranceSettle :: getEstimatePushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
}
}
//如果是新增实缴保费,则推送实缴保费新增
if(CommonConstants.TWO_INT == pushType){
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
updateWrapper.eq(TInsuranceSettle::getId, tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle::getIsActualPush, CommonConstants.ONE_INT)
.set(TInsuranceSettle::getActualPushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
}
}
//如果是变更结算信息,则推送变更结算信息
if(CommonConstants.THREE_INT == pushType){
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
updateWrapper.eq(TInsuranceSettle::getId, tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle::getIsActualPush, CommonConstants.ONE_INT)
.set(TInsuranceSettle::getActualPushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
LambdaUpdateWrapper<TInsuranceDetail> detailLambdaUpdate = new LambdaUpdateWrapper<>();
detailLambdaUpdate.eq(TInsuranceDetail::getId, tInsuranceEkp.getDetailId())
.set(TInsuranceDetail::getSettleMonth, CommonConstants.ONE_INT);
tInsuranceSettleService.update(updateWrapper);
}
}
//如果是作废信息,则推送作废信息
if(CommonConstants.FOUR_INT == pushType){
s = ekpInsuranceUtil.sendToEkp(ekpParam);
}
if(CommonConstants.FIVE_INT == pushType || CommonConstants.SIX_INT == pushType){
tInsuranceEkp.setResendFlag(CommonConstants.TWO_INT);
failList.add(tInsuranceEkp);
continue;
}
//成功则更新,不成功则跳出循环
if(StringUtils.isNotBlank(s)) {
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
updateById(tInsuranceEkp);
}else{
break;
}
} }
ekpParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); //实缴结算中,已结算
String s = ekpInsuranceUtil.sendToEkp(ekpParam); if(InsurancesConstants.SETTLE_ONE.equals(actualStatus) || InsurancesConstants.SETTLE_TWO.equals(actualStatus)){
if(StringUtils.isNotBlank(s)){ //如果是作废,则推送实缴红冲
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT); if(CommonConstants.FOUR_INT == pushType){
successLit.add(tInsuranceEkp); BigDecimal actualPremium = ekpParam.getActualPremium();
}else{ ekpParam.setActualPremium(actualPremium.negate());
break; ekpParam.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
ekpParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
updateById(tInsuranceEkp);
}else{
break;
}
}
if(CommonConstants.SIX_INT == pushType){
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
updateById(tInsuranceEkp);
}else{
break;
}
}else{
//推送预估新增,实缴新增,变更结算信息,作废,则不进行重发
tInsuranceEkp.setResendFlag(CommonConstants.TWO_INT);
updateById(tInsuranceEkp);
}
} }
//如果为红冲数据则正常发送 }else{
}else if(CommonConstants.FIVE_INT == pushType || CommonConstants.SIX_INT == pushType){ //如果实缴未结算
String s = ekpInsuranceUtil.sendToEkp(ekpParam); if(InsurancesConstants.SETTLE_ZERO.equals(actualStatus)){
if(StringUtils.isNotBlank(s)){ //如果是作废信息,则推送预估红冲信息
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT); if(CommonConstants.FOUR_INT == pushType){
successLit.add(tInsuranceEkp); BigDecimal estimatePremium = ekpParam.getEstimatePremium();
ekpParam.setActualPremium(estimatePremium.negate());
ekpParam.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
ekpParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
updateById(tInsuranceEkp);
}else{
break;
}
} else if(CommonConstants.FIVE_INT == pushType){
//如果是预估红冲信息,则推送预估红冲信息
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
updateById(tInsuranceEkp);
}else{
break;
}
}else{
tInsuranceEkp.setResendFlag(CommonConstants.TWO_INT);
updateById(tInsuranceEkp);
}
}else{ }else{
break; //如果是实缴红冲信息,则推送实缴红冲信息
if(CommonConstants.SIX_INT == pushType){
BigDecimal actualPremium = ekpParam.getActualPremium();
ekpParam.setActualPremium(actualPremium.negate());
ekpParam.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
ekpParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
if(StringUtils.isNotBlank(s)) {
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
updateById(tInsuranceEkp);
}else{
break;
}
}else{
tInsuranceEkp.setResendFlag(CommonConstants.TWO_INT);
updateById(tInsuranceEkp);
}
} }
}else{
tInsuranceEkp.setResendFlag(CommonConstants.TWO_INT);
failList.add(tInsuranceEkp);
} }
}else{
//结算id与当前不一致则不进行重发
tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT);
failList.add(tInsuranceEkp);
} }
} }
updateBatchById(successLit);
updateBatchById(failList); updateBatchById(failList);
return R.ok("发送成功"); return R.ok("发送成功");
}else{ }else{
......
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