Эх сурвалжийг харах

不填写强度比例则不校验

qianxb 1 жил өмнө
parent
commit
95b87f713f

+ 5 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -908,9 +908,11 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                         throw new ServiceException("请检查整体结算比例是否在规定范围");
                         throw new ServiceException("请检查整体结算比例是否在规定范围");
                     }
                     }
                 }
                 }
-                if ((meterContractInfo.getSevenRatio().compareTo(BigDecimal.ZERO) < 0 || meterContractInfo.getSevenRatio().compareTo(new BigDecimal("100")) > 0)
-                        || (meterContractInfo.getTwentyEightRatio().compareTo(BigDecimal.ZERO) < 0 || meterContractInfo.getTwentyEightRatio().compareTo(new BigDecimal("100")) > 0)){
-                    throw new ServiceException("强度比例必须在0-100范围内");
+                if (meterContractInfo.getSevenRatio() != null && meterContractInfo.getTwentyEightRatio() != null){
+                    if ((meterContractInfo.getSevenRatio().compareTo(BigDecimal.ZERO) < 0 || meterContractInfo.getSevenRatio().compareTo(new BigDecimal("100")) > 0)
+                            || (meterContractInfo.getTwentyEightRatio().compareTo(BigDecimal.ZERO) < 0 || meterContractInfo.getTwentyEightRatio().compareTo(new BigDecimal("100")) > 0)){
+                        throw new ServiceException("强度比例必须在0-100范围内");
+                    }
                 }
                 }
                 R r = meterContractInfoClient.saveOrUpdate(meterContractInfo);
                 R r = meterContractInfoClient.saveOrUpdate(meterContractInfo);
                 if (r.getCode() != 200){
                 if (r.getCode() != 200){