Sfoglia il codice sorgente

宁夏健康报告中间表服务修改

xieshengjie 2 anni fa
parent
commit
56e6d00630

+ 32 - 0
histroy/healthmanagement-histroy/src/main/java/com/gyee/healthmanagementhistroy/init/Init.java

@@ -0,0 +1,32 @@
+//package com.gyee.healthmanagementhistroy.init;
+//
+//import com.gyee.healthmanagementhistroy.service.healthreport.HealthReportService;
+//import org.springframework.boot.CommandLineRunner;
+//import org.springframework.stereotype.Component;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @ClassName : Init
+// * @Author : xieshengjie
+// * @Date: 2022/6/25 16:56
+// * @Description :
+// */
+//@Component
+//public class Init implements CommandLineRunner {
+//
+//    @Resource
+//    private HealthReportService healthReportService;
+//
+//    @Override
+//    public void run(String... args) throws Exception {
+//        healthReportService.savePowerfitting(null);
+//        healthReportService.saveDeviation(null);
+//        healthReportService.saveDfpcl(null);
+//        healthReportService.saveDfpclWindAndPower(null);
+//        healthReportService.saveQrqc(null);
+//        healthReportService.savePartdanger(null);
+//        healthReportService.saveFaultclassification(null);
+//        healthReportService.savePartpower(null);
+//    }
+//}

+ 5 - 3
histroy/healthmanagement-histroy/src/main/java/com/gyee/healthmanagementhistroy/service/healthreport/HealthReportService.java

@@ -1,6 +1,7 @@
 package com.gyee.healthmanagementhistroy.service.healthreport;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.model.StringUtils;
 import com.gyee.common.util.CommonUtils;
 import com.gyee.common.util.DateUtils;
 import com.gyee.healthmanagementhistroy.mapper.healthreport.PartDangerMapper;
@@ -9,13 +10,11 @@ import com.gyee.healthmanagementhistroy.model.auto.*;
 import com.gyee.healthmanagementhistroy.model.healthreport.PartDanger;
 import com.gyee.healthmanagementhistroy.model.healthreport.PartPower;
 import com.gyee.healthmanagementhistroy.service.auto.*;
-import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.lang.reflect.Field;
 import java.util.*;
-import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 /**
@@ -260,7 +259,10 @@ public class HealthReportService {
             }
             reportdanger.setCountavg((int) avgcount);
             reportdanger.setTimesavg(avgtime);
-            resultList.add(reportdanger);
+            if (StringUtils.isNotEmpty(reportdanger.getPart())){
+                resultList.add(reportdanger);
+            }
+
         });
         reportdangerService.saveBatch(resultList);
     }