|
@@ -255,14 +255,17 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
//保存清单
|
|
|
List<InventoryFormApply> formApplies = formList.stream().map(l -> {
|
|
|
//校验数据
|
|
|
- if (l.getIsBuildThanContract() == 1){
|
|
|
- if (info.getIsOverMeter() == 0 || l.getIsCreateDivide() == 0){
|
|
|
- throw new ServiceException("施工图数量未大于合同数量,保存失败");
|
|
|
- }
|
|
|
- }else {
|
|
|
- if (l.getAllMeterTotal().compareTo(l.getChangeTotal()) == 1 && info.getIsOverMeter() == 0){
|
|
|
- throw new ServiceException("计量量超出施工图数量,保存失败");
|
|
|
- }
|
|
|
+// if (l.getIsBuildThanContract() == 1){
|
|
|
+// if (info.getIsOverMeter() == 0 || l.getIsCreateDivide() == 0){
|
|
|
+// throw new ServiceException("施工图数量大于合同数量,保存失败");
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// if (l.getAllMeterTotal().compareTo(l.getChangeTotal()) == 1 && info.getIsOverMeter() == 0){
|
|
|
+// throw new ServiceException("计量量超出施工图数量,保存失败");
|
|
|
+// }
|
|
|
+// }
|
|
|
+ if(l.getAllMeterTotal().compareTo(l.getContractChangeAllTotal())>0){
|
|
|
+ throw new ServiceException(l.getFormName()+"的累计计量量已超过清单数量,请申请变更流程");
|
|
|
}
|
|
|
InventoryFormApply formApply = new InventoryFormApply();
|
|
|
formApply.setBusinessDate(dto.getBusinessDate());
|
|
@@ -457,14 +460,8 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
//保存清单
|
|
|
List<InventoryFormApply> formApplies = formList.stream().map(l -> {
|
|
|
//校验数据
|
|
|
- if (l.getIsBuildThanContract() == 1){
|
|
|
- if (info.getIsOverMeter() == 0 || l.getIsCreateDivide() == 0){
|
|
|
- throw new ServiceException("施工图数量未大于合同数量,保存失败");
|
|
|
- }
|
|
|
- }else {
|
|
|
- if (l.getAllMeterTotal().compareTo(l.getChangeTotal()) == 1 && info.getIsOverMeter() == 0){
|
|
|
- throw new ServiceException("计量量超出施工图数量,保存失败");
|
|
|
- }
|
|
|
+ if(l.getAllMeterTotal().compareTo(l.getContractChangeAllTotal())>0){
|
|
|
+ throw new ServiceException(l.getFormName()+"的累计计量量已超过清单数量,请申请变更流程");
|
|
|
}
|
|
|
InventoryFormApply formApply = new InventoryFormApply();
|
|
|
formApply.setBusinessDate(dto.getBusinessDate());
|
|
@@ -672,7 +669,9 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
//计算分解数量是否超过合同数量
|
|
|
for (MeterInventoryVO form : formList) {
|
|
|
//设置施工图数量是否大于合同数量
|
|
|
- form.setOtherPayRatio(form.getOtherMeterTotal().divide(form.getCurrentBuildChangeTotal(), 4, RoundingMode.DOWN).multiply(new BigDecimal(100)).setScale(2));
|
|
|
+ if(form.getCurrentBuildChangeTotal()!=null&&form.getCurrentBuildChangeTotal().compareTo(BigDecimal.ZERO)!=0){
|
|
|
+ form.setOtherPayRatio(form.getOtherMeterTotal().divide(form.getCurrentBuildChangeTotal(), 4, RoundingMode.DOWN).multiply(new BigDecimal(100)).setScale(2));
|
|
|
+ }
|
|
|
form.setIsBuildThanContract(form.getChangeTotal().compareTo(form.getContractChangeAllTotal()) == 1?1:0);
|
|
|
}
|
|
|
vo.setFormList(formList);
|