Parcourir la source

Merge branch 'master' of http://39.108.216.210:3000/zhuwei/bladex

huangtf il y a 8 mois
Parent
commit
d5772b1a78

+ 4 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ContractInfoController.java

@@ -702,10 +702,11 @@ public class ContractInfoController extends BladeController {
     @ApiOperationSupport(order = 19)
     @ApiOperation(value = "查询所有施工合同wbs树根节点", notes = "传入wbsId,项目id")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "项目id", value = "projectId", required = true)
+            @ApiImplicitParam(name = "项目id", value = "projectId", required = true),
+            @ApiImplicitParam(name = "合同id", value = "contractId", required = true)
     })
-    public R treeAllConstruction(String projectId) {
-        List<WbsTreeContractVO2> tree = contractInfoService.treeTwo(projectId);
+    public R treeAllConstruction(String projectId,Integer contractType) {
+        List<WbsTreeContractVO2> tree = contractInfoService.treeTwo(projectId,contractType);
         if (tree != null && tree.size() > 0) {
             return R.data(tree);
         }

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

@@ -69,4 +69,6 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
     List<TrialRecordZJTreeLazyVO> trialRelationTreeLazy(String projectId, String contractId, String wbsId, String id);
 
     List<ContractInfo> getContractListByProjectId(Long projectId);
+
+    List<WbsTreeContractVO2> getAllContractByType(@Param("projectId") String projectId,@Param("contractType") Integer contractType);
 }

+ 11 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml

@@ -529,5 +529,16 @@
           AND node_type in (1, 2, 3, 4, 5, 6)
         ORDER BY d.sort, d.create_time
     </select>
+    <select id="getAllContractByType" resultType="org.springblade.manager.vo.WbsTreeContractVO2">
+        select id as contractId,contract_name as contractName
+        from m_contract_info where is_deleted = 0 and p_id = #{projectId}
+            and contract_type = 1
+        <if test="contractType == 3">
+            union all
+            select id as contractId,contract_name as contractName
+            from m_contract_info where is_deleted = 0 and p_id = #{projectId}
+            and contract_type = 2
+        </if>
+    </select>
 
 </mapper>

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IContractInfoService.java

@@ -53,7 +53,7 @@ public interface IContractInfoService extends BaseService<ContractInfo> {
 
     List<WbsTreeContractVO6> tree8(String wbsId, String projectId, String contractId);
 
-    List<WbsTreeContractVO2> treeTwo(String projectId);
+    List<WbsTreeContractVO2> treeTwo(String projectId,Integer contractType);
 
     List<WbsTreeContractTreeVO> queryContractWbsTreeByContractIdAndType(String contractId, Integer wbsType, String parentId);
 

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -771,8 +771,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     }
 
     @Override
-    public List<WbsTreeContractVO2> treeTwo(String projectId) {
-        return wbsTreeContractMapper.selectListByCondition(projectId);
+    public List<WbsTreeContractVO2> treeTwo(String projectId,Integer contractType) {
+        return baseMapper.getAllContractByType(projectId,contractType);
     }
 
     @Override