Parcourir la source

api接口-计量-获取某一合同段的分部分项划分

LHB il y a 1 semaine
Parent
commit
46c07363f5

+ 84 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/APIWbsContractSubdivisionVo.java

@@ -0,0 +1,84 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+import org.springblade.manager.entity.WbsTreeContract;
+
+/**
+ * 合同段分部分项划分节点试图
+ * 包含各个状态
+ * | 01   | 交工证书     | 所有子节点存在一个的major_data_type = 3   值为 true     |
+ * | 02   | 7天强度报告  | 所有最小节点中在m_table_file 中type = 11  存在一个true  |
+ * | 03   | 28天强度报告 | 所有最小节点中在m_table_file 中type = 12   存在一个true |
+ * | 04   | 监理收验资料 | 监理 major_data_type = 4  全部已审批                    |
+ * | 05   | 桩检报告     | 所有最小节点中在m_table_file 中type = 13   存在一个true |
+ * | 06   | 质检资料     | 质检 major_data_type = 4  全部已审批                    |
+ * | 07   | 评定资料     | major_data_type = 2  全部已审批                         |
+ * @author LHB
+ */
+@Data
+public class APIWbsContractSubdivisionVo {
+    /**
+     * 主键
+     */
+    private Long id;
+    /**
+     * 编码 空
+     */
+    private String code;
+    /**
+     * 节点名称
+     */
+    private String name;
+    /**
+     * 桩号
+     */
+    private String stake;
+    /**
+     * 父节点id
+     */
+    private Long pid;
+    /**
+     * 1表示单位工程 2表示分部工程 3表示分项工程
+     */
+    private Integer nodeType;
+    /**
+     * 层级编码 空
+     */
+    private String levelCode;
+    /**
+     * 专业工程id
+     */
+    private String partitionCatagID;
+    /**
+     * 专业工程名称
+     */
+    private String partitionCatagName;
+    /**
+     * 交工证书
+     */
+    private Boolean completionCertificate = false;
+    /**
+     * 7天强度报告
+     */
+    private Boolean strengthReportSeven = false;
+    /**
+     * 28天强度报告
+     */
+    private Boolean strengthReportTwentyEight = false;
+    /**
+     * 监理资料
+     */
+    private Boolean supervisionData = false;
+    /**
+     * 桩检报告
+     */
+    private Boolean pileInspectionReport = false;
+    /**
+     * 质检资料
+     */
+    private Boolean qualityInspectionData = false;
+    /**
+     * 评定资料
+     */
+    private Boolean evaluationData = false;
+}

+ 13 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/APIController.java

@@ -13,6 +13,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.service.IWbsTreeContractService;
 import org.springblade.manager.vo.APIWbsContractNodeHzrcVo;
 import org.springblade.manager.vo.APIWbsContractNodeVo;
+import org.springblade.manager.vo.APIWbsContractSubdivisionVo;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
 
@@ -93,4 +94,16 @@ public class APIController extends BladeController {
         }
         return R.fail(200, "未查询到信息");
     }
+
+    /**
+     * 获取某一合同段的分部分项划分
+     */
+    @GetMapping("/getWbsContractSubdivision")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取某一合同段的分部分项划分", notes = "合同")
+    @ApiImplicitParam(name = "sectionId", value = "合同段Id", required = true)
+    public R<List<APIWbsContractSubdivisionVo>> getWbsContractSubdivision(String sectionId){
+        List<APIWbsContractSubdivisionVo> list = iWbsTreeContractService.getWbsContractSubdivision(sectionId);
+        return R.data(list);
+    }
 }

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

@@ -7,6 +7,7 @@ import org.springblade.manager.entity.*;
 import org.springblade.manager.injector.EasyBaseMapper;
 import org.springblade.manager.vo.*;
 
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -157,4 +158,19 @@ public interface WbsTreeContractMapper extends EasyBaseMapper<WbsTreeContract> {
     void updateSortBatchByPKeyId(List<WbsTreeContract> resourceData);
 
     List<WbsTreeContract> selectListForcheckAllNodeDate(@Param("projectId") Long projectId, @Param("contractId") Long contractId);
+
+    /**
+     * 获取只当合同段下的分部分项划分节点
+     * @param contractId
+     * @return
+     */
+    List<APIWbsContractSubdivisionVo> getWbsContractSubdivision(@Param("contractId") String contractId);
+
+    /**
+     * 获取只当合同段下的分部分项划分节点的祖级节点
+     * @param ids
+     * @return
+     */
+    List<APIWbsContractSubdivisionVo> getWbsContractSubdivisionParentNode(@Param("contractId") String contractId,
+                                                                          @Param("ids") Set<Long> ids);
 }

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

@@ -984,5 +984,53 @@
         and is_deleted=0 and is_buss_show !=2 and init_table_name is not null and html_url is not null and LENGTH(init_table_name) > 10 and LENGTH(html_url) > 10
         and p_id is not null and type=2
     </select>
+    <select id="getWbsContractSubdivision" resultType="org.springblade.manager.vo.APIWbsContractSubdivisionVo">
+        SELECT
+            p_key_id id,
+            p_key_id code,
+            node_name name,
+            null stake,
+            p_id pid,
+            CASE
+                WHEN node_type = 18 THEN 1
+                WHEN node_type = 2 THEN 2
+                ELSE 3
+                END nodeType,
+            null levelCode,
+            null partitionCatagID,
+            null partitionCatagName
+        FROM
+            `m_wbs_tree_contract`
+        WHERE
+            node_type IN ( 2, 4, 18 )
+          AND is_deleted = 0
+          AND status = 1
+          AND contract_id = #{contractId}
+    </select>
+    <select id="getWbsContractSubdivisionParentNode"
+            resultType="org.springblade.manager.vo.APIWbsContractSubdivisionVo">
+        SELECT p_key_id       id,
+               p_key_id       code,
+               node_name      name,
+               null           stake,
+               p_id           pid,
+               CASE
+                   WHEN node_type = 18 THEN 1
+                   WHEN node_type = 2 THEN 2
+                   ELSE 3
+                   END        nodeType,
+               null           levelCode,
+               null           partitionCatagID,
+               null           partitionCatagName
+        FROM `m_wbs_tree_contract`
+        WHERE is_deleted = 0
+          AND status = 1
+          AND contract_id = #{contractId}
+          AND p_key_id in
+          <foreach item="id" collection="ids" separator="," close=")" open="(" index="index">
+              #{id}
+          </foreach>
+
+    </select>
 
 </mapper>

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

@@ -90,4 +90,6 @@ public interface IWbsTreeContractService extends BaseService<WbsTreeContract> {
     EKeyDto getEKey(String contractId, Long pKeyId, String wbsId);
 
     boolean checkNodeAllDate(WbsTreeContract contract);
+
+    List<APIWbsContractSubdivisionVo> getWbsContractSubdivision(String contractId);
 }