Commit dddc6d2a authored by zhaji's avatar zhaji

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

parent 013a7a7b
......@@ -168,6 +168,15 @@ public class ValidityUtil {
if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
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;
}
......
......@@ -2762,37 +2762,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!BigDecimalUtils.isNullOrZero(actualPremium)){
//变更后为单独结算
if(CommonConstants.ONE_INT == newSettleType){
//作废旧的数据,生成作废结算信息记录
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
//根据旧的结算id获取旧的结算信息
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//如果已经推送过实际保费,则先作废,再推送新的预估保费和实际保费
//如果已经推送过实际保费,则先作废,再推送新的实际保费
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){
//推送新的至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){
......
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