Kaynağa Gözat

20240930 修改代码适配数据变化

lifuquan 3 ay önce
ebeveyn
işleme
53db5c4307

BIN
doc/客户安排的更新/20240711-更新7月以后的服请目标/2024年不满诉求考核测算V7.xlsx


BIN
doc/需求文档/2024年适配/2024年适配-工作量.xlsx


+ 5 - 8
pom.xml

@@ -4,19 +4,17 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
+    <groupId>com.nokia</groupId>
+    <artifactId>tsl-data</artifactId>
+    <version>2.3</version>
+
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-parent</artifactId>
-        <version>2.6.14</version>
+        <version>2.7.18</version>
         <relativePath />
     </parent>
 
-    <groupId>com.nokia</groupId>
-    <artifactId>tsl-data</artifactId>
-    <version>2.3</version>
-
-    <packaging>jar</packaging>
-
     <properties>
         <!-- 跳过测试代码 -->
         <skipTests>true</skipTests>
@@ -31,7 +29,6 @@
         <!-- 指定编译的版本 -->
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
-        <maven.compiler.compilerVersion>8</maven.compiler.compilerVersion>
         <!-- 指定maven-compiler-plugin的配置属性结束 -->
     </properties>
 

+ 19 - 4
src/main/java/com/nokia/tsl_data/service/ManagementDetailService.java

@@ -83,7 +83,11 @@ public class ManagementDetailService {
         for (Map<String, Object> map : cityTslForMonth) {
             int dayId = Integer.parseInt(map.get("day_id").toString());
             // 注意这里用的是赋值而不是add
-            result.get(map.get("compl_area_local").toString()).set(dayId - 1, map.get("num"));
+            // 20240930 增加逻辑,跳过省中心
+            String comp = map.get("compl_area_local").toString();
+            if (!"省中心".equals(comp)) {
+                result.get(comp).set(dayId - 1, map.get("num"));
+            }
         }
         List<Map<String, Object>> allTslForMonth = managementDetailMapper.selectAllTslForMonth(day);
         // 全省每日投诉量
@@ -95,7 +99,11 @@ public class ManagementDetailService {
         List<Map<String, Object>> cityAllForMonth = managementDetailMapper.selectCityAllForMonth(day);
         // 各地市投诉总量
         for (Map<String, Object> map : cityAllForMonth) {
-            result.get(map.get("compl_area_local").toString()).add(map.get("num"));
+            // 20240930 增加逻辑,跳过省中心
+            String comp = map.get("compl_area_local").toString();
+            if (!"省中心".equals(comp)) {
+                result.get(comp).add(map.get("num"));
+            }
         }
         // 全省总量
         int total = managementDetailMapper.selectAllForMonth(day);
@@ -229,7 +237,11 @@ public class ManagementDetailService {
         for (Map<String, Object> map : cityTslForMonth) {
             int dayId = Integer.parseInt(map.get("day_id").toString());
             // 注意这里用的是赋值而不是add
-            result.get(map.get("compl_area_local").toString()).set(dayId - 1, map.get("num"));
+            // 20240930 增加逻辑,跳过省中心
+            String comp = map.get("compl_area_local").toString();
+            if (!"省中心".equals(comp)) {
+                result.get(comp).set(dayId - 1, map.get("num"));
+            }
         }
         List<Map<String, Object>> allTslForMonth = mobileComplaintMapper.selectAll3GjwGroupByDayForMonth(day);
         // 全省每日投诉量
@@ -242,7 +254,10 @@ public class ManagementDetailService {
         // 各地市投诉总量
         for (Map<String, Object> map : cityAllForMonth) {
             // 20240602 修改为set
-            result.get(map.get("compl_area_local").toString()).set(dayIndex, map.get("num"));
+            String comp = map.get("compl_area_local").toString();
+            if (!"省中心".equals(comp)) {
+                result.get(comp).set(dayIndex, map.get("num"));
+            }
         }
         // 全省总量,
         int total = mobileComplaintMapper.selectAll3GjwForMonth(day);

+ 22 - 4
src/test/java/com/nokia/tsl_data/TslDataApplicationTest.java

@@ -1,6 +1,5 @@
 package com.nokia.tsl_data;
 
-import java.util.Arrays;
 import java.util.List;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +18,7 @@ class TslDataApplicationTest {
 
     @Test
     void test() {
-        taskService.generateReportV3("20240610");
+        taskService.generateReportV3("20240929");
     }
 
     @Autowired
@@ -27,12 +26,12 @@ class TslDataApplicationTest {
 
     @Test
     void test2() {
-        String path = "D:/abc.txt";
+        String path = "/data/abc.txt";
         List<String> lines = TextUtil.readLines(path, "utf8");
         lines.forEach(line -> {
             String[] split = line.split("\t");
             System.out.println(split[0] + "==" + split[2]);
-            userCountService.updateManagementUserCount("202405", split[0], Double.parseDouble(split[2]));
+            userCountService.updateManagementUserCount("202408", split[0], Double.parseDouble(split[2]));
         });
     }
 
@@ -55,4 +54,23 @@ class TslDataApplicationTest {
         });
     }
 
+    @Test
+    void test4() {
+        String path = "D:/data/abc.txt";
+        List<String> lines = TextUtil.readLines(path, "utf8");
+        lines.forEach(line -> {
+            String[] split = line.split("\t");
+            for (int i = 1; i < split.length; i++) {
+                String city = split[0];
+                String month = i < 10 ? "20240" + i : "2024" + i;
+                Double target = Double.parseDouble(split[i]);
+                System.out.println("地市: " + city + "  月分: " + month + "  率值: " + target);
+                if (i >= 7) {
+                    targetTsRatioMapper.updateServiceRequestTargetRatio(month, city, target);
+                }
+                // targetTsRatioMapper.updateManagementTargetRatio(month, city, target);
+            }
+        });
+    }
+
 }