Commit 40a2611b authored by zhaji's avatar zhaji

Merge remote-tracking branch 'origin/feature/insurance-1.3.0' into feature-1.3-zhaji

parents d940d281 f9fbce8d
......@@ -112,6 +112,10 @@ public class InsurancesConstants {
* 未找到符合条件的参保记录
*/
public static final String NOT_FOUND_INSURANCE_RECORD = "未找到符合条件的参保记录";
/**
* 当前投保状态无法变更投保记录
*/
public static final String CURRENT_STATUS_NOT_CHANGE_INSURANCE_RECORD = "当前投保状态无法变更投保记录";
/**
* 当前投保状态无法登记发票号
*/
......@@ -150,9 +154,9 @@ public class InsurancesConstants {
*/
public static final String REPLACE_IS_EXIST = "替换员工投保记录已存在";
/**
* 替换类型不能修改
* 替换投保不允许变更投保类型
*/
public static final String REPLACE_NOT_ALLOW = "替换类型不能修改";
public static final String REPLACE_NOT_ALLOW = "替换投保不允许变更投保类型";
/**
* 当前记录是待投保,无法替换
*/
......@@ -298,9 +302,9 @@ public class InsurancesConstants {
*/
public static final String POLICY_START_SHOULD_LESS_THAN_POLICY_END = "保单结束时间需要大于保单开始时间";
/**
* 保单开始时间需早于保单结束时间
* 变更后的保单开始时间需早于保单结束时间
*/
public static final String POLICY_START_NEW_SHOULD_LESS_THAN_POLICY_END_NEW = "保单开始时间需早于保单结束时间";
public static final String POLICY_START_NEW_SHOULD_LESS_THAN_POLICY_END_NEW = "变更后的保单开始时间需早于保单结束时间";
/**
* 保单起止时间不能超过365天
*/
......@@ -401,6 +405,10 @@ public class InsurancesConstants {
* 变更原因不能为空
*/
public static final String REASON_EMPTY = "变更原因不能为空";
/**
* 变更原因超过50字符限制
*/
public static final String REASON_MORE_THAN_50 = "变更原因超过50字符限制";
/**
* 发票号长度超过50字符限制
*/
......@@ -418,9 +426,9 @@ public class InsurancesConstants {
*/
public static final String BUY_TYPE_FOUR_NOT_REGISTERED= "替换类型无法登记保单保费";
/**
* 变更后投保类型错误
* 变更后投保类型只能填写新增、批增
*/
public static final String BUY_TYPE_ERROR_NEW = "变更后投保类型错误";
public static final String BUY_TYPE_ERROR_NEW = "变更后投保类型只能填写新增、批增";
/**
* 商险待投保,无法登记保单保费
*/
......
......@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -618,7 +617,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -627,7 +626,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}
}*/
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_START_PARSE_ERROR);
......@@ -767,7 +766,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -776,7 +775,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}
}*/
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId())
......@@ -2050,16 +2049,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//设置发票号
detail.setInvoiceNo(success.getInvoiceNo());
detailList.add(detail);
//推送修改信息
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(detail.getBuyType()));
ekpUpdateParam.setFd_3b5bf030ab1a56(success.getInvoiceNo());
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId());
ekpUpdateParam.setFd_3b5bf0b7b4c058("操作人:"+user.getNickname() + ";操作时间:"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + ";变更前发票号:" + detail.getInvoiceNo() + ";变更后发票号:" + success.getInvoiceNo());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
try {
//推送修改信息
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(success.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(success.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(detail.getBuyType()));
ekpUpdateParam.setFd_3b5bf030ab1a56(success.getInvoiceNo());
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId());
ekpUpdateParam.setFd_3b5bf0b7b4c058("操作人:"+user.getNickname() + ";操作时间:"+LocalDate.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());
}
}
}
}
......@@ -2151,26 +2155,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更记录
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,detail,success.getReason());
//推送修改信息
StringBuilder sb = new StringBuilder();
sb.append("操作人:"+user.getNickname() + ";操作时间:"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if (!detail.getPolicyStart().toString().equals(success.getPolicyStart())){
sb.append(";变更前保单开始时间:" + detail.getPolicyStart() + ";变更后保单开始时间:" + success.getPolicyStart());
}
if (!detail.getPolicyEnd().toString().equals(success.getPolicyEnd())){
sb.append(";变更前保单结束时间:" + detail.getPolicyEnd() + ";变更后保单结束时间:" + success.getPolicyEnd());
}
if (!detail.getBuyType().equals(success.getBuyType())){
sb.append(";变更前投保类型:" + getBuyType(detail.getBuyType()) + ";变更后投保类型:" + getBuyType(success.getBuyType()));
try {
//推送修改信息
StringBuilder sb = new StringBuilder();
sb.append("操作人:" + user.getNickname() + ";操作时间:" + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if (!detail.getPolicyStart().toString().equals(success.getPolicyStart())) {
sb.append(";变更前保单开始时间:" + detail.getPolicyStart() + ";变更后保单开始时间:" + success.getPolicyStart());
}
if (!detail.getPolicyEnd().toString().equals(success.getPolicyEnd())) {
sb.append(";变更前保单结束时间:" + detail.getPolicyEnd() + ";变更后保单结束时间:" + success.getPolicyEnd());
}
if (!detail.getBuyType().equals(success.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(detail.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());
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);
}
}
......@@ -2223,15 +2231,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (StringUtils.isBlank(param.getReason())){
R.failed(InsurancesConstants.REASON_EMPTY);
}
if (StringUtils.isNotBlank(param.getReason()) && !ValidityUtil.validate50(param.getReason())){
R.failed(InsurancesConstants.REASON_MORE_THAN_50);
}
TInsuranceDetail byId = this.getById(param.getId());
if (!Optional.ofNullable(byId).isPresent()){
R.failed(InsurancesConstants.DATA_IS_NOT_EXIST);
R.failed(InsurancesConstants.NOT_FOUND_INSURANCE_RECORD);
}
if (byId.getBuyType() == CommonConstants.FOUR_INT){
R.failed(InsurancesConstants.REPLACE_NOT_ALLOW);
}
if (byId.getBuyHandleStatus() != CommonConstants.THREE_INT){
R.failed(InsurancesConstants.BUY_HANDLE_STATUS_NOT_THREE);
if (byId.getBuyHandleStatus() != CommonConstants.THREE_INT && byId.getBuyHandleStatus() != CommonConstants.FIVE_INT){
R.failed(InsurancesConstants.CURRENT_STATUS_NOT_CHANGE_INSURANCE_RECORD);
}
TInsuranceDetail old = new TInsuranceDetail();
BeanCopyUtils.copyProperties(byId,old);
......@@ -2246,26 +2257,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//变更记录
tBusinessOperateService.saveModificationRecord(byId.getId(),old,byId,param.getReason());
//推送修改信息
StringBuilder sb = new StringBuilder();
sb.append("操作人:"+user.getNickname() + ";操作时间:"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if (!byId.getPolicyStart().toString().equals(param.getPolicyStart())){
sb.append(";变更前保单开始时间:" + byId.getPolicyStart() + ";变更后保单开始时间:" + param.getPolicyStart());
}
if (!byId.getPolicyEnd().toString().equals(param.getPolicyEnd())){
sb.append(";变更前保单结束时间:" + byId.getPolicyEnd() + ";变更后保单结束时间:" + param.getPolicyEnd());
}
if (!byId.getBuyType().equals(param.getBuyType())){
sb.append(";变更前投保类型:" + getBuyType(byId.getBuyType()) + ";变更后投保类型:" + getBuyType(param.getBuyType()));
}
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(param.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(param.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(param.getBuyType()));
ekpUpdateParam.setFd_3b5bf031b52314(byId.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(byId.getId());
ekpUpdateParam.setFd_3b5bf0b7b4c058(sb.toString());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
try {
//推送修改信息
StringBuilder sb = new StringBuilder();
sb.append("操作人:" + user.getNickname() + ";操作时间:" + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if (!byId.getPolicyStart().toString().equals(param.getPolicyStart())) {
sb.append(";变更前保单开始时间:" + byId.getPolicyStart() + ";变更后保单开始时间:" + param.getPolicyStart());
}
if (!byId.getPolicyEnd().toString().equals(param.getPolicyEnd())) {
sb.append(";变更前保单结束时间:" + byId.getPolicyEnd() + ";变更后保单结束时间:" + param.getPolicyEnd());
}
if (!byId.getBuyType().equals(param.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(byId.getBuyType()) + ";变更后投保类型:" + getBuyType(param.getBuyType()));
}
EkpUpdateParam ekpUpdateParam = new EkpUpdateParam();
ekpUpdateParam.setFd_3b5bf02d3b8fc4(param.getPolicyStart());
ekpUpdateParam.setFd_3b5bf02e1d47cc(param.getPolicyEnd());
ekpUpdateParam.setFd_3b5bf02fa14596(getBuyType(param.getBuyType()));
ekpUpdateParam.setFd_3b5bf031b52314(byId.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(byId.getId());
ekpUpdateParam.setFd_3b5bf0b7b4c058(sb.toString());
eKPInsuranceUtil.sendUpdateToEkp(ekpUpdateParam);
}catch (Exception e){
log.error("pushEkp error updateInsuranceInsuredById:",e.getMessage());
}
this.updateById(byId);
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -2427,7 +2443,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -2438,7 +2454,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}
}*/
//根据项目编码查询项目是否存在
try{
......@@ -2747,7 +2763,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -2758,7 +2774,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}
}*/
//根据项目编码查询项目是否存在
try{
......@@ -3129,7 +3145,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getReplaceEmpName());
checkIdCard.setIdCard(param.getReplaceEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -3140,7 +3156,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}
}*/
if (param.getEmpName().equals(param.getReplaceEmpName()) && param.getEmpIdcardNo().equals(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_INFO_SAME);
......@@ -3716,6 +3732,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.REASON_EMPTY);
continue;
}
if (StringUtils.isNotBlank(param.getReason()) && !ValidityUtil.validate50(param.getReason())){
param.setErrorMessage(InsurancesConstants.REASON_MORE_THAN_50);
continue;
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
......@@ -3732,12 +3752,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(detail).isPresent()){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.NOT_FOUND_INSURANCE_RECORD);
continue;
}else {
//判断是否是已投保状态
if (detail.getBuyHandleStatus() != CommonConstants.THREE_INT){
param.setErrorMessage(InsurancesConstants.BUY_HANDLE_STATUS_NOT_THREE);
//判断是否是已投保状态或已减员
if (detail.getBuyHandleStatus() != CommonConstants.THREE_INT && detail.getBuyHandleStatus() != CommonConstants.FIVE_INT){
param.setErrorMessage(InsurancesConstants.CURRENT_STATUS_NOT_CHANGE_INSURANCE_RECORD);
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