Commit 0bc24fe9 authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:优化金额校验,新增不等于零的校验"

See merge request fangxinjiang/yifu!109
parents 013a7a7b dddc6d2a
...@@ -168,6 +168,15 @@ public class ValidityUtil { ...@@ -168,6 +168,15 @@ public class ValidityUtil {
if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){ if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
return Boolean.FALSE ; return Boolean.FALSE ;
} }
BigDecimal bigDecimalMoney= new BigDecimal(money);
boolean max = bigDecimalMoney.compareTo(CommonConstants.MONEY_MAX) >0;
if(max){
return Boolean.FALSE ;
}
boolean min = bigDecimalMoney.compareTo(CommonConstants.MONEY_MIN) <=0;
if(min){
return Boolean.FALSE ;
}
return Boolean.TRUE; return Boolean.TRUE;
} }
......
...@@ -2762,37 +2762,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2762,37 +2762,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!BigDecimalUtils.isNullOrZero(actualPremium)){ if (!BigDecimalUtils.isNullOrZero(actualPremium)){
//变更后为单独结算 //变更后为单独结算
if(CommonConstants.ONE_INT == newSettleType){ if(CommonConstants.ONE_INT == newSettleType){
//作废旧的数据,生成作废结算信息记录 //根据旧的结算id获取旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel);
//推送EKP // TODO: 2022/8/2
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId); TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
//如果已经推送过实际保费,则先作废,再推送新的预估保费和实际保费
if (byId.getIsActualPush() ==CommonConstants.ONE_INT){ if (byId.getIsActualPush() ==CommonConstants.ONE_INT){
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
tInsuranceSettleCancelService.save(cancel);
//生成新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//赋值新的结算信息id
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送至EKP执行作废操作
//作废成功后推送新的 TODO: 2022/8/2
} }
//如果没有推送过实际保费
if(byId.getIsActualPush() ==CommonConstants.ZERO_INT){ if(byId.getIsActualPush() ==CommonConstants.ZERO_INT){
//推送新的至EKP
} }
//新增新的结算数据
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//赋值新的预估费用和新的结算信息
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
} }
//变更后为合并结算 //变更后为合并结算
if(CommonConstants.ZERO_INT == newSettleType){ if(CommonConstants.ZERO_INT == newSettleType){
......
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