|
@@ -0,0 +1,85 @@
|
|
|
+package com.ruoyi.web.controller.warewms.pda;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.ruoyi.ams.task.domain.WcsTask;
|
|
|
+import com.ruoyi.ams.task.domain.form.TaskDispositionForm;
|
|
|
+import com.ruoyi.ams.task.form.AddTaskForm;
|
|
|
+import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
|
+import com.ruoyi.base.constant.Constant;
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * AGV任务Controller
|
|
|
+ *
|
|
|
+ * @author andy
|
|
|
+ * @date 2022-03-10
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/app/wcsTask")
|
|
|
+public class PdawcsTaskController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private IWcsTaskService wcsTaskService;
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/list")
|
|
|
+ public AjaxResult getlist(WcsTask wcsTask) {
|
|
|
+ startPage();
|
|
|
+ List<WcsTask> list = wcsTaskService.selectWcsTaskList(wcsTask);
|
|
|
+ return new AjaxResult(200,"查询成功!",list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Log(title = "取货任务完成", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping(value = "/taskPickupComplete")
|
|
|
+ public AjaxResult taskPickupComplete(@RequestBody WcsTask task) {
|
|
|
+ int agvNo = 9999;
|
|
|
+ WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(task.getTaskNo());
|
|
|
+ if (wcsTask == null) {
|
|
|
+ return AjaxResult.error("任务回调失败");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(wcsTask.getAgvNo())) {
|
|
|
+ agvNo = Integer.parseInt(wcsTask.getAgvNo());
|
|
|
+ }
|
|
|
+ return wcsTaskService.callBack(wcsTask.getTaskNo(), 4, agvNo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Log(title = "卸货任务完成", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping (value = "/taskComplete")
|
|
|
+ public AjaxResult taskComplete(@RequestBody WcsTask task) {
|
|
|
+ int agvNo = 9999;
|
|
|
+ WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(task.getTaskNo());
|
|
|
+ if (wcsTask == null) {
|
|
|
+ return AjaxResult.error("任务回调失败");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(wcsTask.getAgvNo())) {
|
|
|
+ agvNo = Integer.parseInt(wcsTask.getAgvNo());
|
|
|
+ }
|
|
|
+ return wcsTaskService.callBack(wcsTask.getTaskNo(),2,agvNo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Log(title = "任务取消", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping(value = "/taskCancel")
|
|
|
+ public AjaxResult taskCancel(@RequestBody WcsTask task) {
|
|
|
+ WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(task.getTaskNo());
|
|
|
+ if (wcsTask == null) {
|
|
|
+ AjaxResult.error("任务查询不存在");
|
|
|
+ }
|
|
|
+ wcsTaskService.cancelTask(wcsTask);
|
|
|
+ return AjaxResult.success("任务取消指令下发成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+}
|