Commit 1b289500 authored by 李灿灿's avatar 李灿灿

编辑接口调试

parent 6fffc98b
......@@ -408,9 +408,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
//todo 时间区间
//待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT);
setRStatus.add(CommonConstants.FIVE_INT);
TInsuranceDetail insuranceDetail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
......@@ -419,12 +420,35 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getIsOverdue, CommonConstants.ZERO_INT)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetail).isPresent()){
if (Optional.ofNullable(insuranceDetail).isPresent() && !insuranceDetail.getId().equals(param.getId())){
return R.failed(InsurancesConstants.DATA_IS_EXIST);
}
//时间区间
TInsuranceDetail insuranceDetailBetween = 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())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and(
wrapper -> wrapper.between(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.or()
.between(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetailBetween).isPresent() && !insuranceDetailBetween.getId().equals(param.getId())){
return R.failed("当前员工在["+param.getPolicyStart()+"-"+param.getPolicyEnd()+"]期间内有投保记录");
}
BeanCopyUtils.copyProperties(param,byId);
//投保状态:待投保
byId.setBuyHandleStatus(CommonConstants.ONE_INT);
......
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