ソースを参照

增加字段相关

liuyc 3 年 前
コミット
0e750a4871

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java

@@ -84,5 +84,6 @@ public interface WbsTreeContractMapper extends BaseMapper<WbsTreeContract> {
 
     ContractRelationJlyz selectContractRelationInfoByidSG(String contractId);
 
+    List<ContractRelationJlyz> selectContractRelationInfoByidSG2(String contractId);
 
 }

+ 9 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -523,7 +523,9 @@
     </select>
 
     <select id="selectContractInfo" resultType="org.springblade.manager.entity.ContractInfo">
-        SELECT contract_name FROM  m_contract_info WHERE id = #{contractId}
+        SELECT contract_name
+        FROM m_contract_info
+        WHERE id = #{contractId}
     </select>
 
     <select id="selectContractRelationInfoByidSG" resultType="org.springblade.manager.entity.ContractRelationJlyz">
@@ -532,5 +534,11 @@
         WHERE contract_id_sg = #{contractId}
     </select>
 
+    <select id="selectContractRelationInfoByidSG2" resultType="org.springblade.manager.entity.ContractRelationJlyz">
+        SELECT *
+        FROM m_contract_relation_jlyz
+        WHERE contract_id_sg = #{contractId}
+    </select>
+
 
 </mapper>

+ 8 - 10
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -174,16 +174,13 @@ public class WbsTreeContractServiceImpl
                 //新增施工台账
                 constructionLedgerFeign.initConstructionLedger(constructionLedgerList);
 
-
             } else {
                 //删除
-                List<WbsTreeContract> wbsTreeContracts = baseMapper.selectList(Wrappers.<WbsTreeContract>query().lambda()
-                        .eq(WbsTreeContract::getContractIdRelation, pawDTO.getContractId())
-                        .in(WbsTreeContract::getContractType, "2,3")
-                );
-                if (wbsTreeContracts.size() > 0) {
+                List<ContractRelationJlyz> contractRelationJLYZList = baseMapper.selectContractRelationInfoByidSG2(pawDTO.getContractId());
+                if (contractRelationJLYZList.size() > 0) {
                     throw new ServiceException("当前施工合同段wbs树被监理或业主合同段引用中,删除失败!");
                 }
+
                 List<Long> ids1 = diffRent.stream().map(Long::parseLong).collect(Collectors.toList());
                 baseMapper.deleteBatch(ids1, pawDTO.getWbsId(), pawDTO.getProjectId(), pawDTO.getContractId());
 
@@ -226,6 +223,7 @@ public class WbsTreeContractServiceImpl
         wbsTreeContract.setIsLinkTable(wbsTree.getIsLinkTable());
         wbsTreeContract.setExcelId(wbsTree.getExcelId());
         wbsTreeContract.setHtmlUrl(wbsTree.getHtmlUrl());
+        wbsTreeContract.setIsBussShow("1");
         return wbsTreeContract;
     }
 
@@ -338,17 +336,17 @@ public class WbsTreeContractServiceImpl
         List<String> tableOwnerList = null;
         if (StringUtils.isNotEmpty(tableOwner)) {
             String tableOwners = "";
-            if (tableOwner.equals("1")) { //此处加载字典owner_type 固定写死 施工质检1=1 2 3
+            if (tableOwner.equals("1")) { //此处加载字典owner_type 固定写死 施工质检1= 1 2 3
                 tableOwners = "1,2,3";
-            } else if (tableOwner.equals("2")) { //监理抽检2=4 5 6
+            } else if (tableOwner.equals("2")) { //监理抽检2= 4 5 6
                 tableOwners = "4,5,6";
             }
             tableOwnerList = Func.toStrList(tableOwners);
         }
 
         //根据tableOwnerList、tableOwnerNumber 获取当前节点下表单
-        return baseMapper.selectWbsTreeContractList(tableOwnerNumbers, wbsTreeContract.getProjectId(),
-                wbsTreeContract.getWbsId(), wbsTreeContract.getContractId(), wbsTreeContract.getId(), wbsTreeContract.getContractIdRelation(), tableOwnerList);
+        return baseMapper.selectWbsTreeContractList(tableOwnerNumbers, wbsTreeContract.getProjectId(), wbsTreeContract.getWbsId(),
+                wbsTreeContract.getContractId(), wbsTreeContract.getId(), wbsTreeContract.getContractIdRelation(), tableOwnerList);
 
     }