瀏覽代碼

优化特门异常提示

hurugang 3 年之前
父節點
當前提交
ceea210b71

+ 12 - 2
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -1280,7 +1280,12 @@ public class MzChargeDetailController {
                 DecodedJWT decodedJWT = TokenUtil.parseJWT(token);
                 User tokenUser = (User) JsonUtil.jsontoObject(decodedJWT.getSubject(), User.class);
                 PayInfo result = tsmzService.uploadFees(tokenUser.getUserIdCode(), mzChargeDetailYb.getPatientId(), mzChargeDetailYb.getTimes(), mzChargeDetailYb.getReceiptNo());
-                if (result == null || result.getCode() != 0) {
+                if (result == null) {
+                    resultMap.put("code", -1);
+                    resultMap.put("message", "获取特门费用失败");
+                    return resultMap;
+                }
+                if (result.getCode() != 0) {
                     resultMap.put("code", -1);
                     resultMap.put("message", result.getErrorMessage());
                     return resultMap;
@@ -1341,7 +1346,12 @@ public class MzChargeDetailController {
                 DecodedJWT decodedJWT = TokenUtil.parseJWT(token);
                 User tokenUser = (User) JsonUtil.jsontoObject(decodedJWT.getSubject(), User.class);
                 PayInfo result = tsmzService.retractFees(tokenUser.getUserIdCode(), mzChargeDetailYb.getPatientId(), mzChargeDetailYb.getTimes(), mzChargeDetailYb.getReceiptNo());
-                if (result == null || result.getCode() != 0) {
+                if (result == null) {
+                    resultMap.put("code", -1);
+                    resultMap.put("message", "获取特门费用失败");
+                    return resultMap;
+                }
+                if (result.getCode() != 0) {
                     resultMap.put("code", -1);
                     resultMap.put("message", result.getErrorMessage());
                     return resultMap;

+ 4 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -686,7 +686,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             for (MzDepositFile m : mzDepositFileVo.getMzDepositFiles()) {
                 if (Constants.YBJZ.equals(m.getChequeType())) {
                     PayInfo payInfo = tsmzService.calculateCost(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), receiptNo);
-                    if (payInfo == null || payInfo.getCode() == -1) {
+                    if (payInfo == null) {
+                        throw new MzException("特门费用结算失败,错误原因:获取特门费用失败" );
+                    }
+                    if (payInfo.getCode() == -1) {
                         throw new MzException("特门费用结算失败,错误原因:" + payInfo.getErrorMessage());
                     }
                 }