1 Commits

Author SHA1 Message Date
c2d7011506 更新 AcsToWmsController.java
add:新建排产相关功能分支
2023-06-13 09:21:59 +08:00

View File

@@ -1,7 +1,5 @@
package org.nl.wms.ext.acs.rest; package org.nl.wms.ext.acs.rest;
import cn.dev33.satoken.annotation.SaIgnore; import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@@ -10,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import org.nl.common.anno.Log; import org.nl.common.anno.Log;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.api.ResultCode; import org.nl.common.utils.api.ResultCode;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.exception.BizCoreException; import org.nl.modules.common.exception.BizCoreException;
import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.product_manage.sch.tasks.TaskScheduleService; import org.nl.wms.product_manage.sch.tasks.TaskScheduleService;
@@ -30,110 +29,106 @@ import java.util.Map;
@RequestMapping("/api/acsToWms/task") @RequestMapping("/api/acsToWms/task")
@Slf4j @Slf4j
@SaIgnore @SaIgnore
public class AcsToWmsController { public class AcsToWmsController{
@Autowired @Autowired
private AcsToWmsService acsToWmsService; private AcsToWmsService acsToWmsService;
@Autowired @Autowired
private TaskScheduleService taskScheduleService; private TaskScheduleService taskScheduleService;
@Autowired @Autowired
private WashMachineryTask washMachineryTask; private WashMachineryTask washMachineryTask;
@PostMapping("/apply") @PostMapping("/apply")
@Log("ACS给WMS发送任务") @Log("ACS给WMS发送任务")
@ApiOperation("ACS给WMS发送任务") @ApiOperation("ACS给WMS发送任务")
@SaIgnore @SaIgnore
public ResponseEntity<Object> receiveTaskFromAcs(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> receiveTaskFromAcs(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.apply(whereJson), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.apply(whereJson), HttpStatus.OK);
} }
@PostMapping("/receiveTaskIdToCacheLine") @PostMapping("/receiveTaskIdToCacheLine")
@Log("acs给wms发送缓存线的实时任务编号") @Log("acs给wms发送缓存线的实时任务编号")
@ApiOperation("acs给wms发送缓存线的实时任务编号") @ApiOperation("acs给wms发送缓存线的实时任务编号")
@SaIgnore @SaIgnore
public ResponseEntity<Object> receiveTaskIdToCacheLine(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> receiveTaskIdToCacheLine(@RequestBody JSONObject whereJson) {
//参数校验 //参数校验
if(StringUtils.isBlank(whereJson.getString("task_code")) || StringUtils.isBlank(whereJson.getString("position_code"))) { if(StringUtils.isBlank(whereJson.getString("task_code")) || StringUtils.isBlank(whereJson.getString("position_code"))) {
throw new BizCoreException(ResultCode.VALIDATE_FAILED); throw new BadRequestException("任务id或点位编码缺失!");
} }
return new ResponseEntity<>(acsToWmsService.receiveTaskIdToCacheLine(whereJson), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.receiveTaskIdToCacheLine(whereJson), HttpStatus.OK);
} }
@PostMapping("/status") @PostMapping("/status")
@Log("ACS给WMS反馈任务状态") @Log("ACS给WMS反馈任务状态")
@ApiOperation("ACS给WMS反馈任务状态") @ApiOperation("ACS给WMS反馈任务状态")
@SaIgnore @SaIgnore
public ResponseEntity<Object> receiveTaskStatusAcs(@RequestBody String string) { public ResponseEntity<Object> receiveTaskStatusAcs(@RequestBody String string) {
return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK);
} }
@PostMapping("/orderStatus") @PostMapping("/orderStatus")
@Log("ACS给WMS下发工单完成状态") @Log("ACS给WMS下发工单完成状态")
@ApiOperation("ACS给WMS下发工单完成状态") @ApiOperation("ACS给WMS下发工单完成状态")
@SaIgnore @SaIgnore
public ResponseEntity<Object> orderStatus(@RequestBody JSONObject param) { public ResponseEntity<Object> orderStatus(@RequestBody JSONObject param) {
return new ResponseEntity<>(acsToWmsService.orderStatus(param), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.orderStatus(param), HttpStatus.OK);
} }
@PostMapping("/washOrder") @PostMapping("/washOrder")
@Log("ACS给WMS反馈清洗工单完成") @Log("ACS给WMS反馈清洗工单完成")
@ApiOperation("ACS给WMS反馈清洗工单完成") @ApiOperation("ACS给WMS反馈清洗工单完成")
@SaIgnore @SaIgnore
public ResponseEntity<Object> washOrderFinish(@RequestBody JSONObject param) { public ResponseEntity<Object> washOrderFinish(@RequestBody JSONObject param) {
washMachineryTask.updateTaskStatus( param, param.getString("status")); washMachineryTask.updateTaskStatus(param, param.getString("status"));
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/feedDeviceStatusType") @PostMapping("/feedDeviceStatusType")
@ApiOperation("向wms反馈设备状态") @ApiOperation("向wms反馈设备状态")
@SaIgnore @SaIgnore
public ResponseEntity<Object> feedDeviceStatusType(@RequestBody JSONObject param) { public ResponseEntity<Object> feedDeviceStatusType(@RequestBody JSONObject param) {
return new ResponseEntity<>(acsToWmsService.feedDeviceStatusType(param), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.feedDeviceStatusType(param), HttpStatus.OK);
} }
@PostMapping("/feedDeviceQty")
@ApiOperation("向wms反馈设备实时数量")
@SaIgnore
public ResponseEntity<Object> feedDeviceRealQty(@RequestBody Map param) {
acsToWmsService.feedDevQty(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/feedDeviceQty2")
@ApiOperation("反馈深坑数量")
@SaIgnore
@Log("反馈深坑数量")
public ResponseEntity<Object> feedDeviceRealQty2(@RequestBody Map param) {
acsToWmsService.feedDevQty(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/feedDeviceQty") @PostMapping("/feedCacheLineBarcodes")
@ApiOperation("向wms反馈设备实时数量") @Log("向wms反馈缓存载具信息")
@SaIgnore @ApiOperation("向wms反馈缓存载具信息")
public ResponseEntity<Object> feedDeviceRealQty(@RequestBody Map param) { @SaIgnore
acsToWmsService.feedDevQty(param); public ResponseEntity<Object> feedcachelineVe(@RequestBody JSONObject param) {
return new ResponseEntity<>(HttpStatus.OK); acsToWmsService.feedcachelineVe(param);
} return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/feedDeviceQty2") @PostMapping("/feedOrderRealQty")
@ApiOperation("反馈深坑数量") @Log("向wms反实施数量")
@SaIgnore @ApiOperation("向wms反订单实施数量")
@Log("反馈深坑数量") @SaIgnore
public ResponseEntity<Object> feedDeviceRealQty2(@RequestBody Map param) { public ResponseEntity<Object> feedOrderRealQty(@RequestBody JSONObject string) {
acsToWmsService.feedDevQty(param); acsToWmsService.feedOrderRealQty(string);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/feedCacheLineBarcodes") @GetMapping("/taskPublish")
@Log("向wms反馈缓存载具信息") @Log("taskPublish")
@ApiOperation("向wms反馈缓存载具信息") @ApiOperation("taskPublish")
@SaIgnore @SaIgnore
public ResponseEntity<Object> feedcachelineVe(@RequestBody JSONObject param) { public void taskScheduleService() {
acsToWmsService.feedcachelineVe(param); taskScheduleService.taskPublish();
return new ResponseEntity<>(HttpStatus.OK); }
}
@PostMapping("/feedOrderRealQty")
@Log("向wms反实施数量")
@ApiOperation("向wms反订单实施数量")
@SaIgnore
public ResponseEntity<Object> feedOrderRealQty(@RequestBody JSONObject string) {
acsToWmsService.feedOrderRealQty(string);
return new ResponseEntity<>( HttpStatus.OK);
}
@GetMapping("/taskPublish")
@Log("taskPublish")
@ApiOperation("taskPublish")
@SaIgnore
public void taskScheduleService(){
taskScheduleService.taskPublish();
}
} }