Parcourir la source

v2.1 更新了超时工单计数的计算方式

lifuquan il y a 9 mois
Parent
commit
8837a70ede

BIN
doc/部署环境/字段梳理.xlsx


+ 61 - 3
doc/部署环境/手动入库数据.md

@@ -17,7 +17,7 @@ Content-Type:application/json
 POST http://192.168.10.7:22222/tsl_data/report/generate/v3 HTTP/1.1
 Content-Type:application/json
 
-20240310
+20240325
 ```
 
 ## 数据手动入库
@@ -25,17 +25,19 @@ Content-Type:application/json
 - cem_mobile_experience_list
 
 ```http
+### 入库 cem_mobile_experience_list
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/cem_mobile_experience_list HTTP/1.1
 Content-Type:application/json
 
-20240310
+20240325
 ```
 
 ```http
+### 删除 cem_mobile_experience_list
 POST http://192.168.10.7:22222/tsl_data/source/delete/cem_mobile_experience_list HTTP/1.1
 Content-Type:application/json
 
-20240310
+20240325
 ```
 
 - report_auto.he_d_mobile_comp
@@ -84,3 +86,59 @@ Content-Type:application/json
 
 20231015
 ```
+
+```http
+### 入库 mobile_complaint 数据
+POST http://192.168.10.7:22222/tsl_data/source/warehouse/mobile_complaint
+Content-Type: application/json
+
+20231203
+
+### 删除 mobile_complaint 数据
+POST http://192.168.10.7:22222/tsl_data/source/delete/mobile_complaint
+Content-Type: application/json
+
+20231203
+
+### 入库 high_quality_count 数据
+POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_count
+Content-Type: application/json
+
+20231203
+
+### 删除 high_quality_count 数据
+POST http://192.168.10.7:22222/tsl_data/source/delete/high_quality_count
+Content-Type: application/json
+
+20231203
+
+### 入库 high_quality_list 数据
+POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_list
+Content-Type: application/json
+
+20231203
+
+### 删除 high_quality_list 数据
+POST http://192.168.10.7:22222/tsl_data/source/delete/high_quality_list
+Content-Type: application/json
+
+20231203
+
+### 删除 high_quality_list 数据
+POST http://192.168.10.7:22222/tsl_data/highQualityData/generate
+Content-Type: application/json
+
+20231203
+
+### 删除 high_quality_list 数据
+POST http://192.168.10.7:22222/tsl_data/highQualityData/delete
+Content-Type: application/json
+
+20231203
+
+### 生成报表
+POST http://192.168.10.7:22222/tsl_data/report/generate
+Content-Type: application/json
+
+20231203
+```

+ 0 - 53
doc/部署环境/数据入库-部署环境.http

@@ -1,53 +0,0 @@
-### 入库 mobile_complaint 数据
-POST http://192.168.10.7:22222/tsl_data/source/warehouse/mobile_complaint
-Content-Type: application/json
-
-20231203
-
-### 删除 mobile_complaint 数据
-POST http://192.168.10.7:22222/tsl_data/source/delete/mobile_complaint
-Content-Type: application/json
-
-20231203
-
-### 入库 high_quality_count 数据
-POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_count
-Content-Type: application/json
-
-20231203
-
-### 删除 high_quality_count 数据
-POST http://192.168.10.7:22222/tsl_data/source/delete/high_quality_count
-Content-Type: application/json
-
-20231203
-
-### 入库 high_quality_list 数据
-POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_list
-Content-Type: application/json
-
-20231203
-
-### 删除 high_quality_list 数据
-POST http://192.168.10.7:22222/tsl_data/source/delete/high_quality_list
-Content-Type: application/json
-
-20231203
-
-### 删除 high_quality_list 数据
-POST http://192.168.10.7:22222/tsl_data/highQualityData/generate
-Content-Type: application/json
-
-20231203
-
-### 删除 high_quality_list 数据
-POST http://192.168.10.7:22222/tsl_data/highQualityData/delete
-Content-Type: application/json
-
-20231203
-
-### 生成报表
-POST http://192.168.10.7:22222/tsl_data/report/generate
-Content-Type: application/json
-
-20231203

+ 0 - 0
doc/部署环境/部署环境接口测试.md → doc/部署环境/部署环境接口测试-old.md


+ 1 - 1
pom.xml

@@ -13,7 +13,7 @@
 
     <groupId>com.nokia</groupId>
     <artifactId>tsl-data</artifactId>
-    <version>2.0</version>
+    <version>2.1</version>
 
     <packaging>jar</packaging>
 

+ 36 - 0
src/main/java/com/nokia/tsl_data/dao/WorkFlowDao.java

@@ -186,6 +186,42 @@ public class WorkFlowDao {
                 return result;
         }
 
+        // 20240326 要求修改为 使用 回单答复超时 字段统计,排除ZHX开头的工单
+        // 
+        public List<Map<String, Object>> selectTimeoutTsCountForDayV2(Instant start, Instant end) {
+                String sql = "with t1 as (select order_no, city as city_id, \r\n" + //
+                                "form_basic_data->>'serv_order' as kfno,\r\n" + //
+                                "form_basic_data ->> 'res_is_timeout' as is_timeout, \r\n" + //
+                                "form_basic_data->>'kd_accepttime' as kd_accepttime\r\n" + //
+                                "from flow_form_basic\r\n" + //
+                                "where is_effctive = '1'\r\n" + //
+                                "and substring(form_basic_data->>'serv_order' from 1 for 3) != 'ZHX'\r\n" + //
+                                "and form_basic_data->>'kd_accepttime' >= ? " + //
+                                "and form_basic_data->>'kd_accepttime' <= ? ), " + //
+                                "t2 as (select '全省' as city_id, count(1) as total_num, \r\n" + //
+                                "count(is_timeout = 'ca9d5f1f8363440699f11b802150eb77' or null) as timeout_num,\r\n" + //
+                                "count(is_timeout = 'ca9d5f1f8363440699f11b802150eb77' or null)::float8 / count(1) as timeout_ratio\r\n"
+                                + "from t1),\r\n" + //
+                                "t3 as (select city_id, count(1) as total_num, \r\n" + //
+                                "count(is_timeout = 'ca9d5f1f8363440699f11b802150eb77' or null) as timeout_num,\r\n" + //
+                                "count(is_timeout = 'ca9d5f1f8363440699f11b802150eb77' or null)::float8 / count(1) as timeout_ratio\r\n"
+                                + "from t1 group by city_id)\r\n" + //
+                                "select * from t2 union select * from t3";
+                DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
+                                .withZone(ZoneId.of("Asia/Shanghai"));
+                Object[] objects = new Object[] { dateFormat.format(start), dateFormat.format(end) };
+                int[] argTypes = new int[] { Types.TIMESTAMP, Types.TIMESTAMP };
+                Long startLong = System.currentTimeMillis();
+                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, objects, argTypes);
+                log.debug("从工作流读取{}-{}超时工单数据, 耗时 {} ms...",
+                                start,
+                                end,
+                                System.currentTimeMillis() - startLong);
+                return result;
+        }
+
+        // 20240326 要求修改为 使用 回单答复超时 字段统计,排除ZHX开头的工单
+        @Deprecated
         public List<Map<String, Object>> selectTimeoutTsCountForDay(Instant start, Instant end, int target) {
                 String sql = "with t1 as (select distinct city as city_id, \r\n" + //
                                 "form_basic_data->>'serv_order' as kfsn,\r\n" + //

+ 10 - 10
src/main/java/com/nokia/tsl_data/service/DataWarehouseService.java

@@ -54,37 +54,37 @@ public class DataWarehouseService {
         // 河北_CEM移网质量投诉明细
         File mobileComplaintDayFile = getMobileComplaintDayFile(day);
         if (!mobileComplaintDayFile.exists()) {
-            stringBuffer.append("河北_CEM移网质量投诉明细_HE_D_MOBILE_COMP表账期 ").append(day).append(" 数据未到达");
+            stringBuffer.append("河北_CEM移网质量投诉明细_HE_D_MOBILE_COMP表账期 ").append(day).append(" 数据未到达\n");
         } else if (!checkMD5(mobileComplaintDayFile)) {
-            stringBuffer.append("河北_CEM移网质量投诉明细_HE_D_MOBILE_COMP表账期 ").append(day).append(" MD5验证未通过");
+            stringBuffer.append("河北_CEM移网质量投诉明细_HE_D_MOBILE_COMP表账期 ").append(day).append(" MD5验证未通过\n");
         }
         // 河北_CEM高品质2日明细
         File highQualityListDayFile = getHighQualityListDayFile(day);
         if (!highQualityListDayFile.exists()) {
-            stringBuffer.append("河北_CEM高品质2日明细_HE_D_HIGH_QUALITY_LIST表账期 ").append(day).append(" 数据未到达");
+            stringBuffer.append("河北_CEM高品质2日明细_HE_D_HIGH_QUALITY_LIST表账期 ").append(day).append(" 数据未到达\n");
         } else if (!checkMD5(highQualityListDayFile)) {
-            stringBuffer.append("河北_CEM高品质2日明细_HE_D_HIGH_QUALITY_LIST表账期 ").append(day).append(" MD5验证未通过");
+            stringBuffer.append("河北_CEM高品质2日明细_HE_D_HIGH_QUALITY_LIST表账期 ").append(day).append(" MD5验证未通过\n");
         }
         // 河北_CEM高品质2日统计
         File highQualityCountDayFile = getHighQualityCountDayFile(day);
         if (!highQualityCountDayFile.exists()) {
-            stringBuffer.append("河北_CEM高品质2日统计_HE_D_HIGH_QUALITY_COUNT表账期 ").append(day).append(" 数据未到达");
+            stringBuffer.append("河北_CEM高品质2日统计_HE_D_HIGH_QUALITY_COUNT表账期 ").append(day).append(" 数据未到达\n");
         } else if (!checkMD5(highQualityCountDayFile)) {
-            stringBuffer.append("河北_CEM高品质2日统计_HE_D_HIGH_QUALITY_COUNT表账期 ").append(day).append(" MD5验证未通过");
+            stringBuffer.append("河北_CEM高品质2日统计_HE_D_HIGH_QUALITY_COUNT表账期 ").append(day).append(" MD5验证未通过\n");
         }
         // 河北客户体验管理智能定责投诉明细月累计接口日
         File complaintDetailsFixYwdDayFile = getComplaintDetailsFixYwdDayFile(day);
         if (!complaintDetailsFixYwdDayFile.exists()) {
-            stringBuffer.append("河北客户体验管理智能定责投诉明细月累计接口日 表账期 ").append(day).append(" 数据未到达");
+            stringBuffer.append("河北客户体验管理智能定责投诉明细月累计接口日 表账期 ").append(day).append(" 数据未到达\n");
         } else if (!checkMD5(complaintDetailsFixYwdDayFile)) {
-            stringBuffer.append("河北客户体验管理智能定责投诉明细月累计接口日 表账期 ").append(day).append(" MD5验证未通过");
+            stringBuffer.append("河北客户体验管理智能定责投诉明细月累计接口日 表账期 ").append(day).append(" MD5验证未通过\n");
         }
         // 河北客户体验管理系统移网网络体验明细日信息
         File cemMobileExperienceListFile = getCemMobileExperienceListFile(day);
         if (!cemMobileExperienceListFile.exists()) {
-            stringBuffer.append("河北客户体验管理系统移网网络体验明细日信息 表账期 ").append(day).append(" 数据未到达");
+            stringBuffer.append("河北客户体验管理系统移网网络体验明细日信息 表账期 ").append(day).append(" 数据未到达\n");
         } else if (!checkMD5(cemMobileExperienceListFile)) {
-            stringBuffer.append("河北客户体验管理系统移网网络体验明细日信息 表账期 ").append(day).append(" MD5验证未通过");
+            stringBuffer.append("河北客户体验管理系统移网网络体验明细日信息 表账期 ").append(day).append(" MD5验证未通过\n");
         }
         return stringBuffer.toString();
     }

+ 1 - 2
src/main/java/com/nokia/tsl_data/service/WorkFlowService.java

@@ -164,8 +164,7 @@ public class WorkFlowService {
 
     private List<Map<String, Object>> getTimeoutTsCountForDay(Instant start, Instant end) {
         Map<String, String> workFlowCityMap = sysDataDictionaryRepository.findWorkFlowCityMap();
-        List<Map<String, Object>> selectTimeoutTsCountForDay = workFlowDao.selectTimeoutTsCountForDay(start, end,
-                tslDataProperties.getDuration());
+        List<Map<String, Object>> selectTimeoutTsCountForDay = workFlowDao.selectTimeoutTsCountForDayV2(start, end);
         for (Map<String, Object> map : selectTimeoutTsCountForDay) {
             String city_id = (String) map.get("city_id");
             if (city_id.equals("全省")) {

+ 1 - 1
src/test/java/com/nokia/tsl_data/TslDataApplicationTest.java

@@ -18,7 +18,7 @@ class TslDataApplicationTest {
 
     @Test
     void test() {
-        taskService.generateReportV3("20240312");
+        taskService.generateReportV3("20240325");
     }
 
     @Autowired