Commit c499925c authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'feature/insurance-1.3.0'

Feature licancan

See merge request !304
parents a5e52536 a4cd4349
...@@ -39,7 +39,7 @@ public class EkpUpdateParam implements Serializable { ...@@ -39,7 +39,7 @@ public class EkpUpdateParam implements Serializable {
private String fd_3b5bf031b52314; private String fd_3b5bf031b52314;
/** /**
* 商险ID * 商险ID:商险id_结算id
*/ */
private String fd_3b5bf032d7a822; private String fd_3b5bf032d7a822;
......
...@@ -2055,25 +2055,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2055,25 +2055,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
//当两次发票号不一致时才更新 if (Optional.ofNullable(detail).isPresent()){
if (!success.getInvoiceNo().equals(detail.getInvoiceNo())){ //当两次发票号不一致时才更新
//设置发票号 if (!success.getInvoiceNo().equals(detail.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo()); //设置发票号
detailList.add(detail); detail.setInvoiceNo(success.getInvoiceNo());
detailList.add(detail);
try { //只有当结算id存在的时候修改数据才会推给ekp
//推送修改信息 if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam(); try {
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart()); //推送修改信息
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd()); EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(detail.getBuyType())); ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart());
ekpUpdateParam.setFd_3b5bf030ab1a56(success.getInvoiceNo()); ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard()); ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(detail.getBuyType()));
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId()); ekpUpdateParam.setFd_3b5bf030ab1a56(success.getInvoiceNo());
ekpUpdateParam.setFd_3b5bf0b7b4c058("操作人:"+user.getNickname() + ";操作时间:"+LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + ";变更前发票号:" + detail.getInvoiceNo() + ";变更后发票号:" + success.getInvoiceNo()); ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam); ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId() + "_" + detail.getDefaultSettleId());
}catch (Exception e){ ekpUpdateParam.setFd_3b5bf0b7b4c058("操作人:"+user.getNickname() + ";操作时间:"+LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + ";变更前发票号:" + detail.getInvoiceNo() + ";变更后发票号:" + success.getInvoiceNo());
log.error("pushEkp error registeredInvoiceNo:",e.getMessage()); eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
}catch (Exception e){
log.error("pushEkp error registeredInvoiceNo:",e.getMessage());
}
}
} }
} }
} }
...@@ -2156,45 +2161,49 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2156,45 +2161,49 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(detail).isPresent()){
TInsuranceDetail oldDetail = new TInsuranceDetail(); TInsuranceDetail oldDetail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,oldDetail); BeanCopyUtils.copyProperties(detail,oldDetail);
if (StringUtils.isNotBlank(success.getPolicyStartNew())){ if (StringUtils.isNotBlank(success.getPolicyStartNew())){
detail.setPolicyStart(LocalDateUtil.parseLocalDate(success.getPolicyStartNew())); detail.setPolicyStart(LocalDateUtil.parseLocalDate(success.getPolicyStartNew()));
}
if (StringUtils.isNotBlank(success.getPolicyEndNew())){
detail.setPolicyEnd(LocalDateUtil.parseLocalDate(success.getPolicyEndNew()));
}
if (Objects.nonNull(success.getBuyType())){
detail.setBuyType(success.getBuyType());
}
detailList.add(detail);
//变更记录
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,detail,success.getReason());
try {
//推送修改信息
StringBuilder sb = new StringBuilder();
sb.append("操作人:" + user.getNickname() + ";操作时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if (!oldDetail.getPolicyStart().toString().equals(success.getPolicyStart())) {
sb.append(";变更前保单开始时间:" + oldDetail.getPolicyStart() + ";变更后保单开始时间:" + success.getPolicyStart());
} }
if (!oldDetail.getPolicyEnd().toString().equals(success.getPolicyEnd())) { if (StringUtils.isNotBlank(success.getPolicyEndNew())){
sb.append(";变更前保单结束时间:" + oldDetail.getPolicyEnd() + ";变更后保单结束时间:" + success.getPolicyEnd()); detail.setPolicyEnd(LocalDateUtil.parseLocalDate(success.getPolicyEndNew()));
} }
if (!oldDetail.getBuyType().equals(success.getBuyType())) { if (Objects.nonNull(success.getBuyType())){
sb.append(";变更前投保类型:" + getBuyType(oldDetail.getBuyType()) + ";变更后投保类型:" + getBuyType(success.getBuyType())); detail.setBuyType(success.getBuyType());
}
detailList.add(detail);
//变更记录
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,detail,success.getReason());
//只有当结算id存在的时候修改数据才会推给ekp
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
try {
//推送修改信息
StringBuilder sb = new StringBuilder();
sb.append("操作人:" + user.getNickname() + ";操作时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if (!oldDetail.getPolicyStart().toString().equals(success.getPolicyStart())) {
sb.append(";变更前保单开始时间:" + oldDetail.getPolicyStart() + ";变更后保单开始时间:" + success.getPolicyStart());
}
if (!oldDetail.getPolicyEnd().toString().equals(success.getPolicyEnd())) {
sb.append(";变更前保单结束时间:" + oldDetail.getPolicyEnd() + ";变更后保单结束时间:" + success.getPolicyEnd());
}
if (!oldDetail.getBuyType().equals(success.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(oldDetail.getBuyType()) + ";变更后投保类型:" + getBuyType(success.getBuyType()));
}
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(success.getBuyType()));
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId() + "_" + detail.getDefaultSettleId());
ekpUpdateParam.setFd_3b5bf0b7b4c058(sb.toString());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
}catch (Exception e){
log.error("pushEkp error updateInsuranceInsured:",e.getMessage());
}
} }
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(success.getBuyType()));
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId());
ekpUpdateParam.setFd_3b5bf0b7b4c058(sb.toString());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
}catch (Exception e){
log.error("pushEkp error updateInsuranceInsured:",e.getMessage());
} }
} }
} }
...@@ -2275,29 +2284,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2275,29 +2284,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更记录 //变更记录
tBusinessOperateService.saveModificationRecord(byId.getId(),old,byId,param.getReason()); tBusinessOperateService.saveModificationRecord(byId.getId(),old,byId,param.getReason());
try { //只有当结算id存在的时候修改数据才会推给ekp
//推送修改信息 if(StringUtils.isNotBlank(byId.getDefaultSettleId())){
StringBuilder sb = new StringBuilder(); try {
sb.append("操作人:" + user.getNickname() + ";操作时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); //推送修改信息
if (!old.getPolicyStart().toString().equals(param.getPolicyStart())) { StringBuilder sb = new StringBuilder();
sb.append(";变更前保单开始时间:" + old.getPolicyStart() + ";变更后保单开始时间:" + param.getPolicyStart()); sb.append("操作人:" + user.getNickname() + ";操作时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
} if (!old.getPolicyStart().toString().equals(param.getPolicyStart())) {
if (!old.getPolicyEnd().toString().equals(param.getPolicyEnd())) { sb.append(";变更前保单开始时间:" + old.getPolicyStart() + ";变更后保单开始时间:" + param.getPolicyStart());
sb.append(";变更前保单结束时间:" + old.getPolicyEnd() + ";变更后保单结束时间:" + param.getPolicyEnd()); }
} if (!old.getPolicyEnd().toString().equals(param.getPolicyEnd())) {
if (!old.getBuyType().equals(param.getBuyType())) { sb.append(";变更前保单结束时间:" + old.getPolicyEnd() + ";变更后保单结束时间:" + param.getPolicyEnd());
sb.append(";变更前投保类型:" + getBuyType(old.getBuyType()) + ";变更后投保类型:" + getBuyType(param.getBuyType())); }
} if (!old.getBuyType().equals(param.getBuyType())) {
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam(); sb.append(";变更前投保类型:" + getBuyType(old.getBuyType()) + ";变更后投保类型:" + getBuyType(param.getBuyType()));
ekpUpdateParam.setFd_3b5bf02d3b8fc4(param.getPolicyStart()); }
ekpUpdateParam.setFd_3b5bf02e1d47cc(param.getPolicyEnd()); EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(param.getBuyType())); ekpUpdateParam.setFd_3b5bf02d3b8fc4(param.getPolicyStart());
ekpUpdateParam.setFd_3b5bf031b52314(byId.getBuyStandard()); ekpUpdateParam.setFd_3b5bf02e1d47cc(param.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf032d7a822(byId.getId()); ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(param.getBuyType()));
ekpUpdateParam.setFd_3b5bf0b7b4c058(sb.toString()); ekpUpdateParam.setFd_3b5bf031b52314(byId.getBuyStandard());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam); ekpUpdateParam.setFd_3b5bf032d7a822(byId.getId() + "_" + byId.getDefaultSettleId());
}catch (Exception e){ ekpUpdateParam.setFd_3b5bf0b7b4c058(sb.toString());
log.error("pushEkp error updateInsuranceInsuredById:",e.getMessage()); eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
}catch (Exception e){
log.error("pushEkp error updateInsuranceInsuredById:",e.getMessage());
}
} }
this.updateById(byId); this.updateById(byId);
return R.ok(InsurancesConstants.OPERATE_SUCCESS); return R.ok(InsurancesConstants.OPERATE_SUCCESS);
......
...@@ -35,12 +35,18 @@ ...@@ -35,12 +35,18 @@
<if test="param.policyNo != null and param.policyNo.trim() != ''"> <if test="param.policyNo != null and param.policyNo.trim() != ''">
and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null">
AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart}
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null">
AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd} AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd}
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_START) <![CDATA[ <= ]]> #{param.policyEnd}) OR
(DATE(POLICY_END) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd})
)
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
...@@ -61,12 +67,18 @@ ...@@ -61,12 +67,18 @@
<if test="param.policyNo != null and param.policyNo.trim() != ''"> <if test="param.policyNo != null and param.policyNo.trim() != ''">
and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null">
AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} AND DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart}
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null">
AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd} AND DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd}
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(DATE(POLICY_START) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_START) <![CDATA[ <= ]]> #{param.policyEnd}) OR
(DATE(POLICY_END) <![CDATA[ >= ]]> #{param.policyStart} and DATE(POLICY_END) <![CDATA[ <= ]]> #{param.policyEnd})
)
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
......
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