소스 검색

修复一点小问题

lighter 3 달 전
부모
커밋
204535a6bd

+ 9 - 2
pom.xml

@@ -22,8 +22,8 @@
         <thyy-archive>0.1.1</thyy-archive>
         <thyy-haikang>0.0.5</thyy-haikang>
         <thyy-emr-query>1.5.1</thyy-emr-query>
-        <thyy-thirdpart-api>0.0.3</thyy-thirdpart-api>
-        <thyy-scheduled>0.0.2</thyy-scheduled>
+        <thyy-thirdpart-api>0.0.4</thyy-thirdpart-api>
+        <thyy-scheduled>0.0.3</thyy-scheduled>
         <thyy-plugins>0.0.1</thyy-plugins>
         <thyy-hospitalized>0.0.1</thyy-hospitalized>
         <thyy-medinsur>0.0.1</thyy-medinsur>
@@ -89,6 +89,13 @@
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+            <version>7.0.1</version>
+        </dependency>
+
     </dependencies>
 
     <dependencyManagement>

+ 0 - 11
thyy-archive/pom.xml

@@ -20,12 +20,6 @@
             <artifactId>spring-boot-starter</artifactId>
         </dependency>
 
-        <!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-generator -->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
-        </dependency>
-
         <!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
         <dependency>
             <groupId>com.itextpdf</groupId>
@@ -44,11 +38,6 @@
             <groupId>org.thyy.business</groupId>
             <artifactId>thyy-utils</artifactId>
         </dependency>
-        <dependency>
-            <groupId>net.logstash.logback</groupId>
-            <artifactId>logstash-logback-encoder</artifactId>
-            <version>7.0.1</version>
-        </dependency>
     </dependencies>
 
     <build>

+ 0 - 4
thyy-hospitalized/thyy-doctor/pom.xml

@@ -30,10 +30,6 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
-        </dependency>
     </dependencies>
 
     <build>

+ 24 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/controller/DpccController.java

@@ -0,0 +1,24 @@
+package org.thyy.scheduled.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+import org.thyy.scheduled.service.DpccService;
+
+@RestController
+@RequestMapping("/dpcc")
+public class DpccController {
+    private final DpccService service;
+
+    @Autowired
+    public DpccController(DpccService service) {
+        this.service = service;
+    }
+
+    @GetMapping("/uploadMzDataByOffsetDays")
+    public String uploadMzDataByOffsetDays(@RequestParam("offsetDays") Integer offsetDays) {
+        return service.uploadMzDataByOffsetDays(offsetDays);
+    }
+}

+ 2 - 2
thyy-scheduled/src/main/java/org/thyy/scheduled/dao/DpccDao.java

@@ -20,9 +20,9 @@ public interface DpccDao {
             "rtrim(a.patient_id) as patNo,a.times," +
             "rtrim(b.social_no) as idCard,source='1' " +
             "from mz_visit_table a,mz_patient_mi b where a.visit_dept_code='1020700' " +
-            "and a.dpcc_upload_flag=0 and datediff(day,a.visit_date,getdate())=0 " +
+            "and a.dpcc_upload_flag=0 and datediff(day,a.visit_date,getdate())=#{offsetDay} " +
             "and a.patient_id=b.patient_id")
-    List<Patient> getOutpatientList();
+    List<Patient> getOutpatientList(int offsetDay);
 
     @Select("select " +
             "patientNo=rtrim(b.inpatient_no), " +

+ 11 - 1
thyy-scheduled/src/main/java/org/thyy/scheduled/service/DpccService.java

@@ -91,7 +91,7 @@ public class DpccService {
 
     public void uploadHisData() {
         List<Patient> inpatientList = dao.getInpatientList();
-        List<Patient> outpatientList = dao.getOutpatientList();
+        List<Patient> outpatientList = dao.getOutpatientList(0);
         if (inpatientList.isEmpty() && outpatientList.isEmpty()) {
             return;
         }
@@ -105,6 +105,16 @@ public class DpccService {
         uploadOutpatientDrug(outpatientList);
     }
 
+    public String uploadMzDataByOffsetDays(int offsetDays) {
+        if (StrUtil.isBlank(dpcc.getTokenUrl())) {
+            throw new BizException(ExceptionEnum.NO_CONFIGURATION);
+        }
+        List<Patient> outpatientList = dao.getOutpatientList(offsetDays);
+        ReportIndexInquiry inquiry = getReportIndexInquiry();
+        uploadOutpatientCheck(outpatientList, inquiry);
+        uploadOutpatientDrug(outpatientList);
+        return "OK";
+    }
 
     private ReportIndexInquiry getReportIndexInquiry() {
         String now = DateUtil.formatDate(new Date());

+ 16 - 0
thyy-scheduled/src/main/resources/logback-spring.xml

@@ -1,5 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml" />
+    <springProperty scope="context" name="serviceName" source="spring.application.name" defaultValue="wxservice-server"/>
+    <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>172.16.32.134:5044</destination>
+
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"service":"${serviceName}"}</customFields>
+            <includeContext>false</includeContext>
+        </encoder>
+    </appender>
+    <root level="INFO">
+        <!-- 配置哪个级别使用该appender -->
+        <appender-ref ref="LOGSTASH" />
+    </root>
+
+
 
     <springProperty name="application_name" scope="context" source="spring.application.name"/>
     <springProperty scope="context" name="LOG_HOME" source="logging.path"

+ 2 - 2
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/inspection/inspectionImpl/ThyyInspectionImpl.java

@@ -46,8 +46,8 @@ public class ThyyInspectionImpl implements InspectionInterface {
             return new ArrayList<>();
         }
         JyRequest jyRequest = JyRequest.builder()
-                .patientNumType(request.getPatType())
-                .patientNum(request.getPatNo())
+                .patientNumType(request.getPatientType())
+                .patientNum(request.getPatientNum())
                 .startDate(request.getStart())
                 .endDate(request.getEnd())
                 .build();

+ 15 - 3
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/inspection/request/ReportIndexInquiry.java

@@ -7,15 +7,27 @@ import org.thyy.thirdpartapi.inspection.config.PatientNumType;
 
 @Data
 public class ReportIndexInquiry {
+    // 这是文档定义的标准请求参数
+    private PatientNumType patientNumType;
+    private String patientNum;
+    private String startDate;
+    private String endDate;
+
+    // 以下是其他地方的不合规衍生请求参数
     private PatientNumType patType;
-    private Category reportCategory;
     private String patNo;
     private String socialNo;
-    private String startDate;
-    private String endDate;
     private String reqStartTime;
     private String reqEndTime;
 
+    public PatientNumType getPatientType() {
+        return null == patType ? patientNumType : patType;
+    }
+
+    public String getPatientNum() {
+        return StrUtil.isBlank(patNo) ? patientNum : patNo;
+    }
+
     public String getStart() {
         return StrUtil.isBlank(reqStartTime) ? startDate : reqStartTime;
     }

+ 16 - 0
thyy-thirdpart-api/src/main/resources/logback-spring.xml

@@ -1,5 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml" />
+    <springProperty scope="context" name="serviceName" source="spring.application.name" defaultValue="thyy-scheduled"/>
+    <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>172.16.32.134:5044</destination>
+
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"service":"${serviceName}"}</customFields>
+            <includeContext>false</includeContext>
+        </encoder>
+    </appender>
+    <root level="INFO">
+        <!-- 配置哪个级别使用该appender -->
+        <appender-ref ref="LOGSTASH" />
+    </root>
+
+
 
     <springProperty name="application_name" scope="context" source="spring.application.name"/>
     <springProperty scope="context" name="LOG_HOME" source="logging.path"