From c2945bf7f7270dce16d590575207b6bc811ecc68 Mon Sep 17 00:00:00 2001
From: sonin <1457065857@qq.com>
Date: Tue, 25 Mar 2025 15:27:58 +0800
Subject: [PATCH] 运营季报 重点工作情况 修改

---
 sk-base-common/src/main/java/com/skua/common/constant/BusinessConstant.java                           | 23 +++++++++++++++++++++++
 sk-base-common/src/main/java/com/skua/modules/biz/IBusinessService.java                               | 14 ++++++++++++++
 sk-base-common/src/main/java/com/skua/modules/biz/impl/BusinessServiceImpl.java                       | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sk-module-datafill/src/main/java/com/skua/modules/report/service/impl/OperationReportServiceImpl.java | 43 ++++++++++++++++++++++++++++++++++++++++++-
 sk-module-datafill/src/main/java/com/skua/modules/report/vo/ProductDataVO.java                        | 10 ++++++++++
 5 files changed, 165 insertions(+), 1 deletion(-)
 create mode 100644 sk-base-common/src/main/java/com/skua/common/constant/BusinessConstant.java
 create mode 100644 sk-base-common/src/main/java/com/skua/modules/biz/IBusinessService.java
 create mode 100644 sk-base-common/src/main/java/com/skua/modules/biz/impl/BusinessServiceImpl.java

diff --git a/sk-base-common/src/main/java/com/skua/common/constant/BusinessConstant.java b/sk-base-common/src/main/java/com/skua/common/constant/BusinessConstant.java
new file mode 100644
index 0000000..b2587b0
--- /dev/null
+++ b/sk-base-common/src/main/java/com/skua/common/constant/BusinessConstant.java
@@ -0,0 +1,23 @@
+package com.skua.common.constant;
+
+/**
+ * <pre>
+ * 常量
+ * </pre>
+ *
+ * @author sonin
+ * @version 1.0 2023/3/9 10:12
+ */
+public interface BusinessConstant {
+
+    String dateFormat = "yyyy-MM-dd HH:mm:ss";
+
+    String startTimeSuffix = " 00:00:00";
+
+    String endTimeSuffix = " 23:59:59";
+
+    String countSuffix = "Count";
+
+    String sumSuffix = "Sum";
+
+}
diff --git a/sk-base-common/src/main/java/com/skua/modules/biz/IBusinessService.java b/sk-base-common/src/main/java/com/skua/modules/biz/IBusinessService.java
new file mode 100644
index 0000000..bf89a12
--- /dev/null
+++ b/sk-base-common/src/main/java/com/skua/modules/biz/IBusinessService.java
@@ -0,0 +1,14 @@
+package com.skua.modules.biz;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * @Author:sonin
+ * @Date:2025/2/18 15:35
+ */
+public interface IBusinessService {
+
+    Map<String, String> dictMap(String dictCode, Collection<?> inCol);
+
+}
diff --git a/sk-base-common/src/main/java/com/skua/modules/biz/impl/BusinessServiceImpl.java b/sk-base-common/src/main/java/com/skua/modules/biz/impl/BusinessServiceImpl.java
new file mode 100644
index 0000000..5b75e71
--- /dev/null
+++ b/sk-base-common/src/main/java/com/skua/modules/biz/impl/BusinessServiceImpl.java
@@ -0,0 +1,76 @@
+package com.skua.modules.biz.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.skua.modules.base.service.IBaseService;
+import com.skua.modules.biz.IBusinessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author:sonin
+ * @Date:2025/2/18 15:35
+ */
+@Service
+public class BusinessServiceImpl implements IBusinessService {
+
+    @Autowired
+    private IBaseService baseService;
+
+    @Override
+    public Map<String, String> dictMap(String dictCode, Collection<?> inCol) {
+        String key0, value0, table0;
+        QueryWrapper<?> queryWrapper0 = new QueryWrapper<>();
+        if ("equipment_info".equals(dictCode)) {
+            key0 = "id";
+            value0 = "equipment_name";
+            table0 = dictCode;
+        } else if ("sys_user".equals(dictCode)) {
+            key0 = "id";
+            value0 = "realname";
+            table0 = dictCode;
+        } else if ("sys_struct_dict".equals(dictCode)) {
+            key0 = "id";
+            value0 = "struct_name";
+            table0 = dictCode;
+        } else if ("equipment_category".equals(dictCode)) {
+            key0 = "id";
+            value0 = "des";
+            table0 = dictCode;
+        } else if ("evaluate_score_desc".equals(dictCode)) {
+            key0 = "id";
+            value0 = "score_desc";
+            table0 = dictCode;
+        } else if ("carbon_qualitative_desc".equals(dictCode)) {
+            key0 = "id";
+            value0 = "qualitative_desc";
+            table0 = dictCode;
+        } else if ("sys_depart".equals(dictCode)) {
+            key0 = "id";
+            value0 = "depart_name";
+            table0 = dictCode;
+        } else {
+            // 数据字典查询
+            queryWrapper0.eq("sys_dict.dict_code", dictCode);
+            key0 = "sys_dict_item.item_value";
+            value0 = "sys_dict_item.item_text";
+            table0 = "sys_dict inner join sys_dict_item on sys_dict.id = sys_dict_item.dict_id";
+        }
+        String sqlSelect = "select " + key0 + " as key0, " + value0 + " as value0 from " + table0;
+        if (inCol != null && !inCol.isEmpty()) {
+            queryWrapper0.in(key0, inCol);
+        }
+        List<Map<String, Object>> queryMapList0 = baseService.queryForList(sqlSelect, queryWrapper0);
+        Map<String, String> dictMap = new HashMap<>(10);
+        for (Map<String, Object> item : queryMapList0) {
+            dictMap.put(String.valueOf(item.get("key0")), String.valueOf(item.get("value0")));
+        }
+        return dictMap;
+    }
+
+
+}
diff --git a/sk-module-datafill/src/main/java/com/skua/modules/report/service/impl/OperationReportServiceImpl.java b/sk-module-datafill/src/main/java/com/skua/modules/report/service/impl/OperationReportServiceImpl.java
index 5308229..994c921 100644
--- a/sk-module-datafill/src/main/java/com/skua/modules/report/service/impl/OperationReportServiceImpl.java
+++ b/sk-module-datafill/src/main/java/com/skua/modules/report/service/impl/OperationReportServiceImpl.java
@@ -1,10 +1,14 @@
 package com.skua.modules.report.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.skua.common.constant.BusinessConstant;
 import com.skua.common.constant.ReportConstant;
 import com.skua.common.report.ReportViewUtil;
 import com.skua.core.context.BaseContextHandler;
 import com.skua.core.context.SpringContextUtils;
 import com.skua.core.util.ConvertUtils;
+import com.skua.modules.base.service.IBaseService;
+import com.skua.modules.biz.IBusinessService;
 import com.skua.modules.report.mapper.OperationReportMapper;
 import com.skua.modules.report.service.IOperationReportService;
 import com.skua.modules.report.vo.*;
@@ -22,8 +26,11 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /***
  * 运营周报
@@ -33,6 +40,10 @@ public class OperationReportServiceImpl implements  IOperationReportService {
 
     @Resource
     private OperationReportMapper  operationReportMapper;
+    @Resource
+    private IBaseService baseService;
+    @Resource
+    private IBusinessService businessService;
 
     private JdbcTemplate getJdbcTemplate(){
         JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
@@ -154,7 +165,7 @@ public class OperationReportServiceImpl implements  IOperationReportService {
         productDataVO.setDrugDeptartList(yyhMonthDataList);
 
 
-        //隐患排查完成情况
+        // 隐患排查完成情况
         List<String> deptNameList = operationReportMapper.queryDepatNameList();
         productDataVO.setDangerDeptCount( 0 );
         if(deptNameList != null && !deptNameList.isEmpty()){
@@ -162,6 +173,36 @@ public class OperationReportServiceImpl implements  IOperationReportService {
             productDataVO.setDangerDeptNames(String.join(",",deptNameList));
         }
 
+        // 翻译
+        Map<String, String> sysDepartDictMap = businessService.dictMap("sys_depart", null);
+        // 1. 重点工作事项:取重点事项推进情况里面,当月完成的重点事项记录
+        QueryWrapper<?> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.eq("status", "2")
+                .ge("end_time", startDate)
+                .le("end_time", endDate);
+        List<Map<String, Object>> queryMapList1 = baseService.queryForList("select * from f_major_issues_process", queryWrapper1);
+        for (Map<String, Object> item: queryMapList1) {
+            List<Map<String, Object>> priorityWorkItemList = new ArrayList<>();
+            priorityWorkItemList.add(new HashMap<String, Object>(){{
+                put("key0", item.get("depart_id"));
+                put("value0", sysDepartDictMap.get(item.get("depart_id")));
+            }});
+            productDataVO.setPriorityWorkItemList(priorityWorkItemList);
+        }
+        // 2: 隐患排查巡检:取风险点巡检记录里面巡检类型是生产巡检的数据
+        QueryWrapper<?> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("inspection_type", "1")
+                .ge("end_date", startDate + BusinessConstant.startTimeSuffix)
+                .le("end_date", endDate + BusinessConstant.endTimeSuffix);
+        List<Map<String, Object>> queryMapList2 = baseService.queryForList("select * from danger_inspection_record", queryWrapper2);
+        for (Map<String, Object> item: queryMapList2) {
+            List<Map<String, Object>> hiddenDangerInspectionList = new ArrayList<>();
+            hiddenDangerInspectionList.add(new HashMap<String, Object>(){{
+                put("key0", item.get("depart_id"));
+                put("value0", sysDepartDictMap.get(item.get("depart_id")));
+            }});
+            productDataVO.setHiddenDangerInspectionList(hiddenDangerInspectionList);
+        }
         return productDataVO;
     }
 
diff --git a/sk-module-datafill/src/main/java/com/skua/modules/report/vo/ProductDataVO.java b/sk-module-datafill/src/main/java/com/skua/modules/report/vo/ProductDataVO.java
index 8934d48..a9e72d9 100644
--- a/sk-module-datafill/src/main/java/com/skua/modules/report/vo/ProductDataVO.java
+++ b/sk-module-datafill/src/main/java/com/skua/modules/report/vo/ProductDataVO.java
@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 月度生产数据报表
@@ -60,6 +61,15 @@ public class ProductDataVO {
     @ApiModelProperty(value = "药剂实际费用")
     private Double  drugCost;//实际发生为0.219元/吨水
 
+    // 重点工作事项
+    private List<Map<String, Object>> priorityWorkItemList = new ArrayList<>();
+
+    // 隐患排查巡检
+    private List<Map<String, Object>> hiddenDangerInspectionList = new ArrayList<>();
+
+    // 运营管理抽查情况
+    private List<Map<String, Object>> managementSpotCheckList = new ArrayList<>();
+
 
     @ApiModelProperty(value = "实际水量同比下降--水务公司列表")
     private List<FReportWaterMonthDataVO>  waterDeptartList = new ArrayList<>();
--
libgit2 0.24.0