瀏覽代碼

1. 修复了 MobileComplaintMapper.selectAllForMonth 查错表的bug
2. scheduling-starter 依赖版本 变更为 1.0.1-SNAPSHOT 需要同时更新表结构
3. 修复 DataWarehouseService.checkSource 的逻辑错误

lifuquan 1 年之前
父節點
當前提交
88d58cce5c

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

@@ -35,6 +35,18 @@ Content-Type: application/json
 20231203
 
 ### 删除 high_quality_list 数据
+POST http://192.168.10.7:22222/tsl_data/highQualityData/generate
+Content-Type: application/json
+
+20231203
+
+### 删除 high_quality_list 数据
+POST http://192.168.10.7:22222/tsl_data/highQualityData/delete
+Content-Type: application/json
+
+20231203
+
+### 生成报表
 POST http://192.168.10.7:22222/tsl_data/report/generate
 Content-Type: application/json
 

+ 2 - 1
pom.xml

@@ -42,10 +42,11 @@
             <artifactId>push-message-starter</artifactId>
             <version>1.1.0</version>
         </dependency>
+        <!-- scheduling-starter -->
         <dependency>
             <groupId>com.nokia</groupId>
             <artifactId>scheduling-starter</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>1.0.1-SNAPSHOT</version>
         </dependency>
         <!-- common-utils -->
         <dependency>

+ 2 - 2
src/main/java/com/nokia/tsl_data/controller/ReportGenerateController.java

@@ -50,11 +50,11 @@ public class ReportGenerateController {
     public R deleteHighQualityData(@RequestBody String day) {
         try {
             highQualityDataService.deleteHighQualityData(day);
-            return R.ok().message(String.format("HighQualityData 账期 %s 生成成功", day));
+            return R.ok().message(String.format("HighQualityData 账期 %s 删除成功", day));
         } catch (Exception e) {
             log.error(e.getMessage());
             e.printStackTrace();
-            return R.error().message(String.format("HighQualityData 账期 %s 生成失败: %s", day, e.getMessage()));
+            return R.error().message(String.format("HighQualityData 账期 %s 删除失败: %s", day, e.getMessage()));
         }
     }
 }

+ 1 - 1
src/main/java/com/nokia/tsl_data/dao/MobileComplaintMapper.java

@@ -88,7 +88,7 @@ public interface MobileComplaintMapper {
     /**
      * 投诉清单按月计算总数
      */
-    @Select("select count(1) as num from tsl_data.high_quality_list_day hdmc " +
+    @Select("select count(1) as num from tsl_data.mobile_complaint_day hdmc " +
             "where month_id = substring(#{day} from 1 for 6) and day_id = substring(#{day} from 7 for 2)")
     int selectAllForMonth(String day);
 

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

@@ -44,28 +44,26 @@ public class DataWarehouseService {
 
     public String checkSource(String day) {
         StringBuffer stringBuffer = new StringBuffer();
+        // 注意,只有文件已存在时才能 checkMD5, 否则读取MD5文件时必出异常
         // 河北_CEM移网质量投诉明细
         File mobileComplaintDayFile = getMobileComplaintDayFile(day);
         if (!mobileComplaintDayFile.exists()) {
             stringBuffer.append("河北_CEM移网质量投诉明细_HE_D_MOBILE_COMP表账期 ").append(day).append(" 数据未到达");
-        }
-        if (!checkMD5(mobileComplaintDayFile)) {
+        }else if (!checkMD5(mobileComplaintDayFile)) {
             stringBuffer.append("河北_CEM移网质量投诉明细_HE_D_MOBILE_COMP表账期 ").append(day).append(" MD5验证未通过");
         }
         // 河北_CEM高品质2日明细
         File highQualityListDayFile = getHighQualityListDayFile(day);
         if (!highQualityListDayFile.exists()) {
             stringBuffer.append("河北_CEM高品质2日明细_HE_D_HIGH_QUALITY_LIST表账期 ").append(day).append(" 数据未到达");
-        }
-        if (!checkMD5(highQualityListDayFile)) {
+        }else if (!checkMD5(highQualityListDayFile)) {
             stringBuffer.append("河北_CEM高品质2日明细_HE_D_HIGH_QUALITY_LIST表账期 ").append(day).append(" MD5验证未通过");
         }
         // 河北_CEM高品质2日统计
         File highQualityCountDayFile = getHighQualityCountDayFile(day);
         if (!highQualityCountDayFile.exists()) {
             stringBuffer.append("河北_CEM高品质2日统计_HE_D_HIGH_QUALITY_COUNT表账期 ").append(day).append(" 数据未到达");
-        }
-        if (!checkMD5(highQualityCountDayFile)) {
+        } else if (!checkMD5(highQualityCountDayFile)) {
             stringBuffer.append("河北_CEM高品质2日统计_HE_D_HIGH_QUALITY_COUNT表账期 ").append(day).append(" MD5验证未通过");
         }
         return stringBuffer.toString();

+ 7 - 7
src/main/resources/application.yml

@@ -33,10 +33,10 @@ spring:
     password: Richr00t#
 
 ---
-spring:
-  profiles: dev
-  datasource:
-    driver-class-name: org.postgresql.Driver
-    url: jdbc:postgresql://localhost:5432/tsl_data
-    username: postgres
-    password: fantuan1985
+#spring:
+#  profiles: dev
+#  datasource:
+#    driver-class-name: org.postgresql.Driver
+#    url: jdbc:postgresql://localhost:5432/tsl_data
+#    username: postgres
+#    password: fantuan1985