Ver código fonte

集成门特接口。

lighter 4 anos atrás
pai
commit
2c4835f233

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>5.3</version>
+    <version>5.4</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
 

+ 20 - 0
src/main/java/thyyxxk/webserver/controller/markmtfees/MarkMtFeesController.java

@@ -3,10 +3,12 @@ package thyyxxk.webserver.controller.markmtfees;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.pojo.ResultVo;
 import thyyxxk.webserver.pojo.markmtfees.CssybApplyInfo;
 import thyyxxk.webserver.pojo.markmtfees.MarkMtFeeParam;
 import thyyxxk.webserver.pojo.markmtfees.QueryMtInfoParam;
+import thyyxxk.webserver.pojo.markmtfees.UploadMtFeeParam;
 import thyyxxk.webserver.service.markmtfees.MarkMtFeesService;
 
 import java.util.Map;
@@ -47,4 +49,22 @@ public class MarkMtFeesController {
                                                        @RequestParam("times") Integer times) {
         return service.cssybMtPreCal(patientId, times);
     }
+
+    @PassToken
+    @PostMapping("/uploadFees")
+    public Map<String, Object> uploadMtFees(@RequestBody UploadMtFeeParam param) {
+        return service.uploadMtFees(param);
+    }
+
+    @PassToken
+    @PostMapping("/retractFees")
+    public Map<String, Object> retractMtFees(@RequestBody UploadMtFeeParam param) {
+        return service.retractMtFees(param);
+    }
+
+    @PassToken
+    @PostMapping("/calculateCost")
+    public Map<String, Object> calculateMtFees(@RequestBody UploadMtFeeParam param) {
+        return service.calculateMtFees(param);
+    }
 }

+ 6 - 2
src/main/java/thyyxxk/webserver/dao/his/markmtfees/MarkMtFeesDao.java

@@ -34,8 +34,8 @@ public interface MarkMtFeesDao {
                           @Param("responseType") String responseType,
                           @Param("ybType") String ybType);
 
-    @Insert("insert into mt_part_info (patient_id, times, icd, balance, serial_apply) "+
-            "values (#{patientId},#{times},#{icd},#{balance},#{apply})")
+    @Insert("insert into mt_part_info (patient_id, times, icd, balance, serial_apply, responce_type) "+
+            "values (#{patientId},#{times},#{icd},#{balance},#{apply}, '02')")
     void insertHnsybMtPartInfo(@Param("patientId") String patientId,
                                @Param("times") Integer times,
                                @Param("icd") String icd,
@@ -111,4 +111,8 @@ public interface MarkMtFeesDao {
     List<MzReceipt> selectMzReceipts(@Param("patientId") String patientId,
                                      @Param("times") Integer times,
                                      @Param("receiptNo") Integer receiptNo);
+
+    @Select("select top 1 responce_type from mt_part_info where patient_id=#{patientId} and times=#{times}")
+    String selectResponceType(@Param("patientId") String patientId,
+                              @Param("times") Integer times);
 }

+ 16 - 0
src/main/java/thyyxxk/webserver/pojo/markmtfees/UploadMtFeeParam.java

@@ -0,0 +1,16 @@
+package thyyxxk.webserver.pojo.markmtfees;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+public class UploadMtFeeParam {
+    @NotBlank(message = "操作员id不能为空。")
+    private String staffId;
+    @NotBlank(message = "门诊id号不能为空。")
+    private String patientId;
+    @NotNull(message = "就诊次数不能为空。")
+    private Integer times;
+}

+ 67 - 0
src/main/java/thyyxxk/webserver/service/markmtfees/MarkMtFeesService.java

@@ -28,6 +28,7 @@ public class MarkMtFeesService {
     }
 
     public ResultVo<Map<String, Object>> queryMtPersonInfo(QueryMtInfoParam param) {
+        log.info("查询门特身份:{}", param);
         String patientId = param.getPatientId();
         if (null == patientId || patientId.trim().equals("")) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请输入正确的门诊id号!");
@@ -170,4 +171,70 @@ public class MarkMtFeesService {
         }
         return ResultVoUtil.success(map.get("data"));
     }
+
+    public Map<String, Object> uploadMtFees(UploadMtFeeParam param) {
+        log.info("上传门特费用:{}", param);
+        Map<String, Object> resultMap = new HashMap<>();
+        String responceType = dao.selectResponceType(param.getPatientId(), param.getTimes());
+        if (null == responceType) {
+            resultMap.put("code", -1);
+            resultMap.put("msg", "未查询到此人的门特身份记录。");
+            return resultMap;
+        }
+        String urlHead = YbActionLinks.normalLinks.get("mtBase");
+        String urlEnd;
+        if (responceType.equals("02")) {
+            urlEnd = ":2000/shengyb/mt/uploadFees";
+        } else {
+            urlEnd = ":1000/mzsyb/mzCalculate";
+        }
+        String url = urlHead + urlEnd;
+        RestTemplate restTemplate = new RestTemplate();
+        Object templateRet = restTemplate.postForObject(url, param, Object.class);
+        return FilterUtil.cast(templateRet);
+    }
+
+    public Map<String, Object> retractMtFees(UploadMtFeeParam param) {
+        log.info("撤销门特费用:{}", param);
+        Map<String, Object> resultMap = new HashMap<>();
+        String responceType = dao.selectResponceType(param.getPatientId(), param.getTimes());
+        if (null == responceType) {
+            resultMap.put("code", -1);
+            resultMap.put("msg", "未查询到此人的门特身份记录。");
+            return resultMap;
+        }
+        String urlHead = YbActionLinks.normalLinks.get("mtBase");
+        String urlEnd;
+        if (responceType.equals("02")) {
+            urlEnd = ":2000/shengyb/mt/retractFees";
+        } else {
+            urlEnd = ":1000/mzsyb/mzCancelCalculate";
+        }
+        String url = urlHead + urlEnd;
+        RestTemplate restTemplate = new RestTemplate();
+        Object templateRet = restTemplate.postForObject(url, param, Object.class);
+        return FilterUtil.cast(templateRet);
+    }
+
+    public Map<String, Object> calculateMtFees(UploadMtFeeParam param) {
+        log.info("结算门特费用:{}", param);
+        Map<String, Object> resultMap = new HashMap<>();
+        String responceType = dao.selectResponceType(param.getPatientId(), param.getTimes());
+        if (null == responceType) {
+            resultMap.put("code", -1);
+            resultMap.put("msg", "未查询到此人的门特身份记录。");
+            return resultMap;
+        }
+        String urlHead = YbActionLinks.normalLinks.get("mtBase");
+        String urlEnd;
+        if (responceType.equals("02")) {
+            urlEnd = ":2000/shengyb/mt/calculateCost";
+        } else {
+            urlEnd = ":1000/mzsyb/mzCalculate";
+        }
+        String url = urlHead + urlEnd;
+        RestTemplate restTemplate = new RestTemplate();
+        Object templateRet = restTemplate.postForObject(url, param, Object.class);
+        return FilterUtil.cast(templateRet);
+    }
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/utils/YbActionLinks.java

@@ -27,8 +27,8 @@ public class YbActionLinks {
         normalLinks.put("cssybReadMzPatient", environment.getProperty("CSSYB_READ_MZ_PATIENT"));
         normalLinks.put("cssybMtInfo", environment.getProperty("CSSYB_MT_INFO"));
         normalLinks.put("cssybMtPreCal", environment.getProperty("CSSYB_MT_PRE_CAL"));
-
         String UPLOAD_BASE = environment.getProperty("UPLOAD_BASE");
+        normalLinks.put("mtBase", UPLOAD_BASE);
 
         String[] cssybLinks = new String[3];
         cssybLinks[0] = UPLOAD_BASE + ":1100/upload/";

+ 8 - 8
src/main/resources/application-dev.yml

@@ -47,18 +47,18 @@ mybatis:
     map-underscore-to-camel-case: true
 
 UPLOAD_BASE:
-  http://172.16.32.163
+  http://172.16.30.26
 CSSYB_BASE:
-  http://172.16.32.163:1000/cssyb/
+  http://172.16.30.26:1000/cssyb/
 HNSYB_BASE:
-  http://172.16.32.163:2000/hnsyb/
+  http://172.16.30.26:2000/hnsyb/
 XNHYB_BASE:
-  http://172.16.32.163:3000/xnhyb/
+  http://172.16.30.26:3000/xnhyb/
 HNSYB_MT_INFO:
-  http://172.16.32.163:2000/shengyb/mt/getPersonInfo
+  http://172.16.30.26:2000/shengyb/mt/getPersonInfo
 CSSYB_READ_MZ_PATIENT:
-  http://172.16.32.163:1000/mzsyb/readPatient
+  http://172.16.30.26:1000/mzsyb/readPatient
 CSSYB_MT_INFO:
-  http://172.16.32.163:1000/mzsyb/queryApplyInfo
+  http://172.16.30.26:1000/mzsyb/queryApplyInfo
 CSSYB_MT_PRE_CAL:
-  http://172.16.32.163:1000/mzsyb/mzPreCalculate
+  http://172.16.30.26:1000/mzsyb/mzPreCalculate