huangws пре 8 месеци
родитељ
комит
93cfdab2a1
33 измењених фајлова са 1854 додато и 534 уклоњено
  1. 7 0
      GetDataByRESTful/pom.xml
  2. 2 9
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/GetDataByRESTfulApplication.java
  3. 9 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/OpenApiConfig.java
  4. 33 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/controller/IBPSEnvirMonitorController.java
  5. 168 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/controller/IBPSLISController.java
  6. 72 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/controller/IBPSQualityIndicatorController.java
  7. 3 41
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/ApiClientService.java
  8. 0 19
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/ApiException.java
  9. 0 34
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/ApiResponse.java
  10. 1 38
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/HandleDataService.java
  11. 22 37
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/IBPSService.java
  12. 41 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/ApiClientServiceImpl.java
  13. 249 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/BasicMethod.java
  14. 39 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/ConditionalOnEndpoint.java
  15. 83 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/IBPSServiceImpl.java
  16. 95 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/CriticalReport.java
  17. 98 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/IncorrectLISReport.java
  18. 101 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/OvertimeReport.java
  19. 100 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/PostiveReport.java
  20. 179 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/QCMonthReport.java
  21. 113 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/RerunSampleRecord.java
  22. 140 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/QualityIndicator/QualityIndicator.java
  23. 38 0
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/SwaggerConfig.java
  24. 0 94
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/view/TemperatureEntity.java
  25. 0 49
      GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/view/repository/TemperatureEntityRepository.java
  26. 39 6
      GetDataByRESTful/src/main/resources/application.properties
  27. 1 9
      GetDataByView/src/main/java/com/jyxt/getdatabyview/DateRangeUtil.java
  28. 26 15
      GetDataByView/src/main/java/com/jyxt/getdatabyview/GetDataByViewApplication.java
  29. 0 72
      GetDataByView/src/main/java/com/jyxt/getdatabyview/view/QualityIndicator.java
  30. 137 0
      GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/IBPSRepository.java
  31. 54 0
      GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/LISViewRepository.java
  32. 0 105
      GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/QualityIndicatorRepository.java
  33. 4 6
      GetDataByView/src/main/resources/application.properties

+ 7 - 0
GetDataByRESTful/pom.xml

@@ -12,6 +12,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <spring-boot.version>2.7.6</spring-boot.version>
+        <springdoc-openapi.version>1.6.14</springdoc-openapi.version>
     </properties>
     <dependencies>
         <dependency>
@@ -41,6 +42,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+        <!-- SpringDoc OpenAPI UI -->
+        <dependency>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-ui</artifactId>
+            <version>${springdoc-openapi.version}</version>
+        </dependency>
     </dependencies>
     <dependencyManagement>
         <dependencies>

+ 2 - 9
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/GetDataByRESTfulApplication.java

@@ -1,8 +1,6 @@
 package com.jyxt.getdatabyrestful;
 
 import com.jyxt.getdatabyrestful.service.IBPSService;
-import com.jyxt.getdatabyrestful.view.TemperatureEntity;
-import com.jyxt.getdatabyrestful.view.repository.TemperatureEntityRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,15 +24,10 @@ public class GetDataByRESTfulApplication implements CommandLineRunner {
     @Autowired
     private ConfigurableApplicationContext context;
 
-    @Autowired
-    IBPSService ibpsService;
-
     @Override
     public void run(String... args) throws Exception{
-        log.info("<-------------new turn start...------------->");
-        ibpsService.QryUndoData();
-        context.close(); // 直接关闭上下文
-        log.info("<-------------this turn finish...------------->");
+        log.info("<-------------start...------------->");
+
     }
 
 }

+ 9 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/OpenApiConfig.java

@@ -0,0 +1,9 @@
+package com.jyxt.getdatabyrestful;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class OpenApiConfig {
+
+}

+ 33 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/controller/IBPSEnvirMonitorController.java

@@ -0,0 +1,33 @@
+package com.jyxt.getdatabyrestful.controller;
+
+import com.jyxt.getdatabyrestful.service.IBPSService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/EnvirMonitor") // 基础路径
+@Tag(name = "金源信通设施环境管理模块标准接口", description = "")
+@ConditionalOnProperty(
+        name = "interface.EnvirMonitor",
+        havingValue = "1",
+        matchIfMissing = false // 若配置不存在则禁用
+)
+public class IBPSEnvirMonitorController {
+    @Autowired
+    IBPSService ibpsService;
+
+    // 示例:GET接口
+    @GetMapping("/test")
+    @Operation(summary = "示例接口", description = "这是一个示例GET接口,点击右侧'try it out'测试接口能否正常调用")
+    public String hello(@Parameter(description = "用户名", required = true)
+                        @RequestParam String name) {
+        return "Hello, " + name;
+    }
+}

+ 168 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/controller/IBPSLISController.java

@@ -0,0 +1,168 @@
+package com.jyxt.getdatabyrestful.controller;
+
+import com.jyxt.getdatabyrestful.service.IBPSService;
+import com.jyxt.getdatabyrestful.service.impl.ConditionalOnEndpoint;
+import io.swagger.v3.oas.annotations.media.Schema;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/LISProcess") // 基础路径
+@Tag(name = "金源信通检验过程管理模块标准接口", description = "")
+@ConditionalOnProperty(
+        name = "interface.LISProcess",
+        havingValue = "1",
+        matchIfMissing = false // 若配置不存在则禁用
+)
+public class IBPSLISController {
+    @Autowired
+    IBPSService ibpsService;
+
+    // 示例:GET接口
+    @GetMapping("/test")
+    @Operation(summary = "示例接口", description = "这是一个示例GET接口,点击右侧'try it out'测试接口能否正常调用")
+    @ConditionalOnEndpoint(property = "interface.test")
+    public String hello(@Parameter(description = "用户名", required = true)
+                            @RequestParam String name) {
+        return "Hello, " + name;
+    }
+
+    @PostMapping("/QCMonthReport")
+    @Operation(summary = "室内质控月分析总结报告", description = "")
+    @ConditionalOnEndpoint(property = "interface.QCMonthReport")
+    public String saveMonthReport(@RequestBody
+                                      @Schema(
+                                              name = "室内质控月分析总结报告",
+                                              description = "请求示例",
+                                              example = "[{\"CreateUser\":\"创建人张三\",\"CreateTime\":\"2025-07-08 08:30:22\",\"DeviceCode\":\"贝克曼DXI800\"," +
+                                                      "\"DeviceModel\":\"DXI800\",\"ReportDate\":\"2025年6月\",\"QCTestCode\":[{\"TestCode\":\"ALB\",\"QCMFG\":\"伯乐\"," +
+                                                      "\"QCName\":\"9901\",\"LotNumber\":\"220901L\",\"LotStartTime\":\"09-02\",\"QCRule\":\"13s、22s\",\"QCLevel\":\"低\"," +
+                                                      "\"QCChartAvg\":\"55.00\",\"QCChartSD\":\"3.99\",\"QCChartCV\":\"7\",\"RawDataAvg\":\"54.57\",\"RawDataSD\":\"1\"," +
+                                                      "\"RawDataCV\":\"1\",\"RawDataNum\":\"2\",\"OutControlNum\":\"1\",\"ControlDataAvg\":\"1\",\"ControlDataSD\":\"1\"," +
+                                                      "\"ControlDataCV\":\"1\",\"AccumDataAvg\":\"1\",\"AccumDataSD\":\"1\",\"AccumDataCV\":\"1\",\"AccumDataNum\":\"1\"," +
+                                                      "\"AccumDataPer\":\"1\",\"CVRange\":\"1\",\"pass\":\"是\"},{\"TestCode\":\"ALB\",\"QCMFG\":\"伯乐\",\"QCName\":\"9902\"," +
+                                                      "\"LotNumber\":\"220901H\",\"LotStartTime\":\"09-02\",\"QCRule\":\"13s、22s\",\"QCLevel\":\"高\",\"QCChartAvg\":\"55.00\"," +
+                                                      "\"QCChartSD\":\"3.99\",\"QCChartCV\":\"7\",\"RawDataAvg\":\"54.57\",\"RawDataSD\":\"1\",\"RawDataCV\":\"1\"," +
+                                                      "\"RawDataNum\":\"2\",\"OutControlNum\":\"1\",\"ControlDataAvg\":\"1\",\"ControlDataSD\":\"1\",\"ControlDataCV\":\"1\"," +
+                                                      "\"AccumDataAvg\":\"1\",\"AccumDataSD\":\"1\",\"AccumDataCV\":\"1\",\"AccumDataNum\":\"1\",\"AccumDataPer\":\"1\"," +
+                                                      "\"CVRange\":\"1\",\"pass\":\"是\"}]}]"
+                                      )
+                                      List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        // 处理业务逻辑(如保存到数据库)
+        retValue = ibpsService.saveMonthReport(inputList);
+        return retValue;
+    }
+
+    @PostMapping("/RerunSampleRecord")
+    @Operation(summary = "复检样品记录", description = "")
+    @ConditionalOnEndpoint(property = "interface.RerunSampleRecord")
+    public String saveRerunSample(@RequestBody
+                                    @Schema(
+                                        name = "复检样品记录",
+                                        description = "请求示例",
+                                        example = "[{\"CreateUser\":\"编制人张三\",\"CreateTime\":\"2025-07-08 08:30:22\",\"SampleCode\":\"20250708001\"," +
+                                                "\"PatName\":\"病人李四\",\"TestCode\":\"UA\",\"TestCodeName\":\"尿酸\",\"Unit\":\"g/ml\"," +
+                                                "\"InitialResult\":\"1.5\",\"RerunResult\":\"2.8\",\"ReportResult\":\"2.8\",\"Auditer\":\"审核人王五\"," +
+                                                "\"ReportTime\":\"15:02:02\",\"RerunMethod\":\"稀释复检\",\"RerunMethodNote\":\"稀释后复查\"}]"
+                                    )
+                                    List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        retValue = ibpsService.saveRerunSample(inputList);
+        return retValue;
+    }
+
+    @PostMapping("/IncorrectLISReport")
+    @Operation(summary = "不正确检验报告登记", description = "")
+    @ConditionalOnEndpoint(property = "interface.IncrrectLISReport")
+    public String saveIncorrectLISReport(@RequestBody
+                                  @Schema(
+                                          name = "不正确检验报告登记",
+                                          description = "请求示例",
+                                          example = "[{\"CreateUser\":\"编制人张三\",\"RegistTime\":\"2025-07-15 09:25\",\"SampleCode\":\"20250715001\"," +
+                                                  "\"PatName\":\"病人李四\",\"TestCode\":\"GLU\",\"InitialAuditTime\":\"2025-07-11 09:00\"," +
+                                                  "\"ReAuditTime\":\"2025-07-11 09:10\",\"FinalAuditTime\":\"2025-07-11 09:20\",\"Reason\":\"标本溶血\"}]"
+                                  )
+                                  List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        retValue = ibpsService.saveIncorrectLISReport(inputList);
+        return retValue;
+    }
+
+    @PostMapping("/CriticalReport")
+    @Operation(summary = "危急值漏报、上报超时登记", description = "")
+    @ConditionalOnEndpoint(property = "interface.CriticalReport")
+    public String saveCriticalReport(@RequestBody
+                                         @Schema(
+                                                 name = "危急值漏报、上报超时登记",
+                                                 description = "请求示例",
+                                                 example = "[{\"CreateUser\":\"编制人张三\",\"ResponsibleUser\":\"责任人李四\",\"RegistDate\":\"2025-07-01\"," +
+                                                         "\"RegistTime\":\"10:30\",\"PatName\":\"患者王五\",\"SampleCode\":\"202507011111\",\"Advice\":\"电解质5项\"," +
+                                                         "\"Type\":\"上报超时\",\"Reason\":\"溶血导致钾离子假性升高\"}]"
+                                         )
+                                         List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        retValue = ibpsService.saveCriticalReport(inputList);
+        return retValue;
+    }
+
+    @PostMapping("/OvertimeReport")
+    @Operation(summary = "急诊报告超时登记", description = "")
+    @ConditionalOnEndpoint(property = "interface.OvertimeReport")
+    public String saveOvertimeReport(@RequestBody
+                                     @Schema(
+                                             name = "急诊报告超时登记",
+                                             description = "请求示例",
+                                             example = "[{\"CreateUser\":\"编制人张三\",\"ResponsibleUser\":\"责任人李四\",\"RegistDate\":\"2025-07-01\"," +
+                                                     "\"RegistTime\":\"10:30\",\"PatName\":\"患者王五\",\"SampleCode\":\"202507011111\",\"Advice\":\"肝功能2项\"," +
+                                                     "\"TestCode\":\"AST ALB\",\"DelayMins\":\"30\",\"Reason\":\"仪器故障\",\"InfectMins\":\"30\"}]"
+                                     )
+                                     List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        retValue = ibpsService.saveOvertimeReport(inputList);
+        return retValue;
+    }
+
+
+    @PostMapping("/PostiveReport")
+    @Operation(summary = "传染病报告登记", description = "")
+    @ConditionalOnEndpoint(property = "interface.PostiveReport")
+    public String savePostiveReport(@RequestBody
+                                     @Schema(
+                                             name = "传染病报告登记",
+                                             description = "请求示例",
+                                             example = "[{\"CreateUser\":\"编制人张三\",\"RegistTime\":\"2025-07-01 10:30\",\"PatDept\":\"感染科\"," +
+                                                     "\"Doctor\":\"开单医生李四\",\"PatName\":\"患者王五\",\"PatGender\":\"男\",\"PatAge\":\"35岁\"," +
+                                                     "\"ReportDate\":\"2025-07-01\",\"ReportDocDate\":\"2025-07-01 10:10\",\"ReportPHMDate\":\"2025-07-01 10:20\",\"ReportResult\":\"抗戊型肝炎抗体IgM:1.03 S/CO。\"}]"
+                                     )
+                                     List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        retValue = ibpsService.savePostiveReport(inputList);
+        return retValue;
+    }
+}

+ 72 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/controller/IBPSQualityIndicatorController.java

@@ -0,0 +1,72 @@
+package com.jyxt.getdatabyrestful.controller;
+
+import com.jyxt.getdatabyrestful.service.IBPSService;
+import com.jyxt.getdatabyrestful.service.impl.ConditionalOnEndpoint;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/QualityIndicator") // 基础路径
+@Tag(name = "金源信通质量管理模块标准接口", description = "")
+@ConditionalOnProperty(
+        name = "interface.QualityIndicator",
+        havingValue = "1",
+        matchIfMissing = false // 若配置不存在则禁用
+)
+public class IBPSQualityIndicatorController {
+    @Autowired
+    IBPSService ibpsService;
+
+    @GetMapping("/test")
+    @Operation(summary = "示例接口", description = "这是一个示例GET接口,点击右侧'try it out'测试接口能否正常调用")
+    @ConditionalOnEndpoint(property = "interface.test")
+    public String hello(@Parameter(description = "用户名", required = true)
+                        @RequestParam String name) {
+        return "Hello, " + name;
+    }
+
+    @GetMapping("/GetQualityIndicatorItem")
+    @Operation(summary = "获取所有质量指标项目", description = "获取所有可以从对接方提供的质量指标项目,用于在接口发开阶段或者项目有调整时获取需要查询的内容")
+    @ConditionalOnEndpoint(property = "interface.getQualityIndicatorItem")
+    public String getQualityIndicatorItem() {
+        String QualityIndicatorItem = ibpsService.getQualityIndicatorItem();
+        return QualityIndicatorItem;
+    }
+
+
+    @GetMapping("/GetUndoQualityIndicator")
+    @Operation(summary = "获取未完成质量指标项目", description = "获取待处理的质量指标项目,根据里面的项目获取结果再调用:\"保存未完成质量指标项目\"接口返回值")
+    @ConditionalOnEndpoint(property = "interface.getUndoQualityIndicatorItem")
+    public String getUndoQualityIndicatorItem() {
+        String QualityIndicatorItem = ibpsService.getUndoQualityIndicatorItem();
+        return QualityIndicatorItem;
+    }
+
+    @PostMapping("/SaveQualityIndicator")
+    @Operation(summary = "保存未完成质量指标项目", description = "根据接口:\"获取未完成质量指标项目\"获取需要查询的质量指标项目后将结果通过此接口返回")
+    @ConditionalOnEndpoint(property = "interface.saveUndoQualityIndicator")
+    public String saveUndoQualityIndicator(@RequestBody
+                                     @Schema(
+                                             name = "保存未完成质量指标项目",
+                                             description = "请求示例",
+                                             example = "[{\"StatDate\":\"2024年5月份\",\"Frequency\":\"每月\",\"Target\":\"危急值通报及时率\",\"Result\":\"95\",\"Numerator\":\"95\",\"Denominator\":\"100\",\"Pass\":\"Y\"}," +
+                                                     "{\"StatDate\":\"2024年5月份\",\"Frequency\":\"每月\",\"Target\":\"危急值通报率\",\"Result\":\"100\",\"Numerator\":\"400\",\"Denominator\":\"400\",\"Pass\":\"N\"}," +
+                                                     "{\"StatDate\":\"2024年5月份\",\"Frequency\":\"每月\",\"Target\":\"实验室内周转时间中位数-急诊-凝血\",\"Result\":\"12\",\"Numerator\":\"123\",\"Denominator\":\"\",\"Pass\":\"Y\"}]"
+                                     )
+                                     List<Map<String, Object>> inputList) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty()) {
+            return "输入不能为空!";
+        }
+        retValue = ibpsService.saveUndoQualityIndicator(inputList);
+        return retValue;
+    }
+}

+ 3 - 41
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/ApiClientService.java

@@ -1,48 +1,10 @@
 package com.jyxt.getdatabyrestful.service;
 
-import com.jyxt.getdatabyrestful.GetDataByRESTfulApplication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
 import org.springframework.stereotype.Service;
-import org.springframework.web.client.RestTemplate;
 
+public interface ApiClientService {
+     String sendGet(String url);
 
-@Service
-public class ApiClientService {
-
-    private static final RestTemplate restTemplate = new RestTemplate();
-
-    private static final Logger log = LoggerFactory.getLogger(ApiClientService.class);
-
-    @Value("${api.resources.path}") // 注入配置文件中的路径
-    private String apiPath;
-
-    @Value("${UrlAddr}")
-    private String UrlAddr;
-
-
-    // GET请求
-    public static String sendGet(String url) {
-        String RetVal = restTemplate.getForObject(url, String.class);
-        return RetVal;
-    }
-
-    // POST请求
-    public static String sendPost(String url, Object request) {
-        // 设置请求头(如 JSON)
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(MediaType.APPLICATION_JSON);
-        // 包装请求体和头
-        HttpEntity<Object> httpEntity = new HttpEntity<>(request, headers);
-        // 发送 POST 请求
-        String RetVal = restTemplate.postForObject(url, request, String.class);
-        return RetVal;
-    }
-
+     String sendPost(String url, String json);
 
 }

+ 0 - 19
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/ApiException.java

@@ -1,19 +0,0 @@
-package com.jyxt.getdatabyrestful.service;
-
-public class ApiException extends RuntimeException {
-    private final int statusCode;
-
-    public ApiException(String message, int statusCode) {
-        super(message);
-        this.statusCode = statusCode;
-    }
-
-    // 新增单参数构造(默认状态码500)
-    public ApiException(String message) {
-        this(message, 500);
-    }
-
-    public int getStatusCode() {
-        return statusCode;
-    }
-}

+ 0 - 34
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/ApiResponse.java

@@ -1,34 +0,0 @@
-package com.jyxt.getdatabyrestful.service;
-
-public class ApiResponse {
-    private int code;
-    private String message;
-    private Object data;
-
-
-
-    // 标准getter/setter
-    public boolean isSuccess() {
-        return code == 200;
-    }
-
-    public void setCode(int code) {
-        this.code = code;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public Object getData() {
-        return data;
-    }
-
-    public void setData(Object data) {
-        this.data = data;
-    }
-}

+ 1 - 38
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/HandleDataService.java

@@ -1,50 +1,13 @@
 package com.jyxt.getdatabyrestful.service;
 
-import com.jyxt.getdatabyrestful.GetDataByRESTfulApplication;
-import com.jyxt.getdatabyrestful.view.repository.TemperatureEntityRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.HashMap;
-import java.util.Map;
-
 @Component
 public class HandleDataService {
-    private static final Logger log = LoggerFactory.getLogger(GetDataByRESTfulApplication.class);
-
-    @Autowired
-    private ApiClientService apiClientService;
-
-    @Autowired
-    private TemperatureEntityRepository temperatureEntityRepository;
-
-    public void startHandleData(String ID,String Bianzhishijian,String EntityName) {
-        log.info("ID: {}, Bianzhishijian: {}, EntityName: {}", ID, Bianzhishijian, EntityName);
-//        String retVal = apiClientService.sendGet("https://petstore-demo.apifox.com/pet/1");
-//        System.out.println(retVal);
-        System.out.println("---------------------------------------------------------------");
-        Map<String, Object> params = new HashMap<>();
-        params.put("username", "test");  // 替换为实际值
-        params.put("password", "test01");    // 替换为实际值
-        String retVal2 = apiClientService.sendPost("http://120.27.156.224:8089/data/api/getToken",params);
-        System.out.println(retVal2);
-//        apiClientService.callThirdPartyApi(ID, Bianzhishijian, EntityName)
-//                .doOnNext(response -> {
-//                    if(response.isSuccess()) {
-//                        log.info("处理成功数据: {}", response.getData());
-//                        // 业务处理逻辑
-//                    } else {
-//                        log.warn("业务异常: {}", response.getMessage());
-//                    }
-//                })
-//                .doOnError(e -> log.error("处理失败", e))
-//                .subscribe(
-//                    response -> {}, // 成功处理(通常留空,因已用 doOnNext)
-//                    error -> log.error("全局捕获:", error) // 兜底异常处理
-//                );
+    private static final Logger log = LoggerFactory.getLogger(HandleDataService.class);
 
-    }
 
 }

+ 22 - 37
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/IBPSService.java

@@ -1,43 +1,28 @@
 package com.jyxt.getdatabyrestful.service;
 
-import com.jyxt.getdatabyrestful.view.TemperatureEntity;
-import com.jyxt.getdatabyrestful.view.repository.TemperatureEntityRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+
+import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
+
+public interface IBPSService {
+
+     String saveMonthReport(List<Map<String, Object>> inputList);
+
+     String saveRerunSample(List<Map<String, Object>> inputList);
+
+     String saveIncorrectLISReport(List<Map<String, Object>> inputList);
+
+     String saveCriticalReport(List<Map<String, Object>> inputList);
+
+     String saveOvertimeReport(List<Map<String, Object>> inputList);
+
+     String savePostiveReport(List<Map<String, Object>> inputList);
+
+     String getQualityIndicatorItem();
+
+     String getUndoQualityIndicatorItem();
 
-@Component
-public class IBPSService {
-
-    private static final Logger log = LoggerFactory.getLogger(IBPSService.class);
-
-    @Autowired
-    private TemperatureEntityRepository temperatureEntityRepository;
-
-    @Autowired
-    private HandleDataService handleDataService;
-
-    public void QryUndoData(){
-        List<TemperatureEntity> qiList = temperatureEntityRepository.query();
-        if(qiList != null){
-            for (TemperatureEntity te : qiList) {
-                try {
-                    String Id = te.getId();
-                    String Bianzhishijian = te.getBianzhishijian();
-                    String EntityName = te.getEntityname();
-                    handleDataService.startHandleData(Id,Bianzhishijian,EntityName);
-                    break;
-                }catch (Exception ex){
-                    log.error(ex.getMessage());
-                }
-            }
-        }
-    };
-
-    public void InsertUnControlRecord(){
-
-    }
+     String saveUndoQualityIndicator(List<Map<String, Object>> QualityIndicatorList);
 }

+ 41 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/ApiClientServiceImpl.java

@@ -0,0 +1,41 @@
+package com.jyxt.getdatabyrestful.service.impl;
+
+import com.jyxt.getdatabyrestful.service.ApiClientService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+
+@Service
+public class ApiClientServiceImpl implements ApiClientService {
+
+    private static final RestTemplate restTemplate = new RestTemplate();
+
+    private static final Logger log = LoggerFactory.getLogger(ApiClientServiceImpl.class);
+
+
+    // GET请求
+    public String sendGet(String url) {
+        String RetVal = restTemplate.getForObject(url, String.class);
+        return RetVal;
+    }
+
+
+    // POST请求
+    public String sendPost(String url, String request) {
+        // 设置请求头(如 JSON)
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+        // 包装请求体和头
+        HttpEntity<Object> httpEntity = new HttpEntity<>(request, headers);
+        // 发送 POST 请求
+        String RetVal = restTemplate.postForObject(url, request, String.class);
+        return RetVal;
+    }
+
+
+}

+ 249 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/BasicMethod.java

@@ -0,0 +1,249 @@
+package com.jyxt.getdatabyrestful.service.impl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BatchPreparedStatementSetter;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Component;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.*;
+
+@Component
+public class BasicMethod {
+    private static final Logger log = LoggerFactory.getLogger(BasicMethod.class);
+
+    public static List<Map<String, Object>> userList = new ArrayList<>();
+    public static List<Map<String, Object>> posiList = new ArrayList<>();
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    public String saveToTable(List<Map<String, Object>> inputList, String TableName) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty() || TableName == null || TableName.trim().isEmpty()) {
+            return retValue;
+        }
+        try {
+            // 获取第一个Map的字段名作为表字段
+            Map<String, Object> firstRow = inputList.get(0);
+            String columns = String.join(",", firstRow.keySet());
+
+            // 构建占位符部分 (?,?,...)
+            String placeholders = String.join(",", Collections.nCopies(firstRow.size(), "?"));
+
+            // 构建完整SQL语句
+            String sql = String.format("INSERT INTO %s (%s) VALUES (%s)", TableName, columns, placeholders);
+            log.info("executing sql: " + sql);
+            // 批量执行
+            jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
+                @Override
+                public void setValues(PreparedStatement ps, int i) throws SQLException {
+                    Map<String, Object> row = inputList.get(i);
+                    int index = 1;
+                    for (Map.Entry<String, Object> entry : row.entrySet()) {
+                        String key = entry.getKey();
+                        Object value = entry.getValue();
+
+                        if (key.contains("Time") && value instanceof Timestamp) {
+                            ps.setTimestamp(index++, (Timestamp) value);
+                        } else {
+                            ps.setString(index++, value.toString());
+                        }
+                    }
+                }
+                @Override
+                public int getBatchSize() {
+                    return inputList.size();
+                }
+            });
+            retValue = "success";
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "insert failed:"+e.getMessage().split(";")[2];
+        }
+        return retValue;
+    }
+
+    /**
+     * 获取基础数据:
+     * LIS系统用户名对应金通用户信息
+     */
+    public void getBasicData(){
+        String sqlUser = "select id_,name_,positions_ from ibps_party_employee where status_='actived'";
+        userList = jdbcTemplate.queryForList(sqlUser);
+        String sqlPosi = "select * from ibps_party_position";
+        posiList = jdbcTemplate.queryForList(sqlPosi);
+    }
+
+    /**
+     * 返回用户ID@部门ID@部门名称
+     * @param userName
+     * @return
+     */
+    public String getUserInfoByName(String userName){
+        String retVal = "-1";
+        for (Map<String, Object> map : userList) {
+            if (map.get("name_").toString().equals(userName)) {
+                String userId = (String) map.get("id_");
+                String positionId = String.valueOf(map.get("positions_")).split(",")[0];
+                String positionName = (String) getPosiByID(positionId);
+                if (!positionName.equals("-1")) {
+                    retVal = userId+"@"+positionId+"@"+positionName;
+                }else{
+                    retVal = "-1^部门:"+positionName+"未找到!";
+                    return retVal;
+                }
+                return retVal;
+            }
+            retVal = "-1^用户:"+userName+"未找到!";
+        }
+        return retVal;
+    }
+
+    public String getPosiByID(String positionId){
+        String retVal = "-1";
+        for (Map<String, Object> map : posiList) {
+            if (map.get("id_").toString().equals(positionId)) {
+                retVal = map.get("name_").toString();
+                break;
+            }
+        }
+        return retVal;
+    }
+
+    public List<Map<String, Object>> getQualityIndicatorItem(){
+        String qryStr = "select tong_ji_pin_lv_ as Frequency,zhi_liang_zhi_bia as Target,yun_suan_fu_hao_ as Operator,zhi_biao_xian_zhi as LimitValue,dan_wei_ as Unit " +
+                "from t_zlzbpzzb where shi_fou_qi_yong_='Y' and bei_zhu_ like '%LIS导入%' and zhi_liang_zhi_bia is not null";
+        List<Map<String, Object>> QualityIndicatorList = jdbcTemplate.queryForList(qryStr);
+        return QualityIndicatorList;
+    }
+
+    public List<Map<String, Object>> getUndoQualityIndicatorItem(){
+        String qryStr = "select bian_zhi_shi_jian as StatDate,tong_ji_pin_lv_ as Frequency,zhi_liang_zhi_bia as Target," +
+                "SUBSTRING_INDEX(yuan_shi_shu_ju_, '@', 1) AS Operator," +
+                "SUBSTRING_INDEX(SUBSTRING_INDEX(yuan_shi_shu_ju_, '@', 2), '@', -1) AS LimitValue," +
+                "SUBSTRING_INDEX(yuan_shi_shu_ju_, '@', -1) AS Unit from t_zlzbpjzb where zhuang_tai_='待处理'";
+        List<Map<String, Object>> allUndoQualityIndicatorList = jdbcTemplate.queryForList(qryStr);
+        return allUndoQualityIndicatorList;
+    }
+
+    public String updateToTable(Map<String, Object> conditionData, Map<String, Object> updateData, String TableName){
+        String retVal = "fail";
+        // 验证输入数据有效性
+        if (updateData == null || updateData.isEmpty()) {
+            log.warn("Update failed: updateData is null or empty");
+            return "fail: updateData is null or empty";
+        }
+        if (conditionData == null || conditionData.isEmpty()) {
+            log.warn("Update failed: conditionData is null or empty");
+            return "fail: conditionData is null or empty";
+        }
+        try {
+            // 1. 构建动态SET子句
+            StringBuilder setClause = new StringBuilder();
+            List<Object> params = new ArrayList<>();
+            for (Map.Entry<String, Object> entry : updateData.entrySet()) {
+                String column = validateColumnName(entry.getKey());
+                if (column == null) {
+                    String error = "Invalid update column name: " + entry.getKey();
+                    log.warn("Update failed: {}", error);
+                    return "fail: " + error;
+                }
+                if (setClause.length() > 0) setClause.append(", ");
+                setClause.append(column).append(" = ?");
+                params.add(entry.getValue());
+            }
+            // 2. 构建动态WHERE子句
+            StringBuilder whereClause = new StringBuilder();
+            for (Map.Entry<String, Object> entry : conditionData.entrySet()) {
+                String column = validateColumnName(entry.getKey());
+                if (column == null) {
+                    String error = "Invalid condition column name: " + entry.getKey();
+                    log.warn("Update failed: {}", error);
+                    return "fail: " + error;
+                }
+                if (whereClause.length() > 0) whereClause.append(" AND ");
+                whereClause.append(column).append(" = ?");
+                params.add(entry.getValue());
+            }
+            // 3. 验证表名
+            if (!isValidTableName(TableName)) {
+                String error = "Invalid table name: " + TableName;
+                log.warn("Update failed: {}", error);
+                return "fail: " + error;
+            }
+            // 4. 构建完整SQL语句
+            String sql = "UPDATE " + TableName + " SET " + setClause +
+                    " WHERE " + whereClause;
+            // 5. 记录SQL语句和参数到日志
+            logSQLWithParams(sql, params);
+            // 6. 执行更新操作
+            int rowsAffected = jdbcTemplate.update(sql, params.toArray());
+
+            // 7. 记录更新结果
+            if (rowsAffected > 0) {
+                log.info("Update successful: {} row(s) affected in table '{}'", rowsAffected, TableName);
+                return "success";
+            } else {
+                log.warn("Update completed but no rows affected in table '{}'", TableName);
+                return "fail: no rows updated";
+            }
+        } catch (DataAccessException e) {
+            String error = "Database error: " + e.getMessage();
+            log.error("Update failed: {}", error, e);
+            return "fail: " + error;
+        } catch (Exception e) {
+            String error = "System error: " + e.getMessage();
+            log.error("Update failed: {}", error, e);
+            return "fail: " + error;
+        }
+    }
+
+    // 列名校验方法
+    private String validateColumnName(String columnName) {
+        // 只允许字母、数字和下划线
+        if (columnName == null || !columnName.matches("[a-zA-Z0-9_]+")) {
+            return null;
+        }
+        return columnName;
+    }
+
+    // 表名校验方法
+    private boolean isValidTableName(String tableName) {
+        // 可根据需要扩展校验规则
+        return tableName != null && tableName.matches("[a-zA-Z0-9_]+");
+    }
+
+    // 记录SQL语句和参数
+    private void logSQLWithParams(String sql, List<Object> params) {
+        if (log.isInfoEnabled()) {
+            StringBuilder logMessage = new StringBuilder("Executing SQL: \n");
+            logMessage.append(sql);
+
+            if (params != null && !params.isEmpty()) {
+                logMessage.append("\nParameters: [");
+                for (int i = 0; i < params.size(); i++) {
+                    if (i > 0) logMessage.append(", ");
+
+                    Object param = params.get(i);
+                    // 对字符串添加引号
+                    if (param instanceof String) {
+                        logMessage.append("'").append(param).append("'");
+                    } else {
+                        logMessage.append(param);
+                    }
+                }
+                logMessage.append("]");
+            }
+
+            log.info(logMessage.toString());
+        }
+    }
+
+
+}

+ 39 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/ConditionalOnEndpoint.java

@@ -0,0 +1,39 @@
+package com.jyxt.getdatabyrestful.service.impl;
+
+import org.springframework.context.annotation.Condition;
+import org.springframework.context.annotation.ConditionContext;
+import org.springframework.core.type.AnnotatedTypeMetadata;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Map;
+
+// 自定义注解定义
+@Target({ElementType.METHOD}) // 只作用于方法级别
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ConditionalOnEndpoint {
+    String property();         // 配置属性名
+    String havingValue() default "1"; // 启用值,默认"1"
+}
+
+// 条件判断实现
+class EndpointCondition implements Condition {
+    @Override
+    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
+        // 获取注解属性
+        Map<String, Object> attrs = metadata.getAnnotationAttributes(
+                ConditionalOnEndpoint.class.getName()
+        );
+
+        // 读取注解参数
+        String property = (String) attrs.get("property");
+        String expectedValue = (String) attrs.get("havingValue");
+
+        // 从环境变量获取配置值
+        String actualValue = context.getEnvironment().getProperty(property);
+
+        // 检查是否匹配
+        return expectedValue.equals(actualValue);
+    }
+}

+ 83 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/IBPSServiceImpl.java

@@ -0,0 +1,83 @@
+package com.jyxt.getdatabyrestful.service.impl;
+
+import com.jyxt.getdatabyrestful.service.IBPSService;
+import com.jyxt.getdatabyrestful.service.impl.LISProcess.*;
+import com.jyxt.getdatabyrestful.service.impl.QualityIndicator.QualityIndicator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.BatchPreparedStatementSetter;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.*;
+
+@Service
+public class IBPSServiceImpl implements IBPSService {
+    private static final Logger log = LoggerFactory.getLogger(IBPSServiceImpl.class);
+
+    @Autowired
+    RerunSampleRecord rerunSampleRecord;
+
+    @Autowired
+    QCMonthReport qcMonthReport;
+
+    @Autowired
+    IncorrectLISReport incorrectLISReport;
+
+    @Autowired
+    CriticalReport criticalReport;
+
+    @Autowired
+    OvertimeReport overtimeReport;
+
+    @Autowired
+    QualityIndicator qualityIndicator;
+
+    @Autowired
+    PostiveReport postiveReport;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    //检验过程管理---------------------------------------------------------------------------
+    public String saveMonthReport(List<Map<String, Object>> inputList) {
+        return qcMonthReport.saveMonthReport(inputList);
+    }
+
+
+    public String saveRerunSample(List<Map<String, Object>> inputList) {
+        return rerunSampleRecord.saveRerunSample(inputList);
+    }
+
+    public String saveIncorrectLISReport(List<Map<String, Object>> inputList) {
+        return incorrectLISReport.saveIncorrectLISReport(inputList);
+    }
+
+    public String saveCriticalReport(List<Map<String, Object>> inputList) {
+        return criticalReport.saveCriticalReport(inputList);
+    }
+
+    public String saveOvertimeReport(List<Map<String, Object>> inputList) {
+        return overtimeReport.saveOvertimeReport(inputList);
+    }
+
+    public String savePostiveReport(List<Map<String, Object>> inputList) {
+        return postiveReport.savePostiveReport(inputList);
+    }
+
+    //质量管理---------------------------------------------------------------------------
+    public String getQualityIndicatorItem() {
+        return qualityIndicator.getQualityIndicatorItem();
+    }
+
+    public String getUndoQualityIndicatorItem() {
+        return qualityIndicator.getUndoQualityIndicatorItem();
+    }
+
+    public String saveUndoQualityIndicator(List<Map<String, Object>> QualityIndicatorList){
+        return qualityIndicator.saveUndoQualityIndicator(QualityIndicatorList);
+    }
+}

+ 95 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/CriticalReport.java

@@ -0,0 +1,95 @@
+package com.jyxt.getdatabyrestful.service.impl.LISProcess;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+@Component
+public class CriticalReport {
+    private static final Logger log = LoggerFactory.getLogger(CriticalReport.class);
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    static {
+        // 静态初始化块中填充数据
+        fieldConnect.put("CreateUser", "create_by_");
+        fieldConnect.put("ResponsibleUser", "ze_ren_ren_");
+        fieldConnect.put("RegistDate", "ri_qi_");
+        fieldConnect.put("RegistTime", "deng_ji_shi_jian_");
+        fieldConnect.put("PatName", "huan_zhe_xing_min");
+        fieldConnect.put("SampleCode", "jian_yan_hao_");
+        fieldConnect.put("Advice", "yi_zhu_ming_cheng");
+        fieldConnect.put("Type", "lei_xing_");
+        fieldConnect.put("Reason", "chao_shi_yuan_yin");
+
+    }
+
+    public String saveCriticalReport(List<Map<String, Object>> inputList) {
+        // 新增校验逻辑:检查必填字段
+        if (inputList == null) {
+            return "入参为空!";
+        }
+        for (Map<String, Object> map : inputList) {
+            for (String requiredKey : fieldConnect.keySet()) {
+                // 检查键是否存在且值非空
+                if (!map.containsKey(requiredKey) ||
+                        map.get(requiredKey) == null ||
+                        String.valueOf(map.get(requiredKey)).trim().isEmpty()) {
+                    return "参数:"+requiredKey+"为空或不存在!"; // 返回缺失或为空的key
+                }
+            }
+        }
+        basicMethod.getBasicData();
+        String retValue = "-1";
+        List<Map<String, Object>> insertList = new ArrayList<Map<String, Object>>();
+        String fieldName = null;
+        String fieldValue = null;
+        Timestamp timeValue = null;
+        for (Map<String, Object> inputMap : inputList) {
+            Map<String, Object> insertMap = new HashMap<>();
+            //部分字段直接添加
+            LocalDateTime currentDate = LocalDateTime.now();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedDate = currentDate.format(formatter);
+            insertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+            String userInfo = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser")));
+            if(userInfo.contains("-1^")){
+                return userInfo.split("\\^")[1];
+            }
+            insertMap.put("ze_ren_ren_", basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser"))).split("@")[0]);
+            insertMap.put("shi_fou_guo_shen_", "已完成");
+            insertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+            insertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(formattedDate));
+            insertMap.put("create_by_", userInfo.split("@")[0]);
+            insertMap.put("create_time_", Timestamp.valueOf(formattedDate));
+            insertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+            insertMap.put("di_dian_", userInfo.split("@")[1]);
+            for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
+                fieldName = null;
+                fieldValue = null;
+                timeValue = null;
+                fieldName = fieldConnect.get(entry.getKey());
+                fieldValue = String.valueOf(entry.getValue());
+                if(fieldName!=null){
+                    fieldValue = String.valueOf(fieldValue);
+                    String existingValue = String.valueOf(insertMap.get(fieldName)); // 获取当前值
+                    if (existingValue == "null" || existingValue.isEmpty()) {
+                        insertMap.put(fieldName, fieldValue);
+                    }
+                }
+            }
+            insertList.add(insertMap);
+        }
+        retValue = basicMethod.saveToTable(insertList, "t_jzbg");
+        return retValue;
+    }
+}

+ 98 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/IncorrectLISReport.java

@@ -0,0 +1,98 @@
+package com.jyxt.getdatabyrestful.service.impl.LISProcess;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+@Component
+public class IncorrectLISReport {
+
+    private static final Logger log = LoggerFactory.getLogger(IncorrectLISReport.class);
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    static {
+        // 静态初始化块中填充数据
+        fieldConnect.put("CreateUser", "create_by_");
+        fieldConnect.put("RegistTime", "deng_ji_shi_jian_");
+        fieldConnect.put("PatName", "huan_zhe_xing_min");
+        fieldConnect.put("SampleCode", "jian_yan_hao_");
+        fieldConnect.put("TestCode", "jian_yan_xiang_mu");
+        fieldConnect.put("InitialAuditTime", "shen_he_shi_jian_");
+        fieldConnect.put("ReAuditTime", "chong_shen_shi_ji");
+        fieldConnect.put("FinalAuditTime", "shen_he_shijian_");
+        fieldConnect.put("Reason", "chong_shen_yuan_y");
+
+    }
+
+    public String saveIncorrectLISReport(List<Map<String, Object>> inputList) {
+        // 新增校验逻辑:检查必填字段
+        if (inputList == null) {
+            return "入参为空!";
+        }
+        for (Map<String, Object> map : inputList) {
+            for (String requiredKey : fieldConnect.keySet()) {
+                // 检查键是否存在且值非空
+                if (!map.containsKey(requiredKey) ||
+                        map.get(requiredKey) == null ||
+                        String.valueOf(map.get(requiredKey)).trim().isEmpty()) {
+                    return "参数:"+requiredKey+"为空或不存在!"; // 返回缺失或为空的key
+                }
+            }
+        }
+        basicMethod.getBasicData();
+        String retValue = "-1";
+        List<Map<String, Object>> insertList = new ArrayList<Map<String, Object>>();
+        String fieldName = null;
+        String fieldValue = null;
+        Timestamp timeValue = null;
+        for (Map<String, Object> inputMap : inputList) {
+            Map<String, Object> insertMap = new HashMap<>();
+            //部分字段直接添加
+            LocalDateTime currentDate = LocalDateTime.now();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedDate = currentDate.format(formatter);
+            insertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+            String userInfo = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser")));
+            if(userInfo.contains("-1^")){
+                return userInfo.split("\\^")[1];
+            }
+            insertMap.put("shi_fou_guo_shen_", "已完成");
+            insertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+            insertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(formattedDate));
+            insertMap.put("create_by_", userInfo.split("@")[0]);
+            insertMap.put("create_time_", Timestamp.valueOf(formattedDate));
+            insertMap.put("ze_ren_ren_", userInfo.split("@")[0]);
+            insertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+            insertMap.put("di_dian_", userInfo.split("@")[1]);
+            for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
+                fieldName = null;
+                fieldValue = null;
+                timeValue = null;
+                fieldName = fieldConnect.get(entry.getKey());
+                fieldValue = String.valueOf(entry.getValue());
+                if(fieldName!=null){
+                    fieldValue = String.valueOf(fieldValue);
+                    String existingValue = String.valueOf(insertMap.get(fieldName)); // 获取当前值
+                    if (existingValue == "null" || existingValue.isEmpty()) {
+                        insertMap.put(fieldName, fieldValue);
+                    }
+                }
+            }
+            insertList.add(insertMap);
+        }
+        retValue = basicMethod.saveToTable(insertList, "t_bzqjybgdjb");
+        return retValue;
+    }
+}

+ 101 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/OvertimeReport.java

@@ -0,0 +1,101 @@
+package com.jyxt.getdatabyrestful.service.impl.LISProcess;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+@Component
+public class OvertimeReport {
+    private static final Logger log = LoggerFactory.getLogger(OvertimeReport.class);
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    static {
+        // 静态初始化块中填充数据
+        fieldConnect.put("CreateUser", "create_by_");
+        fieldConnect.put("ResponsibleUser", "ze_ren_ren_");
+        fieldConnect.put("RegistDate", "ri_qi_");
+        fieldConnect.put("RegistTime", "deng_ji_shi_jian_");
+        fieldConnect.put("PatName", "huan_zhe_xing_min");
+        fieldConnect.put("SampleCode", "jian_yan_hao_");
+        fieldConnect.put("Advice", "yi_zhu_ming_cheng");
+        fieldConnect.put("TestCode", "xiang_mu_");
+//        fieldConnect.put("Type", "lei_xing_");
+        fieldConnect.put("DelayMins", "chao_shi_shi_chan");
+        fieldConnect.put("Reason", "chao_shi_yuan_yin");
+        fieldConnect.put("InfectMins", "ying_xiang_shi_ch");
+    }
+
+    public String saveOvertimeReport(List<Map<String, Object>> inputList) {
+        // 新增校验逻辑:检查必填字段
+        if (inputList == null) {
+            return "入参为空!";
+        }
+        for (Map<String, Object> map : inputList) {
+            for (String requiredKey : fieldConnect.keySet()) {
+                // 检查键是否存在且值非空
+                if (!map.containsKey(requiredKey) ||
+                        map.get(requiredKey) == null ||
+                        String.valueOf(map.get(requiredKey)).trim().isEmpty()) {
+                    return "参数:"+requiredKey+"为空或不存在!"; // 返回缺失或为空的key
+                }
+            }
+        }
+        basicMethod.getBasicData();
+        String retValue = "-1";
+        List<Map<String, Object>> insertList = new ArrayList<Map<String, Object>>();
+        String fieldName = null;
+        String fieldValue = null;
+        Timestamp timeValue = null;
+        for (Map<String, Object> inputMap : inputList) {
+            Map<String, Object> insertMap = new HashMap<>();
+            //部分字段直接添加
+            LocalDateTime currentDate = LocalDateTime.now();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedDate = currentDate.format(formatter);
+            insertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+            String userInfo = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser")));
+            if(userInfo.contains("-1^")){
+                return userInfo.split("\\^")[1];
+            }
+            insertMap.put("ze_ren_ren_", basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser"))).split("@")[0]);
+            insertMap.put("shi_fou_guo_shen_", "已完成");
+            insertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+            insertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(formattedDate));
+            insertMap.put("create_by_", userInfo.split("@")[0]);
+            insertMap.put("create_time_", Timestamp.valueOf(formattedDate));
+            insertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+            insertMap.put("di_dian_", userInfo.split("@")[1]);
+            for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
+                fieldName = null;
+                fieldValue = null;
+                timeValue = null;
+                fieldName = fieldConnect.get(entry.getKey());
+                fieldValue = String.valueOf(entry.getValue());
+                //急诊超时数据避免插到危急值超时漏报数据
+                if(fieldName.equals("lei_xing_")){
+                    continue;
+                }
+                if(fieldName!=null){
+                    fieldValue = String.valueOf(fieldValue);
+                    String existingValue = String.valueOf(insertMap.get(fieldName)); // 获取当前值
+                    if (existingValue == "null" || existingValue.isEmpty()) {
+                        insertMap.put(fieldName, fieldValue);
+                    }
+                }
+            }
+            insertList.add(insertMap);
+        }
+        retValue = basicMethod.saveToTable(insertList, "t_jzbg");
+        return retValue;
+    }
+}

+ 100 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/PostiveReport.java

@@ -0,0 +1,100 @@
+package com.jyxt.getdatabyrestful.service.impl.LISProcess;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+@Component
+public class PostiveReport {
+    private static final Logger log = LoggerFactory.getLogger(PostiveReport.class);
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    static {
+        // 静态初始化块中填充数据
+        fieldConnect.put("CreateUser", "create_by_");
+        fieldConnect.put("RegistTime", "bian_zhi_shi_jian");
+        fieldConnect.put("PatDept", "song_jian_ke_shi_");
+        fieldConnect.put("Doctor", "song_jian_yi_shen");
+        fieldConnect.put("PatName", "bing_ren_xing_min");
+        fieldConnect.put("PatGender", "xing_bie_");
+        fieldConnect.put("PatAge", "nian_ling_");
+        fieldConnect.put("ReportDate", "bao_gao_ri_qi_");
+        fieldConnect.put("ReportDocDate", "feed_back_dr_time");
+        fieldConnect.put("ReportPHMDate", "feed_back_hosp_ti");
+        fieldConnect.put("ReportResult", "jian_yan_jie_guo_");
+    }
+
+    public String savePostiveReport(List<Map<String, Object>> inputList) {
+        // 新增校验逻辑:检查必填字段
+        if (inputList == null) {
+            return "入参为空!";
+        }
+        for (Map<String, Object> map : inputList) {
+            for (String requiredKey : fieldConnect.keySet()) {
+                // 检查键是否存在且值非空
+                if (!map.containsKey(requiredKey) ||
+                        map.get(requiredKey) == null ||
+                        String.valueOf(map.get(requiredKey)).trim().isEmpty()) {
+                    return "参数:"+requiredKey+"为空或不存在!"; // 返回缺失或为空的key
+                }
+            }
+        }
+        basicMethod.getBasicData();
+        String retValue = "-1";
+        List<Map<String, Object>> insertList = new ArrayList<Map<String, Object>>();
+        String fieldName = null;
+        String fieldValue = null;
+        Timestamp timeValue = null;
+        for (Map<String, Object> inputMap : inputList) {
+            Map<String, Object> insertMap = new HashMap<>();
+            //部分字段直接添加
+            LocalDateTime currentDate = LocalDateTime.now();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
+            String formattedDate = currentDate.format(formatter);
+            insertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+            String userInfo = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser")));
+            if(userInfo.contains("-1^")){
+                return userInfo.split("\\^")[1];
+            }
+            insertMap.put("shi_fou_guo_shen_", "已完成");
+            insertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+            insertMap.put("create_by_", userInfo.split("@")[0]);
+            insertMap.put("create_time_", Timestamp.valueOf(formattedDate));
+            insertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+            insertMap.put("di_dian_", userInfo.split("@")[1]);
+            for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
+                fieldName = null;
+                fieldValue = null;
+                timeValue = null;
+                fieldName = fieldConnect.get(entry.getKey());
+                fieldValue = String.valueOf(entry.getValue());
+                if(fieldName!=null){
+                    String existingValue = String.valueOf(insertMap.get(fieldName)); // 获取当前值
+                    if (existingValue == "null" || existingValue.isEmpty()) {
+                        insertMap.put(fieldName, fieldValue);
+                    }
+                }
+            }
+            String registTimeStr = inputMap.get("RegistTime").toString();
+            if (registTimeStr.length() == 16) { // 格式为"yyyy-MM-dd HH:mm"
+                registTimeStr += ":00";
+            }
+            insertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(registTimeStr));
+            insertList.add(insertMap);
+        }
+        retValue = basicMethod.saveToTable(insertList, "t_crbbgdjb");
+        return retValue;
+    }
+}

+ 179 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/QCMonthReport.java

@@ -0,0 +1,179 @@
+package com.jyxt.getdatabyrestful.service.impl.LISProcess;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+@Component
+public class QCMonthReport {
+    private static final Logger log = LoggerFactory.getLogger(QCMonthReport.class);
+
+    public static List<Map<String, Object>> userList = new ArrayList<>();
+    public static List<Map<String, Object>> posiList = new ArrayList<>();
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    static {
+        // 静态初始化块中填充数据
+        fieldConnect.put("CreateUser", "create_by_");
+        fieldConnect.put("CreateTime", "create_time_");
+        fieldConnect.put("DeviceCode", "she_bei_ming_cheng");
+        fieldConnect.put("DeviceModel", "gui_ge_xing_hao_");
+        fieldConnect.put("ReportDate", "ri_qi_");
+
+        fieldConnect.put("TestCode", "xiang_mu_");
+        fieldConnect.put("QCMFG", "zhi_kong_pin_chan");
+        fieldConnect.put("QCName", "zhi_kong_pin_");
+        fieldConnect.put("LotNumber", "zhi_kong_pin_pi_h");
+        fieldConnect.put("LotStartTime", "pi_hao_kai_shi_sh");
+        fieldConnect.put("QCRule", "pan_duan_fa_ze_");
+        fieldConnect.put("QCUnit", "zhi_kong_tu_dan_w");
+        fieldConnect.put("QCLevel", "zhi_kong_tu_shui_");
+        fieldConnect.put("QCChartAvg", "zhi_kong_tu_jun_z");
+        fieldConnect.put("QCChartSD", "zhi_kong_tu_sd_");
+        fieldConnect.put("QCChartCV", "zhi_kong_tu_cv_");
+        fieldConnect.put("RawDataAvg", "yuan_shi_jun_zhi_");
+        fieldConnect.put("RawDataSD", "yuan_shi_sd_");
+        fieldConnect.put("RawDataCV", "yuan_shi_cv_");
+        fieldConnect.put("RawDataNum", "yuan_shi_n_");
+        fieldConnect.put("OutControlNum", "shi_kong_shu_");
+        fieldConnect.put("ControlDataAvg", "chu_jun_zhi_");
+        fieldConnect.put("ControlDataSD", "chu_sd_");
+        fieldConnect.put("ControlDataCV", "chu_cv_");
+        fieldConnect.put("AccumDataAvg", "lei_jun_zhi_");
+        fieldConnect.put("AccumDataSD", "lei_sd_");
+        fieldConnect.put("AccumDataCV", "lei_cv_");
+        fieldConnect.put("AccumDataNum", "lei_n_");
+        fieldConnect.put("AccumDataPer", "zai_kong_lv_");
+        fieldConnect.put("CVRange", "cv_kong_zhi_fan_w");
+        fieldConnect.put("pass", "shi_fou_he_ge_");
+    }
+
+
+    public String saveMonthReport(List<Map<String, Object>> inputList) {
+        basicMethod.getBasicData();
+        String retValue = "fail";
+        List<Map<String, Object>> insertList = new ArrayList<>();
+        List<Map<String, Object>> insertSubList = new ArrayList<>();
+        String fieldName;
+        String fieldValue;
+        Timestamp timeValue;
+
+        for (Map<String, Object> inputMap : inputList) {
+            Map<String, Object> insertMap = new HashMap<>();
+            // 公共字段初始化
+            LocalDateTime currentDate = LocalDateTime.now();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedDate = currentDate.format(formatter);
+            insertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+            String userInfo = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser")));
+            if (userInfo.contains("-1^")) {
+                return userInfo.split("\\^")[1];
+            }
+            insertMap.put("shi_fou_guo_shen_", "待编制");
+            insertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+            insertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(formattedDate));
+            insertMap.put("create_by_", userInfo.split("@")[0]);
+            insertMap.put("create_time_", Timestamp.valueOf(formattedDate));
+            insertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+            insertMap.put("di_dian_", userInfo.split("@")[1]);
+
+            // 遍历主表字段
+            for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
+                String key = entry.getKey();
+                Object value = entry.getValue();
+
+                if ("QCTestCode".equals(key)) {
+                    // 关键修改:处理子表List结构
+                    if (value instanceof List) {
+                        List<Map<String, Object>> subList = (List<Map<String, Object>>) value;
+                        for (Map<String, Object> subMap : subList) {
+                            Map<String, Object> subInsertMap = new HashMap<>();
+                            // 子表公共字段
+                            subInsertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+                            subInsertMap.put("shi_fou_guo_shen_", "已完成");
+                            subInsertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+                            subInsertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(formattedDate));
+                            subInsertMap.put("create_by_", userInfo.split("@")[0]);
+                            subInsertMap.put("create_time_", Timestamp.valueOf(formattedDate));
+                            subInsertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+                            subInsertMap.put("di_dian_", userInfo.split("@")[1]);
+                            subInsertMap.put("parent_id_", insertMap.get("id_"));
+
+                            // 处理子表字段
+                            for (Map.Entry<String, Object> subEntry : subMap.entrySet()) {
+                                String subKey = subEntry.getKey();
+                                Object subValue = subEntry.getValue();
+                                fieldName = fieldConnect.get(subKey);
+                                if (fieldName == null) continue;
+
+                                if (!subKey.contains("Time")) {
+                                    subInsertMap.put(fieldName, String.valueOf(subValue));
+                                } else {
+                                    try {
+                                        timeValue = Timestamp.valueOf(String.valueOf(subValue));
+                                        subInsertMap.put(fieldName, timeValue);
+                                    } catch (Exception e) {
+                                        subInsertMap.put(fieldName, subValue);
+                                    }
+                                }
+                            }
+                            insertSubList.add(subInsertMap);
+//                            retValue = basicMethod.saveToTable(insertSubList, "t_dlxmsnzkyfxzb");
+                            // 打印子表数据(测试用)
+                            StringBuilder sb = new StringBuilder();
+                            for (Map.Entry<String, Object> subEntry : subInsertMap.entrySet()) {
+                                sb.append(subEntry.getKey()).append(":")
+                                        .append(String.valueOf(subEntry.getValue())).append(",");
+                            }
+                            System.out.println("子表:" + sb);
+                        }
+                        retValue = "success"; // 子表处理成功标志
+                    }
+                } else {
+                    // 主表字段处理(保持原逻辑)
+                    fieldName = fieldConnect.get(key);
+                    if (fieldName == null) continue;
+
+                    if (!key.contains("Time")) {
+                        fieldValue = String.valueOf(value);
+                        String existingValue = String.valueOf(insertMap.get(fieldName)); // 获取当前值
+                        if (existingValue == null || existingValue.isEmpty()) {
+                            insertMap.put(fieldName, fieldValue);
+                        }
+                    } else {
+                        try {
+                            timeValue = Timestamp.valueOf(String.valueOf(value));
+                            insertMap.put(fieldName, timeValue);
+                        } catch (Exception e) {
+                            insertMap.put(fieldName, value);
+                        }
+                    }
+                }
+            }
+            if ("success".equals(retValue)) {
+                insertList.add(insertMap);
+//                retValue = basicMethod.saveToTable(insertList, "t_dlxmsnzkyfx");
+                // 打印主表数据(测试用)
+                StringBuilder sb2 = new StringBuilder();
+                for (Map.Entry<String, Object> entry : insertMap.entrySet()) {
+                    sb2.append(entry.getKey()).append(":")
+                            .append(String.valueOf(entry.getValue())).append(",");
+                }
+                System.out.println("主表:" + sb2);
+            }
+        }
+        return retValue;
+    }
+
+}

+ 113 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/LISProcess/RerunSampleRecord.java

@@ -0,0 +1,113 @@
+package com.jyxt.getdatabyrestful.service.impl.LISProcess;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+@Component
+public class RerunSampleRecord {
+
+    private static final Logger log = LoggerFactory.getLogger(RerunSampleRecord.class);
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public static final Map<String, String> fieldConnect = new HashMap<>();
+
+    static {
+        // 静态初始化块中填充数据
+        fieldConnect.put("CreateUser", "create_by_");
+        fieldConnect.put("CreateTime", "create_time_");
+//        fieldConnect.put("DeviceCode", "gui_ge_xing_hao_");
+        fieldConnect.put("SampleCode", "biao_ben_bian_hao");
+        fieldConnect.put("TestCode", "xiang_mu_id_");
+        fieldConnect.put("TestCodeName", "fu_jian_xiang_mu_");
+//        fieldConnect.put("TestCodeName", "fu_jian_xiang_mu_");
+        fieldConnect.put("InitialResult", "ce_ding_zhi_chu_j");
+        fieldConnect.put("RerunResult", "ce_ding_zhi_fu_ji");
+        fieldConnect.put("ReportResult", "bao_gao_zhi_");
+        fieldConnect.put("Auditer", "jian_yan_zhe_");
+        fieldConnect.put("ReportTime", "bao_gao_shi_jian_");
+        fieldConnect.put("RerunMethodNote", "bei_zhu_fu_jian_f");
+        fieldConnect.put("PatName", "xing_ming_");
+        fieldConnect.put("RerunMethod", "fu_jian_fang_shi_");
+        fieldConnect.put("Unit", "dan_wei_");
+    }
+
+    public String saveRerunSample(List<Map<String, Object>> inputList) {
+        // 新增校验逻辑:检查必填字段
+        if (inputList == null) {
+            return "入参为空!";
+        }
+        for (Map<String, Object> map : inputList) {
+            for (String requiredKey : fieldConnect.keySet()) {
+                // 检查键是否存在且值非空
+                if (!map.containsKey(requiredKey) ||
+                        map.get(requiredKey) == null ||
+                        String.valueOf(map.get(requiredKey)).trim().isEmpty()) {
+                    return "参数:"+requiredKey+"为空或不存在!"; // 返回缺失或为空的key
+                }
+            }
+        }
+        basicMethod.getBasicData();
+        String retValue = "-1";
+        List<Map<String, Object>> insertList = new ArrayList<Map<String, Object>>();
+        String fieldName = null;
+        String fieldValue = null;
+        Timestamp timeValue = null;
+        for (Map<String, Object> inputMap : inputList) {
+            Map<String, Object> insertMap = new HashMap<>();
+            //部分字段直接添加
+            insertMap.put("id_", UUID.randomUUID().toString().replace("-", ""));
+            String userInfo = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("CreateUser")));
+            if(userInfo.contains("-1^")){
+                return userInfo.split("\\^")[1];
+            }
+            insertMap.put("shi_fou_guo_shen_", "已完成");
+            LocalDateTime currentDateTime = LocalDateTime.now();
+            DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedDateTime = currentDateTime.format(formatter2);
+            insertMap.put("bian_zhi_ren_", userInfo.split("@")[0]);
+            insertMap.put("bian_zhi_shi_jian", Timestamp.valueOf(String.valueOf(inputMap.get("CreateTime"))));
+            insertMap.put("create_by_", userInfo.split("@")[0]);
+            insertMap.put("create_time_", Timestamp.valueOf(String.valueOf(formattedDateTime)));
+            insertMap.put("bian_zhi_bu_men_", userInfo.split("@")[1]);
+            String jian_yan_yuan_ = basicMethod.getUserInfoByName(String.valueOf(inputMap.get("Auditer")));
+            if(jian_yan_yuan_.contains("-1^")){
+                return jian_yan_yuan_.split("\\^")[1];
+            }
+            insertMap.put("jian_yan_yuan_", jian_yan_yuan_.split("@")[0]);
+            insertMap.put("di_dian_", userInfo.split("@")[1]);
+            insertMap.put("bu_men_", userInfo.split("@")[2]);
+            LocalDate currentDate = LocalDate.now();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            String formattedDate = currentDate.format(formatter);
+            insertMap.put("ri_qi_", formattedDate);
+            insertMap.put("bao_gao_shi_jian_", inputMap.get("ReportTime"));
+            for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
+                fieldName = null;
+                fieldValue = null;
+                timeValue = null;
+                fieldName = fieldConnect.get(entry.getKey());
+                if (!entry.getKey().contains("Time")) {
+                    fieldValue = String.valueOf(entry.getValue());
+                    if(fieldName!=null){
+                        insertMap.put(fieldName, String.valueOf(fieldValue));
+                    }
+                }
+            }
+            insertList.add(insertMap);
+        }
+        retValue = basicMethod.saveToTable(insertList, "t_fjbbjlb");
+        return retValue;
+    }
+
+}

+ 140 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/QualityIndicator/QualityIndicator.java

@@ -0,0 +1,140 @@
+package com.jyxt.getdatabyrestful.service.impl.QualityIndicator;
+
+import com.jyxt.getdatabyrestful.service.impl.BasicMethod;
+import com.jyxt.getdatabyrestful.service.impl.LISProcess.QCMonthReport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+@Component
+public class QualityIndicator {
+
+    private static final Logger log = LoggerFactory.getLogger(QualityIndicator.class);
+
+    @Autowired
+    BasicMethod basicMethod;
+
+    public String getQualityIndicatorItem() {
+        String retVal = null;
+        List<Map<String, Object>> qualityIndicatorList = basicMethod.getQualityIndicatorItem();
+        if (qualityIndicatorList == null) return "[]";
+        StringBuilder sbRet = new StringBuilder();
+        sbRet.append("[");
+        for (Map<String, Object> qualityIndicator : qualityIndicatorList) {
+            sbRet.append("{");
+            int entryCount = 0;
+            for (Map.Entry<String, Object> entry : qualityIndicator.entrySet()) {
+                entryCount++;
+                sbRet.append("\"").append(entry.getKey()).append("\":\"")
+                        .append(entry.getValue()).append("\"");
+                if (entryCount < qualityIndicator.size()) {
+                    sbRet.append(",");
+                }
+            }
+            sbRet.append("},");  // 注意这里的逗号分隔对象
+        }
+        // 移除最后一个多余的逗号
+        if (sbRet.charAt(sbRet.length() - 1) == ',') {
+            sbRet.deleteCharAt(sbRet.length() - 1);
+        }
+        sbRet.append("]");
+        retVal = String.valueOf(sbRet);
+        return retVal;
+    }
+
+    public String getUndoQualityIndicatorItem(){
+        String retVal = null;
+        List<Map<String, Object>> undoQualityIndicatorList =  getUndoQualityIndicatorList();
+        StringBuilder sbRet = new StringBuilder();
+        sbRet.append("[");
+        for (Map<String, Object> qualityIndicator : undoQualityIndicatorList) {
+            sbRet.append("{");
+            int entryCount = 0;
+            for (Map.Entry<String, Object> entry : qualityIndicator.entrySet()) {
+                entryCount++;
+                sbRet.append("\"").append(entry.getKey()).append("\":\"")
+                        .append(entry.getValue()).append("\"");
+                if (entryCount < qualityIndicator.size()) {
+                    sbRet.append(",");
+                }
+            }
+            sbRet.append("},");  // 注意这里的逗号分隔对象
+        }
+        // 移除最后一个多余的逗号
+        if (sbRet.charAt(sbRet.length() - 1) == ',') {
+            sbRet.deleteCharAt(sbRet.length() - 1);
+        }
+        sbRet.append("]");
+        retVal = String.valueOf(sbRet);
+        return retVal;
+    }
+
+    public List<Map<String, Object>> getUndoQualityIndicatorList() {
+        List<Map<String, Object>> undoQualityIndicatorList = new ArrayList<>();
+        List<Map<String, Object>> qualityIndicatorList = basicMethod.getQualityIndicatorItem();
+        List<Map<String, Object>> allUndoQualityIndicatorList = basicMethod.getUndoQualityIndicatorItem();
+        // 1. 构建qualityIndicatorList的Target值集合(去重)
+        Set<Object> targetSet = new HashSet<>();
+        for (Map<String, Object> map : qualityIndicatorList) {
+            if (map.containsKey("Target") && map.get("Target") != null) {
+                targetSet.add(map.get("Target"));
+            }
+        }
+        // 2. 筛选allQualityIndicatorList中匹配的记录
+        for (Map<String, Object> indicator : allUndoQualityIndicatorList) {
+            String targetValue = indicator.get("Target").toString();
+            if (targetValue != null && targetSet.contains(targetValue)) {
+                undoQualityIndicatorList.add(indicator);
+            }
+        }
+        return undoQualityIndicatorList;
+    }
+
+    public String saveUndoQualityIndicator(List<Map<String, Object>> QualityIndicatorList){
+        String retVal = "fail";
+        List<Map<String, Object>> undoQualityIndicatorList =  getUndoQualityIndicatorList();
+        List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
+        LocalDateTime currentDate = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String formattedDate = currentDate.format(formatter);
+        for (Map<String, Object> qualityIndicator : QualityIndicatorList) {
+            String targetValue = qualityIndicator.get("Target").toString();
+            String StatDate = qualityIndicator.get("StatDate").toString();
+            for (Map<String, Object> undoMap : undoQualityIndicatorList) {
+                String undoTarget = undoMap.get("Target").toString();
+                String undoDate = undoMap.get("StatDate").toString();
+                if (targetValue.equals(undoTarget) && StatDate.equals(undoDate)) {
+                    // 创建更新数据Map(不包含条件字段)
+                    Map<String, Object> updateData = new HashMap<>();
+                    Map<String, Object> conditionData = new HashMap<>();
+                    updateData.put("shi_ji_shu_zhi_", qualityIndicator.get("Result"));
+                    updateData.put("fen_zi_", qualityIndicator.get("Numerator"));
+                    updateData.put("fen_mu_", qualityIndicator.get("Denominator"));
+                    updateData.put("da_biao_qing_kuan", qualityIndicator.get("Pass"));
+                    updateData.put("zhuang_tai_", "已完成");
+                    updateData.put("update_time_", Timestamp.valueOf(formattedDate));
+                    updateData.put("bei_zhu_2_", "自动导入");
+                    conditionData.put("zhi_liang_zhi_bia", targetValue);
+                    conditionData.put("bian_zhi_shi_jian", StatDate);
+                    // 立即执行更新(使用当前的条件值)
+                    retVal = basicMethod.updateToTable(conditionData, updateData, "t_zlzbpjzb");
+                    // 遇到失败立即返回
+                    if (!"success".equals(retVal)) {
+                        return "fail";
+                    }
+                    break; // 找到匹配后跳出内层循环
+                }
+            }
+
+
+        }
+
+        return retVal;
+    }
+}

+ 38 - 0
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/service/impl/SwaggerConfig.java

@@ -0,0 +1,38 @@
+package com.jyxt.getdatabyrestful.service.impl;
+
+import org.springdoc.core.customizers.OperationCustomizer;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.Environment;
+
+
+@Configuration
+public class SwaggerConfig {
+
+    @Autowired
+    private Environment env;
+
+    /**
+     * 自定义操作过滤:根据配置隐藏禁用的接口
+     */
+    @Bean
+    public OperationCustomizer operationCustomizer() {
+        return (operation, handlerMethod) -> {
+            // 检查方法是否有条件注解
+            if (handlerMethod.hasMethodAnnotation(ConditionalOnEndpoint.class)) {
+                ConditionalOnEndpoint annotation = handlerMethod.getMethodAnnotation(ConditionalOnEndpoint.class);
+
+                // 读取配置值
+                String propValue = env.getProperty(annotation.property());
+                String expectedValue = annotation.havingValue();
+
+                // 如果配置值不匹配,返回null将隐藏该接口
+                if (!expectedValue.equals(propValue)) {
+                    return null; // 隐藏接口
+                }
+            }
+            return operation; // 显示接口
+        };
+    }
+}

+ 0 - 94
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/view/TemperatureEntity.java

@@ -1,94 +0,0 @@
-package com.jyxt.getdatabyrestful.view;
-
-public class TemperatureEntity {
-    private String id;
-    private String bianzhishijian;
-    private String caijiqiid;
-    private String entitytype;
-    private String entityname;
-    private String entityname2;
-    private String entityid;
-    private String status;
-    private String monitordate;
-    private String monitordetail;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getBianzhishijian() {
-        return bianzhishijian;
-    }
-
-    public void setBianzhishijian(String bianzhishijian) {
-        this.bianzhishijian = bianzhishijian;
-    }
-
-    public String getCaijiqiid() {
-        return caijiqiid;
-    }
-
-    public void setCaijiqiid(String caijiqiid) {
-        this.caijiqiid = caijiqiid;
-    }
-
-    public String getEntitytype() {
-        return entitytype;
-    }
-
-    public void setEntitytype(String entitytype) {
-        this.entitytype = entitytype;
-    }
-
-    public String getEntityname() {
-        return entityname;
-    }
-
-    public void setEntityname(String entityname) {
-        this.entityname = entityname;
-    }
-
-    public String getEntityname2() {
-        return entityname2;
-    }
-
-    public void setEntityname2(String entityname2) {
-        this.entityname2 = entityname2;
-    }
-
-    public String getEntityid() {
-        return entityid;
-    }
-
-    public void setEntityid(String entityid) {
-        this.entityid = entityid;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getMonitordate() {
-        return monitordate;
-    }
-
-    public void setMonitordate(String monitordate) {
-        this.monitordate = monitordate;
-    }
-
-    public String getMonitordetail() {
-        return monitordetail;
-    }
-
-    public void setMonitordetail(String monitordetail) {
-        this.monitordetail = monitordetail;
-    }
-}

+ 0 - 49
GetDataByRESTful/src/main/java/com/jyxt/getdatabyrestful/view/repository/TemperatureEntityRepository.java

@@ -1,49 +0,0 @@
-package com.jyxt.getdatabyrestful.view.repository;
-
-import com.jyxt.getdatabyrestful.view.TemperatureEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.stereotype.Repository;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-
-@Repository
-public class TemperatureEntityRepository {
-    @Autowired
-    private JdbcTemplate jdbcTemplate;
-
-    private static final Logger log = LoggerFactory.getLogger(TemperatureEntityRepository.class);
-
-    @Value("${fetch.sqlGetUndo}")
-    private String sql;
-
-    @Value("${config.qrymode}")
-    private String qryMode;
-
-    public List<TemperatureEntity> query(){
-        log.info("excute sql:" + sql);
-        List<TemperatureEntity> result = jdbcTemplate.query(
-                sql,
-                new RowMapper<TemperatureEntity>() {
-                    public TemperatureEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
-                        TemperatureEntity te = new TemperatureEntity();
-                        te.setId(rs.getString("id_"));
-                        te.setBianzhishijian(rs.getString("bian_zhi_shi_jian"));
-                        te.setEntityname(rs.getString("bing_xiang_bian_h"));
-                        return te;
-                    }
-                });
-        if (result.isEmpty()) {
-            log.info("-------------no data finded,nothing to do...-------------");
-        }
-        return result;
-    }
-
-}

+ 39 - 6
GetDataByRESTful/src/main/resources/application.properties

@@ -1,16 +1,49 @@
 spring.application.name=GetDataByRESTful
 #spring.datasource.jdbc-url = jdbc:mysql://demo2.local:3306/klims-ibps3?characterEncoding=utf8&useSSL=false
-spring.datasource.jdbc-url = jdbc:mysql://dev1.local:3306/klims-ibps3?characterEncoding=utf8&useSSL=false
+spring.datasource.jdbc-url = jdbc:mysql://192.168.2.212:3306/klims-ibps3?characterEncoding=utf8&useSSL=false
 spring.datasource.username = root
 spring.datasource.password = test001
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 
-#fetch.sqlGetUndo=select id_,bian_zhi_shi_jian,zhi_liang_zhi_bia,yuan_shi_shu_ju_ from t_zlzbpjzb where zhuang_tai_='\u5f85\u5904\u7406'
-fetch.sqlGetUndo=SELECT * from t_bxwdjkjlb where shi_fou_guo_shen_='\u5f85\u5904\u7406' and date(create_time_) = curdate()
 logging.file.name=logs/GetDataByRESTful.log
 # level:TRACE < DEBUG < INFO < WARN < ERROR < FATAL
 logging.level.root=INFO
-#1 or 0,1 means only qry,0 means update
-config.qrymode=0
+server.servlet.context-path=/jyxt
+springdoc.api-docs.title=JYXT API
+springdoc.api-docs.description=JYXT API Description
+#??API:http://localhost:8080/jyxt/swagger-ui/index.html
+springdoc.swagger-ui.path=/swagger-ui.html
+# ??Swagger UI????????
+springdoc.swagger-ui.enabled=true
+server.port=8080
+#1 or 0,0 means only output logs,1 means insert
+config.insertMode=0
 UrlAddr=http://coolaf.com/tool
-api.resources.path=/ibps/platform/v3/auth/resources/getDefaultResources
+api.resources.path=/ibps/platform/v3/auth/resources/getDefaultResources
+#??????(1 enable,0 disable)
+#????,?????????????
+interface.test=1
+#-------------????????------------------
+interface.LISProcess=1
+#??????
+interface.RerunSampleRecord=1
+#???????
+interface.IncrrectLISReport=1
+#????????????
+interface.CriticalReport=1
+#????????
+interface.OvertimeReport=1
+#???????
+interface.PostiveReport=1
+#???????????
+interface.QCMonthReport=1
+#-------------??????------------------
+interface.QualityIndicator=1
+#??????????
+interface.getQualityIndicatorItem=1
+#???????????
+interface.getUndoQualityIndicatorItem=1
+#???????????
+interface.saveUndoQualityIndicator=1
+#-------------????????------------------
+interface.EnvirMonitor=0

+ 1 - 9
GetDataByView/src/main/java/com/jyxt/getdatabyview/DateRangeUtil.java

@@ -85,14 +85,6 @@ public class DateRangeUtil {
 //        System.out.println(getDateRange("2023年第3季度"));
 //        System.out.println(getDateRange("2025年第1季度"));
         Test();
-        Test();
-        Test();
-        Test();
-        Test();
-        Test();
-        Test();
-        Test();
-        Test();
-        Test();
+
     }
 }

+ 26 - 15
GetDataByView/src/main/java/com/jyxt/getdatabyview/GetDataByViewApplication.java

@@ -1,18 +1,20 @@
 package com.jyxt.getdatabyview;
 
-import com.jyxt.getdatabyview.view.QualityIndicator;
+
+import com.jyxt.getdatabyview.view.repository.IBPSRepository;
 import com.jyxt.getdatabyview.view.repository.LISViewRepository;
-import com.jyxt.getdatabyview.view.repository.QualityIndicatorRepository;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.ConfigurableApplicationContext;
 
 import java.util.List;
+import java.util.Map;
 
 @SpringBootApplication
 public class GetDataByViewApplication implements CommandLineRunner{
@@ -23,12 +25,15 @@ public class GetDataByViewApplication implements CommandLineRunner{
     private LISViewRepository lisViewRepository;
 
     @Autowired
-    private QualityIndicatorRepository qualityIndicatorRepository;
+    private IBPSRepository ibpsRepository;
 
     public static void main(String[] args) {
         SpringApplication.run(GetDataByViewApplication.class, args);
     }
 
+    @Value("${table.match}")
+    private String MatchStr;
+
     @Autowired
     private HandleData handleData;
 
@@ -39,21 +44,27 @@ public class GetDataByViewApplication implements CommandLineRunner{
     public void run(String... args) throws Exception {
 //        System.out.println("in run");
         log.info("<-------------new turn start...------------->");
-        List<QualityIndicator> qiList = qualityIndicatorRepository.query();
-        if(qiList != null){
-            for (QualityIndicator qi : qiList) {
-                try {
-                    String pingjiaId = qi.getId();
-                    String zhiliangzhibia = qi.getzhiliangzhibia();
-                    String bianzhishijian = qi.getbianzhishijian();
-                    String yuanshishuju = qi.getYuanshishuju();
-                    handleData.startHandleData(pingjiaId,zhiliangzhibia,bianzhishijian,yuanshishuju);
-
-                }catch (Exception ex){
-                    log.error(ex.getMessage());
+        String[] MatchArr = MatchStr.split("@");
+        handleData.Test();
+        for (String curMatch : MatchArr) {
+            String LISTable = curMatch.split("|")[0];
+            String IBPSTale = curMatch.split("|")[1];
+            if(LISTable != null && !LISTable.isEmpty() &&
+                    IBPSTale != null && !IBPSTale.isEmpty()) {
+                List<Map<String, Object>> retList = lisViewRepository.query(LISTable);
+                for (Map<String, Object> retMap : retList) {
+                    if(retMap != null){
+                        try {
+                            handleData.HandleData(retMap, IBPSTale);
+                        }catch (Exception ex){
+                            log.error(ex.getMessage());
+                        }
+                    }
                 }
             }
         }
+
+
         log.info("<-------------this turn finish...------------->");
         context.close(); // 直接关闭上下文
     }

+ 0 - 72
GetDataByView/src/main/java/com/jyxt/getdatabyview/view/QualityIndicator.java

@@ -1,72 +0,0 @@
-package com.jyxt.getdatabyview.view;
-
-public class QualityIndicator {
-
-    private String id;
-    private String bianzhishijian;
-    private String zhiliangzhibia;
-    private String zhuangtai;
-    private String shijishuzhi;
-    private String yuanshishuju;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getbianzhishijian() {
-        return bianzhishijian;
-    }
-
-    public void setbianzhishijian(String bianzhishijian) {
-        this.bianzhishijian = bianzhishijian;
-    }
-
-    public String getzhiliangzhibia() {
-        return zhiliangzhibia;
-    }
-
-    public void setzhiliangzhibia(String zhiliangzhibia) {
-        this.zhiliangzhibia = zhiliangzhibia;
-    }
-
-    public String getzhuangtai() {
-        return zhuangtai;
-    }
-
-    public void setzhuangtai(String zhuangtai) {
-        this.zhuangtai = zhuangtai;
-    }
-
-    public String getshijishuzhi() {
-        return shijishuzhi;
-    }
-
-    public void setshijishuzhi(String shijishuzhi) {
-        this.shijishuzhi = shijishuzhi;
-    }
-
-    public String getYuanshishuju() {
-        return yuanshishuju;
-    }
-
-    public void setYuanshishuju(String yuanshishuju) {
-        this.yuanshishuju = yuanshishuju;
-    }
-
-    @Override
-    public String toString() {
-        return "VendorBinxiang{" +
-                "id='" + id + '\'' +
-                ", bianzhishijian='" + bianzhishijian + '\'' +
-                ", zhiliangzhibia='" + zhiliangzhibia + '\'' +
-                ", zhuangtai='" + zhuangtai + '\'' +
-                ", shijishuzhi='" + shijishuzhi + '\'' +
-                ", yuanshishuju='" + yuanshishuju + '\'' +
-                '}';
-    }
-
-}

+ 137 - 0
GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/IBPSRepository.java

@@ -0,0 +1,137 @@
+package com.jyxt.getdatabyview.view.repository;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.jdbc.core.*;
+import org.springframework.stereotype.Repository;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+
+@Repository
+public class IBPSRepository {
+    @Autowired
+    @Qualifier("secondJdbcTemplate")
+    private JdbcTemplate jdbcTemplate;
+
+    private static final Logger log = LoggerFactory.getLogger(IBPSRepository.class);
+
+    public static List<Map<String, Object>> userList = new ArrayList<>();
+    public static List<Map<String, Object>> posiList = new ArrayList<>();
+
+    public List<Map<String, Object>> qryExistData(){
+        List<Map<String, Object>> existList = null;
+//        String sqlQry = "SELECT * FROM t_fjbbjlb WHERE bian_zhi_shi_jian >= DATE_SUB(NOW(), INTERVAL 24 HOUR)";
+        String sqlQry = "SELECT * FROM t_fjbbjlb";
+        log.info("excute sql:"+sqlQry);
+        existList = jdbcTemplate.queryForList(sqlQry);
+        return existList;
+    }
+
+
+    public String saveToTable(List<Map<String, Object>> inputList, String TableName) {
+        String retValue = "fail";
+        if (inputList == null || inputList.isEmpty() || TableName == null || TableName.trim().isEmpty()) {
+            return retValue;
+        }
+        try {
+            // 获取第一个Map的字段名作为表字段
+            Map<String, Object> firstRow = inputList.get(0);
+            String columns = String.join(",", firstRow.keySet());
+
+            // 构建占位符部分 (?,?,...)
+            String placeholders = String.join(",", Collections.nCopies(firstRow.size(), "?"));
+
+            // 构建完整SQL语句
+            String sql = String.format("INSERT INTO %s (%s) VALUES (%s)", TableName, columns, placeholders);
+            log.info("executing sql: " + sql);
+            // 批量执行
+            jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
+                @Override
+                public void setValues(PreparedStatement ps, int i) throws SQLException {
+                    Map<String, Object> row = inputList.get(i);
+                    int index = 1;
+                    for (Map.Entry<String, Object> entry : row.entrySet()) {
+                        String key = entry.getKey();
+                        Object value = entry.getValue();
+
+                        if (key.contains("Time") && value instanceof Timestamp) {
+                            ps.setTimestamp(index++, (Timestamp) value);
+                        } else {
+                            ps.setString(index++, value != null ? value.toString() : null);
+                        }
+                    }
+                }
+                @Override
+                public int getBatchSize() {
+                    return inputList.size();
+                }
+            });
+            retValue = "success";
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "insert failed:"+e.getMessage().split(";")[2];
+        }
+        return retValue;
+    }
+
+    /**
+     * 获取基础数据:
+     * LIS系统用户名对应金通用户信息
+     */
+    public void getBasicData(){
+        String sqlUser = "select id_,name_,positions_ from ibps_party_employee where status_='actived'";
+        userList = jdbcTemplate.queryForList(sqlUser);
+        String sqlPosi = "select * from ibps_party_position";
+        posiList = jdbcTemplate.queryForList(sqlPosi);
+    }
+
+    /**
+     * 返回用户ID@部门ID@部门名称
+     * @param userName
+     * @return
+     */
+    public String getUserInfoByName(String userName){
+        String retVal = "-1";
+        for (Map<String, Object> map : userList) {
+            if (map.get("name_").toString().equals(userName)) {
+                String userId = (String) map.get("id_");
+                String positionId = String.valueOf(map.get("positions_")).split(",")[0];
+                String positionName = (String) getPosiByID(positionId);
+                if (!positionName.equals("-1")) {
+                    retVal = userId+"@"+positionId+"@"+positionName;
+                }else{
+                    retVal = "-1^部门:"+positionName+"未找到!";
+                    log.error("部门:"+positionName+"未找到!");
+                    return retVal;
+                }
+                return retVal;
+            }
+            retVal = "-1^用户:"+userName+"未找到!";
+        }
+        log.error("用户:"+userName+"未找到!");
+        return retVal;
+    }
+
+    public String getPosiByID(String positionId){
+        String retVal = "-1";
+        for (Map<String, Object> map : posiList) {
+            if (map.get("id_").toString().equals(positionId)) {
+                retVal = map.get("name_").toString();
+                break;
+            }
+        }
+        return retVal;
+    }
+
+
+}

+ 54 - 0
GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/LISViewRepository.java

@@ -4,13 +4,18 @@ import com.jyxt.getdatabyview.view.LISView;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.dao.DataAccessException;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.RowMapper;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Repository;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Component   // 通用注解
 @Repository
@@ -19,6 +24,55 @@ public class LISViewRepository {
 
     @Autowired
     private JdbcTemplate jdbcTemplate;
+
+    @Value("${fetch.QryDailySql}")
+    private String QryDailySql;
+
+    /**
+     * 查询V_JT_QCMonthReport视图的数据,并将结果存储到Map中。
+     *
+     * @return 包含V_JT_QCMonthReport视图数据的Map,其中键为字段名,值为字段值的字符串表示。
+     */
+    public List<Map<String, Object>> query(String LISTable) {
+        List<Map<String, Object>> retList = new ArrayList<Map<String, Object>>();
+        Map<String, Object> retMap = new HashMap<>();
+        String sqlQry = "SELECT * FROM "+LISTable+" WHERE DATE(CreateTime) = CURDATE() - INTERVAL 1 DAY";
+
+        try {
+            List<Map<String, Object>> results = jdbcTemplate.queryForList(sqlQry);
+            for (Map<String, Object> result : results) {
+                for (Map.Entry<String, Object> entry : result.entrySet()) {
+                    retMap.put(entry.getKey(), entry.getValue());
+                }
+                retList.add(retMap);
+            }
+        } catch (DataAccessException e) {
+            log.error("Error querying "+LISTable+" view", e);
+        }
+        return retList;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 //        qualityIndicatorList.add("总标本不合格率");                //0
 //        qualityIndicatorList.add("抗凝标本凝集率");                //1

+ 0 - 105
GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/QualityIndicatorRepository.java

@@ -1,105 +0,0 @@
-package com.jyxt.getdatabyview.view.repository;
-
-import com.jyxt.getdatabyview.view.QualityIndicator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.PreparedStatementCreator;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.stereotype.Repository;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-import java.util.Objects;
-
-
-@Repository
-public class QualityIndicatorRepository {
-    @Autowired
-    @Qualifier("secondJdbcTemplate")
-    private JdbcTemplate jdbcTemplate;
-
-
-    private static final Logger log = LoggerFactory.getLogger(QualityIndicatorRepository.class);
-    @Value("${fetch.sqlGetUndo}")
-    private String sql;
-
-    @Value("${config.qrymode}")
-    private String qryMode;
-
-    public List<QualityIndicator> query() {
-        log.info("excute sql:" + sql);
-//        System.out.println(sql);
-        List<QualityIndicator> result = jdbcTemplate.query(
-                sql,
-                new RowMapper<QualityIndicator>() {
-                    @Override
-                    public QualityIndicator mapRow(ResultSet rs, int rowNum) throws SQLException {
-                        QualityIndicator qi = new QualityIndicator();
-                        qi.setId(rs.getString("id_"));
-                        qi.setbianzhishijian(rs.getString("bian_zhi_shi_jian"));
-                        qi.setzhiliangzhibia(rs.getString("zhi_liang_zhi_bia"));
-                        qi.setYuanshishuju(rs.getString("yuan_shi_shu_ju_"));
-                        return qi;
-                    }
-                }
-        );
-        if (result.isEmpty()) {
-            log.info("-------------no data finded,nothing to do...-------------");
-        }
-        return result;
-    }
-
-
-    public void save(String Id, String resultValue, String total, String DataDetail, String IsQualified){
-        //sql语句
-        final String sql = "update t_zlzbpjzb set shi_ji_shu_zhi_=?, fen_zi_=?,zhuang_tai_='已完成', bei_zhu_2_='自动导入',bei_zhu_='自动导入',shu_ju_xiang_qing=?,da_biao_qing_kuan=? where id_=? ";
-//        System.out.println("Id:"+Id+",ResultValue:"+ResultValue);
-//        System.out.println("Ready to update t_zlzbpjzb:Id:"+Id+",ResultValue:"+ResultValue);
-        if (Objects.equals(qryMode, "0")){
-            log.info("Ready to update t_zlzbpjzb:Id:"+Id+",ResultValue:"+resultValue+",total:"+total+",DataDetail:"+DataDetail+",IsQualified:"+IsQualified);
-            jdbcTemplate.update(new PreparedStatementCreator() {
-                public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
-                    PreparedStatement prepareStatement = connection.prepareStatement(sql);
-                    prepareStatement.setString(1, resultValue);
-                    prepareStatement.setString(2, total);
-                    prepareStatement.setString(3, DataDetail);
-                    prepareStatement.setString(4, IsQualified);
-                    prepareStatement.setString(5, Id);
-                    return prepareStatement;
-                }
-            });
-        } else{
-            log.info("qryMode=1,pretend to update t_zlzbpjzb:Id:"+Id+",ResultValue:"+resultValue+",total:"+total+",DataDetail:"+DataDetail+",IsQualified:"+IsQualified);
-        }
-    }
-
-    public void save(String Id, String resultValue, String numerator, String denominator,String DataDetail, String IsQualified){
-        //sql语句
-        final String sql = "update t_zlzbpjzb set shi_ji_shu_zhi_=?, fen_zi_=?,fen_mu_=?,zhuang_tai_='已完成', bei_zhu_2_='自动导入',bei_zhu_='自动导入',shu_ju_xiang_qing=?,da_biao_qing_kuan=? where id_=? ";
-//        System.out.println("Id:"+Id+",ResultValue:"+ResultValue);
-        if (Objects.equals(qryMode, "0")){
-            log.info("Ready to update t_zlzbpjzb:Id:"+Id+",ResultValue:"+resultValue+",Numerator:"+numerator+",Denominator:"+denominator+",DataDetail:"+DataDetail+",IsQualified:"+IsQualified);
-            jdbcTemplate.update(new PreparedStatementCreator() {
-                public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
-                    PreparedStatement prepareStatement = connection.prepareStatement(sql);
-                    prepareStatement.setString(1, resultValue);
-                    prepareStatement.setString(2, numerator);
-                    prepareStatement.setString(3, denominator);
-                    prepareStatement.setString(4, DataDetail);
-                    prepareStatement.setString(5, IsQualified);
-                    prepareStatement.setString(6, Id);
-                    return prepareStatement;
-                }
-            });
-        } else{
-            log.info("qryMode=1,pretend to update t_zlzbpjzb:Id:"+Id+",ResultValue:"+resultValue+",Numerator:"+numerator+",Denominator:"+denominator+",DataDetail:"+DataDetail+",IsQualified:"+IsQualified);
-        }
-    }
-}

+ 4 - 6
GetDataByView/src/main/resources/application.properties

@@ -7,11 +7,9 @@ spring.second-datasource.jdbc-url = jdbc:mysql://localhost:3306/klims-ibps3?char
 spring.second-datasource.username = root
 spring.second-datasource.password = test001
 spring.second-datasource.driver-class-name = com.mysql.cj.jdbc.Driver
-fetch.sql=select * from v_jt_lisrequesttest
-fetch.sqlGetUndo=select id_,bian_zhi_shi_jian,zhi_liang_zhi_bia,yuan_shi_shu_ju_ from t_zlzbpjzb where zhuang_tai_='\u5f85\u5904\u7406'
-fetch.QualityIndicatorStr = ;???????????-??????-????; 
-logging.file.name=logs/GetDataByView.log
+fetch.QryDailySql=select * from tablename where CreateTime=curdate()
+table.match=V_JT_QCMonthReport|t_dlxmsnzkyfx@V_JT_QCTestCodeReport|t_dlxmsnzkyfxzb@V_JT_TestCodeRerunRecord|t_fjbbjlb
 # level:TRACE < DEBUG < INFO < WARN < ERROR < FATAL
 logging.level.root=INFO
-#1 or 0,1 means only qry,0 means update
-config.qrymode=1
+#1 or 0,1 means only qry,0 means Insert
+config.insertMode=1