AgvTaskController.java 1.48 KB
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;
    }


}