Parcourir la source

获取挂号费用时添加提示。

lighter il y a 4 ans
Parent
commit
bdbfc50683

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/controller/AppointmentController.java

@@ -47,7 +47,7 @@ public class AppointmentController {
     }
 
     @PostMapping("/getGhFee")
-    public ResultVo<Object> getGhFee(@RequestBody @Validated GetGhFeeParam param) throws ExecutionException, InterruptedException {
+    public ResultVo<Map<String, Object>> getGhFee(@RequestBody @Validated GetGhFeeParam param) throws ExecutionException, InterruptedException {
         return service.getGhFee(param).get();
     }
 

+ 5 - 2
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -136,7 +136,7 @@ public class AppointmentService {
     }
 
     @Async("asyncTask")
-    public CompletableFuture<ResultVo<Object>> getGhFee(GetGhFeeParam param) {
+    public CompletableFuture<ResultVo<Map<String, Object>>> getGhFee(GetGhFeeParam param) {
         log.info("获取挂号费用:{}", param);
         String url = String.format(ThmzUrls.GET_MZ_CHARGE_TYPE_BY_REQUEST_ID_FOR_HAI_CI +
                 "mzyRequestId=%d&patientId=%s", param.getMzyRequestId(), param.getPatientId());
@@ -149,7 +149,10 @@ public class AppointmentService {
         if (-1 == data.getCode()) {
             return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, data.getMessage()));
         }
-        return CompletableFuture.completedFuture(ResultVoUtil.success(data.getData()));
+        Map<String, Object> map = new HashMap<>();
+        map.put("fee", data.getData());
+        map.put("message", data.getMessage());
+        return CompletableFuture.completedFuture(ResultVoUtil.success(map));
     }
 
     public ResultVo<DoctorInfoPojo> getDoctorInfo(String doctorCode, String openId) {