Commit f5cd6b3a authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.5.3' into MVP1.5.3

parents 805190c4 3e88cbd3
...@@ -413,9 +413,9 @@ public class InsurancesConstants { ...@@ -413,9 +413,9 @@ public class InsurancesConstants {
*/ */
public static final String POLICY_NO_MORE_THAN_50 = "保单号长度超过50字符限制"; public static final String POLICY_NO_MORE_THAN_50 = "保单号长度超过50字符限制";
/** /**
* 发票号不能为空 * 保单号和发票号不可都为空
*/ */
public static final String INVOICE_NO_EMPTY = "发票号不能为空"; public static final String INVOICE_NO_EMPTY = "保单号和发票号不可都为空";
/** /**
* 变更原因不能为空 * 变更原因不能为空
*/ */
......
...@@ -33,6 +33,11 @@ public class EkpUpdateParam implements Serializable { ...@@ -33,6 +33,11 @@ public class EkpUpdateParam implements Serializable {
*/ */
private String fd_3b5bf030ab1a56; private String fd_3b5bf030ab1a56;
/**
* 保单号
*/
private String fd_3bb431933ee968;
/** /**
* 购买标准 * 购买标准
*/ */
......
...@@ -76,6 +76,12 @@ public class InsuranceRegisterInvoiceNoParam implements Serializable { ...@@ -76,6 +76,12 @@ public class InsuranceRegisterInvoiceNoParam implements Serializable {
@Schema(description = "错误信息") @Schema(description = "错误信息")
private String errorMessage; private String errorMessage;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/** /**
* 数据传递对象 * 数据传递对象
*/ */
......
...@@ -2096,32 +2096,52 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2096,32 +2096,52 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceRegisterInvoiceNoParam> listSuccess = operateList.stream().filter(e-> e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS)).collect(Collectors.toList()); List<InsuranceRegisterInvoiceNoParam> listSuccess = operateList.stream().filter(e-> e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS)).collect(Collectors.toList());
List<TInsuranceDetail> detailList = new ArrayList<>(); List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){ if (CollectionUtils.isNotEmpty(listSuccess)){
boolean invoiceNoFlag = false;
boolean policeNoFlag = false;
String invoiceNoInfo = "";
String policeNoInfo = "";
for (InsuranceRegisterInvoiceNoParam success : listSuccess) { for (InsuranceRegisterInvoiceNoParam success : listSuccess) {
TInsuranceDetail detail = success.getDetail(); TInsuranceDetail detail = success.getDetail();
if (Optional.ofNullable(detail).isPresent()){ if (Optional.ofNullable(detail).isPresent()){
//当两次发票号不一致时才更新 //判断本地更新了保单号还是发票号还是两个都更新了
if (!success.getInvoiceNo().equals(detail.getInvoiceNo())){ //当两次发票号不一致时
//只有当结算id存在的时候修改数据才会推给ekp if (Common.isNotNull(success.getInvoiceNo()) && !success.getInvoiceNo().equals(detail.getInvoiceNo())){
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){ invoiceNoFlag = true;
try { invoiceNoInfo = ";变更前发票号:" + detail.getInvoiceNo() + ";变更后发票号:" + success.getInvoiceNo();
//推送修改信息 detail.setInvoiceNo(success.getInvoiceNo());
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam(); }
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart()); //当两次保单号不一致时
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd()); if (Common.isNotNull(success.getPolicyNo()) && !success.getPolicyNo().equals(detail.getPolicyNo())){
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(detail.getBuyType())); policeNoFlag = true;
policeNoInfo = ";变更前保单号:" + detail.getPolicyNo() + ";变更后保单号:" + success.getPolicyNo();
detail.setPolicyNo(success.getPolicyNo());
}
detailList.add(detail);
//当两次发票号或发票号不一致时才更新
if ((policeNoFlag || invoiceNoFlag) && StringUtils.isNotBlank(detail.getDefaultSettleId())){
try {
//推送修改信息
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(detail.getBuyType()));
if (invoiceNoFlag) {
ekpUpdateParam.setFd_3b5bf030ab1a56(success.getInvoiceNo()); ekpUpdateParam.setFd_3b5bf030ab1a56(success.getInvoiceNo());
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard()); } else {
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId() + "_" + detail.getDefaultSettleId()); ekpUpdateParam.setFd_3b5bf030ab1a56(detail.getInvoiceNo());
ekpUpdateParam.setFd_3b5bf0b7b4c058("操作人:"+user.getNickname() + ";操作时间:"+LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + ";变更前发票号:" + detail.getInvoiceNo() + ";变更后发票号:" + success.getInvoiceNo());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
}catch (Exception e){
log.error("pushEkp error registeredInvoiceNo:",e.getMessage());
} }
if (policeNoFlag) {
ekpUpdateParam.setFd_3bb431933ee968(success.getInvoiceNo());
} else {
ekpUpdateParam.setFd_3bb431933ee968(detail.getInvoiceNo());
}
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId() + "_" + detail.getDefaultSettleId());
ekpUpdateParam.setFd_3b5bf0b7b4c058("操作人:" + user.getNickname() + ";操作时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + invoiceNoInfo + policeNoInfo);
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
} catch (Exception e) {
log.error("pushEkp error registeredInvoiceNo:", e.getMessage());
} }
//设置发票号
detail.setInvoiceNo(success.getInvoiceNo());
detailList.add(detail);
} }
} }
} }
...@@ -3760,7 +3780,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3760,7 +3780,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY);
continue; continue;
} }
if (StringUtils.isBlank(param.getInvoiceNo())){ if (StringUtils.isBlank(param.getInvoiceNo()) || StringUtils.isBlank(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.INVOICE_NO_EMPTY); param.setErrorMessage(InsurancesConstants.INVOICE_NO_EMPTY);
continue; 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