Explorar el Código

增加了移网感知服务请求率的新版本

“lifuquan” hace 1 año
padre
commit
2a03d818bd
Se han modificado 37 ficheros con 975 adiciones y 610 borrados
  1. 1 0
      .gitignore
  2. 41 6
      doc/开发环境/2023年适配/2024年适配.md
  3. 0 20
      doc/开发环境/RegisteredTaskController接口测试.http
  4. 0 116
      doc/开发环境/ScheduledTaskController接口测试.http
  5. 252 0
      doc/开发环境/任务分析.md
  6. 0 103
      doc/开发环境/任务注册和调度-开发环境.http
  7. BIN
      doc/数据订阅/客户提供/2024年日报考核指标修改20240106.xlsx
  8. 14 0
      doc/数据订阅/客户提供/abc.txt
  9. BIN
      doc/数据订阅/客户提供/各区县用户数_增加区县编码-12月.xlsx
  10. 67 0
      doc/数据订阅/客户提供/更新用户数等.md
  11. BIN
      doc/数据订阅/能力商店/河北客户体验管理系统移网网络体验明细日信息/.~XLSX 工作表.xlsx
  12. BIN
      doc/数据订阅/能力商店/河北客户体验管理系统移网网络体验明细日信息/河北客户体验管理系统移网网络体验明细日信息_HE_D_CEM_MOBILE_EXPERIENCE_LIST.xlsx
  13. 1 5
      src/main/java/com/nokia/tsl_data/config/TslDataConfig.java
  14. 27 0
      src/main/java/com/nokia/tsl_data/controller/DataWarehouseController.java
  15. 61 0
      src/main/java/com/nokia/tsl_data/dao/CemMobileExperienceListMapper.java
  16. 17 19
      src/main/java/com/nokia/tsl_data/dao/TargetTsRatioMapper.java
  17. 23 0
      src/main/java/com/nokia/tsl_data/dao/TslDataDao.java
  18. 0 9
      src/main/java/com/nokia/tsl_data/dao/UserResidentRepository.java
  19. 0 18
      src/main/java/com/nokia/tsl_data/entity/TargetTsRatio.java
  20. 0 39
      src/main/java/com/nokia/tsl_data/entity/UserResident.java
  21. 0 46
      src/main/java/com/nokia/tsl_data/properties/DataWarehouseProperties.java
  22. 0 12
      src/main/java/com/nokia/tsl_data/properties/OutputProperties.java
  23. 0 19
      src/main/java/com/nokia/tsl_data/properties/TargetProperties.java
  24. 61 0
      src/main/java/com/nokia/tsl_data/properties/TslDataProperties.java
  25. 118 0
      src/main/java/com/nokia/tsl_data/service/CemMobileExperienceListService.java
  26. 84 16
      src/main/java/com/nokia/tsl_data/service/DataWarehouseService.java
  27. 18 18
      src/main/java/com/nokia/tsl_data/service/HighQualityCountService.java
  28. 6 5
      src/main/java/com/nokia/tsl_data/service/HighQualityDataService.java
  29. 3 7
      src/main/java/com/nokia/tsl_data/service/ManagementDetailService.java
  30. 17 17
      src/main/java/com/nokia/tsl_data/service/ReportServiceV1.java
  31. 138 1
      src/main/java/com/nokia/tsl_data/service/ReportServiceV3.java
  32. 2 2
      src/main/java/com/nokia/tsl_data/service/TaskService.java
  33. 14 15
      src/main/java/com/nokia/tsl_data/service/TslDataService.java
  34. 0 107
      src/main/java/com/nokia/tsl_data/service/UserResidentWareHouseService.java
  35. 6 6
      src/main/java/com/nokia/tsl_data/service/WorkFlowService.java
  36. 2 3
      src/main/java/com/nokia/tsl_data/util/DateFormatUtil.java
  37. 2 1
      src/test/java/com/nokia/tsl_data/TslDataApplicationTest.java

+ 1 - 0
.gitignore

@@ -19,5 +19,6 @@
 
 
 # office临时文件
 # office临时文件
 **/~$*
 **/~$*
+**/.~*
 # draio临时文件
 # draio临时文件
 **/.$*
 **/.$*

+ 41 - 6
doc/开发环境/2023年适配/2024年适配.md

@@ -157,7 +157,7 @@ from t1 group by real_name order by real_name
 POST http://192.168.10.7:22222/tsl_data/report/generate/v3
 POST http://192.168.10.7:22222/tsl_data/report/generate/v3
 Content-Type: application/json
 Content-Type: application/json
 
 
-20240104
+20240105
 ```
 ```
 
 
 ### 2. 数据入库
 ### 2. 数据入库
@@ -168,7 +168,7 @@ Content-Type: application/json
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/mobile_complaint
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/mobile_complaint
 Content-Type: application/json
 Content-Type: application/json
 
 
-20240104
+20240105
 ```
 ```
 
 
 ### 2.2 high_quality_count
 ### 2.2 high_quality_count
@@ -177,7 +177,7 @@ Content-Type: application/json
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_count
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_count
 Content-Type: application/json
 Content-Type: application/json
 
 
-20240104
+20240105
 ```
 ```
 
 
 ### 2.3 high_quality_list
 ### 2.3 high_quality_list
@@ -186,7 +186,7 @@ Content-Type: application/json
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_list
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/high_quality_list
 Content-Type: application/json
 Content-Type: application/json
 
 
-20240104
+20240105
 ```
 ```
 
 
 ### 2.4 complaint_details_fix_ywd
 ### 2.4 complaint_details_fix_ywd
@@ -195,7 +195,7 @@ Content-Type: application/json
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/complaint_details_fix_ywd
 POST http://192.168.10.7:22222/tsl_data/source/warehouse/complaint_details_fix_ywd
 Content-Type: application/json
 Content-Type: application/json
 
 
-20240104
+20240105
 ```
 ```
 
 
 ### 2.5 management_detail
 ### 2.5 management_detail
@@ -204,7 +204,7 @@ Content-Type: application/json
 POST http://192.168.10.7:22222/tsl_data/source/update/management_detail
 POST http://192.168.10.7:22222/tsl_data/source/update/management_detail
 Content-Type: application/json
 Content-Type: application/json
 
 
-20240104
+20240105
 ```
 ```
 
 
 ### 2.6 highQualityData
 ### 2.6 highQualityData
@@ -223,3 +223,38 @@ POST http://192.168.10.7:22222/tsl_data/source/update/work_flow_basic_data
 Content-Type: application/json
 Content-Type: application/json
 
 
 ```
 ```
+
+### 2.8 cem_mobile_experience_list
+
+```http
+POST http://192.168.10.7:22222/tsl_data/source/warehouse/cem_mobile_experience_list
+Content-Type: application/json
+
+20240108
+```
+
+## 取消sheet2客户端考核, 新增 服务请求压降
+
+```sql
+create table tsl_data.cem_mobile_experience_list (
+  id bigserial NOT null,
+  month_id varchar(6) null,
+  day_id varchar(2) null,
+  service_id varchar(300) null,
+  contact_id varchar(300) null,
+  create_time varchar(8) null,
+  mobile_no varchar(300) null,
+  service_type_name1 varchar(300) null,
+  pro_name varchar(30) null,
+  code_cust_area varchar(30) null,
+  zyx varchar(300) null,
+  lwly_name varchar(300) null,
+  big_type_name varchar(300) null,
+  small_type_name varchar(300) null,
+  acct_month varchar(24) null,
+  day_id1 varchar(6) null,
+  sheet_no varchar(300) null,
+  compl_city_local varchar(300) null,
+  CONSTRAINT cem_mobile_experience_list_pkey PRIMARY KEY (id)
+)
+```

+ 0 - 20
doc/开发环境/RegisteredTaskController接口测试.http

@@ -1,20 +0,0 @@
-### 任务注册-查询列表
-POST http://127.0.0.1:9999/common/scheduling/task/registered/list/all
-Content-Type: application/json
-
-### 任务注册-新增
-POST http://127.0.0.1:9999/common/scheduling/task/registered/add
-Content-Type: application/json
-
-{
-"beanName": "demoService",
-"methodName": "test1",
-"withParameter": false,
-"description": "测试用..."
-}
-
-### 任务注册-删除
-POST http://127.0.0.1:22222/common/scheduling/task/registered/delete
-Content-Type: application/json
-
-211340469899235328

+ 0 - 116
doc/开发环境/ScheduledTaskController接口测试.http

@@ -1,116 +0,0 @@
-### 任务调度==查询全部
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/list/all
-Content-Type: application/json
-
-### 任务调度==查询正在调度的任务
-POST http://127.0.0.1:9999/common/scheduling/task/scheduled/list/scheduled
-Content-Type: application/json
-
-### 任务调度==删除
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/delete
-Content-Type: application/json
-
-211537692419297280
-
-### 任务调度==更新
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/update
-Content-Type: application/json
-
-{
-  "id": 211596024697982976,
-  "registeredTask": {
-    "id": 211593346244808704
-  },
-  "status": "ON",
-  "description": "abc"
-}
-
-### 任务调度==新增 1. 新增马上调度
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 211528578876182528
-  },
-  "status": "ON",
-  "scheduledType": "IMMEDIATELY",
-  "description": "测试用..."
-}
-
-### 2. 新增单次调度
-POST http://127.0.0.1:9999/demo/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 2
-  },
-  "status": "ON",
-  "scheduledType": "ONCE",
-  "methodParameter": "abc",
-  "scheduledParameter": {
-    "startTime": "2023-11-27 17:04:00"
-  }
-}
-
-### 2. 新增单次调度2
-POST http://127.0.0.1:9999/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 213707591296094208
-  },
-  "status": "ON",
-  "scheduledType": "ONCE",
-  "methodParameter": "abc",
-  "scheduledParameter": {
-    "delayOfSeconds": 5
-  }
-}
-
-### 3. 新增定时调度
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 211593346244808704
-  },
-  "status": "ON",
-  "scheduledType": "CRON",
-  "scheduledParameter": {
-    "cronExpression": "0 15 14 * * *"
-  }
-}
-
-### 4. 新增周期调度
-POST http://127.0.0.1:9999/demo/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 1
-  },
-  "status": "ON",
-  "scheduledType": "INTERVAL",
-  "scheduledParameter": {
-    "periodOfSeconds": 15
-  }
-}
-
-### 5. 新增固定延时调度
-POST http://127.0.0.1:9999/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 213707591296094208
-  },
-  "status": "ON",
-  "scheduledType": "FIXED_DELAY",
-  "scheduledParameter": {
-    "delayOfSeconds": 15
-  }
-}

+ 252 - 0
doc/开发环境/任务分析.md

@@ -54,3 +54,255 @@ select stat_day_id, count(1)
 from tsl_data.management_detail md 
 from tsl_data.management_detail md 
 group by stat_day_id 
 group by stat_day_id 
 ```
 ```
+
+## 接口测试记录
+
+```http
+### 任务调度==查询全部
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/list/all
+Content-Type: application/json
+
+### 任务调度==查询正在调度的任务
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/list/scheduled
+Content-Type: application/json
+
+### 任务调度-每天定时出报表
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 211648899235057664
+  },
+  "status": "ON",
+  "scheduledType": "CRON",
+  "scheduledParameter": {
+    "cronExpression": "0 45 13 * * *"
+  },
+  "description": "每天定时出报表"
+}
+
+### 任务调度-每天定时清理临时表
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 211598274090635264
+  },
+  "status": "ON",
+  "scheduledType": "CRON",
+  "scheduledParameter": {
+    "cronExpression": "0 15 14 * * *"
+  },
+  "description": "每天定时清理临时表"
+}
+
+### 任务调度-每小时从工单系统更新数据
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 211598274090635264
+  },
+  "status": "ON",
+  "scheduledType": "CRON",
+  "scheduledParameter": {
+    "cronExpression": "0 5 * * * *"
+  },
+  "description": "每小时从工单系统更新数据"
+}
+
+### 任务注册-查询列表
+POST http://127.0.0.1:22222/common/scheduling/task/registered/list/all
+Content-Type: application/json
+
+### 任务注册-清理临时表
+POST http://127.0.0.1:22222/common/scheduling/task/registered/add
+Content-Type: application/json
+
+{
+  "beanName": "taskService",
+  "methodName": "tempTableCleanCronTask",
+  "withParameter": false,
+  "description": "清理临时表"
+}
+
+### 任务注册-从工单系统更新数据
+POST http://127.0.0.1:22222/common/scheduling/task/registered/add
+Content-Type: application/json
+
+{
+  "beanName": "taskService",
+  "methodName": "updateWorkFlowBasicDataTask",
+  "withParameter": false,
+  "description": "从工单系统更新数据"
+}
+
+### 任务注册- 入库-生成报表-截图 单次任务
+POST http://127.0.0.1:22222/common/scheduling/task/registered/add
+Content-Type: application/json
+
+{
+  "beanName": "taskService",
+  "methodName": "wareHouseTask",
+  "withParameter": true,
+  "description": "入库-生成报表-截图"
+}
+
+### 任务注册- 入库-生成报表-截图 定时任务
+POST http://127.0.0.1:22222/common/scheduling/task/registered/add
+Content-Type: application/json
+
+{
+  "beanName": "taskService",
+  "methodName": "dailyWarehouseTask",
+  "withParameter": false,
+  "description": "入库-生成报表-截图 定时任务"
+}
+
+```
+
+```http
+### 任务注册-查询列表
+POST http://127.0.0.1:9999/common/scheduling/task/registered/list/all
+Content-Type: application/json
+
+### 任务注册-新增
+POST http://127.0.0.1:9999/common/scheduling/task/registered/add
+Content-Type: application/json
+
+{
+"beanName": "demoService",
+"methodName": "test1",
+"withParameter": false,
+"description": "测试用..."
+}
+
+### 任务注册-删除
+POST http://127.0.0.1:22222/common/scheduling/task/registered/delete
+Content-Type: application/json
+
+211340469899235328
+```
+
+```http
+### 任务调度==查询全部
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/list/all
+Content-Type: application/json
+
+### 任务调度==查询正在调度的任务
+POST http://127.0.0.1:9999/common/scheduling/task/scheduled/list/scheduled
+Content-Type: application/json
+
+### 任务调度==删除
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/delete
+Content-Type: application/json
+
+211537692419297280
+
+### 任务调度==更新
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/update
+Content-Type: application/json
+
+{
+  "id": 211596024697982976,
+  "registeredTask": {
+    "id": 211593346244808704
+  },
+  "status": "ON",
+  "description": "abc"
+}
+
+### 任务调度==新增 1. 新增马上调度
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 211528578876182528
+  },
+  "status": "ON",
+  "scheduledType": "IMMEDIATELY",
+  "description": "测试用..."
+}
+
+### 2. 新增单次调度
+POST http://127.0.0.1:9999/demo/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 2
+  },
+  "status": "ON",
+  "scheduledType": "ONCE",
+  "methodParameter": "abc",
+  "scheduledParameter": {
+    "startTime": "2023-11-27 17:04:00"
+  }
+}
+
+### 2. 新增单次调度2
+POST http://127.0.0.1:9999/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 213707591296094208
+  },
+  "status": "ON",
+  "scheduledType": "ONCE",
+  "methodParameter": "abc",
+  "scheduledParameter": {
+    "delayOfSeconds": 5
+  }
+}
+
+### 3. 新增定时调度
+POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 211593346244808704
+  },
+  "status": "ON",
+  "scheduledType": "CRON",
+  "scheduledParameter": {
+    "cronExpression": "0 15 14 * * *"
+  }
+}
+
+### 4. 新增周期调度
+POST http://127.0.0.1:9999/demo/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 1
+  },
+  "status": "ON",
+  "scheduledType": "INTERVAL",
+  "scheduledParameter": {
+    "periodOfSeconds": 15
+  }
+}
+
+### 5. 新增固定延时调度
+POST http://127.0.0.1:9999/common/scheduling/task/scheduled/add
+Content-Type: application/json
+
+{
+  "registeredTask": {
+    "id": 213707591296094208
+  },
+  "status": "ON",
+  "scheduledType": "FIXED_DELAY",
+  "scheduledParameter": {
+    "delayOfSeconds": 15
+  }
+}
+
+```

+ 0 - 103
doc/开发环境/任务注册和调度-开发环境.http

@@ -1,103 +0,0 @@
-### 任务调度==查询全部
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/list/all
-Content-Type: application/json
-
-### 任务调度==查询正在调度的任务
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/list/scheduled
-Content-Type: application/json
-
-### 任务调度-每天定时出报表
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 211648899235057664
-  },
-  "status": "ON",
-  "scheduledType": "CRON",
-  "scheduledParameter": {
-    "cronExpression": "0 45 13 * * *"
-  },
-  "description": "每天定时出报表"
-}
-
-### 任务调度-每天定时清理临时表
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 211598274090635264
-  },
-  "status": "ON",
-  "scheduledType": "CRON",
-  "scheduledParameter": {
-    "cronExpression": "0 15 14 * * *"
-  },
-  "description": "每天定时清理临时表"
-}
-
-### 任务调度-每小时从工单系统更新数据
-POST http://127.0.0.1:22222/common/scheduling/task/scheduled/add
-Content-Type: application/json
-
-{
-  "registeredTask": {
-    "id": 211598274090635264
-  },
-  "status": "ON",
-  "scheduledType": "CRON",
-  "scheduledParameter": {
-    "cronExpression": "0 5 * * * *"
-  },
-  "description": "每小时从工单系统更新数据"
-}
-
-### 任务注册-查询列表
-POST http://127.0.0.1:22222/common/scheduling/task/registered/list/all
-Content-Type: application/json
-
-### 任务注册-清理临时表
-POST http://127.0.0.1:22222/common/scheduling/task/registered/add
-Content-Type: application/json
-
-{
-  "beanName": "taskService",
-  "methodName": "tempTableCleanCronTask",
-  "withParameter": false,
-  "description": "清理临时表"
-}
-
-### 任务注册-从工单系统更新数据
-POST http://127.0.0.1:22222/common/scheduling/task/registered/add
-Content-Type: application/json
-
-{
-  "beanName": "taskService",
-  "methodName": "updateWorkFlowBasicDataTask",
-  "withParameter": false,
-  "description": "从工单系统更新数据"
-}
-
-### 任务注册- 入库-生成报表-截图 单次任务
-POST http://127.0.0.1:22222/common/scheduling/task/registered/add
-Content-Type: application/json
-
-{
-  "beanName": "taskService",
-  "methodName": "wareHouseTask",
-  "withParameter": true,
-  "description": "入库-生成报表-截图"
-}
-
-### 任务注册- 入库-生成报表-截图 定时任务
-POST http://127.0.0.1:22222/common/scheduling/task/registered/add
-Content-Type: application/json
-
-{
-  "beanName": "taskService",
-  "methodName": "dailyWarehouseTask",
-  "withParameter": false,
-  "description": "入库-生成报表-截图 定时任务"
-}

BIN
doc/数据订阅/客户提供/2024年日报考核指标修改20240106.xlsx


+ 14 - 0
doc/数据订阅/客户提供/abc.txt

@@ -0,0 +1,14 @@
+石家庄	18.0	23.0	24.7	25.7	23.1	25.7	25.7	24.6	21.7	17.7	17.6	21.8
+唐山	17.6	19.5	21.4	19.8	20.8	19.8	19.8	22.0	19.7	16.8	15.6	20.2
+秦皇岛	17.4	16.8	21.0	20.4	20.6	20.4	20.4	20.1	18.3	15.8	16.9	23.2
+邯郸	15.3	16.2	17.9	17.9	18.0	17.9	17.9	17.4	16.3	13.6	13.1	20.1
+邢台	13.3	14.6	15.6	16.0	18.2	16.0	16.0	17.4	16.0	13.5	13.0	17.8
+保定	19.2	22.2	19.7	21.0	21.2	21.0	21.0	26.7	20.5	16.5	15.3	18.1
+张家口	14.7	14.4	16.2	18.9	19.9	18.9	18.9	19.7	15.9	13.2	12.0	15.3
+承德	17.7	18.0	21.6	24.5	24.0	24.5	24.5	25.4	19.7	17.0	15.9	21.0
+廊坊	16.4	16.9	19.5	20.5	21.5	20.5	20.5	22.3	17.7	15.2	14.1	16.3
+沧州	15.5	17.4	18.2	21.5	25.6	21.5	21.5	19.3	16.8	15.3	13.7	16.1
+衡水	13.9	14.7	15.0	17.0	16.4	17.0	17.0	17.4	13.3	11.2	10.0	13.2
+雄安	12.5	14.3	14.9	17.5	18.2	17.5	17.5	16.8	12.9	10.8	10.8	13.9
+全省	17.3	21.1	21.9	22.6	22.8	16.6	18.0	23.7	19.1	16.1	15.2	19.5
+

BIN
doc/数据订阅/客户提供/各区县用户数_增加区县编码-12月.xlsx


+ 67 - 0
doc/数据订阅/客户提供/更新用户数等.md

@@ -0,0 +1,67 @@
+# 更新
+
+## 更新用户数
+
+```java
+@Autowired
+private UserCountService userCountService;
+
+@Test
+void test2() {
+    String path = "/home/lfq/Documents/code/tsl-data/doc/数据订阅/客户提供/abc.txt";
+    List<String> lines = TextUtil.readLines(path);
+    lines.forEach(
+        line -> {
+            String[] split = line.split("\t");
+            userCountService.updateManagementUserCount("202401", split[0], Double.parseDouble(split[2]));
+            System.out.println(Arrays.toString(split));
+        }
+    );
+}
+```
+
+## 更新移网感知万投比
+
+```java
+@Autowired
+private TargetTsRatioMapper targetTsRatioMapper;
+
+@Test
+void test2() {
+    String path = "/home/lfq/Documents/code/tsl-data/doc/数据订阅/客户提供/abc.txt";
+    List<String> lines = TextUtil.readLines(path);
+    lines.forEach(line -> {
+        String[] split = line.split("\t");
+        String city = split[0];
+        for (int i = 1; i < split.length; i++) {
+            String month = "2024" + (i >= 10 ? i : "0" + i);
+            double target = Double.parseDouble(split[i]);
+            System.out.println(city + "==" + month + "==" + target);
+            targetTsRatioMapper.updateManagementTargetRatio(month, city, target);
+        }
+    });
+}
+```
+
+## 更新移网感知服务请求率 service_request_target_ratio
+
+```java
+@Autowired
+private TargetTsRatioMapper targetTsRatioMapper;
+
+@Test
+void test2() {
+    String path = "/home/lfq/Documents/code/tsl-data/doc/数据订阅/客户提供/abc.txt";
+    List<String> lines = TextUtil.readLines(path);
+    lines.forEach(line -> {
+        String[] split = line.split("\t");
+        String city = split[0];
+        for (int i = 1; i < split.length; i++) {
+            String month = "2024" + (i >= 10 ? i : "0" + i);
+            double target = Double.parseDouble(split[i]);
+            System.out.println(city + "==" + month + "==" + target);
+            targetTsRatioMapper.updateServiceRequestTargetRatio(month, city, target);
+        }
+    });
+}
+```

BIN
doc/数据订阅/能力商店/河北客户体验管理系统移网网络体验明细日信息/.~XLSX 工作表.xlsx


BIN
doc/数据订阅/能力商店/河北客户体验管理系统移网网络体验明细日信息/河北客户体验管理系统移网网络体验明细日信息_HE_D_CEM_MOBILE_EXPERIENCE_LIST.xlsx


+ 1 - 5
src/main/java/com/nokia/tsl_data/config/TslDataConfig.java

@@ -1,8 +1,5 @@
 package com.nokia.tsl_data.config;
 package com.nokia.tsl_data.config;
 
 
-import com.nokia.tsl_data.properties.TargetProperties;
-import com.nokia.tsl_data.properties.DataWarehouseProperties;
-import com.nokia.tsl_data.properties.OutputProperties;
 import com.nokia.tsl_data.properties.TslDataProperties;
 import com.nokia.tsl_data.properties.TslDataProperties;
 import com.zaxxer.hikari.HikariConfig;
 import com.zaxxer.hikari.HikariConfig;
 import com.zaxxer.hikari.HikariDataSource;
 import com.zaxxer.hikari.HikariDataSource;
@@ -18,8 +15,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
 
 
 @Configuration
 @Configuration
 @EnableScheduling
 @EnableScheduling
-@EnableConfigurationProperties({ TslDataProperties.class, DataWarehouseProperties.class, OutputProperties.class,
-        TargetProperties.class })
+@EnableConfigurationProperties(TslDataProperties.class)
 public class TslDataConfig {
 public class TslDataConfig {
 
 
     private final int poolSize = 3;
     private final int poolSize = 3;

+ 27 - 0
src/main/java/com/nokia/tsl_data/controller/DataWarehouseController.java

@@ -159,6 +159,33 @@ public class DataWarehouseController {
         }
         }
     }
     }
 
 
+    @PostMapping("warehouse/cem_mobile_experience_list")
+    public R warehouseCemMobileExperienceList(@RequestBody String day) {
+        try {
+            dataWarehouseService.warehouseCemMobileExperienceList(day);
+            return R.ok().message(String.format("管理端详表 ComplaintDetailsFix(河北客户体验管理智能定责投诉明细月累计接口日) 数据账期 %s 入库成功", day));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            e.printStackTrace();
+            return R.error().message(String.format("管理端详表 ComplaintDetailsFix(河北客户体验管理智能定责投诉明细月累计接口日) 数据账期 %s 入库失败: %s",
+                    day, e.getMessage()));
+        }
+    }
+
+    @PostMapping("delete/cem_mobile_experience_list")
+    public R deleteCemMobileExperienceList(@RequestBody String day) {
+        try {
+            int count = dataWarehouseService.deleteCemMobileExperienceList(day);
+            return R.ok().message(
+                    String.format("CemMobileExperienceList(河北客户体验管理系统移网网络体验明细日信息) 数据账期 %s 删除 %s 条", day, count));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            e.printStackTrace();
+            return R.error().message(String.format("CemMobileExperienceList(河北客户体验管理系统移网网络体验明细日信息) 数据账期 %s 删除失败: %s",
+                    day, e.getMessage()));
+        }
+    }
+
     @PostMapping("update/management_detail")
     @PostMapping("update/management_detail")
     public R updateManagementDetail(@RequestBody String day) {
     public R updateManagementDetail(@RequestBody String day) {
         try {
         try {

+ 61 - 0
src/main/java/com/nokia/tsl_data/dao/CemMobileExperienceListMapper.java

@@ -0,0 +1,61 @@
+package com.nokia.tsl_data.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface CemMobileExperienceListMapper {
+    
+    @Select("select count(1) from tsl_data.cem_mobile_experience_list where month_id = #{month_id} and day_id = #{day_id}")
+    int countForDay(@Param("month_id") String monthId, @Param("day_id") String dayId);
+
+    default int countForDay(String day) {
+        return countForDay(day.substring(0, 6), day.substring(6));
+    }
+
+    @Select("select day_id1 as day_id , code_cust_area as city, count(1) as num\n" + //
+            " from tsl_data.cem_mobile_experience_list cmel\n" + //
+            " where month_id = #{monthId} and day_id = #{dayId} and code_cust_area != '异地'\n" + //
+            " group by day_id1, code_cust_area\n" + //
+            " order by day_id1, code_cust_area")
+    List<Map<String, Object>> selectCityCountForStat(@Param("monthId") String monthId, @Param("dayId") String dayId);
+
+    default List<Map<String, Object>> selectCityCountForStat(String day){
+        return selectCityCountForStat(day.substring(0,6), day.substring(6));
+    } 
+
+    @Select("select day_id1 as day_id, count(1) as num \n" + //
+            " from tsl_data.cem_mobile_experience_list cmel\n" + //
+            " where month_id = #{monthId} and day_id = #{dayId} and code_cust_area != '异地'\n" + //
+            " group by day_id1 " + //
+            " order by day_id1 ")
+    List<Map<String, Object>> selectAllCountForStat(@Param("monthId") String monthId, @Param("dayId") String dayId);
+
+    default List<Map<String, Object>> selectAllCountForStat(String day){
+        return selectAllCountForStat(day.substring(0,6), day.substring(6));
+    }
+
+    @Select("select code_cust_area as city, count(1) as num\n" + //
+            " from tsl_data.cem_mobile_experience_list cmel\n" + //
+            " where month_id = #{monthId} and day_id = #{dayId} and code_cust_area != '异地'\n" + //
+            " group by code_cust_area\n" + //
+            " order by code_cust_area")
+    List<Map<String, Object>> selectCityAllForStat(@Param("monthId") String monthId, @Param("dayId") String dayId);
+
+    default List<Map<String, Object>> selectCityAllForStat(String day){
+        return selectCityAllForStat(day.substring(0,6), day.substring(6));
+    } 
+
+    @Select("select count(1)\n" + //
+            " from tsl_data.cem_mobile_experience_list cmel\n" + //
+            " where month_id = #{monthId} and day_id = #{dayId} and code_cust_area != '异地'")
+    int selectCountForStat(@Param("monthId") String monthId, @Param("dayId") String dayId);
+
+    default int selectCountForStat(String day){
+        return selectCountForStat(day.substring(0,6), day.substring(6));
+    }
+}

+ 17 - 19
src/main/java/com/nokia/tsl_data/dao/TargetTsRatioMapper.java

@@ -1,30 +1,28 @@
 package com.nokia.tsl_data.dao;
 package com.nokia.tsl_data.dao;
 
 
-import com.nokia.tsl_data.entity.TargetTsRatio;
+import java.util.List;
+import java.util.Map;
 
 
-import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Results;
-import org.apache.ibatis.annotations.Result;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
+import org.apache.ibatis.annotations.Update;
 
 
 @Mapper
 @Mapper
 public interface TargetTsRatioMapper {
 public interface TargetTsRatioMapper {
 
 
-    @Results(id = "targetTsRatioResults", value = {
-            @Result(property = "id", column = "id", id = true),
-            @Result(property = "cityName", column = "city_name"),
-            @Result(property = "monthId", column = "month_id"),
-            @Result(property = "managementTargetRatio", column = "management_target_ratio"),
-            @Result(property = "customerTargetRatio", column = "customer_target_ratio")
-    })
-    @Select("select * from tsl_data.target_ts_ratio where month_id = #{monthId}")
-    List<TargetTsRatio> findByMonthId(String monthId);
+        @Select("select * from tsl_data.target_ts_ratio where month_id = #{monthId}")
+        List<Map<String, Object>> findByMonthId(String monthId);
+
+        @Update("UPDATE tsl_data.target_ts_ratio\n" + //
+                        " SET management_target_ratio = #{target} \n" + //
+                        " WHERE month_id = #{monthId} and city_name = #{city} ")
+        void updateManagementTargetRatio(@Param("monthId") String monthId,
+                        @Param("city") String city, @Param("target") double target);
 
 
-    @Insert("INSERT INTO tsl_data.target_ts_ratio\n" + //
-            "(city_name, customer_target_ratio, management_target_ratio, month_id)\n" + //
-            "VALUES(#{cityName}, #{customerTargetRatio}, #{managementTargetRatio}, #{monthId});")
-    void insertOne(TargetTsRatio targetTsRatio);
+        @Update("UPDATE tsl_data.target_ts_ratio\n" + //
+                        " SET service_request_target_ratio = #{target} \n" + //
+                        " WHERE month_id = #{monthId} and city_name = #{city} ")
+        void updateServiceRequestTargetRatio(@Param("monthId") String monthId,
+                        @Param("city") String city, @Param("target") double target);
 }
 }

+ 23 - 0
src/main/java/com/nokia/tsl_data/dao/TslDataDao.java

@@ -228,4 +228,27 @@ public class TslDataDao {
             ps.setString(2, day.substring(6, 8));
             ps.setString(2, day.substring(6, 8));
         });
         });
     }
     }
+
+    /**
+     * 河北客户体验管理系统移网网络体验明细日信息 cem_mobile_experience_list 数据入库
+     */
+    public void batchInsertCemMobileExperienceList(List<Object[]> data) {
+        String sql = "INSERT INTO tsl_data.cem_mobile_experience_list " + //
+                "(month_id, day_id, service_id, contact_id, create_time, mobile_no, service_type_name1,"+
+                " pro_name, code_cust_area, zyx, lwly_name, big_type_name, small_type_name, acct_month,"+
+                " day_id1, sheet_no, compl_city_local) " + //
+                "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
+        jdbcTemplate.batchUpdate(sql, data);
+    }
+
+    /**
+     * 河北客户体验管理系统移网网络体验明细日信息 cem_mobile_experience_list 按照帐期清空
+     */
+    public int deleteCemMobileExperienceList(String day) {
+        String sql = "delete from tsl_data.cem_mobile_experience_list where month_id = ? and day_id = ?";
+        return jdbcTemplate.update(sql, (ps) -> {
+            ps.setString(1, day.substring(0, 6));
+            ps.setString(2, day.substring(6, 8));
+        });
+    }
 }
 }

+ 0 - 9
src/main/java/com/nokia/tsl_data/dao/UserResidentRepository.java

@@ -1,9 +0,0 @@
-package com.nokia.tsl_data.dao;
-
-import com.nokia.tsl_data.entity.UserResident;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface UserResidentRepository extends JpaRepository<UserResident, Long> {
-}

+ 0 - 18
src/main/java/com/nokia/tsl_data/entity/TargetTsRatio.java

@@ -1,18 +0,0 @@
-package com.nokia.tsl_data.entity;
-
-import lombok.Data;
-
-/**
- * 目标率值
- */
-@Data
-public class TargetTsRatio {
-
-    private Long id;
-    private String monthId;
-    private String cityName;
-    // 管理端目标值
-    private Double managementTargetRatio;
-    // 客户端目标值
-    private Double customerTargetRatio;
-}

+ 0 - 39
src/main/java/com/nokia/tsl_data/entity/UserResident.java

@@ -1,39 +0,0 @@
-package com.nokia.tsl_data.entity;
-
-import lombok.Data;
-
-import javax.persistence.*;
-import java.sql.Date;
-
-/**
- * 用户常驻小区
- */
-@Data
-@Entity
-@Table(name = "user_resident", schema = "public")
-public class UserResident {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private Long id;
-
-    @Column(name = "month_id", columnDefinition = "text", nullable = false)
-    private String monthId;
-
-    @Column(name = "day_id", columnDefinition = "text", nullable = false)
-    private String dayId;
-
-    @Column(name = "area_no", columnDefinition = "text", nullable = false)
-    private String areaNo;
-
-    @Column(name = "device_number", columnDefinition = "text", nullable = false)
-    private String deviceNumber;
-
-    @Column(name = "lac", columnDefinition = "text", nullable = true)
-    private String lac;
-
-    @Column(name = "ci", columnDefinition = "text", nullable = true)
-    private String ci;
-
-    @Column(name = "last_modify", columnDefinition = "timestamp default now()", nullable = true)
-    private Date lastModify;
-}

+ 0 - 46
src/main/java/com/nokia/tsl_data/properties/DataWarehouseProperties.java

@@ -1,46 +0,0 @@
-package com.nokia.tsl_data.properties;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@Data
-@ConfigurationProperties(prefix = "tsl.source")
-public class DataWarehouseProperties {
-
-    /**
-     * 河北_CEM高品质2日详表
-     */
-    // HighQualityListDay 文件存储路径
-    private String dirOfHighQualityListDay = "/data/nenglishangdian/high_quality_list_day";
-    // HighQualityListDay 文件前缀
-    private String prefixOfHighQualityListDay = "HE_D_HIGH_QUALITY_LIST_DAY_1114200095151828992_";
-    // HighQualityListDay 字段数量
-    private Integer filedNumOfHighQualityListDay = 70;
-
-    /**
-     * 河北_CEM高品质2日统计
-     */
-    // HighQualityCountDay 文件存储路径
-    private String dirOfHighQualityCountDay = "/data/nenglishangdian/high_quality_count/";
-    // HighQualityCountDay 文件前缀
-    private String prefixOfHighQualityCountDay = "HE_D_HIGH_QUALITY_COUNT_DAY_1087387382887477248_";
-    // HighQualityCountDay 字段数量
-    private Integer filedNumOfHighQualityCountDay = 33;
-
-    /**
-     * 河北_CEM移网质量投诉明细
-     */
-    // HighQualityCountDay 文件存储路径
-    private String dirOfMobileComplaint = "/data/nenglishangdian/mobile_complaint/";
-    // HighQualityCountDay 文件前缀
-    private String prefixOfMobileComplaint = "HE_D_MOBILE_COMPLAINT_DETAILS_DAY_1087468015013851136_";
-    // HighQualityCountDay 字段数量
-    private Integer filedNumOfMobileComplaintDay = 47;
-
-    /**
-     * 河北客户体验管理智能定责投诉明细月累计接口日
-     */
-    private String dirOfComplaintDetailsFixYwdDay = "/data/nenglishangdian/complaint_details_fix_ywd_day/";
-    private String prefixOfComplaintDetailsFixYwdDay = "HE_D_COMPLAINT_DETAILS_FIX_YWD_DAY_1186327221372567552_";
-    private Integer filedNumOfComplaintDetailsFixYwdDay = 95;
-}

+ 0 - 12
src/main/java/com/nokia/tsl_data/properties/OutputProperties.java

@@ -1,12 +0,0 @@
-package com.nokia.tsl_data.properties;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@Data
-@ConfigurationProperties(prefix = "tsl.output")
-public class OutputProperties {
-
-    private String outputPath = "./output";
-    private String outputFileNamePrefix = "投诉清单各地市投诉率";
-}

+ 0 - 19
src/main/java/com/nokia/tsl_data/properties/TargetProperties.java

@@ -1,19 +0,0 @@
-package com.nokia.tsl_data.properties;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@Data
-@ConfigurationProperties(prefix = "target")
-public class TargetProperties {
-    // 满意度目标
-    private double satisfiedCompliance = 0.92d;
-    // 解决率目标
-    private double resolutionCompliance = 0.85d;
-    // 响应率目标
-    private double responseCompliance = 0.99d;
-    // 移网综合投诉评价 目标
-    private double evaluation = 0.93d;
-    // 处理时长达标值 单位是小时
-    private int duration = 30;
-}

+ 61 - 0
src/main/java/com/nokia/tsl_data/properties/TslDataProperties.java

@@ -7,6 +7,67 @@ import lombok.Data;
 @Data
 @Data
 @ConfigurationProperties(prefix = "tsl.data")
 @ConfigurationProperties(prefix = "tsl.data")
 public class TslDataProperties {
 public class TslDataProperties {
+    /**
+     * 输出
+     */
     private String outputPath = "./output";
     private String outputPath = "./output";
     private String outputFileNamePrefix = "投诉清单各地市投诉率";
     private String outputFileNamePrefix = "投诉清单各地市投诉率";
+
+    /**
+     * 目标值
+     */
+    // 满意度目标
+    private double satisfiedCompliance = 0.92d;
+    // 解决率目标
+    private double resolutionCompliance = 0.85d;
+    // 响应率目标
+    private double responseCompliance = 0.99d;
+    // 移网综合投诉评价 目标
+    private double evaluation = 0.93d;
+    // 处理时长达标值 单位是小时
+    private int duration = 30;
+
+    /**
+     * 河北_CEM高品质2日详表
+     */
+    // HighQualityListDay 文件存储路径
+    private String dirOfHighQualityListDay = "/data/nenglishangdian/high_quality_list_day";
+    // HighQualityListDay 文件前缀
+    private String prefixOfHighQualityListDay = "HE_D_HIGH_QUALITY_LIST_DAY_1114200095151828992_";
+    // HighQualityListDay 字段数量
+    private Integer filedNumOfHighQualityListDay = 70;
+
+    /**
+     * 河北_CEM高品质2日统计
+     */
+    // HighQualityCountDay 文件存储路径
+    private String dirOfHighQualityCountDay = "/data/nenglishangdian/high_quality_count/";
+    // HighQualityCountDay 文件前缀
+    private String prefixOfHighQualityCountDay = "HE_D_HIGH_QUALITY_COUNT_DAY_1087387382887477248_";
+    // HighQualityCountDay 字段数量
+    private Integer filedNumOfHighQualityCountDay = 33;
+
+    /**
+     * 河北_CEM移网质量投诉明细
+     */
+    // HighQualityCountDay 文件存储路径
+    private String dirOfMobileComplaint = "/data/nenglishangdian/mobile_complaint/";
+    // HighQualityCountDay 文件前缀
+    private String prefixOfMobileComplaint = "HE_D_MOBILE_COMPLAINT_DETAILS_DAY_1087468015013851136_";
+    // HighQualityCountDay 字段数量
+    private Integer filedNumOfMobileComplaintDay = 47;
+
+    /**
+     * 河北客户体验管理智能定责投诉明细月累计接口日
+     */
+    private String dirOfComplaintDetailsFixYwdDay = "/data/nenglishangdian/complaint_details_fix_ywd_day/";
+    private String prefixOfComplaintDetailsFixYwdDay = "HE_D_COMPLAINT_DETAILS_FIX_YWD_DAY_1186327221372567552_";
+    private Integer filedNumOfComplaintDetailsFixYwdDay = 95;
+
+    /**
+     * 河北客户体验管理系统移网网络体验明细日信息
+     */
+    private String dirOfCemMobileExperienceList = "/data/nenglishangdian/HE_D_CEM_MOBILE_EXPERIENCE_LIST/";
+    private String prefixOfCemMobileExperienceList = "HE_D_CEM_MOBILE_EXPERIENCE_LIST_1193846275255566336_";
+    private Integer filedNumOfCemMobileExperienceList = 17;
 }
 }

+ 118 - 0
src/main/java/com/nokia/tsl_data/service/CemMobileExperienceListService.java

@@ -0,0 +1,118 @@
+package com.nokia.tsl_data.service;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.nokia.tsl_data.dao.CemMobileExperienceListMapper;
+import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
+import com.nokia.tsl_data.dao.TargetTsRatioMapper;
+import com.nokia.tsl_data.exception.LackOfDataRuntimeException;
+import com.nokia.tsl_data.util.DateFormatUtil;
+
+/**
+ * 河北客户体验管理系统移网网络体验明细日信息_HE_D_CEM_MOBILE_EXPERIENCE_LIST
+ */
+@Service
+public class CemMobileExperienceListService {
+    
+    @Autowired
+    private CemMobileExperienceListMapper cemMobileExperienceListMapper;
+    @Autowired
+    private SysDataDictionaryRepository sysDataDictionaryRepository;
+    @Autowired
+    private TargetTsRatioMapper targetTsRatioRepository;
+    @Autowired
+    private UserCountService userCountService;
+
+    public Map<String, List<Object>> getSheetData(String day) {
+        // 1. 初始化存储
+        Map<String, List<Object>> result = new HashMap<>();
+        // 从1开始的,当前是当月的第几天
+        int dayIndex = Integer.parseInt(day.substring(6, 8));
+        // 初始化每个地市(按固定顺序)每天的工单量
+        for (String area : sysDataDictionaryRepository.findAllCityName()) {
+            List<Object> list = new ArrayList<>();
+            for (int i = 0; i < dayIndex; i++) {
+                list.add(0);
+            }
+            result.put(area, list);
+        }
+        // 初始化全省每天工作量
+        List<Object> list0 = new ArrayList<>();
+        for (int i = 0; i < dayIndex; i++) {
+            list0.add(0);
+        }
+        result.put("全省", list0);
+        // 读取数据库数据
+        // 按照帐期查询数据
+        List<Map<String, Object>> cityCountForStat = cemMobileExperienceListMapper.selectCityCountForStat(day);
+        // 各地市每日
+        for (Map<String,Object> map : cityCountForStat) {
+            int dayId = Integer.parseInt(map.get("day_id").toString());
+            result.get(map.get("city").toString()).set(dayId - 1, map.get("num"));
+        }
+        List<Map<String, Object>> allforStat = cemMobileExperienceListMapper.selectAllCountForStat(day);
+        // 全省每日
+        for (Map<String,Object> map : allforStat) {
+            int dayId = Integer.parseInt(map.get("day_id").toString());
+            result.get("全省").set(dayId - 1, map.get("num"));
+        }
+        // 地市总数
+        List<Map<String, Object>> cityAllForStat = cemMobileExperienceListMapper.selectCityAllForStat(day);
+        for (Map<String,Object> map : cityAllForStat) {
+            result.get(map.get("city").toString()).add(map.get("num"));
+        }
+        // 全省总数
+        int total = cemMobileExperienceListMapper.selectCountForStat(day);
+        result.get("全省").add(total);
+        // 3. 读取数据库 当月管理端用户数
+        Map<String, Double> userCount = userCountService.getManagementUserCountForMonth(day.substring(0, 6));
+        // 管理端用户数写入结果
+        for (Entry<String, List<Object>> entry : result.entrySet()) {
+            entry.getValue().add(userCount.get(entry.getKey()));
+        }
+        // 4. 万投率和本月预测
+        Calendar calendar = DateFormatUtil.toCalendar(day, "yyyyMMdd");
+        for (Entry<String, List<Object>> entry : result.entrySet()) {
+            List<Object> list = entry.getValue();
+            int size = list.size();
+            // 计算万投率
+            double wtl = Double.parseDouble(list.get(size - 2).toString())
+                    / Double.parseDouble(list.get(size - 1).toString());
+            list.add(wtl);
+            // 计算预测万投率
+            double ycwtl = wtl * calendar.getActualMaximum(Calendar.DAY_OF_MONTH) / calendar.get(Calendar.DAY_OF_MONTH);
+            list.add(ycwtl);
+        }
+        // 5. 期望万投率
+        List<Map<String,Object>> targetTsRatios = targetTsRatioRepository.findByMonthId(day.substring(0, 6));
+        for (Map<String,Object> targetTsRatio : targetTsRatios) {
+            result.get(targetTsRatio.get("city_name").toString()).add(targetTsRatio.get("service_request_target_ratio"));
+        }
+        // 6. 与目标差距
+        for (Entry<String, List<Object>> entry : result.entrySet()) {
+            List<Object> list = entry.getValue();
+            int size = list.size();
+            double cj = ((double) list.get(size - 2)) - ((double) list.get(size - 1));
+            list.add(cj);
+        }
+        return result;
+    }
+
+    /**
+     * 按照账期检查数据
+     */
+    public void checkStatDayCount(String day) {
+        int count = cemMobileExperienceListMapper.countForDay(day);
+        if (count == 0) {
+            throw new LackOfDataRuntimeException(String.format("management_detail 表缺少账期 %s 数据", day));
+        }
+    }
+}

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

@@ -1,7 +1,7 @@
 package com.nokia.tsl_data.service;
 package com.nokia.tsl_data.service;
 
 
 import com.nokia.tsl_data.dao.*;
 import com.nokia.tsl_data.dao.*;
-import com.nokia.tsl_data.properties.DataWarehouseProperties;
+import com.nokia.tsl_data.properties.TslDataProperties;
 import com.nokia.tsl_data.util.CodecUtil;
 import com.nokia.tsl_data.util.CodecUtil;
 import com.nokia.tsl_data.util.TextUtil;
 import com.nokia.tsl_data.util.TextUtil;
 
 
@@ -37,11 +37,13 @@ public class DataWarehouseService {
     @Autowired
     @Autowired
     private ComplaintDetailsFixYwdDayMapper complaintDetailsFixYwdDayMapper;
     private ComplaintDetailsFixYwdDayMapper complaintDetailsFixYwdDayMapper;
     @Autowired
     @Autowired
+    private CemMobileExperienceListMapper cemMobileExperienceListMapper;
+    @Autowired
     private ManagementDetailMapper managementDetailMapper;
     private ManagementDetailMapper managementDetailMapper;
     @Autowired
     @Autowired
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     @Autowired
     @Autowired
-    private DataWarehouseProperties dataWarehouseProperties;
+    private TslDataProperties tslDataProperties;
 
 
     /**
     /**
      * 入库前检查数据源是否具备
      * 入库前检查数据源是否具备
@@ -77,14 +79,20 @@ public class DataWarehouseService {
         } else if (!checkMD5(complaintDetailsFixYwdDayFile)) {
         } else if (!checkMD5(complaintDetailsFixYwdDayFile)) {
             stringBuffer.append("河北客户体验管理智能定责投诉明细月累计接口日 表账期 ").append(day).append(" MD5验证未通过");
             stringBuffer.append("河北客户体验管理智能定责投诉明细月累计接口日 表账期 ").append(day).append(" MD5验证未通过");
         }
         }
-        // 
+        // 河北客户体验管理系统移网网络体验明细日信息
+        File cemMobileExperienceListFile = getCemMobileExperienceListFile(day);
+        if (!cemMobileExperienceListFile.exists()) {
+            stringBuffer.append("河北客户体验管理系统移网网络体验明细日信息 表账期 ").append(day).append(" 数据未到达");
+        } else if (!checkMD5(cemMobileExperienceListFile)) {
+            stringBuffer.append("河北客户体验管理系统移网网络体验明细日信息 表账期 ").append(day).append(" MD5验证未通过");
+        }
         return stringBuffer.toString();
         return stringBuffer.toString();
     }
     }
 
 
     /**
     /**
      * 入库全部文件的任务
      * 入库全部文件的任务
      */
      */
-    public void wareHouse(String day) {
+    public void warehouse(String day) {
         int count;
         int count;
         if ((count = highQualityCountMapper.countForDay(day)) == 0) {
         if ((count = highQualityCountMapper.countForDay(day)) == 0) {
             warehouseHighQualityCountDay(day);
             warehouseHighQualityCountDay(day);
@@ -106,6 +114,11 @@ public class DataWarehouseService {
         } else {
         } else {
             log.warn("complaintDetailsFixYwdDay 账期 {} 已存在 {} 条数据,已跳过...", day, count);
             log.warn("complaintDetailsFixYwdDay 账期 {} 已存在 {} 条数据,已跳过...", day, count);
         }
         }
+        if ((count = cemMobileExperienceListMapper.countForDay(day)) == 0) {
+            warehouseCemMobileExperienceList(day);
+        } else {
+            log.warn("CemMobileExperienceList 账期 {} 已存在 {} 条数据,已跳过...", day, count);
+        }
     }
     }
 
 
     /**
     /**
@@ -136,6 +149,13 @@ public class DataWarehouseService {
         return tslDataDao.deleteComplaintDetailsFixYwdDay(day);
         return tslDataDao.deleteComplaintDetailsFixYwdDay(day);
     }
     }
 
 
+    /**
+     * 删除 河北客户体验管理系统移网网络体验明细日信息
+     */
+    public int deleteCemMobileExperienceList(String day) {
+        return tslDataDao.deleteCemMobileExperienceList(day);
+    }
+
     /**
     /**
      * 入库 河北高质量2日明细数据
      * 入库 河北高质量2日明细数据
      */
      */
@@ -192,6 +212,20 @@ public class DataWarehouseService {
         warehouseComplaintDetailsFixYwdDay(getComplaintDetailsFixYwdDayFile(day));
         warehouseComplaintDetailsFixYwdDay(getComplaintDetailsFixYwdDayFile(day));
     }
     }
 
 
+    /**
+     * 入库 河北客户体验管理系统移网网络体验明细日信息
+     */
+    public void warehouseCemMobileExperienceList(String day) {
+        // 1. 检查是否已存在数据
+        int countForDay = cemMobileExperienceListMapper.countForDay(day);
+        if (countForDay != 0) {
+            throw new RuntimeException(
+                String.format("CemMobileExperienceList 帐期 %s 已存在 %s 条数据", day, countForDay));
+        }
+        // 2. 入库新数据
+        warehouseCemMobileExperienceList(getCemMobileExperienceListFile(day));
+    }
+
     private void warehouseHighQualityListDay(File file) {
     private void warehouseHighQualityListDay(File file) {
         // 读取文件
         // 读取文件
         try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
         try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
@@ -210,7 +244,7 @@ public class DataWarehouseService {
             for (CSVRecord record : records) {
             for (CSVRecord record : records) {
                 // 按照serv_type_name进行筛选
                 // 按照serv_type_name进行筛选
                 if (allServTypeNames.contains(record.get(9))) {
                 if (allServTypeNames.contains(record.get(9))) {
-                    Object[] ps = new Object[dataWarehouseProperties.getFiledNumOfHighQualityListDay().intValue()];
+                    Object[] ps = new Object[tslDataProperties.getFiledNumOfHighQualityListDay().intValue()];
                     list.add(ps);
                     list.add(ps);
                     for (int i = 0; i < ps.length; i++) {
                     for (int i = 0; i < ps.length; i++) {
                         ps[i] = record.get(i);
                         ps[i] = record.get(i);
@@ -238,7 +272,7 @@ public class DataWarehouseService {
             List<CSVRecord> records = parser.getRecords();
             List<CSVRecord> records = parser.getRecords();
             List<Object[]> list = new ArrayList<>();
             List<Object[]> list = new ArrayList<>();
             for (CSVRecord record : records) {
             for (CSVRecord record : records) {
-                Object[] ps = new Object[dataWarehouseProperties.getFiledNumOfMobileComplaintDay().intValue()];
+                Object[] ps = new Object[tslDataProperties.getFiledNumOfMobileComplaintDay().intValue()];
                 list.add(ps);
                 list.add(ps);
                 for (int i = 0; i < ps.length; i++) {
                 for (int i = 0; i < ps.length; i++) {
                     ps[i] = record.get(i);
                     ps[i] = record.get(i);
@@ -265,7 +299,7 @@ public class DataWarehouseService {
             List<CSVRecord> records = parser.getRecords();
             List<CSVRecord> records = parser.getRecords();
             List<Object[]> list = new ArrayList<>();
             List<Object[]> list = new ArrayList<>();
             for (CSVRecord record : records) {
             for (CSVRecord record : records) {
-                Object[] ps = new Object[dataWarehouseProperties.getFiledNumOfHighQualityCountDay().intValue()];
+                Object[] ps = new Object[tslDataProperties.getFiledNumOfHighQualityCountDay().intValue()];
                 list.add(ps);
                 list.add(ps);
                 for (int i = 0; i < ps.length; i++) {
                 for (int i = 0; i < ps.length; i++) {
                     ps[i] = record.get(i);
                     ps[i] = record.get(i);
@@ -293,7 +327,7 @@ public class DataWarehouseService {
             List<CSVRecord> records = parser.getRecords();
             List<CSVRecord> records = parser.getRecords();
             List<Object[]> list = new ArrayList<>();
             List<Object[]> list = new ArrayList<>();
             for (CSVRecord record : records) {
             for (CSVRecord record : records) {
-                Object[] ps = new Object[dataWarehouseProperties.getFiledNumOfComplaintDetailsFixYwdDay().intValue()];
+                Object[] ps = new Object[tslDataProperties.getFiledNumOfComplaintDetailsFixYwdDay().intValue()];
                 list.add(ps);
                 list.add(ps);
                 for (int i = 0; i < ps.length; i++) {
                 for (int i = 0; i < ps.length; i++) {
                     ps[i] = record.get(i);
                     ps[i] = record.get(i);
@@ -307,25 +341,59 @@ public class DataWarehouseService {
         }
         }
     }
     }
 
 
+    // 河北客户体验管理系统移网网络体验明细日信息
+    private void warehouseCemMobileExperienceList(File file) {
+        try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
+            // SOH作为分割符
+            char delimiter = 1;
+            CSVParser parser = CSVFormat.DEFAULT.builder()
+                    .setRecordSeparator("\n")
+                    .setQuote(null)
+                    .setDelimiter(delimiter)
+                    .setSkipHeaderRecord(false)
+                    .build().parse(reader);
+            List<CSVRecord> records = parser.getRecords();
+            List<Object[]> list = new ArrayList<>();
+            for (CSVRecord record : records) {
+                Object[] ps = new Object[tslDataProperties.getFiledNumOfCemMobileExperienceList().intValue()];
+                list.add(ps);
+                for (int i = 0; i < ps.length; i++) {
+                    ps[i] = record.get(i);
+                }
+            }
+            tslDataDao.batchInsertCemMobileExperienceList(list);
+            log.debug("河北客户体验管理系统移网网络体验明细日信息 数据入库成功...");
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw new RuntimeException("河北客户体验管理系统移网网络体验明细日信息..." + e.getMessage());
+        }
+    }
+
     private File getMobileComplaintDayFile(String day) {
     private File getMobileComplaintDayFile(String day) {
-        String fileName = dataWarehouseProperties.getPrefixOfMobileComplaint() + day + ".csv";
-        return Paths.get(dataWarehouseProperties.getDirOfMobileComplaint(), fileName).toFile();
+        String fileName = tslDataProperties.getPrefixOfMobileComplaint() + day + ".csv";
+        return Paths.get(tslDataProperties.getDirOfMobileComplaint(), fileName).toFile();
     }
     }
 
 
     private File getHighQualityListDayFile(String day) {
     private File getHighQualityListDayFile(String day) {
-        String fileName = dataWarehouseProperties.getPrefixOfHighQualityListDay() + day + ".csv";
-        return Paths.get(dataWarehouseProperties.getDirOfHighQualityListDay(), fileName).toFile();
+        String fileName = tslDataProperties.getPrefixOfHighQualityListDay() + day + ".csv";
+        return Paths.get(tslDataProperties.getDirOfHighQualityListDay(), fileName).toFile();
     }
     }
 
 
     private File getHighQualityCountDayFile(String day) {
     private File getHighQualityCountDayFile(String day) {
-        String fileName = dataWarehouseProperties.getPrefixOfHighQualityCountDay() + day + ".csv";
-        return Paths.get(dataWarehouseProperties.getDirOfHighQualityCountDay(), fileName).toFile();
+        String fileName = tslDataProperties.getPrefixOfHighQualityCountDay() + day + ".csv";
+        return Paths.get(tslDataProperties.getDirOfHighQualityCountDay(), fileName).toFile();
     }
     }
 
 
     // 河北客户体验管理智能定责投诉明细月累计接口日
     // 河北客户体验管理智能定责投诉明细月累计接口日
     private File getComplaintDetailsFixYwdDayFile(String day) {
     private File getComplaintDetailsFixYwdDayFile(String day) {
-        String fileName = dataWarehouseProperties.getPrefixOfComplaintDetailsFixYwdDay() + day + ".csv";
-        return Paths.get(dataWarehouseProperties.getDirOfComplaintDetailsFixYwdDay(), fileName).toFile();
+        String fileName = tslDataProperties.getPrefixOfComplaintDetailsFixYwdDay() + day + ".csv";
+        return Paths.get(tslDataProperties.getDirOfComplaintDetailsFixYwdDay(), fileName).toFile();
+    }
+
+    // 河北客户体验管理系统移网网络体验明细日信息
+    private File getCemMobileExperienceListFile(String day) {
+        String fileName = tslDataProperties.getPrefixOfCemMobileExperienceList() + day + ".csv";
+        return Paths.get(tslDataProperties.getDirOfCemMobileExperienceList(), fileName).toFile();
     }
     }
 
 
     /**
     /**

+ 18 - 18
src/main/java/com/nokia/tsl_data/service/HighQualityCountService.java

@@ -2,7 +2,7 @@ package com.nokia.tsl_data.service;
 
 
 import com.nokia.tsl_data.dao.HighQualityCountMapper;
 import com.nokia.tsl_data.dao.HighQualityCountMapper;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
-import com.nokia.tsl_data.properties.TargetProperties;
+import com.nokia.tsl_data.properties.TslDataProperties;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -24,7 +24,7 @@ public class HighQualityCountService {
     @Autowired
     @Autowired
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     @Autowired
     @Autowired
-    private TargetProperties customerRateTargetProperties;
+    private TslDataProperties tslDataProperties;
 
 
     public List<List<Object>> getThreeRateOfCityV3(String day) {
     public List<List<Object>> getThreeRateOfCityV3(String day) {
         List<List<Object>> result = new ArrayList<>();
         List<List<Object>> result = new ArrayList<>();
@@ -44,8 +44,8 @@ public class HighQualityCountService {
             // 移网综合投诉评价“三率”=响应率*0.1+解决率*0.4+满意率*0.5
             // 移网综合投诉评价“三率”=响应率*0.1+解决率*0.4+满意率*0.5
             double rate = arr[2] * 0.1 + arr[1] * 0.4 + arr[0] * 0.5;
             double rate = arr[2] * 0.1 + arr[1] * 0.4 + arr[0] * 0.5;
             list.add(rate);
             list.add(rate);
-            list.add(customerRateTargetProperties.getEvaluation());
-            list.add(customerRateTargetProperties.getEvaluation() - rate);
+            list.add(tslDataProperties.getEvaluation());
+            list.add(tslDataProperties.getEvaluation() - rate);
         });
         });
         // 逆序排序
         // 逆序排序
         result.sort((o1, o2) -> Double.compare((double) o2.get(6), (double) o1.get(6)));
         result.sort((o1, o2) -> Double.compare((double) o2.get(6), (double) o1.get(6)));
@@ -59,8 +59,8 @@ public class HighQualityCountService {
                 add(allCity[1]);
                 add(allCity[1]);
                 add(allCity[2]);
                 add(allCity[2]);
                 add(rate);
                 add(rate);
-                add(customerRateTargetProperties.getEvaluation());
-                add(customerRateTargetProperties.getEvaluation() - rate);
+                add(tslDataProperties.getEvaluation());
+                add(tslDataProperties.getEvaluation() - rate);
             }
             }
         });
         });
         return result;
         return result;
@@ -162,13 +162,13 @@ public class HighQualityCountService {
             list.add(map.get("rate"));
             list.add(map.get("rate"));
             numerator += (double) map.get("numerator");
             numerator += (double) map.get("numerator");
             denominator += (double) map.get("denominator");
             denominator += (double) map.get("denominator");
-            list.add(customerRateTargetProperties.getSatisfiedCompliance());
-            list.add((double) map.get("rate") - customerRateTargetProperties.getSatisfiedCompliance());
+            list.add(tslDataProperties.getSatisfiedCompliance());
+            list.add((double) map.get("rate") - tslDataProperties.getSatisfiedCompliance());
         }
         }
         rate = numerator / denominator;
         rate = numerator / denominator;
         allCity.add(rate);
         allCity.add(rate);
-        allCity.add(customerRateTargetProperties.getSatisfiedCompliance());
-        allCity.add(rate - customerRateTargetProperties.getSatisfiedCompliance());
+        allCity.add(tslDataProperties.getSatisfiedCompliance());
+        allCity.add(rate - tslDataProperties.getSatisfiedCompliance());
         // 客户端地市解决率
         // 客户端地市解决率
         numerator = 0;
         numerator = 0;
         denominator = 0;
         denominator = 0;
@@ -184,13 +184,13 @@ public class HighQualityCountService {
             list.add(map.get("rate"));
             list.add(map.get("rate"));
             numerator += (double) map.get("numerator");
             numerator += (double) map.get("numerator");
             denominator += (double) map.get("denominator");
             denominator += (double) map.get("denominator");
-            list.add(customerRateTargetProperties.getResolutionCompliance());
-            list.add((double) map.get("rate") - customerRateTargetProperties.getResolutionCompliance());
+            list.add(tslDataProperties.getResolutionCompliance());
+            list.add((double) map.get("rate") - tslDataProperties.getResolutionCompliance());
         }
         }
         rate = numerator / denominator;
         rate = numerator / denominator;
         allCity.add(rate);
         allCity.add(rate);
-        allCity.add(customerRateTargetProperties.getResolutionCompliance());
-        allCity.add(rate - customerRateTargetProperties.getResolutionCompliance());
+        allCity.add(tslDataProperties.getResolutionCompliance());
+        allCity.add(rate - tslDataProperties.getResolutionCompliance());
         // 客户端地市响应率
         // 客户端地市响应率
         numerator = 0;
         numerator = 0;
         denominator = 0;
         denominator = 0;
@@ -206,13 +206,13 @@ public class HighQualityCountService {
             list.add(map.get("rate"));
             list.add(map.get("rate"));
             numerator += (double) map.get("numerator");
             numerator += (double) map.get("numerator");
             denominator += (double) map.get("denominator");
             denominator += (double) map.get("denominator");
-            list.add(customerRateTargetProperties.getResponseCompliance());
-            list.add((double) map.get("rate") - customerRateTargetProperties.getResponseCompliance());
+            list.add(tslDataProperties.getResponseCompliance());
+            list.add((double) map.get("rate") - tslDataProperties.getResponseCompliance());
         }
         }
         rate = numerator / denominator;
         rate = numerator / denominator;
         allCity.add(rate);
         allCity.add(rate);
-        allCity.add(customerRateTargetProperties.getResponseCompliance());
-        allCity.add(rate - customerRateTargetProperties.getResponseCompliance());
+        allCity.add(tslDataProperties.getResponseCompliance());
+        allCity.add(rate - tslDataProperties.getResponseCompliance());
         return result;
         return result;
     }
     }
 
 

+ 6 - 5
src/main/java/com/nokia/tsl_data/service/HighQualityDataService.java

@@ -5,7 +5,8 @@ import com.nokia.tsl_data.dao.HighQualityDataRepository;
 import com.nokia.tsl_data.dao.HighQualityListDayMapper;
 import com.nokia.tsl_data.dao.HighQualityListDayMapper;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
 import com.nokia.tsl_data.entity.HighQualityData;
 import com.nokia.tsl_data.entity.HighQualityData;
-import com.nokia.tsl_data.properties.TargetProperties;
+import com.nokia.tsl_data.properties.TslDataProperties;
+
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,7 +33,7 @@ public class HighQualityDataService {
     @Autowired
     @Autowired
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     @Autowired
     @Autowired
-    private TargetProperties customerRateTargetProperties;
+    private TslDataProperties tslDataProperties;
 
 
     /**
     /**
      * 根据商定的算法生成数据
      * 根据商定的算法生成数据
@@ -86,7 +87,7 @@ public class HighQualityDataService {
                 list.add(1.0);
                 list.add(1.0);
             }
             }
             // 写入达标值
             // 写入达标值
-            list.add(customerRateTargetProperties.getResolutionCompliance());
+            list.add(tslDataProperties.getResolutionCompliance());
             // 写入与达标值的差距
             // 写入与达标值的差距
             list.add((double) list.get(2) - (double) list.get(3));
             list.add((double) list.get(2) - (double) list.get(3));
         }
         }
@@ -136,7 +137,7 @@ public class HighQualityDataService {
                 list.add(1.0);
                 list.add(1.0);
             }
             }
             // 写入达标值
             // 写入达标值
-            list.add(customerRateTargetProperties.getSatisfiedCompliance());
+            list.add(tslDataProperties.getSatisfiedCompliance());
             // 写入与达标值的差距
             // 写入与达标值的差距
             list.add((double) list.get(2) - (double) list.get(3));
             list.add((double) list.get(2) - (double) list.get(3));
         }
         }
@@ -187,7 +188,7 @@ public class HighQualityDataService {
             }
             }
             // 写入达标值和与达标值的差距
             // 写入达标值和与达标值的差距
             // 写入达标值
             // 写入达标值
-            list.add(customerRateTargetProperties.getResponseCompliance());
+            list.add(tslDataProperties.getResponseCompliance());
             // 写入与达标值的差距
             // 写入与达标值的差距
             list.add((double) list.get(2) - (double) list.get(3));
             list.add((double) list.get(2) - (double) list.get(3));
         }
         }

+ 3 - 7
src/main/java/com/nokia/tsl_data/service/ManagementDetailService.java

@@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
 import com.nokia.tsl_data.dao.ManagementDetailMapper;
 import com.nokia.tsl_data.dao.ManagementDetailMapper;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
 import com.nokia.tsl_data.dao.TargetTsRatioMapper;
 import com.nokia.tsl_data.dao.TargetTsRatioMapper;
-import com.nokia.tsl_data.entity.TargetTsRatio;
 import com.nokia.tsl_data.exception.LackOfDataRuntimeException;
 import com.nokia.tsl_data.exception.LackOfDataRuntimeException;
 import com.nokia.tsl_data.util.DateFormatUtil;
 import com.nokia.tsl_data.util.DateFormatUtil;
 
 
@@ -25,13 +24,10 @@ public class ManagementDetailService {
 
 
     @Autowired
     @Autowired
     private ManagementDetailMapper managementDetailMapper;
     private ManagementDetailMapper managementDetailMapper;
-
     @Autowired
     @Autowired
     private SysDataDictionaryRepository sysDataDictionaryRepository;
     private SysDataDictionaryRepository sysDataDictionaryRepository;
-
     @Autowired
     @Autowired
     private TargetTsRatioMapper targetTsRatioRepository;
     private TargetTsRatioMapper targetTsRatioRepository;
-
     @Autowired
     @Autowired
     private UserCountService userCountService;
     private UserCountService userCountService;
 
 
@@ -121,9 +117,9 @@ public class ManagementDetailService {
             list.add(ycwtl);
             list.add(ycwtl);
         }
         }
         // 5. 期望万投率
         // 5. 期望万投率
-        List<TargetTsRatio> targetTsRatios = targetTsRatioRepository.findByMonthId(day.substring(0, 6));
-        for (TargetTsRatio targetTsRatio : targetTsRatios) {
-            result.get(targetTsRatio.getCityName()).add(targetTsRatio.getManagementTargetRatio());
+        List<Map<String,Object>>  targetTsRatios = targetTsRatioRepository.findByMonthId(day.substring(0, 6));
+        for (Map<String,Object> targetTsRatio : targetTsRatios) {
+            result.get(targetTsRatio.get("city_name").toString()).add(targetTsRatio.get("management_target_ratio"));
         }
         }
         // 6. 与目标差距
         // 6. 与目标差距
         for (Entry<String, List<Object>> entry : result.entrySet()) {
         for (Entry<String, List<Object>> entry : result.entrySet()) {

+ 17 - 17
src/main/java/com/nokia/tsl_data/service/ReportServiceV1.java

@@ -3,7 +3,7 @@ package com.nokia.tsl_data.service;
 import com.nokia.tsl_data.dao.HighQualityCountMapper;
 import com.nokia.tsl_data.dao.HighQualityCountMapper;
 import com.nokia.tsl_data.dao.MobileComplaintMapper;
 import com.nokia.tsl_data.dao.MobileComplaintMapper;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
 import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
-import com.nokia.tsl_data.properties.OutputProperties;
+import com.nokia.tsl_data.properties.TslDataProperties;
 import com.nokia.tsl_data.util.excel.PoiUtil;
 import com.nokia.tsl_data.util.excel.PoiUtil;
 import com.nokia.tsl_data.util.excel.entity.CellRect;
 import com.nokia.tsl_data.util.excel.entity.CellRect;
 
 
@@ -40,7 +40,7 @@ public class ReportServiceV1 {
     @Autowired
     @Autowired
     private TslDataService tslDataService;
     private TslDataService tslDataService;
     @Autowired
     @Autowired
-    private OutputProperties outputProperties;
+    private TslDataProperties tslDataProperties;
     @Autowired
     @Autowired
     private HighQualityCountMapper highQualityCountMapper;
     private HighQualityCountMapper highQualityCountMapper;
     @Autowired
     @Autowired
@@ -63,9 +63,9 @@ public class ReportServiceV1 {
      * 截图任务
      * 截图任务
      */
      */
     public void screenShotV2(String day) {
     public void screenShotV2(String day) {
-        String fileName = outputProperties.getOutputFileNamePrefix() + day + ".xlsx";
+        String fileName = tslDataProperties.getOutputFileNamePrefix() + day + ".xlsx";
         // 输出文件路径 增加V2
         // 输出文件路径 增加V2
-        File file = Paths.get(outputProperties.getOutputPath(), "V2", day, fileName).toFile();
+        File file = Paths.get(tslDataProperties.getOutputPath(), "V2", day, fileName).toFile();
         if (!file.exists()) {
         if (!file.exists()) {
             throw new RuntimeException(String.format("无法截图,文件%s不存在", file.getAbsolutePath()));
             throw new RuntimeException(String.format("无法截图,文件%s不存在", file.getAbsolutePath()));
         }
         }
@@ -78,42 +78,42 @@ public class ReportServiceV1 {
             String area = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
             String area = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
             screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-移网质量类"), area, "微软雅黑");
             screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-移网质量类"), area, "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-1-投诉率.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-1-投诉率.png").toFile());
             // 截图2
             // 截图2
             String area2 = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
             String area2 = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
             screenShot = PoiUtil.screenShot(workbook.getSheet("客户端-战略考核"), area2, "微软雅黑");
             screenShot = PoiUtil.screenShot(workbook.getSheet("客户端-战略考核"), area2, "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-2-客户端-战略考核.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-2-客户端-战略考核.png").toFile());
             // 截图3 每月1号不发送重复投诉率
             // 截图3 每月1号不发送重复投诉率
             if (!day.endsWith("01")) {
             if (!day.endsWith("01")) {
                 screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-重复投诉率"), "A1:G16", "微软雅黑");
                 screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-重复投诉率"), "A1:G16", "微软雅黑");
                 ImageIO.write(screenShot, "png",
                 ImageIO.write(screenShot, "png",
-                        Paths.get(outputProperties.getOutputPath(), day, day + "-3-重复投诉率.png").toFile());
+                        Paths.get(tslDataProperties.getOutputPath(), day, day + "-3-重复投诉率.png").toFile());
             }
             }
             // 截图4 5
             // 截图4 5
             Sheet sheet = workbook.getSheet("投诉处理时长、超时工单概况");
             Sheet sheet = workbook.getSheet("投诉处理时长、超时工单概况");
             screenShot = PoiUtil.screenShot(sheet, "A1:D15", "微软雅黑");
             screenShot = PoiUtil.screenShot(sheet, "A1:D15", "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-4-超时工单.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-4-超时工单.png").toFile());
             screenShot = PoiUtil.screenShot(sheet, "G1:J14", "微软雅黑");
             screenShot = PoiUtil.screenShot(sheet, "G1:J14", "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-5-处理时长.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-5-处理时长.png").toFile());
             // 截图6
             // 截图6
             sheet = workbook.getSheet("客户端地市三率");
             sheet = workbook.getSheet("客户端地市三率");
             screenShot = PoiUtil.screenShot(sheet, "A1:J15", "微软雅黑");
             screenShot = PoiUtil.screenShot(sheet, "A1:J15", "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-6-地市三率.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-6-地市三率.png").toFile());
             // 截图7 8 9 区县三率
             // 截图7 8 9 区县三率
             sheet = workbook.getSheet("客户端区县三率");
             sheet = workbook.getSheet("客户端区县三率");
             screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
             screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-7-区县响应率.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-7-区县响应率.png").toFile());
             screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
             screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-8-区县满意度.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-8-区县满意度.png").toFile());
             screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
             screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
             ImageIO.write(screenShot, "png",
             ImageIO.write(screenShot, "png",
-                    Paths.get(outputProperties.getOutputPath(), day, day + "-9-区县解决率.png").toFile());
+                    Paths.get(tslDataProperties.getOutputPath(), day, day + "-9-区县解决率.png").toFile());
         } catch (EncryptedDocumentException | IOException | ParseException e) {
         } catch (EncryptedDocumentException | IOException | ParseException e) {
             e.printStackTrace();
             e.printStackTrace();
             throw new RuntimeException(e.getMessage());
             throw new RuntimeException(e.getMessage());
@@ -124,9 +124,9 @@ public class ReportServiceV1 {
      * 生成报表,版本2,包含区县三率
      * 生成报表,版本2,包含区县三率
      */
      */
     public void generateReportV2(String day) {
     public void generateReportV2(String day) {
-        String fileName = outputProperties.getOutputFileNamePrefix() + day + ".xlsx";
+        String fileName = tslDataProperties.getOutputFileNamePrefix() + day + ".xlsx";
         // 输出路径 增加 V2
         // 输出路径 增加 V2
-        File file = Paths.get(outputProperties.getOutputPath(), "V2", day).toFile();
+        File file = Paths.get(tslDataProperties.getOutputPath(), "V2", day).toFile();
         if (!file.exists()) {
         if (!file.exists()) {
             boolean mkdirs = file.mkdirs();
             boolean mkdirs = file.mkdirs();
             System.out.println(mkdirs);
             System.out.println(mkdirs);
@@ -166,8 +166,8 @@ public class ReportServiceV1 {
     }
     }
 
 
     public void generateReportV1(String day) {
     public void generateReportV1(String day) {
-        String fileName = outputProperties.getOutputFileNamePrefix() + day + ".xlsx";
-        File file = Paths.get(outputProperties.getOutputPath(), "V1", day).toFile();
+        String fileName = tslDataProperties.getOutputFileNamePrefix() + day + ".xlsx";
+        File file = Paths.get(tslDataProperties.getOutputPath(), "V1", day).toFile();
         if (!file.exists()) {
         if (!file.exists()) {
             boolean mkdirs = file.mkdirs();
             boolean mkdirs = file.mkdirs();
             System.out.println(mkdirs);
             System.out.println(mkdirs);

+ 138 - 1
src/main/java/com/nokia/tsl_data/service/ReportServiceV3.java

@@ -59,6 +59,8 @@ public class ReportServiceV3 {
     @Autowired
     @Autowired
     private ManagementDetailService managementDetailService;
     private ManagementDetailService managementDetailService;
     @Autowired
     @Autowired
+    private CemMobileExperienceListService cemMobileExperienceListService;
+    @Autowired
     private WorkFlowService workFlowService;
     private WorkFlowService workFlowService;
     @Autowired
     @Autowired
     private TslDataService tslDataService;
     private TslDataService tslDataService;
@@ -204,6 +206,13 @@ public class ReportServiceV3 {
                         Paths.get(file.getParentFile().getAbsolutePath(), "管理端-移网感知类-" + day + ".png").toFile());
                         Paths.get(file.getParentFile().getAbsolutePath(), "管理端-移网感知类-" + day + ".png").toFile());
             }
             }
             // 截图 服请
             // 截图 服请
+            sheet = workbook.getSheet("移网感知服务请求率");
+            if (sheet != null) {
+                area = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
+                screenShot = PoiUtil.screenShot(sheet, area, "微软雅黑");
+                ImageIO.write(screenShot, "png",
+                        Paths.get(file.getParentFile().getAbsolutePath(), "移网感知服务请求率-" + day + ".png").toFile());
+            }
             // 截图 重复投诉
             // 截图 重复投诉
             sheet = workbook.getSheet("管理端-重复投诉率");
             sheet = workbook.getSheet("管理端-重复投诉率");
             if (sheet != null) {
             if (sheet != null) {
@@ -249,8 +258,12 @@ public class ReportServiceV3 {
         writeSheet1(workbookWrapper, day);
         writeSheet1(workbookWrapper, day);
         log.info("帐期 {} 管理端-移网感知类 sheet写入成功", day);
         log.info("帐期 {} 管理端-移网感知类 sheet写入成功", day);
         // 1.2 写入 服请情况
         // 1.2 写入 服请情况
+        cemMobileExperienceListService.checkStatDayCount(day);
+        writeSheetServiceRequest(workbookWrapper, day);
+        log.info("帐期 {} 服务请求 sheet写入成功", day);
         // 1.3 管理端-重复投诉率
         // 1.3 管理端-重复投诉率
         writeSheetRepeatTs(workbookWrapper, day);
         writeSheetRepeatTs(workbookWrapper, day);
+        log.info("帐期 {} 管理端-重复投诉率 sheet写入成功", day);
         // 1.4 写入 投诉处理时长、超时工单概况
         // 1.4 写入 投诉处理时长、超时工单概况
         writeSheet3(workbookWrapper, day);
         writeSheet3(workbookWrapper, day);
         log.info("帐期 {} 投诉处理时长、超时工单概况 sheet写入成功", day);
         log.info("帐期 {} 投诉处理时长、超时工单概况 sheet写入成功", day);
@@ -611,12 +624,14 @@ public class ReportServiceV3 {
         // 计算天数
         // 计算天数
         LocalDate date = LocalDate.parse(day, DateTimeFormatter.ofPattern("yyyyMMdd"));
         LocalDate date = LocalDate.parse(day, DateTimeFormatter.ofPattern("yyyyMMdd"));
         int dayOfMonth = date.getDayOfMonth();
         int dayOfMonth = date.getDayOfMonth();
+        int monthOfYear = date.getMonthValue();
         Sheet sheet = workbookWrapper.getWorkbook().createSheet(sheetName);
         Sheet sheet = workbookWrapper.getWorkbook().createSheet(sheetName);
         Row row;
         Row row;
         Cell cell;
         Cell cell;
         // 第一行 标题栏
         // 第一行 标题栏
         cell = sheet.createRow(0).createCell(0);
         cell = sheet.createRow(0).createCell(0);
-        cell.setCellValue(day.substring(0, 4) + "年客服投诉清单各地市投诉率情况(" + sheetName + ")");
+        cell.setCellValue(day.substring(0, 4) + "年" + monthOfYear
+                + "客服投诉清单各地市投诉率情况(" + sheetName + ")");
         cell.setCellStyle(workbookWrapper.getCellStyle4());
         cell.setCellStyle(workbookWrapper.getCellStyle4());
         PoiUtil.addMergedRegion(sheet, 0, 0, 0, dayOfMonth + 7);
         PoiUtil.addMergedRegion(sheet, 0, 0, 0, dayOfMonth + 7);
         // 第二行 列名
         // 第二行 列名
@@ -721,6 +736,128 @@ public class ReportServiceV3 {
         }
         }
     }
     }
 
 
+    /**
+     * 服务请求数据
+     */
+    private void writeSheetServiceRequest(XSSFWorkbookWrapper workbookWrapper, String day) {
+        String sheetName = "移网感知服务请求率";
+        // 获取数据
+        Map<String, List<Object>> sheetData = cemMobileExperienceListService.getSheetData(day);
+        // 计算天数
+        LocalDate date = LocalDate.parse(day, DateTimeFormatter.ofPattern("yyyyMMdd"));
+        int dayOfMonth = date.getDayOfMonth();
+        int monthOfYear = date.getMonthValue();
+        Sheet sheet = workbookWrapper.getWorkbook().createSheet(sheetName);
+        Row row;
+        Cell cell;
+        // 第一行 标题栏
+        cell = sheet.createRow(0).createCell(0);
+        cell.setCellValue(day.substring(0, 4) + "年"
+                + monthOfYear + "月移网感知(服务请求)");
+        cell.setCellStyle(workbookWrapper.getCellStyle4());
+        PoiUtil.addMergedRegion(sheet, 0, 0, 0, dayOfMonth + 7);
+        // 第二行 列名
+        row = sheet.createRow(1);
+        cell = row.createCell(0);
+        cell.setCellValue("地市");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        for (int i = 1; i <= dayOfMonth; i++) {
+            cell = row.createCell(i);
+            cell.setCellValue(i + "日");
+            cell.setCellStyle(workbookWrapper.getCellStyle1());
+        }
+        cell = row.createCell(dayOfMonth + 1);
+        cell.setCellValue("服请总数");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        cell = row.createCell(dayOfMonth + 2);
+        cell.setCellValue("用户数");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        cell = row.createCell(dayOfMonth + 3);
+        cell.setCellValue("目前万投率");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        cell = row.createCell(dayOfMonth + 4);
+        cell.setCellValue("本月预测");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        cell = row.createCell(dayOfMonth + 5);
+        cell.setCellValue("目标值");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        cell = row.createCell(dayOfMonth + 6);
+        cell.setCellValue("与目标差距");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        cell = row.createCell(dayOfMonth + 7);
+        cell.setCellValue("地市");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        int rowNum = 2;
+        int cellNum = 0;
+        // 写入各地市数据
+        for (String area : sysDataDictionaryRepository.findAllCityName()) {
+            row = sheet.createRow(rowNum++);
+            // 写入A列的地市
+            cell = row.createCell(cellNum++);
+            cell.setCellValue(area);
+            cell.setCellStyle(workbookWrapper.getCellStyle1());
+            for (Object obj : sheetData.get(area)) {
+                cell = row.createCell(cellNum++);
+                cell.setCellValue(Double.parseDouble(obj.toString()));
+                cell.setCellStyle(workbookWrapper.getCellStyle1());
+            }
+            // 写入最后一列的地市
+            cell = row.createCell(cellNum);
+            cell.setCellValue(area);
+            cell.setCellStyle(workbookWrapper.getCellStyle1());
+            // cellNum复位
+            cellNum = 0;
+        }
+        // 写入全省数据
+        row = sheet.createRow(rowNum);
+        // 写入A列的地市
+        cell = row.createCell(cellNum++);
+        cell.setCellValue("全省");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        for (Object obj : sheetData.get("全省")) {
+            cell = row.createCell(cellNum++);
+            cell.setCellValue(Double.parseDouble(obj.toString()));
+            cell.setCellStyle(workbookWrapper.getCellStyle1());
+        }
+        // 写入最后一列的地市
+        cell = row.createCell(cellNum);
+        cell.setCellValue("全省");
+        cell.setCellStyle(workbookWrapper.getCellStyle1());
+        // 3-15行(2-14)dayOfMonth+2 - dayOfMonth+6是浮点数,设置为显示小数点后2位
+        for (int i = 2; i <= 14; i++) {
+            row = sheet.getRow(i);
+            for (int j = dayOfMonth + 2; j <= dayOfMonth + 6; j++) {
+                cell = row.getCell(j);
+                cell.setCellStyle(workbookWrapper.getCellStyle5());
+            }
+        }
+        // 添加条件格式B15-V15
+        PoiUtil.setConditionalFormattingGreenToRed(sheet, rowNum, rowNum, 1, dayOfMonth);
+        // 添加条件格式(dayOfMonth+3)(3-14)
+        PoiUtil.setConditionalFormattingGreenToRed(sheet, 2, 13, dayOfMonth + 3, dayOfMonth + 3);
+        // 添加条件格式Z3-Z14
+        PoiUtil.setConditionalFormattingGreenToRed(sheet, 2, 13, dayOfMonth + 4, dayOfMonth + 4);
+        // 添加条件格式AB3-AB14
+        PoiUtil.setConditionalFormattingGreenToRed(sheet, 2, 13, dayOfMonth + 6, dayOfMonth + 6);
+        // 设置sheet的列宽
+        sheet.setColumnWidth(0, 1600);
+        for (int i = 1; i <= dayOfMonth; i++) {
+            sheet.setColumnWidth(i, 1300);
+        }
+        sheet.setColumnWidth(dayOfMonth + 1, 1700);
+        sheet.setColumnWidth(dayOfMonth + 2, 2100);
+        sheet.setColumnWidth(dayOfMonth + 3, 2100);
+        sheet.setColumnWidth(dayOfMonth + 4, 2100);
+        sheet.setColumnWidth(dayOfMonth + 5, 1700);
+        sheet.setColumnWidth(dayOfMonth + 6, 2100);
+        sheet.setColumnWidth(dayOfMonth + 7, 1600);
+
+        // 设置行高 15
+        for (int i = 0; i < rowNum; i++) {
+            sheet.getRow(i).setHeightInPoints(15F);
+        }
+    }
+
     /**
     /**
      * 获取一个 XSSFWorkbook 并初始化几个需要的格式
      * 获取一个 XSSFWorkbook 并初始化几个需要的格式
      */
      */

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

@@ -70,7 +70,7 @@ public class TaskService {
     /**
     /**
      * 指定日期任务
      * 指定日期任务
      */
      */
-    public void wareHouseTask(String day) {
+    public void warehouseTask(String day) {
         // 检查源是否具备
         // 检查源是否具备
         String result = dataWarehouseService.checkSource(day);
         String result = dataWarehouseService.checkSource(day);
         if (StringUtils.hasLength(result)) {
         if (StringUtils.hasLength(result)) {
@@ -86,7 +86,7 @@ public class TaskService {
         } else {
         } else {
             try {
             try {
                 // 执行入库任务
                 // 执行入库任务
-                dataWarehouseService.wareHouse(day);
+                dataWarehouseService.warehouse(day);
                 // 生成HighQualityData
                 // 生成HighQualityData
                 highQualityDataService.generateHighQualityData(day);
                 highQualityDataService.generateHighQualityData(day);
                 // 生成ManagementDetail
                 // 生成ManagementDetail

+ 14 - 15
src/main/java/com/nokia/tsl_data/service/TslDataService.java

@@ -1,9 +1,8 @@
 package com.nokia.tsl_data.service;
 package com.nokia.tsl_data.service;
 
 
 import com.nokia.tsl_data.dao.*;
 import com.nokia.tsl_data.dao.*;
-import com.nokia.tsl_data.entity.TargetTsRatio;
 import com.nokia.tsl_data.exception.LackOfDataRuntimeException;
 import com.nokia.tsl_data.exception.LackOfDataRuntimeException;
-import com.nokia.tsl_data.properties.TargetProperties;
+import com.nokia.tsl_data.properties.TslDataProperties;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -34,7 +33,7 @@ public class TslDataService {
     @Autowired
     @Autowired
     private TargetTsRatioMapper targetTsRatioRepository;
     private TargetTsRatioMapper targetTsRatioRepository;
     @Autowired
     @Autowired
-    private TargetProperties customerRateTargetProperties;
+    private TslDataProperties tslDataProperties;
 
 
     /**
     /**
      * 客户端-投诉问题解决满意度 客户端-投诉问题解决率 客户端-投诉问题响应率
      * 客户端-投诉问题解决满意度 客户端-投诉问题解决率 客户端-投诉问题响应率
@@ -66,7 +65,7 @@ public class TslDataService {
             // 满意率
             // 满意率
             list1.add(1, dataMap.get(area).get("complaint_satisfied"));
             list1.add(1, dataMap.get(area).get("complaint_satisfied"));
             // 达标值
             // 达标值
-            list1.add(2, customerRateTargetProperties.getSatisfiedCompliance());
+            list1.add(2, tslDataProperties.getSatisfiedCompliance());
             // 差距
             // 差距
             list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
             list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
         }
         }
@@ -80,7 +79,7 @@ public class TslDataService {
         // 满意率
         // 满意率
         list1.add(1, dataMap.get("全省").get("complaint_satisfied"));
         list1.add(1, dataMap.get("全省").get("complaint_satisfied"));
         // 达标值
         // 达标值
-        list1.add(2, customerRateTargetProperties.getSatisfiedCompliance());
+        list1.add(2, tslDataProperties.getSatisfiedCompliance());
         // 差距
         // 差距
         list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
         list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
 
 
@@ -96,7 +95,7 @@ public class TslDataService {
             // 解决率
             // 解决率
             list1.add(1, dataMap.get(area).get("complaint_resolution"));
             list1.add(1, dataMap.get(area).get("complaint_resolution"));
             // 达标值
             // 达标值
-            list1.add(2, customerRateTargetProperties.getResolutionCompliance());
+            list1.add(2, tslDataProperties.getResolutionCompliance());
             // 差距
             // 差距
             list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
             list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
         }
         }
@@ -110,7 +109,7 @@ public class TslDataService {
         // 解决率
         // 解决率
         list1.add(1, dataMap.get("全省").get("complaint_resolution"));
         list1.add(1, dataMap.get("全省").get("complaint_resolution"));
         // 达标值
         // 达标值
-        list1.add(2, customerRateTargetProperties.getResolutionCompliance());
+        list1.add(2, tslDataProperties.getResolutionCompliance());
         // 差距
         // 差距
         list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
         list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
 
 
@@ -125,7 +124,7 @@ public class TslDataService {
             // 解决率
             // 解决率
             list1.add(1, dataMap.get(area).get("complaint_response"));
             list1.add(1, dataMap.get(area).get("complaint_response"));
             // 达标值
             // 达标值
-            list1.add(2, customerRateTargetProperties.getResponseCompliance());
+            list1.add(2, tslDataProperties.getResponseCompliance());
             // 差距
             // 差距
             list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
             list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
         }
         }
@@ -137,7 +136,7 @@ public class TslDataService {
         // 相应
         // 相应
         list1.add(1, dataMap.get("全省").get("complaint_response"));
         list1.add(1, dataMap.get("全省").get("complaint_response"));
         // 达标值
         // 达标值
-        list1.add(2, customerRateTargetProperties.getResponseCompliance());
+        list1.add(2, tslDataProperties.getResponseCompliance());
         // 差距
         // 差距
         list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
         list1.add(3, ((double) list1.get(1)) - (double) list1.get(2));
 
 
@@ -347,9 +346,9 @@ public class TslDataService {
 
 
         // 期望万投率--从数据库取出来是一个字符串
         // 期望万投率--从数据库取出来是一个字符串
         // 客户端目标投诉率
         // 客户端目标投诉率
-        List<TargetTsRatio> targetTsRatios = targetTsRatioRepository.findByMonthId(day.substring(0, 6));
-        for (TargetTsRatio targetTsRatio : targetTsRatios) {
-            result.get(targetTsRatio.getCityName()).add(targetTsRatio.getCustomerTargetRatio());
+        List<Map<String,Object>> targetTsRatios = targetTsRatioRepository.findByMonthId(day.substring(0, 6));
+        for (Map<String,Object> targetTsRatio : targetTsRatios) {
+            result.get(targetTsRatio.get("city_name")).add(targetTsRatio.get("customer_target_ratio"));
         }
         }
 
 
         // 与目标差距
         // 与目标差距
@@ -430,9 +429,9 @@ public class TslDataService {
         }
         }
         // 期望万投率--从数据库取出来是一个字符串
         // 期望万投率--从数据库取出来是一个字符串
         // 服务端目标投诉率
         // 服务端目标投诉率
-        List<TargetTsRatio> targetTsRatios = targetTsRatioRepository.findByMonthId(monthId);
-        for (TargetTsRatio targetTsRatio : targetTsRatios) {
-            result.get(targetTsRatio.getCityName()).add(targetTsRatio.getManagementTargetRatio());
+        List<Map<String,Object>> targetTsRatios = targetTsRatioRepository.findByMonthId(monthId);
+        for (Map<String,Object> targetTsRatio : targetTsRatios) {
+            result.get(targetTsRatio.get("city_name")).add(targetTsRatio.get("management_target_ratio"));
         }
         }
         // 与目标差距
         // 与目标差距
         for (Entry<String, List<Object>> entry : result.entrySet()) {
         for (Entry<String, List<Object>> entry : result.entrySet()) {

+ 0 - 107
src/main/java/com/nokia/tsl_data/service/UserResidentWareHouseService.java

@@ -1,107 +0,0 @@
-package com.nokia.tsl_data.service;
-
-import com.nokia.tsl_data.dao.UserResidentRepository;
-import com.nokia.tsl_data.entity.UserResident;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.csv.CSVFormat;
-import org.apache.commons.csv.CSVParser;
-import org.apache.commons.csv.CSVRecord;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.LinkOption;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Stream;
-
-/**
- * 入库用户常驻基站数据
- * 
- * 入库逻辑,每次清空原数据,导入新数据
- */
-@Slf4j
-@Service
-public class UserResidentWareHouseService {
-
-    @Value("${tsl_data.user_resident.source_path:/data/nenglishangdian/}")
-    private String sourcePath;
-
-    @Value("${tsl_data.user_resident.prefix:aaa}")
-    private String fileNamePrefix;
-
-    @Value("${tsl_data.user_resident.suffix:aaa}")
-    private String suffix;
-
-    private final MessageService messageService;
-    private final UserResidentRepository userResidentJpaDao;
-
-    private final int batchSize = 65536;
-
-    public UserResidentWareHouseService(MessageService messageService, UserResidentRepository userResidentJpaDao) {
-        this.messageService = messageService;
-        this.userResidentJpaDao = userResidentJpaDao;
-    }
-
-    /**
-     * 检查源文件是否存在
-     */
-    public boolean sourceFileExist(String day) {
-        Path path = Paths.get(sourcePath, fileNamePrefix + day + suffix);
-        return Files.exists(path, LinkOption.NOFOLLOW_LINKS);
-    }
-
-    public void wareHouse(String day) {
-        Path path = Paths.get(sourcePath, fileNamePrefix + day + suffix);
-        CSVFormat csvFormat = CSVFormat.DEFAULT.builder()
-                .setDelimiter("||")
-                .setIgnoreHeaderCase(false)
-                .setQuote(null)
-                .build();
-        List<UserResident> batchTemp = new ArrayList<>(1024);
-        // 采用流式方式读取csv文件
-        try (Stream<String> lines = Files.lines(path)) {
-            lines.map(line -> {
-                try {
-                    return CSVParser.parse(line, csvFormat);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                    return null;
-                }
-            }).filter(Objects::nonNull).flatMap(records -> {
-                Stream.Builder<CSVRecord> builder = Stream.builder();
-                try {
-                    for (CSVRecord record : records) {
-                        builder.add(record);
-                    }
-                    return builder.build();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return null;
-                }
-            }).forEach(record -> {
-                UserResident userResident = new UserResident();
-                userResident.setMonthId(record.get(0));
-                userResident.setDayId(record.get(1));
-                userResident.setAreaNo(record.get(2));
-                userResident.setDeviceNumber(record.get(3));
-                userResident.setLac(record.get(9));
-                userResident.setCi(record.get(10));
-                batchTemp.add(userResident);
-                if (batchTemp.size() >= batchSize) {
-                    userResidentJpaDao.saveAllAndFlush(batchTemp);
-                    batchTemp.clear();
-                    log.info("batch=====");
-                }
-            });
-        } catch (IOException e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-            messageService.error(e.getMessage());
-        }
-    }
-}

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

@@ -8,7 +8,7 @@ import com.nokia.tsl_data.dao.WorkFlowBasicDataMapper;
 import com.nokia.tsl_data.dao.WorkFlowDao;
 import com.nokia.tsl_data.dao.WorkFlowDao;
 import com.nokia.tsl_data.entity.TaskRecord;
 import com.nokia.tsl_data.entity.TaskRecord;
 import com.nokia.tsl_data.entity.WorkFlowBasicData;
 import com.nokia.tsl_data.entity.WorkFlowBasicData;
-import com.nokia.tsl_data.properties.TargetProperties;
+import com.nokia.tsl_data.properties.TslDataProperties;
 
 
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 
 
@@ -47,7 +47,7 @@ public class WorkFlowService {
     @Autowired
     @Autowired
     private AvgDurationMapperV3 avgDurationMapperV3;
     private AvgDurationMapperV3 avgDurationMapperV3;
     @Autowired
     @Autowired
-    private TargetProperties targetProperties;
+    private TslDataProperties tslDataProperties;
 
 
     private final DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
     private final DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
             .withZone(ZoneId.of("Asia/Shanghai"));
             .withZone(ZoneId.of("Asia/Shanghai"));
@@ -97,7 +97,7 @@ public class WorkFlowService {
             e.printStackTrace();
             e.printStackTrace();
             throw new RuntimeException(e.getMessage());
             throw new RuntimeException(e.getMessage());
         }
         }
-        List<Map<String, Object>> data = workFlowBasicDataMapper.selectTimeoutTsCountForDay(start, end, targetProperties.getDuration());
+        List<Map<String, Object>> data = workFlowBasicDataMapper.selectTimeoutTsCountForDay(start, end, tslDataProperties.getDuration());
         Map<String, Map<String, Object>> dayMap = new HashMap<>();
         Map<String, Map<String, Object>> dayMap = new HashMap<>();
         for (Map<String, Object> map : data) {
         for (Map<String, Object> map : data) {
             dayMap.put((String) map.get("city"), map);
             dayMap.put((String) map.get("city"), map);
@@ -188,11 +188,11 @@ public class WorkFlowService {
             Map<String, Object> map = dayMap.get(area);
             Map<String, Object> map = dayMap.get(area);
             if (map == null) {
             if (map == null) {
                 list.add(2, 0.0);
                 list.add(2, 0.0);
-                list.add(3, targetProperties.getDuration());
+                list.add(3, tslDataProperties.getDuration());
                 list.add(4, 0.0);
                 list.add(4, 0.0);
             } else {
             } else {
                 list.add(2, dayMap.get(area).get("avg_duration"));
                 list.add(2, dayMap.get(area).get("avg_duration"));
-                list.add(3, targetProperties.getDuration());
+                list.add(3, tslDataProperties.getDuration());
                 // 与目标值差距
                 // 与目标值差距
                 list.add(4, ((double) list.get(2)) - (int) list.get(3));
                 list.add(4, ((double) list.get(2)) - (int) list.get(3));
             }
             }
@@ -210,7 +210,7 @@ public class WorkFlowService {
             allCity.add(0.0);
             allCity.add(0.0);
         } else {
         } else {
             allCity.add(dayMap.get("全省").get("avg_duration"));
             allCity.add(dayMap.get("全省").get("avg_duration"));
-            allCity.add(targetProperties.getDuration());
+            allCity.add(tslDataProperties.getDuration());
             allCity.add((double) allCity.get(2) - (double) allCity.get(1));
             allCity.add((double) allCity.get(2) - (double) allCity.get(1));
         }
         }
         return result;
         return result;

+ 2 - 3
src/main/java/com/nokia/tsl_data/util/DateFormatUtil.java

@@ -23,10 +23,9 @@ public class DateFormatUtil {
     }
     }
 
 
     public static Date zeroClockTodayDate() {
     public static Date zeroClockTodayDate() {
-        DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd000000");
-        String formattedDateString = dateFormat.format(new Date());
+        String formattedDateString = new SimpleDateFormat("yyyyMMdd000000").format(new Date());
         try {
         try {
-            return dateFormat.parse(formattedDateString);
+            return new SimpleDateFormat("yyyyMMddHHmmss").parse(formattedDateString);
         } catch (ParseException e) {
         } catch (ParseException e) {
             e.printStackTrace();
             e.printStackTrace();
             throw new RuntimeException("获取zeroClockTodayDate出错: " + e.getMessage());
             throw new RuntimeException("获取zeroClockTodayDate出错: " + e.getMessage());

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

@@ -14,6 +14,7 @@ class TslDataApplicationTest {
 
 
     @Test
     @Test
     void test() {
     void test() {
-        taskService.generateReportV3("20240103");
+        taskService.generateReportV3("20240108");
     }
     }
+
 }
 }