| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.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.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; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/11/30 15:33 |
| | | */ |
| | | @Api(tags = "WMS平尿°æ®æ¨éæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/wms") |
| | | @Slf4j |
| | | public class WmsPushController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WmsService wmsService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("ãWMSãæ¨éå
¥åºåéç¥ä»»å¡") |
| | | @PostMapping("/push/inboundNotice") |
| | | public WmsBaseResponse inboundNotice(@RequestBody WmsBaseRequest<WmsInboundNoticeRequest> param) { |
| | | |
| | | int success = Constants.ZERO; |
| | | WmsBaseResponse result =null; |
| | | try { |
| | | result = wmsService.inboundNotice(param); |
| | | }catch (BusinessException e){ |
| | | log.error("ãWMSãæ¨éå
¥åºåéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | success = Constants.ONE; |
| | | }catch (Exception e){ |
| | | log.error("ãWMSãæ¨éå
¥åºåéç¥ä»»å¡===失败ï¼"+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("ãWMSãæ¨éåºåºåéç¥ä»»å¡") |
| | | @PostMapping("/push/outboundNotice") |
| | | public WmsBaseResponse outboundNotice(@RequestBody WmsBaseRequest<WmsOutboundNoticeRequest> param) { |
| | | int success = Constants.ZERO; |
| | | WmsBaseResponse result =null; |
| | | try { |
| | | result = wmsService.outboundNotice(param); |
| | | }catch (BusinessException e){ |
| | | log.error("ãWMSãæ¨éåºåºåéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | success = Constants.ONE; |
| | | }catch (Exception e){ |
| | | log.error("ãWMSãæ¨éåºåºåéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | success = Constants.ONE; |
| | | }finally { |
| | | wmsService.saveInterfaceLog("/wms/push/outboundNotice", "ãWMSãæ¨éåºåºåéç¥ä»»å¡",JSONObject.toJSONString(param),success |
| | | , JSONObject.toJSONString(result),Constants.ONE); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("ãWMSãæ¨éåæ¶å
¥åºåéç¥ä»»å¡") |
| | | @PostMapping("/push/cancelInbound") |
| | | public WmsBaseResponse cancelInbound(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> param) { |
| | | int success = Constants.ZERO; |
| | | WmsBaseResponse result =null; |
| | | try { |
| | | result = wmsService.cancelInbound(param); |
| | | }catch (BusinessException e){ |
| | | log.error("ãWMSãæ¨éåæ¶å
¥åºåéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | success = Constants.ONE; |
| | | }catch (Exception e){ |
| | | log.error("ãWMSãæ¨éåæ¶å
¥åºåéç¥ä»»å¡===失败ï¼"+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("ãWMSãæ¨éåæ¶åºåºåéç¥ä»»å¡") |
| | | @PostMapping("/push/cancelOutbound") |
| | | public WmsBaseResponse cancelOutbound(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> param) { |
| | | int success = Constants.ZERO; |
| | | WmsBaseResponse result =null; |
| | | try { |
| | | result = wmsService.cancelOutbound(param); |
| | | }catch (BusinessException e){ |
| | | log.error("ãWMSãæ¨éåæ¶åºåºåéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | success = Constants.ONE; |
| | | }catch (Exception e){ |
| | | log.error("ãWMSãæ¨éåæ¶åºåºåéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | success = Constants.ONE; |
| | | }finally { |
| | | wmsService.saveInterfaceLog("/wms/push/cancelOutbound", "ãTMSãæ¨éåæ¶åºåºåéç¥ä»»å¡", |
| | | JSONObject.toJSONString(param), success, JSONObject.toJSONString(result),Constants.ONE); |
| | | } |
| | | return result; |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("ãWMSãæ¨éåºå
¥åºä½ä¸å®æéç¥ä»»å¡") |
| | | @PostMapping("/push/doneTask") |
| | | public WmsBaseResponse doneTask(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> param) { |
| | | int success = Constants.ZERO; |
| | | WmsBaseResponse result =null; |
| | | try { |
| | | result = wmsService.doneTask(param); |
| | | }catch (BusinessException e){ |
| | | log.error("ãWMSãæ¨éåºå
¥åºä½ä¸å®æéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | success = Constants.ONE; |
| | | }catch (Exception e){ |
| | | log.error("ãWMSãæ¨éåºå
¥åºä½ä¸å®æéç¥ä»»å¡===失败ï¼"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | success = Constants.ONE; |
| | | }finally { |
| | | wmsService.saveInterfaceLog("/wms/push/doneTask", "æ¨éåºå
¥åºä½ä¸å®æéç¥ä»»å¡",JSONObject.toJSONString(param), |
| | | success, JSONObject.toJSONString(result),Constants.ONE); |
| | | } |
| | | return result; |
| | | } |
| | | } |