|
@@ -264,7 +264,8 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
// throw new ServiceException("计量量超出施工图数量,保存失败");
|
|
|
// }
|
|
|
// }
|
|
|
- if(l.getAllMeterTotal().compareTo(l.getContractChangeAllTotal())>0){
|
|
|
+
|
|
|
+ if(compare(l.getAllMeterTotal(),l.getContractChangeAllTotal())>0){
|
|
|
throw new ServiceException(l.getFormName()+"的累计计量量已超过清单数量,请申请变更流程");
|
|
|
}
|
|
|
InventoryFormApply formApply = new InventoryFormApply();
|
|
@@ -333,6 +334,16 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static int compare(BigDecimal a, BigDecimal b) {
|
|
|
+ if(a==null){
|
|
|
+ a=BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ if(b==null){
|
|
|
+ b=BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ return a.compareTo(b);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取当前节点变更令
|
|
|
*/
|
|
@@ -460,7 +471,7 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
//保存清单
|
|
|
List<InventoryFormApply> formApplies = formList.stream().map(l -> {
|
|
|
//校验数据
|
|
|
- if(l.getAllMeterTotal().compareTo(l.getContractChangeAllTotal())>0){
|
|
|
+ if(compare(l.getAllMeterTotal(),l.getContractChangeAllTotal())>0){
|
|
|
throw new ServiceException(l.getFormName()+"的累计计量量已超过清单数量,请申请变更流程");
|
|
|
}
|
|
|
InventoryFormApply formApply = new InventoryFormApply();
|