Commit a3bb6d3c authored by zhaji's avatar zhaji

"feature-zhaJi:变更项目和变更月份时,剔除已减员数据,优化项目数据获取逻辑"

parent 4637c3e4
...@@ -546,6 +546,11 @@ public class InsurancesConstants { ...@@ -546,6 +546,11 @@ public class InsurancesConstants {
*/ */
public static final String USER_DATA_IS_NOT_EXIST = "员工投保信息不存在"; public static final String USER_DATA_IS_NOT_EXIST = "员工投保信息不存在";
/**
* 存在多条在保记录
*/
public static final String MULTIPLE_RECORDS_UNDER_WARRANTY = "存在多条在保记录";
/***********************商险产品错误码********************************/ /***********************商险产品错误码********************************/
/** /**
......
...@@ -2334,6 +2334,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2334,6 +2334,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setReduceHandleStatus(refundType); tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){ if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
}else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
} }
successList.add(tInsuranceDetail); successList.add(tInsuranceDetail);
refund.setInsDetailId(tInsuranceDetail.getId()); refund.setInsDetailId(tInsuranceDetail.getId());
...@@ -2625,9 +2627,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2625,9 +2627,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName).eq(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.THREE_INT)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)) .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
errorList.add(param);
continue;
}
TInsuranceDetail one = getOne(queryWrapper); TInsuranceDetail one = getOne(queryWrapper);
if (Common.isEmpty(one)){ if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
...@@ -2860,6 +2870,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2860,6 +2870,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
errorList.add(param);
continue;
}
TInsuranceDetail insuranceDetail = getOne(queryWrapper); TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空 //如果保单信息为空
if (Common.isEmpty(insuranceDetail)){ if (Common.isEmpty(insuranceDetail)){
...@@ -3032,20 +3050,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3032,20 +3050,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//根据项目编码查询项目是否存在 //根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(newDeptNo)); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(newDeptNo));
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){ if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
errorList.add(param);
continue;
}else {
ProjectSetInfoVo jsonObject = data.get(newDeptNo);
if (null == jsonObject){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_IS_NOT_EXIST);
errorList.add(param); errorList.add(param);
continue; continue;
}else { }else {
//结算类型,根据项目编码获取,并冗余到明细记录中 //结算类型,根据项目编码获取,并冗余到明细记录中
ProjectSetInfoVo jsonObject = data.get(newDeptNo);
String settleType = jsonObject.getInsuranceSettleType(); String settleType = jsonObject.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){ if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE); param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
...@@ -3056,7 +3069,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3056,7 +3069,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
}
//必填格式校通过后查询对应的保单信息 //必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
...@@ -3064,6 +3076,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3064,6 +3076,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo) .eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
errorList.add(param);
continue;
}
TInsuranceDetail insuranceDetail = getOne(queryWrapper); TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空 //如果保单信息为空
if (Common.isEmpty(insuranceDetail)){ if (Common.isEmpty(insuranceDetail)){
......
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