From c47f7b9c4899036c52ad0e4f46c4aff7102110bc Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 09 九月 2024 19:56:07 +0800
Subject: [PATCH] 最新版本

---
 server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java |   89 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
index 026283a..b526e8e 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
@@ -1,7 +1,9 @@
 package com.doumee.api.business;
 
+import com.alibaba.fastjson.JSONObject;
 import com.doumee.api.BaseController;
 import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.exception.BusinessException;
 import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest;
 import com.doumee.core.haikang.model.param.request.EventSubRequest;
 import com.doumee.core.haikang.model.param.request.ParkListRequest;
@@ -10,6 +12,7 @@
 import com.doumee.core.haikang.model.param.request.event.parks.EventParkRequest;
 import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest;
 import com.doumee.core.model.ApiResponse;
+import com.doumee.core.utils.Constants;
 import com.doumee.core.wms.model.request.WmsActionNoticeRequest;
 import com.doumee.core.wms.model.request.WmsInboundNoticeRequest;
 import com.doumee.core.wms.model.request.WmsOutboundNoticeRequest;
@@ -21,6 +24,8 @@
 import com.doumee.service.business.impl.hksync.HkSyncPushServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -39,6 +44,7 @@
 @Api(tags = "WMS骞冲彴鏁版嵁鎺ㄩ�佹帴鍙�")
 @RestController
 @RequestMapping("/wms")
+@Slf4j
 public class WmsPushController extends BaseController {
 
     @Autowired
@@ -48,7 +54,23 @@
     @ApiOperation("銆怌MS銆戞帹閫佸叆搴撳崟閫氱煡浠诲姟")
     @PostMapping("/push/inboundNotice")
     public WmsBaseResponse inboundNotice(@RequestBody List<WmsInboundNoticeRequest> param) {
-        WmsBaseResponse result = wmsService.inboundNotice(param);
+
+        int success = Constants.ZERO;
+        WmsBaseResponse result =null;
+        try {
+             result = wmsService.inboundNotice(param);
+        }catch (BusinessException e){
+            log.error("銆怌MS銆戞帹閫佸叆搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            success = Constants.ONE;
+        }catch (Exception e){
+            log.error("銆怌MS銆戞帹閫佸叆搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            e.printStackTrace();
+            success = Constants.ONE;
+        }finally {
+            wmsService.saveInterfaceLog("/wms/push/inboundNotice", "鎺ㄩ�佸叆搴撳崟閫氱煡浠诲姟",JSONObject.toJSONString(param),
+                    success, JSONObject.toJSONString(result),Constants.ONE);
+        }
+
         return result;
     }
 
@@ -56,28 +78,85 @@
     @ApiOperation("銆怌MS銆戞帹閫佸嚭搴撳崟閫氱煡浠诲姟")
     @PostMapping("/push/outboundNotice")
     public WmsBaseResponse outboundNotice(@RequestBody List<WmsOutboundNoticeRequest> param) {
-        WmsBaseResponse result = wmsService.outboundNotice(param);
+        int success = Constants.ZERO;
+        WmsBaseResponse result =null;
+        try {
+              result = wmsService.outboundNotice(param);
+        }catch (BusinessException e){
+            log.error("銆怌MS銆戞帹閫佸嚭搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            success = Constants.ONE;
+        }catch (Exception e){
+            log.error("銆怌MS銆戞帹閫佸嚭搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            e.printStackTrace();
+            success = Constants.ONE;
+        }finally {
+            wmsService.saveInterfaceLog("/wms/push/outboundNotice", "鎺ㄩ�佸嚭搴撳崟閫氱煡浠诲姟",JSONObject.toJSONString(param),success
+                    , JSONObject.toJSONString(result),Constants.ONE);
+        }
+
         return result;
     }
     @PreventRepeat
     @ApiOperation("銆怌MS銆戞帹閫佸彇娑堝叆搴撳崟閫氱煡浠诲姟")
     @PostMapping("/push/cancelInbound")
     public WmsBaseResponse cancelInbound(@RequestBody List<WmsActionNoticeRequest> param) {
-        WmsBaseResponse result = wmsService.cancelInbound(param);
+        int success = Constants.ZERO;
+        WmsBaseResponse result =null;
+        try {
+            result = wmsService.cancelInbound(param);
+        }catch (BusinessException e){
+            log.error("銆怌MS銆戞帹閫佸彇娑堝叆搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            success = Constants.ONE;
+        }catch (Exception e){
+            log.error("銆怌MS銆戞帹閫佸彇娑堝叆搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            e.printStackTrace();
+            success = Constants.ONE;
+        }finally {
+            wmsService.saveInterfaceLog("/wms/push/cancelInbound", "鎺ㄩ�佸彇娑堝叆搴撳崟閫氱煡浠诲姟",JSONObject.toJSONString(param),
+                    success, JSONObject.toJSONString(result),Constants.ONE);
+        }
         return result;
     }
     @PreventRepeat
     @ApiOperation("銆怌MS銆戞帹閫佸彇娑堝嚭搴撳崟閫氱煡浠诲姟")
     @PostMapping("/push/cancelOutbound")
     public WmsBaseResponse cancelOutbound(@RequestBody List<WmsActionNoticeRequest> param) {
-        WmsBaseResponse result = wmsService.cancelOutbound(param);
+        int success = Constants.ZERO;
+        WmsBaseResponse result =null;
+        try {
+            result = wmsService.cancelOutbound(param);
+        }catch (BusinessException e){
+            log.error("銆怌MS銆戞帹閫佸彇娑堝嚭搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            success = Constants.ONE;
+        }catch (Exception e){
+            log.error("銆怌MS銆戞帹閫佸彇娑堝嚭搴撳崟閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            e.printStackTrace();
+            success = Constants.ONE;
+        }finally {
+            wmsService.saveInterfaceLog("/wms/push/cancelOutbound", "鎺ㄩ�佸彇娑堝嚭搴撳崟閫氱煡浠诲姟",
+                    JSONObject.toJSONString(param),  success, JSONObject.toJSONString(result),Constants.ONE);
+        }
         return result;
     }
     @PreventRepeat
     @ApiOperation("銆怌MS銆戞帹閫佸嚭鍏ュ簱浣滀笟瀹屾垚閫氱煡浠诲姟")
     @PostMapping("/push/doneTask")
     public WmsBaseResponse doneTask(@RequestBody List<WmsActionNoticeRequest> param) {
-        WmsBaseResponse result = wmsService.doneTask(param);
+        int success = Constants.ZERO;
+        WmsBaseResponse result =null;
+        try {
+            result = wmsService.doneTask(param);
+        }catch (BusinessException e){
+            log.error("銆怌MS銆戞帹閫佸嚭鍏ュ簱浣滀笟瀹屾垚閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            success = Constants.ONE;
+        }catch (Exception e){
+            log.error("銆怌MS銆戞帹閫佸嚭鍏ュ簱浣滀笟瀹屾垚閫氱煡浠诲姟===澶辫触锛�"+e.getMessage());
+            e.printStackTrace();
+            success = Constants.ONE;
+        }finally {
+            wmsService.saveInterfaceLog("/wms/push/doneTask", "鎺ㄩ�佸嚭鍏ュ簱浣滀笟瀹屾垚閫氱煡浠诲姟",JSONObject.toJSONString(param),
+                    success, JSONObject.toJSONString(result),Constants.ONE);
+        }
         return result;
     }
 }

--
Gitblit v1.9.3