From 330fcece11892289f2936ec8e11e4c8a610d5bab Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 15 十月 2025 10:30:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao
---
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/WmsPushCloudController.java | 128 +++++++++++++++++++++++++++++++++---------
1 files changed, 100 insertions(+), 28 deletions(-)
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/WmsPushCloudController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/WmsPushCloudController.java
index 828af42..72c6997 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/WmsPushCloudController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/WmsPushCloudController.java
@@ -1,23 +1,24 @@
package com.doumee.cloud.admin;
+import com.alibaba.fastjson.JSONObject;
import com.doumee.api.BaseController;
import com.doumee.config.annotation.LoginNoRequired;
-import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.exception.BusinessException;
import com.doumee.core.utils.Constants;
import com.doumee.core.wms.model.request.WmsActionNoticeRequest;
+import com.doumee.core.wms.model.request.WmsBaseRequest;
import com.doumee.core.wms.model.request.WmsInboundNoticeRequest;
import com.doumee.core.wms.model.request.WmsOutboundNoticeRequest;
import com.doumee.core.wms.model.response.WmsBaseResponse;
-import com.doumee.service.business.WmsService;
+import com.doumee.service.business.third.WmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
/**
* @author 姹熻箘韫�
@@ -25,51 +26,122 @@
*/
@Api(tags = "WMS骞冲彴鏁版嵁鎺ㄩ�佹帴鍙�")
@RestController
+@Slf4j
+@LoginNoRequired
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/wms")
public class WmsPushCloudController extends BaseController {
@Autowired
private WmsService wmsService;
- @PreventRepeat
- @ApiOperation("銆怌MS銆戞帹閫佸叆搴撳崟閫氱煡浠诲姟")
+ @ApiOperation("銆怶MS銆戞帹閫佸叆搴撳崟閫氱煡浠诲姟")
@PostMapping("/push/inboundNotice")
@LoginNoRequired
- public WmsBaseResponse inboundNotice(@RequestBody List<WmsInboundNoticeRequest> param) {
- WmsBaseResponse result = wmsService.inboundNotice(param);
+ public WmsBaseResponse inboundNotice(@RequestBody WmsBaseRequest<WmsInboundNoticeRequest> param) {
+ int success = Constants.ZERO;
+ WmsBaseResponse result =null;
+ try {
+ result = wmsService.inboundNotice(param);
+ wmsService.computjobTotalNum(param.getJobIdList());
+ }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;
}
- @PreventRepeat
- @ApiOperation("銆怌MS銆戞帹閫佸嚭搴撳崟閫氱煡浠诲姟")
+ @ApiOperation("銆怶MS銆戞帹閫佸嚭搴撳崟閫氱煡浠诲姟")
+ @LoginNoRequired
@PostMapping("/push/outboundNotice")
- @LoginNoRequired
- public WmsBaseResponse outboundNotice(@RequestBody List<WmsOutboundNoticeRequest> param) {
- WmsBaseResponse result = wmsService.outboundNotice(param);
+ public WmsBaseResponse outboundNotice(@RequestBody WmsBaseRequest<WmsOutboundNoticeRequest> param) {
+ int success = Constants.ZERO;
+ WmsBaseResponse result =null;
+ try {
+ result = wmsService.outboundNotice(param);
+ wmsService.computjobTotalNum(param.getJobIdList());
+ }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銆戞帹閫佸彇娑堝叆搴撳崟閫氱煡浠诲姟")
+ @ApiOperation("銆怶MS銆戞帹閫佸彇娑堝叆搴撳崟閫氱煡浠诲姟")
+ @LoginNoRequired
@PostMapping("/push/cancelInbound")
- @LoginNoRequired
- public WmsBaseResponse cancelInbound(@RequestBody List<WmsActionNoticeRequest> param) {
- WmsBaseResponse result = wmsService.cancelInbound(param);
+ public WmsBaseResponse cancelInbound(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> 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銆戞帹閫佸彇娑堝嚭搴撳崟閫氱煡浠诲姟")
+ @ApiOperation("銆怶MS銆戞帹閫佸彇娑堝嚭搴撳崟閫氱煡浠诲姟")
+ @LoginNoRequired
@PostMapping("/push/cancelOutbound")
- @LoginNoRequired
- public WmsBaseResponse cancelOutbound(@RequestBody List<WmsActionNoticeRequest> param) {
- WmsBaseResponse result = wmsService.cancelOutbound(param);
+ public WmsBaseResponse cancelOutbound(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> 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", "銆怲MS銆戞帹閫佸彇娑堝嚭搴撳崟閫氱煡浠诲姟",
+ JSONObject.toJSONString(param), success, JSONObject.toJSONString(result),Constants.ONE);
+ }
return result;
}
- @PreventRepeat
- @ApiOperation("銆怌MS銆戞帹閫佸嚭鍏ュ簱浣滀笟瀹屾垚閫氱煡浠诲姟")
+ @ApiOperation("銆怶MS銆戞帹閫佸嚭鍏ュ簱浣滀笟瀹屾垚閫氱煡浠诲姟")
+ @LoginNoRequired
@PostMapping("/push/doneTask")
- @LoginNoRequired
- public WmsBaseResponse doneTask(@RequestBody List<WmsActionNoticeRequest> param) {
- WmsBaseResponse result = wmsService.doneTask(param);
+ public WmsBaseResponse doneTask(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> 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