From c2d7011506278f34cfe93582a464fec3a08ca207 Mon Sep 17 00:00:00 2001 From: baoge <751575283@qq.com> Date: Tue, 13 Jun 2023 09:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20AcsToWmsController.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add:新建排产相关功能分支 --- .../wms/ext/acs/rest/AcsToWmsController.java | 189 +++++++++--------- 1 file changed, 92 insertions(+), 97 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java index 9527822f..cd50c377 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java @@ -1,7 +1,5 @@ - package org.nl.wms.ext.acs.rest; - import cn.dev33.satoken.annotation.SaIgnore; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; @@ -10,6 +8,7 @@ import org.apache.commons.lang3.StringUtils; import org.nl.common.anno.Log; import lombok.extern.slf4j.Slf4j; import org.nl.common.utils.api.ResultCode; +import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BizCoreException; import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.product_manage.sch.tasks.TaskScheduleService; @@ -30,110 +29,106 @@ import java.util.Map; @RequestMapping("/api/acsToWms/task") @Slf4j @SaIgnore -public class AcsToWmsController { - @Autowired - private AcsToWmsService acsToWmsService; - @Autowired - private TaskScheduleService taskScheduleService; - @Autowired - private WashMachineryTask washMachineryTask; +public class AcsToWmsController{ + @Autowired + private AcsToWmsService acsToWmsService; + @Autowired + private TaskScheduleService taskScheduleService; + @Autowired + private WashMachineryTask washMachineryTask; - @PostMapping("/apply") - @Log("ACS给WMS发送任务") - @ApiOperation("ACS给WMS发送任务") - @SaIgnore - public ResponseEntity receiveTaskFromAcs(@RequestBody JSONObject whereJson) { - return new ResponseEntity<>(acsToWmsService.apply(whereJson), HttpStatus.OK); - } + @PostMapping("/apply") + @Log("ACS给WMS发送任务") + @ApiOperation("ACS给WMS发送任务") + @SaIgnore + public ResponseEntity receiveTaskFromAcs(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(acsToWmsService.apply(whereJson), HttpStatus.OK); + } - @PostMapping("/receiveTaskIdToCacheLine") - @Log("acs给wms发送缓存线的实时任务编号") - @ApiOperation("acs给wms发送缓存线的实时任务编号") - @SaIgnore - public ResponseEntity receiveTaskIdToCacheLine(@RequestBody JSONObject whereJson) { - //参数校验 - if(StringUtils.isBlank(whereJson.getString("task_code")) || StringUtils.isBlank(whereJson.getString("position_code"))) { - throw new BizCoreException(ResultCode.VALIDATE_FAILED); - } - return new ResponseEntity<>(acsToWmsService.receiveTaskIdToCacheLine(whereJson), HttpStatus.OK); - } + @PostMapping("/receiveTaskIdToCacheLine") + @Log("acs给wms发送缓存线的实时任务编号") + @ApiOperation("acs给wms发送缓存线的实时任务编号") + @SaIgnore + public ResponseEntity receiveTaskIdToCacheLine(@RequestBody JSONObject whereJson) { + //参数校验 + if(StringUtils.isBlank(whereJson.getString("task_code")) || StringUtils.isBlank(whereJson.getString("position_code"))) { + throw new BadRequestException("任务id或点位编码缺失!"); + } + return new ResponseEntity<>(acsToWmsService.receiveTaskIdToCacheLine(whereJson), HttpStatus.OK); + } - @PostMapping("/status") - @Log("ACS给WMS反馈任务状态") - @ApiOperation("ACS给WMS反馈任务状态") - @SaIgnore - public ResponseEntity receiveTaskStatusAcs(@RequestBody String string) { - return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK); - } + @PostMapping("/status") + @Log("ACS给WMS反馈任务状态") + @ApiOperation("ACS给WMS反馈任务状态") + @SaIgnore + public ResponseEntity receiveTaskStatusAcs(@RequestBody String string) { + return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK); + } - @PostMapping("/orderStatus") - @Log("ACS给WMS下发工单完成状态") - @ApiOperation("ACS给WMS下发工单完成状态") - @SaIgnore - public ResponseEntity orderStatus(@RequestBody JSONObject param) { - return new ResponseEntity<>(acsToWmsService.orderStatus(param), HttpStatus.OK); - } + @PostMapping("/orderStatus") + @Log("ACS给WMS下发工单完成状态") + @ApiOperation("ACS给WMS下发工单完成状态") + @SaIgnore + public ResponseEntity orderStatus(@RequestBody JSONObject param) { + return new ResponseEntity<>(acsToWmsService.orderStatus(param), HttpStatus.OK); + } - @PostMapping("/washOrder") - @Log("ACS给WMS反馈清洗工单完成") - @ApiOperation("ACS给WMS反馈清洗工单完成") - @SaIgnore - public ResponseEntity washOrderFinish(@RequestBody JSONObject param) { - washMachineryTask.updateTaskStatus( param, param.getString("status")); - return new ResponseEntity<>(HttpStatus.OK); - } + @PostMapping("/washOrder") + @Log("ACS给WMS反馈清洗工单完成") + @ApiOperation("ACS给WMS反馈清洗工单完成") + @SaIgnore + public ResponseEntity washOrderFinish(@RequestBody JSONObject param) { + washMachineryTask.updateTaskStatus(param, param.getString("status")); + return new ResponseEntity<>(HttpStatus.OK); + } - @PostMapping("/feedDeviceStatusType") - @ApiOperation("向wms反馈设备状态") - @SaIgnore - public ResponseEntity feedDeviceStatusType(@RequestBody JSONObject param) { - return new ResponseEntity<>(acsToWmsService.feedDeviceStatusType(param), HttpStatus.OK); - } + @PostMapping("/feedDeviceStatusType") + @ApiOperation("向wms反馈设备状态") + @SaIgnore + public ResponseEntity feedDeviceStatusType(@RequestBody JSONObject param) { + return new ResponseEntity<>(acsToWmsService.feedDeviceStatusType(param), HttpStatus.OK); + } + @PostMapping("/feedDeviceQty") + @ApiOperation("向wms反馈设备实时数量") + @SaIgnore + public ResponseEntity feedDeviceRealQty(@RequestBody Map param) { + acsToWmsService.feedDevQty(param); + return new ResponseEntity<>(HttpStatus.OK); + } + @PostMapping("/feedDeviceQty2") + @ApiOperation("反馈深坑数量") + @SaIgnore + @Log("反馈深坑数量") + public ResponseEntity feedDeviceRealQty2(@RequestBody Map param) { + acsToWmsService.feedDevQty(param); + return new ResponseEntity<>(HttpStatus.OK); + } - @PostMapping("/feedDeviceQty") - @ApiOperation("向wms反馈设备实时数量") - @SaIgnore - public ResponseEntity feedDeviceRealQty(@RequestBody Map param) { - acsToWmsService.feedDevQty(param); - return new ResponseEntity<>(HttpStatus.OK); - } + @PostMapping("/feedCacheLineBarcodes") + @Log("向wms反馈缓存载具信息") + @ApiOperation("向wms反馈缓存载具信息") + @SaIgnore + public ResponseEntity feedcachelineVe(@RequestBody JSONObject param) { + acsToWmsService.feedcachelineVe(param); + return new ResponseEntity<>(HttpStatus.OK); + } - @PostMapping("/feedDeviceQty2") - @ApiOperation("反馈深坑数量") - @SaIgnore - @Log("反馈深坑数量") - public ResponseEntity feedDeviceRealQty2(@RequestBody Map param) { - acsToWmsService.feedDevQty(param); - return new ResponseEntity<>(HttpStatus.OK); - } + @PostMapping("/feedOrderRealQty") + @Log("向wms反实施数量") + @ApiOperation("向wms反订单实施数量") + @SaIgnore + public ResponseEntity feedOrderRealQty(@RequestBody JSONObject string) { + acsToWmsService.feedOrderRealQty(string); + return new ResponseEntity<>(HttpStatus.OK); + } - @PostMapping("/feedCacheLineBarcodes") - @Log("向wms反馈缓存载具信息") - @ApiOperation("向wms反馈缓存载具信息") - @SaIgnore - public ResponseEntity feedcachelineVe(@RequestBody JSONObject param) { - acsToWmsService.feedcachelineVe(param); - return new ResponseEntity<>(HttpStatus.OK); - } - - - @PostMapping("/feedOrderRealQty") - @Log("向wms反实施数量") - @ApiOperation("向wms反订单实施数量") - @SaIgnore - public ResponseEntity feedOrderRealQty(@RequestBody JSONObject string) { - acsToWmsService.feedOrderRealQty(string); - return new ResponseEntity<>( HttpStatus.OK); - } - - - @GetMapping("/taskPublish") - @Log("taskPublish") - @ApiOperation("taskPublish") - @SaIgnore - public void taskScheduleService(){ - taskScheduleService.taskPublish(); - } + @GetMapping("/taskPublish") + @Log("taskPublish") + @ApiOperation("taskPublish") + @SaIgnore + public void taskScheduleService() { + taskScheduleService.taskPublish(); + } }