瀏覽代碼

隐蔽工程节点

liuyc 2 年之前
父節點
當前提交
3b56ad3f73

+ 6 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreeContract.java

@@ -239,4 +239,10 @@ public class WbsTreeContract extends BaseEntity {
     @ApiModelProperty(value = "导入wbs划分匹配字段")
     private String importMatchingInfo;
 
+    /**
+     * 是否为隐蔽工程节点 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否为隐蔽工程节点 '0'否 '1'是")
+    private Integer isConcealedWorksNode;
+
 }

+ 2 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -67,6 +67,7 @@
         <result column="colorStatus" property="colorStatus"/>
         <result column="type" property="type"/>
         <result column="partitionCode" property="partitionCode"/>
+        <result column="isConcealedWorksNode" property="isConcealedWorksNode"/>
     </resultMap>
 
     <resultMap id="intResultMap" type="java.lang.Integer"/>
@@ -151,6 +152,7 @@
 
     <select id="queryContractTree" resultMap="queryContractTreeMap">
         SELECT
+            wtc.is_concealed_works_node AS "isConcealedWorksNode",
             wtc.p_key_id AS primaryKeyId,
             wtc.id,
             CASE wtc.parent_id

+ 7 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java

@@ -74,4 +74,11 @@ public class WbsTreeContractController extends BladeController {
         return R.status(iWbsTreeContractService.submitRelation(wbsTreeContractDTO2));
     }
 
+    @GetMapping("/concealed-works-node")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "标记/取消隐蔽工程节点", notes = "传入节点pKeyId")
+    public R concealedWorksNode(@RequestParam String pKeyId) {
+        return R.status(iWbsTreeContractService.concealedWorksNode(pKeyId));
+    }
+
 }

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

@@ -48,6 +48,7 @@
         <result column="is_type_private_pid" property="isTypePrivatePid"/>
         <result column="is_import_identification_node" property="isImportIdentificationNode"/>
         <result column="import_matching_info" property="importMatchingInfo"/>
+        <result column="is_concealed_works_node" property="isConcealedWorksNode"/>
     </resultMap>
 
     <resultMap id="resultMap2" type="org.springblade.manager.vo.WbsTreeContractVO">

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeContractService.java

@@ -44,4 +44,6 @@ public interface IWbsTreeContractService extends BaseService<WbsTreeContract> {
 
     boolean submitRelation(WbsTreeContractDTO2 wbsTreeContractDTO2);
 
+    boolean concealedWorksNode(String pKeyId);
+
 }

+ 30 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -418,6 +418,36 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
         return true;
     }
 
+    @Override
+    public boolean concealedWorksNode(String pKeyId) {
+        if (StringUtils.isNotEmpty(pKeyId)) {
+            //获取节点信息
+            WbsTreeContract wbsTreeContract = baseMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getPKeyId, pKeyId));
+            List<ContractInfo> contractInfos = contractInfoMapper.selectList(Wrappers.<ContractInfo>query().lambda().eq(ContractInfo::getPId, wbsTreeContract.getProjectId()).eq(ContractInfo::getStatus, 1));
+            List<WbsTreeContract> wbsTreeContractList = new ArrayList<>();
+            for (ContractInfo contractInfo : contractInfos) {
+                WbsTreeContract node = baseMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                        .eq(WbsTreeContract::getId, wbsTreeContract.getId())
+                        .eq(WbsTreeContract::getProjectId, wbsTreeContract.getProjectId())
+                        .eq(WbsTreeContract::getContractId, contractInfo.getId())
+                        .eq(WbsTreeContract::getStatus, 1)
+                        .eq(WbsTreeContract::getType, 1)
+                );
+                wbsTreeContractList.add(node);
+            }
+            //标记是否隐蔽工程节点
+            for (WbsTreeContract treeContract : wbsTreeContractList) {
+                treeContract.setIsConcealedWorksNode(treeContract.getIsConcealedWorksNode().equals(0) ? 1 : 0);
+                LambdaUpdateWrapper<WbsTreeContract> updateWrapper = new LambdaUpdateWrapper<>();
+                updateWrapper.eq(WbsTreeContract::getPKeyId, treeContract.getPKeyId())
+                        .set(WbsTreeContract::getIsConcealedWorksNode, treeContract.getIsConcealedWorksNode());
+                baseMapper.update(null, updateWrapper);
+            }
+            return true;
+        }
+        return false;
+    }
+
     private List<WbsTreeContract> findAllNodeList(String wbsTreeIds, String projectId, String contractId, String wbsId) {
         String[] ids = wbsTreeIds.split(",");
         List<WbsTreeContract> list = new ArrayList<>();