Commit 4656f222 authored by fangxinjiang's avatar fangxinjiang

商险退回 编辑提交的校验

parent 82b2144b
......@@ -768,6 +768,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}
// fxj 2023-08-22 需要替换的人已经存在在途商险的禁止替换
Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT);
setRStatus.add(CommonConstants.FIVE_INT);
TInsuranceDetail insuranceDetailExits = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd())
.eq(TInsuranceDetail::getBuyStandard, param.getBuyStandard())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
//有效
.and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect)
)
//未过期
.and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetailExits).isPresent() && !insuranceDetailExits.getId().equals(param.getId())){
return R.failed(InsurancesConstants.DATA_IS_EXIST);
}
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId())
......
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