Browse Source

重点库项目页面修改

Wayne 4 months ago
parent
commit
41b00e0c3c

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInduMapper.java

@@ -29,4 +29,8 @@ public interface SubInduMapper {
 
     @Update("update sub_indu set logic_delete_flag=1 where id=#{id}")
     void del(@Param("id") String id);
+
+    List<SubIndu> selectAllSubIndu();
+
+    List<String> getChildrenCodesByCode(@Param("indusKinds") String indusKinds);
 }

+ 25 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInduMapper.xml

@@ -41,4 +41,29 @@
             s.title as parentTitle
         from sub_indu i left join sub_indu s on i.last_id = s.id where i.logic_delete_flag=0 and i.id = #{id}
     </select>
+    <select id="selectAllSubIndu" resultType="com.rtrh.projects.modules.projects.po.SubIndu">
+        SELECT
+            si.id AS id,
+            si.code AS code,
+            si.title AS title,
+            si.last_id AS lastId,
+            parent.title AS parentTitle
+        FROM
+            sub_indu si
+                LEFT JOIN
+            sub_indu parent
+            ON
+                si.last_id = parent.id
+        WHERE
+            si.logic_delete_flag = 0;
+    </select>
+    <select id="getChildrenCodesByCode" resultType="java.lang.String">
+        SELECT
+            b.code as code
+        FROM
+            sub_indu a left join  sub_indu b on a.id = b.last_id
+        WHERE
+            a.code = #{indusKinds}
+                AND a.logic_delete_flag = 0;
+    </select>
 </mapper>

+ 16 - 3
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoQueryServiceImpl.java

@@ -1480,7 +1480,7 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
         sql.append(" left join j_unit b on a.unit_id = b.id ");
         sql.append(" LEFT JOIN j_unit c ON a.main_id = c.id ");
         sql.append(" LEFT JOIN t_systable ts on ts.`code` = a.subject_id and ts.kind = 'JSDD' ");
-        sql.append(" LEFT JOIN t_systable ts1 on ts1.id = a.indus_kind  ");
+        sql.append(" LEFT JOIN sub_indu ts1 on ts1.code = a.indus_kind  ");
         sql.append(" LEFT JOIN sub_label sla on sla.sub_id = a.id  and sla.logic_delete_flag=0 ");
 
 
@@ -1611,7 +1611,14 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
 
 
         if (StringUtil.isNotEmpty(queryVO.getIndusKinds())) {
-            sql.append(this.getSqls("a.indus_kind", queryVO.getIndusKinds()));
+            if ("null".equals(queryVO.getIndusKinds())){
+                // 拼接a.indus_kind is null
+                sql.append(" AND a.indus_kind IS NULL ");
+            }else {
+                // 获取该行业下所有的子行业
+                String childrenCodes = subInduService.getChildrenCodesByCode(queryVO.getIndusKinds());
+                sql.append(this.getSqls("a.indus_kind", childrenCodes));
+            }
         }
 
         if (StringUtil.isNotEmpty(queryVO.getSubjects())) {
@@ -3767,7 +3774,13 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
 
 
         if (StringUtil.isNotEmpty(queryVO.getIndusKinds())) {
-            sql.append(this.getSqls("a.indus_kind", queryVO.getIndusKinds()));
+            if ("null".equals(queryVO.getIndusKinds())){
+                sql.append(" and a.indus_kind is null ");
+            }else {
+                // 获取该行业下所有的子行业
+                String childrenCodes = subInduService.getChildrenCodesByCode(queryVO.getIndusKinds());
+                sql.append(this.getSqls("a.indus_kind", childrenCodes));
+            }
         }
 
         if (StringUtil.isNotEmpty(queryVO.getSubjects())) {

+ 4 - 4
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java

@@ -4788,7 +4788,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
         // 获取行业
         List<SubIndu> subInduList = Optional.ofNullable(
-                subInduService.queryTreeALl()
+                subInduService.selectAllSubIndu()
         ).orElse(Collections.emptyList());
 
 
@@ -4877,7 +4877,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
         // 获取行业
         List<SubIndu> subInduList = Optional.ofNullable(
-                subInduService.queryTreeALl()
+                subInduService.selectAllSubIndu()
         ).orElse(Collections.emptyList());
 
         // 遍历重点项目信息,找到对应的前期手续信息,然后拼接手续完成情况为字符串,拼接到对应的重点项目信息中
@@ -4945,7 +4945,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
         // 获取行业
         List<SubIndu> subInduList = Optional.ofNullable(
-                subInduService.queryTreeALl()
+                subInduService.selectAllSubIndu()
         ).orElse(Collections.emptyList());
 
         // 遍历重点项目信息,找到对应的前期手续信息,然后拼接手续完成情况为字符串,拼接到对应的重点项目信息中
@@ -5003,7 +5003,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
         // 获取行业
         List<SubIndu> subInduList = Optional.ofNullable(
-                subInduService.queryTreeALl()
+                subInduService.selectAllSubIndu()
         ).orElse(Collections.emptyList());
 
         // 遍历重点项目信息,找到对应的前期手续信息,然后拼接手续完成情况为字符串,拼接到对应的重点项目信息中

+ 11 - 0
projects-service/src/main/java/com/rtrh/projects/modules/system/service/ISubInduService.java

@@ -30,4 +30,15 @@ public interface ISubInduService {
 
     List<SubIndu> queryParentAll();
 
+    /**
+     * 查询出所有行业分类,子行业不塞入到 父行业中
+     * @return
+     */
+    List<SubIndu> selectAllSubIndu();
+
+    /**
+     * 根据父code查询出所有子行业
+     * @return
+     */
+    String getChildrenCodesByCode(String indusKinds);
 }

+ 13 - 0
projects-service/src/main/java/com/rtrh/projects/modules/system/service/impl/SubInduServiceImpl.java

@@ -123,4 +123,17 @@ public class SubInduServiceImpl implements ISubInduService {
         List<SubIndu> subIndus = this.queryAll(null);
         return subIndus == null ? new ArrayList<>() : subIndus.stream().filter(e -> e.getCode().length() == 2).collect(Collectors.toList());
     }
+
+    @Override
+    public List<SubIndu> selectAllSubIndu() {
+        return subInduMapper.selectAllSubIndu();
+    }
+
+    @Override
+    public String getChildrenCodesByCode(String indusKinds) {
+        List<String> codes = subInduMapper.getChildrenCodesByCode(indusKinds);
+        //将codes转换为字符串用,进行分割
+        String newCodes = StringUtils.join(codes, ",");
+        return newCodes;
+    }
 }

+ 1 - 1
projects/src/main/java/com/rtrh/projects/web/controller/subject/SubInfoExportController.java

@@ -649,7 +649,7 @@ public class SubInfoExportController extends BaseController {
             //获取属地字典
             List<TSystable> jsddList = tSysTableService.getByKind(SysTableKind.JSDD);
             //获取行业
-            List<SubIndu> subInduList = subInduService.queryTreeALl();
+            List<SubIndu> subInduList = subInduService.selectAllSubIndu();
             //遍历subInfoTotalExcel,将subjectId替换为jsddList中code=subjectId的title
             for (SubInfoTotalExcel data : subInfoTotalExcel) {
                 if (data == null) {

+ 4 - 3
projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoQueryApiController.java

@@ -604,7 +604,8 @@ public class SubInfoQueryApiController extends BaseController {
         Message message = new Message();
 
         //查询出行业分类
-        List<SubIndu> subInduList = subInduService.queryTreeALl();
+        List<SubIndu> subInduList = subInduService.selectAllSubIndu();
+
         //保存行业code
         List<String> indusKinds = new ArrayList<>();
         //判断搜索条件中是否有行业分类条件
@@ -752,7 +753,7 @@ public class SubInfoQueryApiController extends BaseController {
                 if (first.isPresent()){
                     item.setCode(first.get().getCode());
                 }else {
-                    item.setCode("");
+                    item.setCode("nll");
                 }
             });
 
@@ -776,7 +777,7 @@ public class SubInfoQueryApiController extends BaseController {
                 if (first.isPresent()){
                     item.setCode(first.get().getCode());
                 }else {
-                    item.setCode("");
+                    item.setCode("null");
                 }
             });
 

+ 0 - 23
projects/src/main/webapp/vmodules/subject/subInfo/tz/year_extend.jsp

@@ -279,29 +279,6 @@
         </div>
         <div class="table_box" style="padding-top: 0;">
             <div class="table_process" style="position: relative;">
-                <div class="export" style="background: transparent" @mouseover="openExport" @mouseout="choseExport">
-                    <div class="export" style="right: 25px;top: 0">
-                        <img src="${WebSite.asset}/css/images/left/export.svg"/>
-                        <span>导出</span>
-                    </div>
-                    <div class="sanjiao"></div>
-                    <div class="export-item" v-if="showExport" style="right: 5px;top:-30px">
-                        <%--                        <button type="button" class="" @click="exportExcel">--%>
-                        <%--                            项目汇总--%>
-                        <%--                        </button>--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportExcelByIndusKind">按所属行业--%>
-                        <%--                        </button>--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportSchedulingExcel">项目调度表--%>
-                        <%--                        </button>--%>
-                        <%--                        <!-- <button type="button" class="" @click="exportExcel2">项目明细导出</button> -->--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportMoreExcel">自定义--%>
-                        <%--                        </button>--%>
-                        <button type="button" class="" @click="exportProject">续建项目</button>
-                    </div>
-                </div>
                 <table id="table1" lay-filter="test" style="position: relative;"></table>
                 <div class="pagination-box" id="pagination"></div>
             </div>

+ 0 - 10
projects/src/main/webapp/vmodules/subject/subInfo/tz/year_new.jsp

@@ -276,16 +276,6 @@
         </div>
         <div class="table_box" style="padding-top: 0;">
             <div class="table_process" style="position: relative;">
-                <div class="export" style="background: transparent" @mouseover="openExport" @mouseout="choseExport">
-                    <div class="export" style="right: 25px;top: 0">
-                        <img src="${WebSite.asset}/css/images/left/export.svg"/>
-                        <span>导出</span>
-                    </div>
-                    <div class="sanjiao"></div>
-                    <div class="export-item" v-if="showExport" style="right: 5px;top:-30px">
-                        <button type="button" class="" @click="exportProject">新建项目</button>
-                    </div>
-                </div>
                 <table id="table1" lay-filter="test" style="position: relative;"></table>
                 <div class="pagination-box" id="pagination"></div>
             </div>

+ 0 - 23
projects/src/main/webapp/vmodules/subject/subInfo/tz/year_reserve.jsp

@@ -307,29 +307,6 @@
         </div>
         <div class="table_box" style="padding-top: 0;">
             <div class="table_process" style="position: relative;">
-                <div class="export" style="background: transparent" @mouseover="openExport" @mouseout="choseExport">
-                    <div class="export" style="right: 25px;top: 0">
-                        <img src="${WebSite.asset}/css/images/left/export.svg"/>
-                        <span>导出</span>
-                    </div>
-                    <div class="sanjiao"></div>
-                    <div class="export-item" v-if="showExport" style="right: 5px;top:-30px">
-                        <%--                        <button type="button" class="" @click="exportExcel">--%>
-                        <%--                            项目汇总--%>
-                        <%--                        </button>--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportExcelByIndusKind">按所属行业--%>
-                        <%--                        </button>--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportSchedulingExcel">项目调度表--%>
-                        <%--                        </button>--%>
-                        <%--                        <!-- <button type="button" class="" @click="exportExcel2">项目明细导出</button> -->--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportMoreExcel">自定义--%>
-                        <%--                        </button>--%>
-                        <button type="button" class="" @click="exportProject">储备项目</button>
-                    </div>
-                </div>
                 <table id="table1" lay-filter="test" style="position: relative;"></table>
                 <div class="pagination-box" id="pagination"></div>
             </div>

+ 0 - 23
projects/src/main/webapp/vmodules/subject/subInfo/tz/year_sum.jsp

@@ -293,29 +293,6 @@
         </div>
         <div class="table_box" style="padding-top: 0;">
             <div class="table_process" style="position: relative;">
-                <div class="export" style="background: transparent" @mouseover="openExport" @mouseout="choseExport">
-                    <div class="export" style="right: 25px;top: 0">
-                        <img src="${WebSite.asset}/css/images/left/export.svg"/>
-                        <span>导出</span>
-                    </div>
-                    <div class="sanjiao"></div>
-                    <div class="export-item" v-if="showExport" style="right: 5px;top:-30px">
-                        <%--                        <button type="button" class="" @click="exportExcel">--%>
-                        <%--                            项目汇总--%>
-                        <%--                        </button>--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportExcelByIndusKind">按所属行业--%>
-                        <%--                        </button>--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportSchedulingExcel">项目调度表--%>
-                        <%--                        </button>--%>
-                        <%--                        <!-- <button type="button" class="" @click="exportExcel2">项目明细导出</button> -->--%>
-                        <%--                        <button type="button" class=""--%>
-                        <%--                                @click="exportMoreExcel">自定义--%>
-                        <%--                        </button>--%>
-                        <button type="button" class="" @click="exportProject">续建项目</button>
-                    </div>
-                </div>
                 <table id="table1" lay-filter="test" style="position: relative;"></table>
                 <div class="pagination-box" id="pagination"></div>
             </div>