AgvTaskController.java
1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.huaheng.api.acs.controller;
import com.huaheng.api.acs.domain.AgvTask;
import com.huaheng.api.acs.service.AcsService;
import com.huaheng.common.support.Convert;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@Controller
@RequestMapping("/agv")
public class AgvTaskController {
@Resource
private AcsService acsService;
@ApiOperation(value = "AGV创建任务", httpMethod = "POST")
@PostMapping("/createAGVTask")
@ResponseBody
public AjaxResult createAGVTask (@RequestBody AgvTask agvTask) {
return acsService.createAGVTask(agvTask);
}
@Log(title = "任务-任务管理", operating = "下发立库任务", action = BusinessType.UPDATE)
@PostMapping( "/execute")
@ResponseBody
public AjaxResult execute(@RequestParam String taskId)
{
if (StringUtils.isEmpty(taskId)){
return AjaxResult.error("taskId不能为空");
}
AjaxResult<AgvTask> ajaxResult = acsService.sendTaskToAGV(Convert.toIntArray(taskId));
return ajaxResult;
}
}