qinhouyu před 1 rokem
rodič
revize
485ac2f75a

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringIndustryMapper.java

@@ -18,6 +18,7 @@ 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);
     List<Map<String,String>> getReviewStatusByNodeId(@Param("id") String id);
 
 }

+ 15 - 3
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringIndustryServiceImpl.java

@@ -97,7 +97,12 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
             DateList.add(item.substring(item.indexOf("2")));
         });
         String username = LoginHelper.getUsername();
-        Page<Map<String, Object>> listPage = baseMapper.getByUserList(DateList, username, leftJoin, szAndGy, page);
+        Page<Map<String, Object>> listPage = null;
+        if (type.equals("6")) {
+            listPage = baseMapper.getByUserList1(DateList, username, leftJoin, szAndGy, page);
+        } else {
+            listPage = baseMapper.getByUserList(DateList, username, leftJoin, szAndGy, page);
+        }
 
         if ("1".equals(type)){ // 顶管
             listPage.getRecords().forEach(item -> {
@@ -180,7 +185,11 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
                 mapList.forEach(ite -> {
                     String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
                     // "municipal_engineering_node";
-                    ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
+                    try {
+                        ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
+                    } catch (Exception e) {
+                        ite.put("type","");
+                    }
                     ite.put("reviewStatus", str);
                 });
                 municipalEngineeringNode.forEach(ite -> {
@@ -211,10 +220,13 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
             });
             MonthTableNameHandler.removeData();
         }
-        else if ("6".equals(type)){ // 工业工程
+        else if ("6".equals(type)){ // 带气封堵
             listPage.getRecords().forEach(item -> {
                 String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
 ;
+                Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+                List<SysDictData> municipalEngineeringNode = sysDictMap.get("air_wall_node");
+
                 MonthTableNameHandler.setData(date);
                 List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
                 mapList.forEach(ite -> {

+ 47 - 0
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringIndustryMapper.xml

@@ -79,4 +79,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </select>
 
+    <select id="getByUserList1" resultType="java.util.Map">
+        SELECT
+        epj.id AS id,
+        epj.engin_name AS enginName,
+        dict.dict_label as dictName,
+        dict.dict_value as dictvalue,
+        epj.create_time AS createTime
+        FROM z_engineering_info  ei
+        LEFT JOIN z_engineering_node en ON ei.eng_info_id = en.id
+        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'">
+                and epj.type = '1'
+            </if>
+            <if test="szAndGy == 'gy'">
+                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
+        <foreach collection="names" item="name">
+            union
+            SELECT
+            epj.id AS id,
+            epj.engin_name AS enginName,
+            dict.dict_label as dictName,
+            dict.dict_value as dictvalue,
+            epj.create_time AS createTime
+            FROM z_engineering_info_${name}  ei
+            LEFT JOIN z_engineering_node_${name} en ON ei.eng_info_id = en.id
+            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'">
+                    and epj.type = '1'
+                </if>
+                <if test="szAndGy == 'gy'">
+                    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
+
+        </foreach>
+    </select>
+
 </mapper>