Commit 7fa9129b authored by 李灿灿's avatar 李灿灿

feat:批增,根据保单号获取起止保时间改为从保单表中查询

parent 680872c4
...@@ -273,6 +273,10 @@ public class InsurancesConstants { ...@@ -273,6 +273,10 @@ public class InsurancesConstants {
* 保单结束时间格式错误 * 保单结束时间格式错误
*/ */
public static final String POLICY_END_PARSE_ERROR = "保单结束时间格式错误"; public static final String POLICY_END_PARSE_ERROR = "保单结束时间格式错误";
/**
* 保单结束时间需要大于派单日期
*/
public static final String POLICY_END_SHOULD_IS_FUTURE = "保单结束时间需要大于派单日期";
/** /**
* 购买标准不能为空 * 购买标准不能为空
*/ */
...@@ -389,6 +393,10 @@ public class InsurancesConstants { ...@@ -389,6 +393,10 @@ public class InsurancesConstants {
* 保单号不存在或已过期 * 保单号不存在或已过期
*/ */
public static final String POLICY_NO_EXIST = "保单号不存在或已过期"; public static final String POLICY_NO_EXIST = "保单号不存在或已过期";
/**
* 保单号被禁用
*/
public static final String POLICY_NO_FORBIDDEN = "保单号被禁用";
/** /**
* 保单号不存在 * 保单号不存在
*/ */
......
...@@ -2551,29 +2551,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2551,29 +2551,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else { }else {
param.setInsuranceCity(Integer.parseInt(redisCityName)); param.setInsuranceCity(Integer.parseInt(redisCityName));
} }
//保单开始日期、结束日期,由系统根据保单号关联查询投保状态为 "已投保" 的商险记录的任意一条 //保单开始日期、结束日期,根据保单号到t_insurance_policy表查询的 1128需求调整改造
TInsuranceDetail limitOne = getOne(Wrappers.<TInsuranceDetail>query().lambda() TInsurancePolicy limitOne = tInsurancePolicyService.getOne(Wrappers.<TInsurancePolicy>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo()) .eq(TInsurancePolicy::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.THREE_INT) .eq(TInsurancePolicy::getDeleteFlag,CommonConstants.ZERO_INT)
//有效 .last(CommonConstants.LAST_ONE_SQL));
/*.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)
)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(limitOne).isPresent()){ if (!Optional.ofNullable(limitOne).isPresent()){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EXIST); param.setErrorMessage(InsurancesConstants.POLICY_NO_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
if(limitOne.getEnableFlag() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.POLICY_NO_FORBIDDEN);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isFutureDate(limitOne.getPolicyEnd().toString())){
param.setErrorMessage(InsurancesConstants.POLICY_END_SHOULD_IS_FUTURE);
listResult.add(param);
continue;
}
if (!LocalDateUtil.compareDate(limitOne.getPolicyStart().toString(),limitOne.getPolicyEnd().toString())){
param.setErrorMessage(InsurancesConstants.POLICY_START_SHOULD_LESS_THAN_POLICY_END);
listResult.add(param);
continue;
}
param.setPolicyStart(limitOne.getPolicyStart()); param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd()); param.setPolicyEnd(limitOne.getPolicyEnd());
} }
......
...@@ -128,6 +128,9 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap ...@@ -128,6 +128,9 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
if (!Optional.ofNullable(tInsurancePolicy).isPresent()){ if (!Optional.ofNullable(tInsurancePolicy).isPresent()){
return R.failed("数据不存在"); return R.failed("数据不存在");
} }
if (!param.getPolicyNo().equals(tInsurancePolicy.getPolicyNo())){
return R.failed("保单号不能修改");
}
//操作日志 //操作日志
tBusinessOperateService.saveModificationRecord(param.getId(),tInsurancePolicy,param,null); tBusinessOperateService.saveModificationRecord(param.getId(),tInsurancePolicy,param,null);
BeanCopyUtils.copyProperties(param,tInsurancePolicy); BeanCopyUtils.copyProperties(param,tInsurancePolicy);
......
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