Browse Source

电子发票接口和日志管理

lighter 4 tháng trước cách đây
mục cha
commit
c2fdbf8301

+ 5 - 2
src/main/java/thyyxxk/wxservice_server/controller/AppointmentController.java

@@ -111,8 +111,11 @@ public class AppointmentController {
     }
 
     @GetMapping("/getPaidMzGhList")
-    public ResultVo<List<Map<String, String>>> getPaidMzGhList(@RequestParam("patientId") String patientId) {
-        return ResultVoUtil.success(service.getPaidMzGhList(patientId));
+    public ResultVo<List<Map<String, String>>> getPaidMzGhList(
+            @RequestParam("patientId") String patientId,
+            @RequestParam("start") String start,
+            @RequestParam("end") String end) {
+        return ResultVoUtil.success(service.getPaidMzGhList(patientId, start, end));
     }
 
     @PostMapping("/listMzyReqrec")

+ 10 - 2
src/main/java/thyyxxk/wxservice_server/controller/PayMzFeeController.java

@@ -34,8 +34,11 @@ public class PayMzFeeController {
     }
 
     @GetMapping("/getMzPaidList")
-    public ResultVo<List<Map<String, String>>> getMzPaidList(@RequestParam("patientId") String patientId) {
-        return service.getMzPaidList(patientId);
+    public ResultVo<List<Map<String, String>>> getMzPaidList(
+            @RequestParam("patientId") String patientId,
+            @RequestParam("start") String start,
+            @RequestParam("end") String end) {
+        return service.getMzPaidList(patientId, start, end);
     }
 
     @GetMapping("/getMzPaidDetail")
@@ -48,4 +51,9 @@ public class PayMzFeeController {
         MedinsSettle setlinfo = service.getFundPayAmt(hisOrdNum);
         return ResultVoUtil.success(setlinfo);
     }
+
+    @GetMapping("/queryDzfp")
+    public ResultVo<String> queryDzfp(@RequestParam("hisOrdNum") String hisOrdNum) {
+        return service.queryDzfp(hisOrdNum);
+    }
 }

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/controller/api/PowersiMiPayPlugin.java

@@ -118,7 +118,7 @@ public class PowersiMiPayPlugin {
         List<BillInfo> list = new ArrayList<>();
         for (String patNo : patNoList) {
             QueryReceiptRequest receiptRequest =
-                    new QueryReceiptRequest.Builder().patCardNo(patNo).build();
+                    QueryReceiptRequest.builder().patCardNo(patNo).build();
             ResultVo<List<Map<String, Object>>> vo =
                     thmzService.getMzChargeDetailForUnPaid(receiptRequest);
             if (vo.getCode() != ExceptionEnum.SUCCESS.getCode()) {

+ 34 - 35
src/main/java/thyyxxk/wxservice_server/factory/thmz/ThmzService.java

@@ -42,7 +42,7 @@ public class ThmzService {
         JSONObject params = new JSONObject();
         params.put("patIdType", "11");
         params.put("patIdNo", patIdNo);
-        JSONObject response = template.postForObject(thmzApi + "/queryPatientInfo", params, JSONObject.class);
+        JSONObject response = template.postForObject(thmzApi + "/api/v1/queryPatientInfo", params, JSONObject.class);
         log.info("在绑卡前查询患者信息:\n参数:{}\n结果:{}", params, response);
         if (null == response || response.getInteger("resultCode") != 0) {
             return null;
@@ -51,7 +51,7 @@ public class ThmzService {
     }
 
     public String savePatientInfo(CreatCardParam request) {
-        CreateCardResponse response = template.postForObject(thmzApi + "/savePatientInfo", request, CreateCardResponse.class);
+        CreateCardResponse response = template.postForObject(thmzApi + "/api/v1/savePatientInfo", request, CreateCardResponse.class);
         log.info("首诊患者建档:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
         if (null == response) {
             return "ERROR:网络异常。";
@@ -63,7 +63,7 @@ public class ThmzService {
     }
 
     public List<Map<String, Object>> getMzClass() {
-        MzClassResponse response = template.getForObject(thmzApi + "/getMzClass", MzClassResponse.class);
+        MzClassResponse response = template.getForObject(thmzApi + "/api/v1/getMzClass", MzClassResponse.class);
         log.info("获取门诊科室分类:{}", JSON.toJSON(response));
         if (null == response || 0 != response.getResultCode()) {
             return new ArrayList<>();
@@ -72,9 +72,9 @@ public class ThmzService {
     }
 
     public List<Map<String, Object>> getUnitCodeByMzClass(QueryUnitCodeRequest request) {
-        String url = thmzApi + "/getUnitCodeByMzClass";
+        String url = thmzApi + "/api/v1/getUnitCodeByMzClass";
         if (request.isP4Request()) {
-            url = thmzApi + "/getP4UnitCode";
+            url = thmzApi + "/api/v1/getP4UnitCode";
         }
         MzClassResponse response = template.postForObject(url, request, MzClassResponse.class);
         log.info("获取门诊科室列表:{}", JSON.toJSON(response));
@@ -86,7 +86,7 @@ public class ThmzService {
 
     public List<Map<String, Object>> getDoctorByDateAndDept(QueryMzDoctorRequest request) {
         String url = String.format(thmzApi
-                        + "/getDoctorByDateAndDept?requestDay=%s&unitCode=%s",
+                        + "/api/v1/getDoctorByDateAndDept?requestDay=%s&unitCode=%s",
                 request.getRequestDay(), request.getUnitCode());
         SourcesResponse response = template.getForObject(url, SourcesResponse.class);
         if (null == response || response.getResultCode() == -1) {
@@ -96,7 +96,7 @@ public class ThmzService {
     }
 
     public List<Map<String, Object>> getDoctorsArrangement(QueryMzDoctorRequest request) {
-        String url = String.format(thmzApi + "/getRequestByDateAndDeptAndDoctor?requestDay=%s&unitCode=%s&doctorCode=%s",
+        String url = String.format(thmzApi + "/api/v1/getRequestByDateAndDeptAndDoctor?requestDay=%s&unitCode=%s&doctorCode=%s",
                 request.getRequestDay(), request.getUnitCode(), request.getDoctorCode());
         SourcesResponse response = template.getForObject(url, SourcesResponse.class);
         if (null == response || null == response.getResultCode() || response.getResultCode() == -1) {
@@ -106,7 +106,7 @@ public class ThmzService {
     }
 
     public Map<String, Object> getRegisterCost(QueryRegisterCostRequest request) {
-        String url = String.format(thmzApi + "/getMzChargeTypeByRequestIdForHaiCi?" +
+        String url = String.format(thmzApi + "/api/v1/getMzChargeTypeByRequestIdForHaiCi?" +
                 "mzyRequestId=%d&patientId=%s", request.getMzyRequestId(), request.getPatientId());
         HrgCommonResponse data = template.getForObject(url, HrgCommonResponse.class);
         log.info("获取挂号费用:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(data));
@@ -119,11 +119,9 @@ public class ThmzService {
         return map;
     }
 
-    public List<Map<String, String>> getPaidMzGhList(String patientId) {
-        JSONObject params = new JSONObject();
-        params.put("patientId", patientId);
+    public List<Map<String, String>> getPaidMzGhList(QueryReceiptRequest request) {
         SourcesResponse response = template.postForObject(thmzApi
-                + "/getRegistrationForPaid", params, SourcesResponse.class);
+                + "/api/v1/getRegistrationForPaid", request, SourcesResponse.class);
         if (null == response || response.getResultCode() != 0) {
             return new ArrayList<>();
         }
@@ -131,7 +129,7 @@ public class ThmzService {
     }
 
     public List<MzyReqrec> listMzyReqrec(QueryMzyReqrecRequest request) {
-        String url = thmzApi + "/listMzyReqrec?patientId=" + request.getPatientId()
+        String url = thmzApi + "/api/v1/listMzyReqrec?patientId=" + request.getPatientId()
                 + "&payMark=" + request.getPayMark();
         List<MzyReqrec> list = new ArrayList<>();
         JSONObject response = template.getForObject(url, JSONObject.class);
@@ -157,7 +155,7 @@ public class ThmzService {
     }
 
     public MzyReqrec getMzyReqrecInfo(QueryMzyReqrecRequest request) {
-        String url = thmzApi + "/getMzyReqrecInfo?patientId=" +
+        String url = thmzApi + "/api/v1/getMzyReqrecInfo?patientId=" +
                 request.getPatientId() + "&times=" + request.getTimes();
         JSONObject response = template.getForObject(url, JSONObject.class);
         if (null == response || 0 != response.getInteger("resultCode")) {
@@ -178,7 +176,7 @@ public class ThmzService {
     }
 
     public String cancelReqFromHis(QueryMzyReqrecRequest request) {
-        String url = thmzApi + "/cancelReqrec";
+        String url = thmzApi + "/api/v1/cancelReqrec";
         JSONObject response = template.postForObject(url, request, JSONObject.class);
         log.info("自助退号:\n参数:{}\n结果:{}", JSON.toJSON(request), response);
         if (null == response) {
@@ -191,7 +189,7 @@ public class ThmzService {
     }
 
     public ResultVo<List<Map<String, Object>>> getMzChargeDetailForUnPaid(QueryReceiptRequest request) {
-        String url = thmzApi + "/getMzChargeDetailForUnPaid";
+        String url = thmzApi + "/api/v1/getMzChargeDetailForUnPaid";
         SourcesResponse response = template.postForObject(url, request, SourcesResponse.class);
         if (null == response || null == response.getResultCode()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
@@ -203,7 +201,7 @@ public class ThmzService {
     }
 
     public ResultVo<List<Map<String, Object>>> getChargeDetailByHisOrdNum(QueryReceiptRequest request) {
-        String url = thmzApi + "/getChargeDetailByHisOrdNum";
+        String url = thmzApi + "/api/v1/getChargeDetailByHisOrdNum";
         SourcesResponse response = template.postForObject(url, request, SourcesResponse.class);
         if (null == response || null == response.getResultCode()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
@@ -215,13 +213,13 @@ public class ThmzService {
     }
 
     public ResultVo<List<Map<String, String>>> getMzPaidList(QueryReceiptRequest request) {
-        String url = thmzApi + "/getMzChargeDetailForPaid";
+        String url = thmzApi + "/api/v1/getMzChargeDetailForPaid";
         SourcesResponse hrgResponse = template.postForObject(url, request, SourcesResponse.class);
         return ThmzUtil.getResultVoCompletableFuture(hrgResponse);
     }
 
     public ResultVo<List<Map<String, Object>>> getMzPaidDetail(QueryReceiptRequest request) {
-        String url = thmzApi + "/getSfjkMzbrmx?djh=" + request.getHisOrdNum();
+        String url = thmzApi + "/api/v1/getSfjkMzbrmx?djh=" + request.getHisOrdNum();
         SourcesResponse hrgResponse = template.getForObject(url, SourcesResponse.class);
         if (null == hrgResponse) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -233,7 +231,7 @@ public class ThmzService {
     }
 
     public ResultVo<List<Map<String, String>>> getParentIdByPatientId(String patientId) {
-        String url = thmzApi + "/getParentIdByPatientId?patientId=" + patientId;
+        String url = thmzApi + "/api/v1/getParentIdByPatientId?patientId=" + patientId;
         HrgCommonResponse response = template.getForObject(url, HrgCommonResponse.class);
         if (null != response && response.getCode() == 0) {
             return ResultVoUtil.success(CastUtil.cast(response.getData()));
@@ -263,7 +261,7 @@ public class ThmzService {
     }
 
     private ExceptionEnum saveMzPayResult(SaveMzPayRequest request, int times) {
-        String url = request.isNormalClinic() ? thmzApi + "/payChargeDetailFormHaiCi"
+        String url = request.isNormalClinic() ? thmzApi + "/api/v1/payChargeDetailFormHaiCi"
                 : "http://172.16.32.160:8088/thmz/api/v1/payChargeDetailFormHaiCi";
         String des = request.isNormalClinic() ? "门诊" : "医美";
         SaveMzFeeResponse mzFeeResponse = null;
@@ -289,7 +287,7 @@ public class ThmzService {
     public String saveAppointment(SaveAppointmentRequest request) {
         SaveGhFeeResponse response = null;
         try {
-            response = template.postForObject(thmzApi + "/payRegistrationFormHaiCi",
+            response = template.postForObject(thmzApi + "/api/v1/payRegistrationFormHaiCi",
                     request, SaveGhFeeResponse.class);
             log.info("保存挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
         } catch (Exception e) {
@@ -307,7 +305,7 @@ public class ThmzService {
     public String saveClinicRegister(SaveClinicRegisterRequest request) {
         SaveGhFeeResponse response = null;
         try {
-            response = template.postForObject(thmzApi + "/payRegistration", request, SaveGhFeeResponse.class);
+            response = template.postForObject(thmzApi + "/api/v1/payRegistration", request, SaveGhFeeResponse.class);
             log.info("保存诊间挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
         } catch (Exception e) {
             log.error("网络连接失败,保存诊间挂号信息失败:", e);
@@ -321,20 +319,21 @@ public class ThmzService {
         return "ERROR:" + response.getMessage();
     }
 
-    public String saveTemplate(SaveTemplateRequest request) {
-        HrgCommonResponse response = null;
-        try {
-            response = template.postForObject(thmzApi + "/saveTcPrescription", request, HrgCommonResponse.class);
-            log.info("保存套餐缴费:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
-        } catch (Exception e) {
-            log.error("网络连接失败,保存套餐缴费信息失败:", e);
-        }
+
+    public ResultVo<String> queryInvoiceFile(QueryDzfpRequest request) {
+        String url = thmzApi + "/queryInvoiceFile";
+        JSONObject response = template.postForObject(url, request, JSONObject.class);
         if (null == response) {
-            return "ERROR:保存套餐缴费失败,门诊接口返回空。";
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (0 == response.getCode() || response.getMessage().contains("已经缴费成功")) {
-            return "保存套餐信息成功。";
+        Integer code = response.getInteger("code");
+        if (null == code) {
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        return "ERROR:" + response.getMessage();
+        if (code == 0) {
+            JSONObject data = response.getJSONObject("data");
+            return ResultVoUtil.success(data.getString("pdfFileStr"));
+        }
+        return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, response.getString("message"));
     }
 }

+ 24 - 0
src/main/java/thyyxxk/wxservice_server/factory/thmz/model/QueryDzfpRequest.java

@@ -0,0 +1,24 @@
+package thyyxxk.wxservice_server.factory.thmz.model;
+
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class QueryDzfpRequest {
+    // 门诊或住院号
+    private String patientId;
+    // 就诊次数
+    private Integer times;
+    //发票类型 1 门诊蓝字发票  2 门诊红字发票 3住院蓝字发票 4住院红字发票
+    private Integer typeFlag;
+    // //缴费次数或住院账页数,挂号的可以不传
+    private Integer receiptNo;
+
+    public static class Type {
+        public static Integer MZLZ = 1;
+        public static Integer MZHZ = 2;
+        public static Integer ZYLZ = 3;
+        public static Integer ZYHZ = 1;
+    }
+}

+ 6 - 33
src/main/java/thyyxxk/wxservice_server/factory/thmz/model/QueryReceiptRequest.java

@@ -1,42 +1,15 @@
 package thyyxxk.wxservice_server.factory.thmz.model;
 
-import lombok.Getter;
+import lombok.Builder;
+import lombok.Data;
 
-@Getter
+@Builder
+@Data
 public class QueryReceiptRequest {
     private final String patCardType = "1";
     private final String patientId;
     private final String patCardNo;
     private final String hisOrdNum;
-
-    private QueryReceiptRequest(String patientId, String patCardNo, String hisOrdNum) {
-        this.patientId = patientId;
-        this.patCardNo = patCardNo;
-        this.hisOrdNum = hisOrdNum;
-    }
-
-    public static class Builder {
-        private String patientId;
-        private String patCardNo;
-        private String hisOrdNum;
-
-        public Builder patientId(String patientId) {
-            this.patientId = patientId;
-            return this;
-        }
-
-        public Builder patCardNo(String patCardNo) {
-            this.patCardNo = patCardNo;
-            return this;
-        }
-
-        public Builder hisOrdNum(String hisOrdNum) {
-            this.hisOrdNum = hisOrdNum;
-            return this;
-        }
-
-        public QueryReceiptRequest build() {
-            return new QueryReceiptRequest(patientId, patCardNo, hisOrdNum);
-        }
-    }
+    private final String startTime;
+    private final String endTime;
 }

+ 8 - 6
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -11,10 +11,7 @@ import thyyxxk.wxservice_server.dao.AppointmentDao;
 import thyyxxk.wxservice_server.entity.BriefPatInfo;
 import thyyxxk.wxservice_server.entity.appointment.*;
 import thyyxxk.wxservice_server.factory.thmz.ThmzService;
-import thyyxxk.wxservice_server.factory.thmz.model.QueryMzDoctorRequest;
-import thyyxxk.wxservice_server.factory.thmz.model.QueryMzyReqrecRequest;
-import thyyxxk.wxservice_server.factory.thmz.model.QueryRegisterCostRequest;
-import thyyxxk.wxservice_server.factory.thmz.model.QueryUnitCodeRequest;
+import thyyxxk.wxservice_server.factory.thmz.model.*;
 import thyyxxk.wxservice_server.utils.*;
 
 import java.text.SimpleDateFormat;
@@ -265,9 +262,14 @@ public class AppointmentService {
         return json.getString("qr_code");
     }
 
-    public List<Map<String, String>> getPaidMzGhList(String patientId) {
+    public List<Map<String, String>> getPaidMzGhList(String patientId, String start, String end) {
         healthCardService.reportHisData(patientId, "01010111", null, null);
-        return thmzService.getPaidMzGhList(patientId);
+        start = start + " 00:00:00";
+        end = end + " 23:59:59";
+        QueryReceiptRequest request = QueryReceiptRequest
+                .builder().patientId(patientId)
+                .startTime(start).endTime(end).build();
+        return thmzService.getPaidMzGhList(request);
     }
 
     public List<MzyReqrec> listMzyReqrec(BriefPatInfo patInfo) {

+ 8 - 8
src/main/java/thyyxxk/wxservice_server/service/BookableService.java

@@ -66,7 +66,7 @@ public class BookableService {
         book.getMzBlRecord().setEmrPe("申请" + yjReq.getName());
         book.getMzBlRecord().setEmrFzjc("申请" + yjReq.getName());
         book.getMzBlRecord().setEmrProcess("申请" + yjReq.getName());
-        SaveMzFeeResponse hrgResponse = template.postForObject(thmzApi + "/savePrescription", book, SaveMzFeeResponse.class);
+        SaveMzFeeResponse hrgResponse = template.postForObject(thmzApi + "/api/v1/savePrescription", book, SaveMzFeeResponse.class);
         log.info("自助开单预约:\n参数:{}\n结果:{}", JSONObject.toJSONString(book), JSONObject.toJSONString(hrgResponse));
         if (null == hrgResponse) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -89,7 +89,7 @@ public class BookableService {
                     BookedYjReq bookedItem = queue.take();
                     Integer payMark = dao.selectPayMarkByReqNo(bookedItem.getReqNo());
                     if (null != payMark && payMark == 5) {
-                        String url = thmzApi + "/cancelApplyScheduleOfMedical?scheduleId=" + bookedItem.getId();
+                        String url = thmzApi + "/api/v1/cancelApplyScheduleOfMedical?scheduleId=" + bookedItem.getId();
                         HrgCommonResponse res = template.getForObject(url, HrgCommonResponse.class);
                         dao.revokeMzYjReq(bookedItem.getReqNo(), 1);
                         log.info("自动取消未支付的检验检查预约结果:{},容器剩余:{}", res, queue.size());
@@ -105,7 +105,7 @@ public class BookableService {
     public ResultVo<Map<String, Object>> getFullScheduleOfMedicalForPlatform(String execUnit) {
         String[] dateRange = DateUtil.getDatesInOneWeek();
         HrgCommonResponse hrgResponse = template
-                .getForObject(String.format(thmzApi + "/getFullScheduleOfMedicalForPlatform?depNo=%s&beginTime=%s&endTime=%s",
+                .getForObject(String.format(thmzApi + "/api/v1/getFullScheduleOfMedicalForPlatform?depNo=%s&beginTime=%s&endTime=%s",
                         execUnit, dateRange[0], dateRange[6]), HrgCommonResponse.class);
         if (null == hrgResponse) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
@@ -141,7 +141,7 @@ public class BookableService {
     public ResultVo<List<Map<String, Object>>> getOtherTimeForRejectedReq(String execUnit) {
         String[] dateRange = DateUtil.getDatesInOneWeek();
         HrgCommonResponse hrgResponse = template
-                .getForObject(String.format(thmzApi + "/getFullScheduleOfMedicalForPlatform?depNo=%s&beginTime=%s&endTime=%s",
+                .getForObject(String.format(thmzApi + "/api/v1/getFullScheduleOfMedicalForPlatform?depNo=%s&beginTime=%s&endTime=%s",
                         execUnit, dateRange[0], dateRange[6]), HrgCommonResponse.class);
         if (null == hrgResponse) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
@@ -195,7 +195,7 @@ public class BookableService {
             book.getMzChargeDetailList().add(charge);
         }
         log.info("自助开单预约:{}", JSONObject.toJSONString(book));
-        SaveMzFeeResponse hrgResponse = template.postForObject(thmzApi + "/savePrescription", book, SaveMzFeeResponse.class);
+        SaveMzFeeResponse hrgResponse = template.postForObject(thmzApi + "/api/v1/savePrescription", book, SaveMzFeeResponse.class);
         log.info("自助开单:{},结果:{}", param, hrgResponse);
         if (null == hrgResponse) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -221,7 +221,7 @@ public class BookableService {
         // 心电图检查结果
         obj.put("xdtjcjg", 0);
         obj.put("actOrderNo", reqNo);
-        HrgCommonResponse hrgCommonResponse = template.postForObject(thmzApi + "/applyScheduleOfMedicalForPlatform",
+        HrgCommonResponse hrgCommonResponse = template.postForObject(thmzApi + "/api/v1/applyScheduleOfMedicalForPlatform",
                 obj, HrgCommonResponse.class);
         if (null == hrgCommonResponse) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -244,7 +244,7 @@ public class BookableService {
         obj.put("scheduleId", param.getId());
         obj.put("xdtjcjg", 0);
         obj.put("actOrderNo", param.getReqNo());
-        HrgCommonResponse hrgCommonResponse = template.postForObject(thmzApi + "/applyScheduleOfMedicalForPlatform",
+        HrgCommonResponse hrgCommonResponse = template.postForObject(thmzApi + "/api/v1/applyScheduleOfMedicalForPlatform",
                 obj, HrgCommonResponse.class);
         if (null == hrgCommonResponse) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -275,7 +275,7 @@ public class BookableService {
         if (order.getTradeState() == Transaction.TradeStateEnum.SUCCESS) {
             JSONObject param = new JSONObject();
             param.put("hisOrdNum", order.getHisOrdNum());
-            SaveMzFeeResponse response = template.postForObject(thmzApi + "/saveRefundFeeFormHaiCi",
+            SaveMzFeeResponse response = template.postForObject(thmzApi + "/api/v1/saveRefundFeeFormHaiCi",
                     param, SaveMzFeeResponse.class);
             log.info("【hisOrdNum: {}】撤销处方结果:{}", order.getHisOrdNum(), response);
             if (null == response || null == response.getResultCode()) {

+ 22 - 6
src/main/java/thyyxxk/wxservice_server/service/PayMzFeeService.java

@@ -3,12 +3,14 @@ package thyyxxk.wxservice_server.service;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
 import thyyxxk.wxservice_server.constant.medins.Insutype;
 import thyyxxk.wxservice_server.constant.medins.MedType;
 import thyyxxk.wxservice_server.dao.PayMzFeeDao;
 import thyyxxk.wxservice_server.entity.ResultVo;
 import thyyxxk.wxservice_server.entity.paymzfee.MedinsSettle;
 import thyyxxk.wxservice_server.factory.thmz.ThmzService;
+import thyyxxk.wxservice_server.factory.thmz.model.QueryDzfpRequest;
 import thyyxxk.wxservice_server.factory.thmz.model.QueryReceiptRequest;
 import thyyxxk.wxservice_server.utils.DecimalTool;
 
@@ -34,26 +36,28 @@ public class PayMzFeeService {
     }
 
     public ResultVo<List<Map<String, Object>>> getUnPaidFee(String patientId) {
-        QueryReceiptRequest request = new QueryReceiptRequest.Builder()
+        QueryReceiptRequest request = QueryReceiptRequest.builder()
                 .patCardNo(patientId.trim()).build();
         return thmzService.getMzChargeDetailForUnPaid(request);
     }
 
     public ResultVo<List<Map<String, Object>>> getUnPaidDetail(String patientId, String hisOrdNum) {
-        QueryReceiptRequest request = new QueryReceiptRequest.Builder()
+        QueryReceiptRequest request = QueryReceiptRequest.builder()
                 .patCardNo(patientId.trim()).hisOrdNum(hisOrdNum.trim()).build();
         return thmzService.getChargeDetailByHisOrdNum(request);
     }
 
-    public ResultVo<List<Map<String, String>>> getMzPaidList(String patientId) {
+    public ResultVo<List<Map<String, String>>> getMzPaidList(String patientId, String start, String end) {
         healthCardService.reportHisData(patientId, "0101022", null, null);
-        QueryReceiptRequest request = new QueryReceiptRequest.Builder()
-                .patientId(patientId.trim()).build();
+        start = start + " 00:00:00";
+        end = end + " 23:59:59";
+        QueryReceiptRequest request = QueryReceiptRequest.builder()
+                .patientId(patientId.trim()).startTime(start).endTime(end).build();
         return thmzService.getMzPaidList(request);
     }
 
     public ResultVo<List<Map<String, Object>>> getMzPaidDetail(String hisOrdNum) {
-        QueryReceiptRequest request = new QueryReceiptRequest.Builder()
+        QueryReceiptRequest request = QueryReceiptRequest.builder()
                 .hisOrdNum(hisOrdNum.trim()).build();
         return thmzService.getMzPaidDetail(request);
     }
@@ -75,4 +79,16 @@ public class PayMzFeeService {
         setlinfo.setAcctPay(DecimalTool.moneyYuanToFen2(setlinfo.getAcctPay()));
         return setlinfo;
     }
+
+    public ResultVo<String> queryDzfp(String hisOrdNum) {
+        String[] arr = hisOrdNum.split("_");
+        String patNo = arr[0];
+        int times = Integer.parseInt(arr[1]);
+        int receiptNum = Integer.parseInt(arr[2]);
+
+        QueryDzfpRequest request = QueryDzfpRequest.builder()
+                .patientId(patNo).times(times).receiptNo(receiptNum)
+                .typeFlag(QueryDzfpRequest.Type.MZLZ).build();
+        return thmzService.queryInvoiceFile(request);
+    }
 }

+ 2 - 3
src/main/resources/application-8083.yml

@@ -80,11 +80,10 @@ management:
       enabled: true
 
 thyy:
-  apiAddr:
+  api-addr:
     his-mip-api: http://172.16.32.166:1100/mobilePayApi
-    thmz-api: http://172.16.32.160:81/thmz/api/v1
+    thmz-api: http://172.16.32.160:81/thmz
     chronic-api: http://172.16.32.160:8077/chronicDisease
     physical-check-api: http://172.16.32.183:8888/bdp/dataservice/api
     add-face-api: http://172.16.32.167:20923/thyy/api/haikang/door/addFaceRecognition
-
 production: true

+ 2 - 3
src/main/resources/application-8085.yml

@@ -81,11 +81,10 @@ management:
       enabled: true
 
 thyy:
-  apiAddr:
+  api-addr:
     his-mip-api: http://172.16.32.166:1100/mobilePayApi
-    thmz-api: http://172.16.32.160:81/thmz/api/v1
+    thmz-api: http://172.16.32.160:81/thmz
     chronic-api: http://172.16.32.160:8077/chronicDisease
     physical-check-api: http://172.16.32.183:8888/bdp/dataservice/api
     add-face-api: http://172.16.32.167:20923/thyy/api/haikang/door/addFaceRecognition
-
 production: true

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

@@ -4,7 +4,7 @@ server:
     context-path: /wxserver
 spring:
   application:
-    name: wxservice-server
+    name: wxservice-server-dev
   thymeleaf:
     cache: false
   datasource:
@@ -42,9 +42,9 @@ mybatis-plus:
     map-underscore-to-camel-case: true
 
 thyy:
-  apiAddr:
+  api-addr:
     his-mip-api: http://172.16.30.26:1100/mobilePayApi
-    thmz-api: http://172.16.30.119:8089/thmz/api/v1
+    thmz-api: http://172.16.30.119:8089/thmz
     chronic-api: http://172.16.32.160:8077/chronicDisease
     physical-check-api: http://172.16.32.183:8888/bdp/dataservice/api
     add-face-api: http://172.16.30.66:20923/thyy/api/haikang/door/addFaceRecognition

+ 2 - 2
src/main/resources/application-prod.yml

@@ -42,9 +42,9 @@ mybatis-plus:
     map-underscore-to-camel-case: true
 
 thyy:
-  apiAddr:
+  api-addr:
     his-mip-api: http://172.16.32.166:1100/mobilePayApi
-    thmz-api: http://172.16.32.160:81/thmz/api/v1
+    thmz-api: http://172.16.32.160:81/thmz
     chronic-api: http://172.16.32.160:8077/chronicDisease
     physical-check-api: http://172.16.32.183:8888/bdp/dataservice/api
     add-face-api: http://172.16.32.167:20923/thyy/api/haikang/door/addFaceRecognition