Selaa lähdekoodia

医保电子处方

lighter 1 vuosi sitten
vanhempi
commit
a20785008e

+ 7 - 7
src/main/java/thyyxxk/simzfeeoprnsystm/controller/SiMzFeeController.java

@@ -74,37 +74,37 @@ public class SiMzFeeController {
     }
 
     @PostMapping("/rxPreCheck")
-    public JSONObject rxPreCheck(@RequestBody RxPreCheckRequest request) throws Exception {
+    public ResultVo<JSONObject> rxPreCheck(@RequestBody RxPreCheckRequest request) throws Exception {
         return rxService.rxPreCheck(request);
     }
 
     @PostMapping("/rxSign")
-    public JSONObject rxSign(@RequestBody RxSignRequest request) throws Exception {
+    public ResultVo<JSONObject> rxSign(@RequestBody RxSignRequest request) throws Exception {
         return rxService.rxSign(request);
     }
 
     @PostMapping("/rxUpload")
-    public JSONObject rxUpload(@RequestBody RxUploadRequest request) throws Exception {
+    public ResultVo<JSONObject> rxUpload(@RequestBody RxUploadRequest request) throws Exception {
         return rxService.rxUpload(request);
     }
 
     @PostMapping("/rxRevoke")
-    public JSONObject rxRevoke(@RequestBody RxRevokeRequest request) throws Exception {
+    public ResultVo<JSONObject> rxRevoke(@RequestBody RxRevokeRequest request) throws Exception {
         return rxService.rxRevoke(request);
     }
 
     @PostMapping("/rxInfoQuery")
-    public JSONObject rxInfoQuery(@RequestBody RxInfoQueryRequest request) throws Exception {
+    public ResultVo<JSONObject> rxInfoQuery(@RequestBody RxInfoQueryRequest request) throws Exception {
         return rxService.rxInfoQuery(request);
     }
 
     @PostMapping("/rxAuditingQuery")
-    public JSONObject rxAuditingQuery(@RequestBody RxAuditingQueryRequest request) throws Exception {
+    public ResultVo<JSONObject> rxAuditingQuery(@RequestBody RxAuditingQueryRequest request) throws Exception {
         return rxService.rxAuditingQuery(request);
     }
 
     @PostMapping("/rxSetlQuery")
-    public JSONObject rxSetlQuery(@RequestBody RxSetlQueryRequest request) throws Exception {
+    public ResultVo<JSONObject> rxSetlQuery(@RequestBody RxSetlQueryRequest request) throws Exception {
         return rxService.rxSetlQuery(request);
     }
 

+ 23 - 24
src/main/java/thyyxxk/simzfeeoprnsystm/service/DigitalReceiptService.java

@@ -8,11 +8,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.simzfeeoprnsystm.dao.RxDao;
 import thyyxxk.simzfeeoprnsystm.dicts.SiFunction;
+import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
 import thyyxxk.simzfeeoprnsystm.pojo.digitalreceipt.*;
 import thyyxxk.simzfeeoprnsystm.pojo.digitalreceipt.request.*;
-import thyyxxk.simzfeeoprnsystm.utils.DateUtil;
-import thyyxxk.simzfeeoprnsystm.utils.Global;
-import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
+import thyyxxk.simzfeeoprnsystm.utils.*;
 import thyyxxk.simzfeeoprnsystm.utils.rxsign.HseEncAndDecUtil;
 
 import com.itextpdf.text.*;
@@ -37,7 +36,7 @@ public class DigitalReceiptService {
         this.rxDao = rxDao;
     }
 
-    public JSONObject rxPreCheck(RxPreCheckRequest request) throws Exception {
+    public ResultVo<JSONObject> rxPreCheck(RxPreCheckRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxPreCheck(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         String rxdrugdetailRef = JSONArray.toJSONStringWithDateFormat(request.getRxDrugDetailList(), "yyyy-MM-dd HH:mm:ss");
@@ -53,7 +52,7 @@ public class DigitalReceiptService {
 
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
 
         JSONObject decryptResult = HseEncAndDecUtil.decryptMsg(result);
@@ -69,10 +68,10 @@ public class DigitalReceiptService {
         rxUpload.setRxFile(createRxPdf(request));
         rxDao.insertRxPrecheck(request.getPatientId(), request.getTimes(), rxUpload);
         deleteRxPdfFile(request);
-        return decryptResult;
+        return ResultVoUtil.success(decryptResult);
     }
 
-    public JSONObject rxSign(RxSignRequest request) throws Exception {
+    public ResultVo<JSONObject> rxSign(RxSignRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxSign(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         log.info("明文:{}", data);
@@ -81,16 +80,16 @@ public class DigitalReceiptService {
         log.info("电子处方医保电子签名:\n参数:{},\n结果:{}", input, result);
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
         JSONObject decryptResult = HseEncAndDecUtil.decryptMsg(result);
         String signDigest = decryptResult.getString("signDigest");
         String rxFile = decryptResult.getString("rxFile");
         rxDao.updateSignDigest(request.getPatientId(), request.getTimes(), signDigest, rxFile);
-        return decryptResult;
+        return ResultVoUtil.success(decryptResult);
     }
 
-    public JSONObject rxUpload(RxUploadRequest request) throws Exception {
+    public ResultVo<JSONObject> rxUpload(RxUploadRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxUpload(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         log.info("明文:{}", data);
@@ -99,15 +98,15 @@ public class DigitalReceiptService {
         log.info("电子处方上传:\n参数:{},\n结果:{}", input, result);
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
         JSONObject decryptResult = HseEncAndDecUtil.decryptMsg(result);
         String hiRxno = decryptResult.getString("hiRxno");
         rxDao.updateRxState(hiRxno, RxState.UPLOADED);
-        return decryptResult;
+        return ResultVoUtil.success(decryptResult);
     }
 
-    public JSONObject rxRevoke(RxRevokeRequest request) throws Exception {
+    public ResultVo<JSONObject> rxRevoke(RxRevokeRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxRevoke(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         log.info("明文:{}", data);
@@ -116,15 +115,15 @@ public class DigitalReceiptService {
         log.info("电子处方撤销:\n参数:{},\n结果:{}", input, result);
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
         JSONObject decryptResult = HseEncAndDecUtil.decryptMsg(result);
         String hiRxno = decryptResult.getString("hiRxno");
         rxDao.updateRxState(hiRxno, RxState.REVOKED);
-        return decryptResult;
+        return ResultVoUtil.success(decryptResult);
     }
 
-    public JSONObject rxInfoQuery(RxInfoQueryRequest request) throws Exception {
+    public ResultVo<JSONObject> rxInfoQuery(RxInfoQueryRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxInfoQuery(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         log.info("明文:{}", data);
@@ -133,12 +132,12 @@ public class DigitalReceiptService {
         log.info("电子处方信息查询:\n参数:{},\n结果:{}", input, result);
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
-        return HseEncAndDecUtil.decryptMsg(result);
+        return ResultVoUtil.success(HseEncAndDecUtil.decryptMsg(result));
     }
 
-    public JSONObject rxAuditingQuery(RxAuditingQueryRequest request) throws Exception {
+    public ResultVo<JSONObject> rxAuditingQuery(RxAuditingQueryRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxAuditingQuery(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         log.info("明文:{}", data);
@@ -147,12 +146,12 @@ public class DigitalReceiptService {
         log.info("电子处方审核结果查询:\n参数:{},\n结果:{}", input, result);
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
-        return HseEncAndDecUtil.decryptMsg(result);
+        return ResultVoUtil.success(HseEncAndDecUtil.decryptMsg(result));
     }
 
-    public JSONObject rxSetlQuery(RxSetlQueryRequest request) throws Exception {
+    public ResultVo<JSONObject> rxSetlQuery(RxSetlQueryRequest request) throws Exception {
         String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxSetlQuery(), "yyyy-MM-dd HH:mm:ss");
         JSONObject data = JSONObject.parseObject(dataRef);
         log.info("明文:{}", data);
@@ -161,9 +160,9 @@ public class DigitalReceiptService {
         log.info("电子处方取药结果查询:\n参数:{},\n结果:{}", input, result);
         Integer code = result.getInteger("code");
         if (null == code || code != 0){
-            return result;
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
         }
-        return HseEncAndDecUtil.decryptMsg(result);
+        return ResultVoUtil.success(HseEncAndDecUtil.decryptMsg(result));
     }
 
     private String createRxPdf(RxPreCheckRequest request) throws Exception {

+ 1 - 1
src/main/resources/application.yml

@@ -66,5 +66,5 @@ mybatis-plus:
 si-api-url: http://10.93.28.242:80/isp-api/powercsb/
 si-access-key: ohksRseHwPk9JAVGAQ5lghF5euo6NQZjiv8O2V
 si-secret-key: SKQgruu508MeFbQmLZs4Oyj5Qk0GjLstGVtWJB3Y
-web-his-url: http://172.16.30.26:8706
+web-his-url: http://localhost:8706
 thmz-url: http://demo.hnthyy.cn:8089/thmz