feat:PC 下发任务
This commit is contained in:
@@ -42,6 +42,11 @@
|
||||
<artifactId>nl-module-task-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-base-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
@@ -164,4 +169,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -36,6 +36,12 @@ public class TransportTaskApiImpl implements TransportTaskApi {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> issueTransportTask(Long taskId) {
|
||||
transportTaskService.issueTransportTask(taskId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<TaskInfoDTO> getTaskById(Long taskId) {
|
||||
return success(transportTaskService.getTaskInfoById(taskId));
|
||||
|
||||
@@ -1,112 +1,121 @@
|
||||
package cn.code.nl.module.task.controller.admin.transporttask;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.code.nl.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.code.nl.module.task.controller.admin.transporttask.vo.*;
|
||||
import cn.code.nl.module.task.dal.dataobject.transporttask.TransportTaskDO;
|
||||
import cn.code.nl.module.task.service.transporttask.TransportTaskService;
|
||||
|
||||
@Tag(name = "管理后台 - 搬运任务")
|
||||
@RestController
|
||||
@RequestMapping("/task/transport-task")
|
||||
@Validated
|
||||
public class TransportTaskController {
|
||||
|
||||
@Resource
|
||||
private TransportTaskService transportTaskService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建搬运任务")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:create')")
|
||||
public CommonResult<Long> createTransportTask(@Valid @RequestBody TransportTaskSaveReqVO createReqVO) {
|
||||
return success(transportTaskService.createTransportTask(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新搬运任务")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:update')")
|
||||
public CommonResult<Boolean> updateTransportTask(@Valid @RequestBody TransportTaskSaveReqVO updateReqVO) {
|
||||
transportTaskService.updateTransportTask(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/operate")
|
||||
@Operation(summary = "PC 端操作搬运任务(完成/取消/强制完成)")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:operate')")
|
||||
public CommonResult<Boolean> operateTransportTask(@Valid @RequestBody TransportTaskOperateReqVO reqVO) {
|
||||
transportTaskService.operateTransportTask(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除搬运任务")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:delete')")
|
||||
public CommonResult<Boolean> deleteTransportTask(@RequestParam("id") Long id) {
|
||||
transportTaskService.deleteTransportTask(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除搬运任务")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:delete')")
|
||||
public CommonResult<Boolean> deleteTransportTaskList(@RequestParam("ids") List<Long> ids) {
|
||||
transportTaskService.deleteTransportTaskListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得搬运任务")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:query')")
|
||||
public CommonResult<TransportTaskRespVO> getTransportTask(@RequestParam("id") Long id) {
|
||||
TransportTaskDO transportTask = transportTaskService.getTransportTask(id);
|
||||
return success(BeanUtils.toBean(transportTask, TransportTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得搬运任务分页")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:query')")
|
||||
public CommonResult<PageResult<TransportTaskRespVO>> getTransportTaskPage(@Valid TransportTaskPageReqVO pageReqVO) {
|
||||
PageResult<TransportTaskDO> pageResult = transportTaskService.getTransportTaskPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TransportTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出搬运任务 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTransportTaskExcel(@Valid TransportTaskPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TransportTaskDO> list = transportTaskService.getTransportTaskPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "搬运任务.xls", "数据", TransportTaskRespVO.class,
|
||||
BeanUtils.toBean(list, TransportTaskRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
package cn.code.nl.module.task.controller.admin.transporttask;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.code.nl.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.code.nl.module.task.controller.admin.transporttask.vo.*;
|
||||
import cn.code.nl.module.task.dal.dataobject.transporttask.TransportTaskDO;
|
||||
import cn.code.nl.module.task.service.transporttask.TransportTaskService;
|
||||
|
||||
@Tag(name = "管理后台 - 搬运任务")
|
||||
@RestController
|
||||
@RequestMapping("/task/transport-task")
|
||||
@Validated
|
||||
public class TransportTaskController {
|
||||
|
||||
@Resource
|
||||
private TransportTaskService transportTaskService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建搬运任务")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:create')")
|
||||
public CommonResult<Long> createTransportTask(@Valid @RequestBody TransportTaskSaveReqVO createReqVO) {
|
||||
return success(transportTaskService.createTransportTask(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新搬运任务")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:update')")
|
||||
public CommonResult<Boolean> updateTransportTask(@Valid @RequestBody TransportTaskSaveReqVO updateReqVO) {
|
||||
transportTaskService.updateTransportTask(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/operate")
|
||||
@Operation(summary = "PC 端操作搬运任务(完成/取消/强制完成)")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:operate')")
|
||||
public CommonResult<Boolean> operateTransportTask(@Valid @RequestBody TransportTaskOperateReqVO reqVO) {
|
||||
transportTaskService.operateTransportTask(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/issue")
|
||||
@Operation(summary = "PC 端下发搬运任务到 ACS")
|
||||
@Parameter(name = "taskId", description = "任务ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:issue')")
|
||||
public CommonResult<Boolean> issueTransportTask(@RequestParam("taskId") Long taskId) {
|
||||
transportTaskService.issueTransportTask(taskId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除搬运任务")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:delete')")
|
||||
public CommonResult<Boolean> deleteTransportTask(@RequestParam("id") Long id) {
|
||||
transportTaskService.deleteTransportTask(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除搬运任务")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:delete')")
|
||||
public CommonResult<Boolean> deleteTransportTaskList(@RequestParam("ids") List<Long> ids) {
|
||||
transportTaskService.deleteTransportTaskListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得搬运任务")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:query')")
|
||||
public CommonResult<TransportTaskRespVO> getTransportTask(@RequestParam("id") Long id) {
|
||||
TransportTaskDO transportTask = transportTaskService.getTransportTask(id);
|
||||
return success(BeanUtils.toBean(transportTask, TransportTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得搬运任务分页")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:query')")
|
||||
public CommonResult<PageResult<TransportTaskRespVO>> getTransportTaskPage(@Valid TransportTaskPageReqVO pageReqVO) {
|
||||
PageResult<TransportTaskDO> pageResult = transportTaskService.getTransportTaskPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TransportTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出搬运任务 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('task:transport-task:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTransportTaskExcel(@Valid TransportTaskPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TransportTaskDO> list = transportTaskService.getTransportTaskPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "搬运任务.xls", "数据", TransportTaskRespVO.class,
|
||||
BeanUtils.toBean(list, TransportTaskRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class TransportTaskPageReqVO extends PageParam {
|
||||
@Schema(description = "任务类型", example = "2")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "任务类型及子类型编码列表", hidden = true)
|
||||
private List<String> taskTypeList;
|
||||
|
||||
@Schema(description = "任务状态(支持多选)", example = "[\"10\", \"50\"]")
|
||||
private List<String> taskStatus;
|
||||
|
||||
@@ -119,4 +122,4 @@ public class TransportTaskPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,162 +1,162 @@
|
||||
package cn.code.nl.module.task.controller.admin.transporttask.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
import cn.code.nl.framework.excel.core.annotations.DictFormat;
|
||||
import cn.code.nl.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运任务 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TransportTaskRespVO {
|
||||
|
||||
@Schema(description = "任务标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "11528")
|
||||
@ExcelProperty("任务标识")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "任务编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("任务编码")
|
||||
private String taskCode;
|
||||
|
||||
@Schema(description = "任务名称", example = "张三")
|
||||
@ExcelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "业务归属服务:LMS/WMS,用于完成取消事件一级路由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("业务归属服务:LMS/WMS,用于完成取消事件一级路由")
|
||||
private String ownerService;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
@ExcelProperty("业务类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "业务侧标识", example = "31008")
|
||||
@ExcelProperty("业务侧标识")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "业务回调处理器编码")
|
||||
@ExcelProperty("业务回调处理器编码")
|
||||
private String handleCode;
|
||||
|
||||
@Schema(description = "任务类型", example = "2")
|
||||
@ExcelProperty("任务类型")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
@Schema(description = "ACS任务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("ACS任务类型")
|
||||
private String acsTaskType;
|
||||
|
||||
@Schema(description = "AGV系统类型", example = "1")
|
||||
@ExcelProperty("AGV系统类型")
|
||||
private String agvSystemType;
|
||||
|
||||
@Schema(description = "ACS外部任务号")
|
||||
@ExcelProperty("ACS外部任务号")
|
||||
private String externalTaskNo;
|
||||
|
||||
@Schema(description = "取货点1")
|
||||
@ExcelProperty("取货点1")
|
||||
private String pointCode1;
|
||||
|
||||
@Schema(description = "放货点1")
|
||||
@ExcelProperty("放货点1")
|
||||
private String pointCode2;
|
||||
|
||||
@Schema(description = "取货点2")
|
||||
@ExcelProperty("取货点2")
|
||||
private String pointCode3;
|
||||
|
||||
@Schema(description = "放货点2")
|
||||
@ExcelProperty("放货点2")
|
||||
private String pointCode4;
|
||||
|
||||
@Schema(description = "载具类型", example = "2")
|
||||
@ExcelProperty("载具类型")
|
||||
private String vehicleType;
|
||||
|
||||
@Schema(description = "载具数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("载具数量")
|
||||
private Long vehicleQty;
|
||||
|
||||
@Schema(description = "载具编码")
|
||||
@ExcelProperty("载具编码")
|
||||
private String vehicleCode;
|
||||
|
||||
@Schema(description = "载具编码2")
|
||||
@ExcelProperty("载具编码2")
|
||||
private String vehicleCode2;
|
||||
|
||||
@Schema(description = "车号")
|
||||
@ExcelProperty("车号")
|
||||
private String carNo;
|
||||
|
||||
@Schema(description = "优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("优先级")
|
||||
private String priority;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
@ExcelProperty("生产区域")
|
||||
private String productArea;
|
||||
|
||||
@Schema(description = "是否自动下发", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否自动下发")
|
||||
private String isAutoIssue;
|
||||
|
||||
@Schema(description = "任务组标识", example = "21169")
|
||||
@ExcelProperty("任务组标识")
|
||||
private Long taskGroupId;
|
||||
|
||||
@Schema(description = "任务组顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("任务组顺序号")
|
||||
private Long sortSeq;
|
||||
|
||||
@Schema(description = "任务完成类型", example = "1")
|
||||
@ExcelProperty("任务完成类型")
|
||||
private String finishedType;
|
||||
|
||||
@Schema(description = "业务回调状态:PENDING/SUCCESS/FAILED", example = "2")
|
||||
@ExcelProperty("业务回调状态:PENDING/SUCCESS/FAILED")
|
||||
private String callbackStatus;
|
||||
|
||||
@Schema(description = "业务回调重试次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "2146")
|
||||
@ExcelProperty("业务回调重试次数")
|
||||
private Integer callbackRetryCount;
|
||||
|
||||
@Schema(description = "业务回调失败原因")
|
||||
@ExcelProperty("业务回调失败原因")
|
||||
private String callbackErrorMsg;
|
||||
|
||||
@Schema(description = "生成方式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "生成方式", converter = DictConvert.class)
|
||||
@DictFormat("user_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String createMode;
|
||||
|
||||
@Schema(description = "创建任务请求参数")
|
||||
@ExcelProperty("创建任务请求参数")
|
||||
private String requestParam;
|
||||
|
||||
@Schema(description = "下发ACS的AcsTaskDto扩展报文")
|
||||
@ExcelProperty("下发ACS的AcsTaskDto扩展报文")
|
||||
private String dispatchParam;
|
||||
|
||||
@Schema(description = "ACS反馈参数")
|
||||
@ExcelProperty("ACS反馈参数")
|
||||
private String resultParam;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
package cn.code.nl.module.task.controller.admin.transporttask.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
import cn.code.nl.framework.excel.core.annotations.DictFormat;
|
||||
import cn.code.nl.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运任务 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TransportTaskRespVO {
|
||||
|
||||
@Schema(description = "任务标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "11528")
|
||||
@ExcelProperty("任务标识")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "任务编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("任务编码")
|
||||
private String taskCode;
|
||||
|
||||
@Schema(description = "任务名称", example = "张三")
|
||||
@ExcelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "业务归属服务:LMS/WMS,用于完成取消事件一级路由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("业务归属服务:LMS/WMS,用于完成取消事件一级路由")
|
||||
private String ownerService;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
@ExcelProperty("业务类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "业务侧标识", example = "31008")
|
||||
@ExcelProperty("业务侧标识")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "业务回调处理器编码")
|
||||
@ExcelProperty("业务回调处理器编码")
|
||||
private String handleCode;
|
||||
|
||||
@Schema(description = "任务类型", example = "2")
|
||||
@ExcelProperty("任务类型")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
@Schema(description = "ACS任务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("ACS任务类型")
|
||||
private String acsTaskType;
|
||||
|
||||
@Schema(description = "AGV系统类型", example = "1")
|
||||
@ExcelProperty("AGV系统类型")
|
||||
private String agvSystemType;
|
||||
|
||||
@Schema(description = "ACS外部任务号")
|
||||
@ExcelProperty("ACS外部任务号")
|
||||
private String externalTaskNo;
|
||||
|
||||
@Schema(description = "取货点1")
|
||||
@ExcelProperty("取货点1")
|
||||
private String pointCode1;
|
||||
|
||||
@Schema(description = "放货点1")
|
||||
@ExcelProperty("放货点1")
|
||||
private String pointCode2;
|
||||
|
||||
@Schema(description = "取货点2")
|
||||
@ExcelProperty("取货点2")
|
||||
private String pointCode3;
|
||||
|
||||
@Schema(description = "放货点2")
|
||||
@ExcelProperty("放货点2")
|
||||
private String pointCode4;
|
||||
|
||||
@Schema(description = "载具类型", example = "2")
|
||||
@ExcelProperty("载具类型")
|
||||
private String vehicleType;
|
||||
|
||||
@Schema(description = "载具数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("载具数量")
|
||||
private Long vehicleQty;
|
||||
|
||||
@Schema(description = "载具编码")
|
||||
@ExcelProperty("载具编码")
|
||||
private String vehicleCode;
|
||||
|
||||
@Schema(description = "载具编码2")
|
||||
@ExcelProperty("载具编码2")
|
||||
private String vehicleCode2;
|
||||
|
||||
@Schema(description = "车号")
|
||||
@ExcelProperty("车号")
|
||||
private String carNo;
|
||||
|
||||
@Schema(description = "优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("优先级")
|
||||
private String priority;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
@ExcelProperty("生产区域")
|
||||
private String productArea;
|
||||
|
||||
@Schema(description = "是否自动下发", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否自动下发")
|
||||
private String isAutoIssue;
|
||||
|
||||
@Schema(description = "任务组标识", example = "21169")
|
||||
@ExcelProperty("任务组标识")
|
||||
private Long taskGroupId;
|
||||
|
||||
@Schema(description = "任务组顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("任务组顺序号")
|
||||
private Long sortSeq;
|
||||
|
||||
@Schema(description = "任务完成类型", example = "1")
|
||||
@ExcelProperty("任务完成类型")
|
||||
private String finishedType;
|
||||
|
||||
@Schema(description = "业务回调状态:PENDING/SUCCESS/FAILED", example = "2")
|
||||
@ExcelProperty("业务回调状态:PENDING/SUCCESS/FAILED")
|
||||
private String callbackStatus;
|
||||
|
||||
@Schema(description = "业务回调重试次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "2146")
|
||||
@ExcelProperty("业务回调重试次数")
|
||||
private Integer callbackRetryCount;
|
||||
|
||||
@Schema(description = "业务回调失败原因")
|
||||
@ExcelProperty("业务回调失败原因")
|
||||
private String callbackErrorMsg;
|
||||
|
||||
@Schema(description = "生成方式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "生成方式", converter = DictConvert.class)
|
||||
@DictFormat("task_create_mode")
|
||||
private String createMode;
|
||||
|
||||
@Schema(description = "创建任务请求参数")
|
||||
@ExcelProperty("创建任务请求参数")
|
||||
private String requestParam;
|
||||
|
||||
@Schema(description = "下发ACS的AcsTaskDto扩展报文")
|
||||
@ExcelProperty("下发ACS的AcsTaskDto扩展报文")
|
||||
private String dispatchParam;
|
||||
|
||||
@Schema(description = "ACS反馈参数")
|
||||
@ExcelProperty("ACS反馈参数")
|
||||
private String resultParam;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface TransportTaskMapper extends BaseMapperX<TransportTaskDO> {
|
||||
.eqIfPresent(TransportTaskDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(TransportTaskDO::getBizId, reqVO.getBizId())
|
||||
.eqIfPresent(TransportTaskDO::getHandleCode, reqVO.getHandleCode())
|
||||
.eqIfPresent(TransportTaskDO::getTaskType, reqVO.getTaskType())
|
||||
.inIfPresent(TransportTaskDO::getTaskType, reqVO.getTaskTypeList())
|
||||
.inIfPresent(TransportTaskDO::getTaskStatus, reqVO.getTaskStatus())
|
||||
.eqIfPresent(TransportTaskDO::getAcsTaskType, reqVO.getAcsTaskType())
|
||||
.eqIfPresent(TransportTaskDO::getAgvSystemType, reqVO.getAgvSystemType())
|
||||
|
||||
@@ -76,6 +76,13 @@ public interface TransportTaskService {
|
||||
*/
|
||||
void operateTransportTask(@Valid TransportTaskOperateReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 根据任务ID下发搬运任务到 ACS
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
*/
|
||||
void issueTransportTask(Long taskId);
|
||||
|
||||
/**
|
||||
* 根据 taskId 查询任务全量信息(RPC 用,自动过滤逻辑删除,查不到返回 null)
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.code.nl.module.task.service.transporttask;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import cn.code.nl.module.base.api.classstandard.ClassStandardApi;
|
||||
import cn.code.nl.module.task.controller.admin.transporttask.vo.TransportTaskOperateReqVO;
|
||||
import cn.code.nl.module.task.controller.admin.transporttask.vo.TransportTaskPageReqVO;
|
||||
import cn.code.nl.module.task.controller.admin.transporttask.vo.TransportTaskSaveReqVO;
|
||||
@@ -19,6 +20,7 @@ import cn.code.nl.module.task.manage.TransportTaskIssueManager;
|
||||
import cn.code.nl.module.task.manage.TransportTaskOperateCheckManager;
|
||||
import cn.code.nl.module.task.manage.TransportTaskOperationManager;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -29,8 +31,10 @@ import java.util.List;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.module.task.enums.ErrorCodeConstants.TRANSPORT_TASK_ALREADY_FINAL;
|
||||
import static cn.code.nl.module.task.enums.ErrorCodeConstants.TRANSPORT_TASK_AUTO_ISSUE_NOT_ALLOW_MANUAL;
|
||||
import static cn.code.nl.module.task.enums.ErrorCodeConstants.TRANSPORT_TASK_NOT_EXISTS;
|
||||
import static cn.code.nl.module.task.enums.ErrorCodeConstants.TRANSPORT_TASK_OPERATION_NOT_SUPPORTED;
|
||||
import static cn.code.nl.module.task.enums.ErrorCodeConstants.TRANSPORT_TASK_STATUS_NOT_ALLOW;
|
||||
|
||||
/**
|
||||
* 搬运任务 Service 实现类
|
||||
@@ -54,6 +58,9 @@ public class TransportTaskServiceImpl implements TransportTaskService {
|
||||
@Resource
|
||||
private TransportTaskOperateCheckManager transportTaskOperateCheckManager;
|
||||
|
||||
@Resource
|
||||
private ClassStandardApi classStandardApi;
|
||||
|
||||
@Override
|
||||
public Long createTransportTask(TransportTaskSaveReqVO createReqVO) {
|
||||
TransportTaskDO transportTask = BeanUtils.toBean(createReqVO, TransportTaskDO.class);
|
||||
@@ -111,6 +118,10 @@ public class TransportTaskServiceImpl implements TransportTaskService {
|
||||
|
||||
@Override
|
||||
public PageResult<TransportTaskDO> getTransportTaskPage(TransportTaskPageReqVO pageReqVO) {
|
||||
if (StrUtil.isNotBlank(pageReqVO.getTaskType())) {
|
||||
List<String> taskTypeList = classStandardApi.getClassStandardCodeListByCode(pageReqVO.getTaskType()).getCheckedData();
|
||||
pageReqVO.setTaskTypeList(CollUtil.isNotEmpty(taskTypeList) ? taskTypeList : List.of(pageReqVO.getTaskType()));
|
||||
}
|
||||
return transportTaskMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@@ -148,6 +159,23 @@ public class TransportTaskServiceImpl implements TransportTaskService {
|
||||
transportTaskOperationManager.dispatchOperation(task, type, reqDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务ID手动下发任务到 ACS,复用自动下发的数组接口逻辑
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
*/
|
||||
@Override
|
||||
public void issueTransportTask(Long taskId) {
|
||||
TransportTaskDO task = transportTaskMapper.selectById(taskId);
|
||||
if (task == null) {
|
||||
throw exception(TRANSPORT_TASK_NOT_EXISTS);
|
||||
}
|
||||
if ("1".equals(task.getIsAutoIssue())) {
|
||||
throw exception(TRANSPORT_TASK_AUTO_ISSUE_NOT_ALLOW_MANUAL);
|
||||
}
|
||||
transportTaskIssueManager.issueTasks(List.of(task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskInfoDTO getTaskInfoById(Long taskId) {
|
||||
TransportTaskDO task = transportTaskMapper.selectById(taskId);
|
||||
|
||||
Reference in New Issue
Block a user