From 7ff6e6ac3d2cca7593162eb49d135cc0cb6b9105 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 11 一月 2022 10:15:54 +0800
Subject: [PATCH] 云卓全景支付 开发完成

---
 service-api/src/main/java/com/java110/api/smo/impl/ApiServiceSMOImpl.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/service-api/src/main/java/com/java110/api/smo/impl/ApiServiceSMOImpl.java b/service-api/src/main/java/com/java110/api/smo/impl/ApiServiceSMOImpl.java
index 47d011c..88d9b73 100755
--- a/service-api/src/main/java/com/java110/api/smo/impl/ApiServiceSMOImpl.java
+++ b/service-api/src/main/java/com/java110/api/smo/impl/ApiServiceSMOImpl.java
@@ -32,6 +32,7 @@
 import com.java110.utils.log.LoggerEngine;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -105,17 +106,16 @@
             responseEntity = dataFlow.getResponseEntity();
 
         } catch (DecryptException e) { //瑙e瘑寮傚父
-            responseEntity = new ResponseEntity<String>("瑙e瘑寮傚父锛�" + e.getMessage(), HttpStatus.NON_AUTHORITATIVE_INFORMATION);
+            responseEntity = ResultVo.error("瑙e瘑寮傚父锛�" + e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
         } catch (BusinessException e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.BAD_REQUEST);
+            responseEntity = ResultVo.error(e.getMessage(),HttpStatus.BAD_REQUEST);
         } catch (NoAuthorityException e) {
-            responseEntity = new ResponseEntity<String>("閴存潈澶辫触锛�" + e.getMessage(), HttpStatus.UNAUTHORIZED);
+            responseEntity = ResultVo.error("閴存潈澶辫触锛�" + e.getMessage(),HttpStatus.UNAUTHORIZED);
         } catch (InitConfigDataException e) {
-            responseEntity = new ResponseEntity<String>("鍒濆鍖栧け璐ワ細" + e.getMessage(), HttpStatus.BAD_REQUEST);
+            responseEntity = ResultVo.error("鍒濆鍖栧け璐ワ細" + e.getMessage(), HttpStatus.BAD_REQUEST);
         } catch (Exception e) {
             logger.error("鍐呴儴寮傚父锛�", e);
-            responseEntity = new ResponseEntity<String>("鍐呴儴寮傚父锛�" + e.getMessage() + e.getLocalizedMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-
+            responseEntity = ResultVo.error("鍐呴儴寮傚父锛�" + e.getMessage() + e.getLocalizedMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
         } finally {
             Date endDate = DateUtil.getCurrentDate();
             if (dataFlow != null) {
@@ -158,6 +158,7 @@
                 || "/transactionLog/queryTransactionLogMessage".equals(serviceCode)
                 || "file.getFile".equals(serviceCode)
                 || "file.getFileByObjId".equals(serviceCode)
+                || "/machine/heartbeat".equals(serviceCode) // 蹇冭烦涔熶笉璁板綍
         ) {
             return;
         }
@@ -388,6 +389,14 @@
                         "鏈嶅姟銆�" + appService.getServiceCode() + "銆戣皟鐢ㄦ柟寮忎笉瀵硅妫�鏌�,褰撳墠璇锋眰鏂瑰紡涓猴細" + httpMethod);
             }
             dataFlow.setApiCurrentService(ServiceCodeConstant.SERVICE_CODE_SYSTEM_TRANSFER);
+        } else if ("CMD".equals(appService.getIsInstance())) {
+            //濡傛灉鏄�忎紶绫� 璇锋眰鏂瑰紡蹇呴』涓庢帴鍙f彁渚涙柟璋冪敤鏂瑰紡涓�鑷�
+            String httpMethod = dataFlow.getRequestCurrentHeaders().get(CommonConstant.HTTP_METHOD);
+            if (!appService.getMethod().equals(httpMethod)) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR,
+                        "鏈嶅姟銆�" + appService.getServiceCode() + "銆戣皟鐢ㄦ柟寮忎笉瀵硅妫�鏌�,褰撳墠璇锋眰鏂瑰紡涓猴細" + httpMethod);
+            }
+            dataFlow.setApiCurrentService(ServiceCodeConstant.SERVICE_CODE_SYSTEM_CMD);
         } else {
             dataFlow.setApiCurrentService(dataFlow.getRequestHeaders().get(CommonConstant.HTTP_SERVICE));
         }

--
Gitblit v1.8.0