package com.shkj.wms.controller.task;

import com.shkj.common.core.controller.BaseController;
import com.shkj.common.core.domain.Result;
import com.shkj.common.core.page.TableDataInfo;
import com.shkj.wms.bo.BusinTaskThirdQueryBo;
import com.shkj.wms.service.IBusinTaskService;
import com.shkj.wms.vo.BusinTaskVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作业任务Controller  (废弃)
 *
 * @author lch
 * @menu 作业任务管理
 * @date 2023-02-27
 */
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/wms/task")
@Deprecated
public class BusinTaskController extends BaseController {

    private final IBusinTaskService iBusinTaskService;

    /**
     * 查询作业任务列表
     */
    @GetMapping("/list")
    public TableDataInfo<BusinTaskVo> list(BusinTaskThirdQueryBo bo) {
        startPage();
        List<BusinTaskVo> list = iBusinTaskService.queryList(bo);
        return getDataTable(list);
    }


    /**
     * 重新下发
     *
     * @param taskCode
     * @return {@code Result<Boolean>}
     * @throws Exception 异常
     */
    @PostMapping("/redistribution/{taskCode}")
    public Result<Boolean> redistribution(@PathVariable("taskCode") String taskCode) throws Exception {
        return iBusinTaskService.redistribution(taskCode);
    }

}
