qinhouyu 1 год назад
Родитель
Сommit
88caa8c976

+ 7 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZEngineeringIndustryController.java

@@ -49,8 +49,13 @@ public class ZEngineeringIndustryController extends BaseController {
     private final IZEngineeringIndustryService iZEngineeringIndustryService;
 
     @GetMapping("getByUserList")
-    public R<?> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery){
-        return R.ok(iZEngineeringIndustryService.getByUserList(type,enginName,enginType,enginProcedure,enginStatus, pageQuery));
+    public R<?> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery,String nodeType,String createBy){
+        return R.ok(iZEngineeringIndustryService.getByUserList(type,enginName,enginType,enginProcedure,enginStatus, pageQuery,nodeType,createBy));
+    }
+
+    @GetMapping("/getByUserListAndDicts/{dictType}")
+    public R<?> getByUserListAndDicts(@PathVariable String dictType){
+        return R.ok(iZEngineeringIndustryService.getByUserListAndDicts(dictType));
     }
 
     /**

+ 3 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringIndustryMapper.java

@@ -17,8 +17,9 @@ import java.util.Map;
  */
 public interface ZEngineeringIndustryMapper extends BaseMapperPlus<ZEngineeringIndustryMapper, ZEngineeringIndustry, ZEngineeringIndustryVo> {
 
-    Page<Map<String,Object>> getByUserList(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page);
-    Page<Map<String,Object>> getByUserList1(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page);
+    Page<Map<String,Object>> getByUserList(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page,@Param("enginName")String enginName,@Param("enginType")String enginType);
+    Page<Map<String,Object>> getByUserList1(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page,@Param("enginName")String enginName,@Param("enginType")String enginType);
     List<Map<String,String>> getReviewStatusByNodeId(@Param("id") String id);
+    List<Map<String,String>> getDicts(@Param("type") String type);
 
 }

+ 4 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/IZEngineeringIndustryService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.zdsz.service;
 
 import com.ruoyi.common.core.domain.PageQuery;
+import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.zdsz.domain.bo.ZEngineeringIndustryBo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryTypeVo;
@@ -18,7 +19,7 @@ import java.util.Map;
  */
 public interface IZEngineeringIndustryService {
 
-    TableDataInfo<Map<String, Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery);
+    TableDataInfo<Map<String, Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery,String nodeType,String createBy);
 
     /**
      * 查询工业工程|市政工程
@@ -56,4 +57,6 @@ public interface IZEngineeringIndustryService {
 
     ZEngineeringIndustryVo query(String id);
     List<ZEngineeringIndustryTypeVo> queryNameByType(ZEngineeringIndustryBo bo);
+
+    List<Map<String,String>> getByUserListAndDicts(String dictType);
 }

+ 69 - 13
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringIndustryServiceImpl.java

@@ -66,29 +66,33 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
     private ZEngineeringCivilMapper zEngineeringCivilMapper;
 
     @Override
-    public TableDataInfo<Map<String, Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery) {
+    public TableDataInfo<Map<String, Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery,String nodeType,String createBy) {
         Page<T> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
         String leftJoin = null;
         String szAndGy = null;
+
         if ("1".equals(type)){
             leftJoin = "z_engineering_pipe_jacking"; // 顶管
+            enginType = "";
         }
         else if ("2".equals(type)){
             leftJoin = "z_engineering_infrastructure"; // 基建
+            enginType = "";
         }
         else if ("3".equals(type)){
             leftJoin = "z_engineering_dangerous"; // 危险工程
         }
         else if ("4".equals(type)){
             leftJoin = "z_engineering_industry"; // 市政工程
-            szAndGy = "gy";
+            szAndGy = "sz";
+            enginType = "";
         }
         else if ("5".equals(type)){
             leftJoin = "z_engineering_industry"; // 工业工程
-            szAndGy = "sz";
+            szAndGy = "gy";
         }
         else if ("6".equals(type)){
-            leftJoin = "z_engineering_air_wall"; // 工业工程
+            leftJoin = "z_engineering_air_wall"; // 带气工程
         }
         LinkedList<String> list = zEngineeringCivilMapper.getTableNames("z_engineering_info");
         List DateList = new ArrayList();
@@ -96,12 +100,12 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
         list.stream().forEach(item -> {
             DateList.add(item.substring(item.indexOf("2")));
         });
-        String username = LoginHelper.getUsername();
+        String username = createBy;
         Page<Map<String, Object>> listPage = null;
         if (type.equals("6")) {
-            listPage = baseMapper.getByUserList1(DateList, username, leftJoin, szAndGy, page);
+            listPage = baseMapper.getByUserList1(DateList, username, leftJoin, szAndGy, page,enginName,enginType);
         } else {
-            listPage = baseMapper.getByUserList(DateList, username, leftJoin, szAndGy, page);
+            listPage = baseMapper.getByUserList(DateList, username, leftJoin, szAndGy, page,enginName,enginType);
         }
 
         if ("1".equals(type)){ // 顶管
@@ -119,16 +123,25 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
                     ite.put("reviewStatus", str);
                 });
+                List<Map<String, String>> finalMapList = mapList;
                 municipalEngineeringNode.forEach(ite -> {
                     String dictLabel = ite.getDictLabel();
-                    List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
+                    List<Map<String, String>> type1 = finalMapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
                     if (type1.size() == 0) {
                         HashMap<String, String> objectObjectHashMap = new HashMap<>();
                         objectObjectHashMap.put("reviewStatus","未审核");
                         objectObjectHashMap.put("type",dictLabel);
-                        mapList.add(objectObjectHashMap);
+                        finalMapList.add(objectObjectHashMap);
                     }
                 });
+                mapList = finalMapList;
+                if (!ObjectUtils.isEmpty(enginStatus)){
+                    String s = "2".equals(enginStatus)?"未审核":"1".equals(enginStatus)?"通过":"未通过";
+                    mapList = mapList.stream().filter(obj->obj.get("reviewStatus").equals(s)).collect(Collectors.toList());
+                }
+                if (!ObjectUtils.isEmpty(nodeType)){
+                    mapList = mapList.stream().filter(obj->obj.get("type").equals(nodeType)).collect(Collectors.toList());
+                }
                 item.put("status",mapList);
                 MonthTableNameHandler.removeData();
             });
@@ -146,16 +159,25 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
                     ite.put("reviewStatus", str);
                 });
+                List<Map<String, String>> finalMapList = mapList;
                 municipalEngineeringNode.forEach(ite -> {
                     String dictLabel = ite.getDictLabel();
-                    List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
+                    List<Map<String, String>> type1 = finalMapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
                     if (type1.size() == 0) {
                         HashMap<String, String> objectObjectHashMap = new HashMap<>();
                         objectObjectHashMap.put("reviewStatus","未审核");
                         objectObjectHashMap.put("type",dictLabel);
-                        mapList.add(objectObjectHashMap);
+                        finalMapList.add(objectObjectHashMap);
                     }
                 });
+                mapList = finalMapList;
+                if (!ObjectUtils.isEmpty(enginStatus)){
+                    String s = "2".equals(enginStatus)?"未审核":"1".equals(enginStatus)?"通过":"未通过";
+                    mapList = mapList.stream().filter(obj->obj.get("reviewStatus").equals(s)).collect(Collectors.toList());
+                }
+                if (!ObjectUtils.isEmpty(nodeType)){
+                    mapList = mapList.stream().filter(obj->obj.get("type").equals(nodeType)).collect(Collectors.toList());
+                }
                 item.put("status",mapList);
                 MonthTableNameHandler.removeData();
             });
@@ -170,6 +192,10 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
                     ite.put("reviewStatus", str);
                 });
+                if (!ObjectUtils.isEmpty(enginStatus)){
+                    String s = "2".equals(enginStatus)?"未审核":"1".equals(enginStatus)?"通过":"未通过";
+                    mapList = mapList.stream().filter(obj->obj.get("reviewStatus").equals(s)).collect(Collectors.toList());
+                }
                 item.put("status",mapList);
                 MonthTableNameHandler.removeData();
             });
@@ -192,16 +218,25 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     }
                     ite.put("reviewStatus", str);
                 });
+                List<Map<String, String>> finalMapList = mapList;
                 municipalEngineeringNode.forEach(ite -> {
                     String dictLabel = ite.getDictLabel();
-                    List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
+                    List<Map<String, String>> type1 = finalMapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
                     if (type1.size() == 0) {
                         HashMap<String, String> objectObjectHashMap = new HashMap<>();
                         objectObjectHashMap.put("reviewStatus","未审核");
                         objectObjectHashMap.put("type",dictLabel);
-                        mapList.add(objectObjectHashMap);
+                        finalMapList.add(objectObjectHashMap);
                     }
                 });
+                mapList = finalMapList;
+                if (!ObjectUtils.isEmpty(enginStatus)){
+                    String s = "2".equals(enginStatus)?"未审核":"1".equals(enginStatus)?"通过":"未通过";
+                    mapList = mapList.stream().filter(obj->obj.get("reviewStatus").equals(s)).collect(Collectors.toList());
+                }
+                if (!ObjectUtils.isEmpty(nodeType)){
+                    mapList = mapList.stream().filter(obj->obj.get("type").equals(nodeType)).collect(Collectors.toList());
+                }
                 item.put("status",mapList);
                 MonthTableNameHandler.removeData();
             });
@@ -216,6 +251,10 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
                     ite.put("reviewStatus", str);
                 });
+                if (!ObjectUtils.isEmpty(enginStatus)){
+                    String s = "2".equals(enginStatus)?"未审核":"1".equals(enginStatus)?"通过":"未通过";
+                    mapList = mapList.stream().filter(obj->obj.get("reviewStatus").equals(s)).collect(Collectors.toList());
+                }
                 item.put("status",mapList);
             });
             MonthTableNameHandler.removeData();
@@ -233,10 +272,22 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                     String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
                     ite.put("reviewStatus", str);
                 });
+                if (!ObjectUtils.isEmpty(enginStatus)){
+                    String s = "2".equals(enginStatus)?"未审核":"1".equals(enginStatus)?"通过":"未通过";
+                    mapList = mapList.stream().filter(obj->obj.get("reviewStatus").equals(s)).collect(Collectors.toList());
+                }
                 item.put("status",mapList);
             });
             MonthTableNameHandler.removeData();
         }
+        if (!ObjectUtils.isEmpty(listPage)){
+            for (int i = 0; i < listPage.getRecords().size(); i++) {
+                if (ObjectUtils.isEmpty(listPage.getRecords().get(i).get("status"))){
+                    listPage.getRecords().remove(i);
+                    i--;
+                }
+            }
+        }
         return TableDataInfo.build(listPage);
     }
 
@@ -655,6 +706,11 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
         return zEngineeringIndustryTypeVos;
     }
 
+    @Override
+    public List<Map<String,String>> getByUserListAndDicts(String dictType) {
+        return baseMapper.getDicts(dictType);
+    }
+
     private LambdaQueryWrapper<ZEngineeringIndustry> buildListByType(ZEngineeringIndustryBo bo) {
 
         LambdaQueryWrapper<ZEngineeringIndustry> queryWrapper = new LambdaQueryWrapper<ZEngineeringIndustry>();

+ 69 - 14
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringIndustryMapper.xml

@@ -26,17 +26,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <select id="getDicts" resultType="java.util.Map">
+        SELECT dict_label as dictLabel,dict_value as dictValue
+        from sys_dict_data
+        where 1 = 1
+        <if test="type == 4">
+            and dict_type = 'municipal_engineering_node'
+        </if>
+        <if test="type == 2">
+            and dict_type = 'engineering_infrastructure'
+        </if>
+        <if test="type == 1">
+            and dict_type = 'pipe_jack'
+        </if>
+        <if test="type == 5">
+            and dict_type = 'engin_classification'
+        </if>
+        <if test="type == 3">
+            and dict_type = 'air_wall_node'
+        </if>
+    </select>
     <select id="getReviewStatusByNodeId" resultType="java.util.Map">
         SELECT
             en.type,
             COALESCE(
-                    (SELECT er.review_status FROM z_engineering_review er WHERE er.eng_info_id = en.id AND er.del_flag = 0 ORDER BY er.update_info_time DESC LIMIT 1),
+                    (SELECT er.review_status FROM z_engineering_review er WHERE er.eng_info_id = en.id AND er.del_flag = 0
+                                                                          ORDER BY er.update_info_time DESC LIMIT 1),
         '2'
     ) AS reviewStatus
         FROM
             z_engineering_node en
         WHERE
-            en.civli_id = #{id};
+            en.civli_id = #{id}
     </select>
     <select id="getByUserList" resultType="java.util.Map">
         SELECT
@@ -47,15 +68,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                  LEFT JOIN z_engineering_node en ON ei.eng_info_id = en.id
                  LEFT JOIN ${type} epj ON epj.id = en.civli_id
                 <if test="szAndGy != null and szAndGy != ''">
-                    <if test="szAndGy == 'sz'">
+                    <if test="szAndGy == 'gy'">
                         and epj.type = '1'
                     </if>
-                    <if test="szAndGy == 'gy'">
+                    <if test="szAndGy == 'sz'">
                         and epj.type = '2'
                     </if>
                 </if>
                 and epj.del_flag = '0'
-        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL GROUP BY epj.id
+        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+        <if test="enginName != '' and enginName != null ">
+            and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+        </if>
+        <if test="enginType != '' and enginType != null and szAndGy!='gy'">
+            and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+        </if>
+        <if test="enginType != '' and enginType != null and szAndGy=='gy'">
+            and epj.engin_classification LIKE CONCAT('%',#{enginType},'%')
+        </if>
+        GROUP BY epj.id
         <foreach collection="names" item="name">
             union
             SELECT
@@ -66,15 +97,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN z_engineering_node_${name} en ON ei.eng_info_id = en.id
             LEFT JOIN ${type} epj ON epj.id = en.civli_id
             <if test="szAndGy != null and szAndGy != ''">
-                <if test="szAndGy == 'sz'">
+                <if test="szAndGy == 'gy'">
                     and epj.type = '1'
                 </if>
-                <if test="szAndGy == 'gy'">
+                <if test="szAndGy == 'sz'">
                     and epj.type = '2'
                 </if>
             </if>
             and epj.del_flag = '0'
-            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL GROUP BY epj.id
+            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+            <if test="enginName != '' and enginName != null ">
+                and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+            </if>
+            <if test="enginType != '' and enginType != null and szAndGy!='gy'">
+                and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+            </if>
+            <if test="enginType != '' and enginType != null and szAndGy=='gy'">
+                and epj.engin_classification LIKE CONCAT('%',#{enginType},'%')
+            </if>
+            GROUP BY epj.id
 
         </foreach>
     </select>
@@ -91,15 +132,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN ${type} epj ON epj.id = en.civli_id
         left join sys_dict_data as dict ON dict.dict_value = epj.engin_type
         <if test="szAndGy != null and szAndGy != ''">
-            <if test="szAndGy == 'sz'">
+            <if test="szAndGy == 'gy'">
                 and epj.type = '1'
             </if>
-            <if test="szAndGy == 'gy'">
+            <if test="szAndGy == 'sz'">
                 and epj.type = '2'
             </if>
         </if>
         and epj.del_flag = '0'
-        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL GROUP BY epj.id
+        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+        <if test="enginName != '' and enginName != null ">
+            and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+        </if>
+        <if test="enginType != '' and enginType != null and type!='z_engineering_dangerous'">
+            and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+        </if>
+        GROUP BY epj.id
         <foreach collection="names" item="name">
             union
             SELECT
@@ -113,15 +161,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN ${type} epj ON epj.id = en.civli_id
             left join sys_dict_data as dict ON dict.dict_value = epj.engin_type
             <if test="szAndGy != null and szAndGy != ''">
-                <if test="szAndGy == 'sz'">
+                <if test="szAndGy == 'gy'">
                     and epj.type = '1'
                 </if>
-                <if test="szAndGy == 'gy'">
+                <if test="szAndGy == 'sz'">
                     and epj.type = '2'
                 </if>
             </if>
             and epj.del_flag = '0'
-            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL GROUP BY epj.id
+            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+            <if test="enginName != '' and enginName != null ">
+                and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+            </if>
+            <if test="enginType != '' and enginType != null and type!='z_engineering_dangerous'">
+                and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+            </if>
+            GROUP BY epj.id
 
         </foreach>
     </select>