Browse Source

合同工程清单修改增加调差校验2

qianxb 7 tháng trước cách đây
mục cha
commit
e04d2de833

+ 6 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractInventoryFormServiceImpl.java

@@ -573,6 +573,12 @@ public class ContractInventoryFormServiceImpl extends BaseServiceImpl<ContractIn
         if (total > 0) {
             throw new ServiceException("当前节点下有子节点已经被变更,不能删除");
         }
+        //校验是否被材料关联
+        int count = Math.toIntExact(formMaterialService.count(new LambdaQueryWrapper<InventoryFormMaterial>()
+                .eq(InventoryFormMaterial::getContractFormId, id)));
+        if (count > 0){
+            throw new ServiceException("当前清单已经关联材料,请取消关联后再删除");
+        }
         baseMapper.updateNode(id,contractId);
     }