机器人任务
This commit is contained in:
parent
101be5a8ad
commit
84980c31f7
@ -48,7 +48,7 @@ public class MqttCallBack implements MqttCallback {
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||
IMqttAsyncClient client = token.getClient();
|
||||
log.info("[MQTT]{}:消息发布成功!", client.getClientId());
|
||||
// log.info("[MQTT]{}:消息发布成功!", client.getClientId());
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iododer.yudao.module.mqtt.config;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.Getter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -28,8 +29,12 @@ public class MqttProperties {
|
||||
@Value("${mqtt.qos}")
|
||||
private int qos;
|
||||
|
||||
private String clientUUId;
|
||||
|
||||
public String getClientId() {
|
||||
clientId = clientId + System.currentTimeMillis();
|
||||
return clientId;
|
||||
if (clientUUId == null) {
|
||||
clientUUId = clientId + IdUtil.fastSimpleUUID();
|
||||
}
|
||||
return clientUUId;
|
||||
}
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ management:
|
||||
|
||||
# MQTT
|
||||
mqtt:
|
||||
host: tcp://127.0.0.1:1883
|
||||
username: admin
|
||||
password: admin
|
||||
host: tcp://127.0.0.1:7788
|
||||
username: adminuser
|
||||
password: adminuser
|
||||
qos: 1
|
||||
clientId: mqttx_b82345a52
|
||||
timeout: 10
|
||||
|
@ -182,4 +182,10 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 车辆信息 1-002-034-000 ==========
|
||||
ErrorCode ROBOT_INFORMATION_NOT_EXISTS = new ErrorCode(1-002-034-001, "车辆信息不存在");
|
||||
|
||||
// ========== 机器人任务主表 1-002-035-000 ==========
|
||||
ErrorCode TASK_NOT_EXISTS = new ErrorCode(1-002-035-001, "机器人任务主表不存在");
|
||||
|
||||
// ========== 机器人任务明细 1-002-036-000 ==========
|
||||
ErrorCode TASK_DETAIL_NOT_EXISTS = new ErrorCode(1-002-036-001, "机器人任务明细不存在");
|
||||
}
|
||||
|
@ -40,6 +40,12 @@ public class HouseLocationPageReqVO extends PageParam {
|
||||
@Schema(description = "物料消息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料批次")
|
||||
private String skuBatch;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Integer skuNumber;
|
||||
|
||||
@Schema(description = "启用/禁用(0:禁用、1:启用)")
|
||||
private Integer locationEnable;
|
||||
|
||||
@ -50,10 +56,10 @@ public class HouseLocationPageReqVO extends PageParam {
|
||||
private Integer locationUseStatus;
|
||||
|
||||
@Schema(description = "库位坐标x轴")
|
||||
private BigDecimal locationX;
|
||||
private String locationX;
|
||||
|
||||
@Schema(description = "库位坐标y轴")
|
||||
private BigDecimal locationY;
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "宽(库位上目前所放物品的宽)")
|
||||
private BigDecimal locationWide;
|
||||
|
@ -48,6 +48,14 @@ public class HouseLocationRespVO {
|
||||
@ExcelProperty("物料消息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料批次")
|
||||
@ExcelProperty("物料批次")
|
||||
private String skuBatch;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
@ExcelProperty("物料数量")
|
||||
private Integer skuNumber;
|
||||
|
||||
@Schema(description = "启用/禁用(0:禁用、1:启用)")
|
||||
@ExcelProperty("启用/禁用(0:禁用、1:启用)")
|
||||
private Integer locationEnable;
|
||||
@ -62,11 +70,11 @@ public class HouseLocationRespVO {
|
||||
|
||||
@Schema(description = "库位坐标x轴")
|
||||
@ExcelProperty("库位坐标x轴")
|
||||
private BigDecimal locationX;
|
||||
private String locationX;
|
||||
|
||||
@Schema(description = "库位坐标y轴")
|
||||
@ExcelProperty("库位坐标y轴")
|
||||
private BigDecimal locationY;
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "宽(库位上目前所放物品的宽)")
|
||||
@ExcelProperty("宽(库位上目前所放物品的宽)")
|
||||
|
@ -25,8 +25,7 @@ public class HouseLocationSaveReqVO {
|
||||
@Schema(description = "库区名称", example = "芋艿")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "库位编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "库位编号不能为空")
|
||||
@Schema(description = "库位编号", example = "A-10")
|
||||
private String locationNo;
|
||||
|
||||
@Schema(description = "弧度")
|
||||
@ -38,6 +37,12 @@ public class HouseLocationSaveReqVO {
|
||||
@Schema(description = "物料消息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料批次")
|
||||
private String skuBatch;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Integer skuNumber;
|
||||
|
||||
@Schema(description = "启用/禁用(0:禁用、1:启用)")
|
||||
private Integer locationEnable;
|
||||
|
||||
@ -48,10 +53,10 @@ public class HouseLocationSaveReqVO {
|
||||
private Integer locationUseStatus;
|
||||
|
||||
@Schema(description = "库位坐标x轴")
|
||||
private BigDecimal locationX;
|
||||
private String locationX;
|
||||
|
||||
@Schema(description = "库位坐标y轴")
|
||||
private BigDecimal locationY;
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "宽(库位上目前所放物品的宽)")
|
||||
private BigDecimal locationWide;
|
||||
|
@ -0,0 +1,98 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.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 javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 机器人任务主表")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/task")
|
||||
@Validated
|
||||
public class RobotTaskController {
|
||||
|
||||
@Resource
|
||||
private RobotTaskService taskService;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建机器人任务主表")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task:create')")
|
||||
public CommonResult<Long> createTask(@Valid @RequestBody RobotTaskSaveReqVO createReqVO) {
|
||||
return success(taskService.createTask(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新机器人任务主表")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task:update')")
|
||||
public CommonResult<Boolean> updateTask(@Valid @RequestBody RobotTaskSaveReqVO updateReqVO) {
|
||||
taskService.updateTask(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除机器人任务主表")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('robot:task:delete')")
|
||||
public CommonResult<Boolean> deleteTask(@RequestParam("id") Long id) {
|
||||
taskService.deleteTask(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得机器人任务主表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task:query')")
|
||||
public CommonResult<RobotTaskRespVO> getTask(@RequestParam("id") Long id) {
|
||||
RobotTaskDO task = taskService.getTask(id);
|
||||
return success(BeanUtils.toBean(task, RobotTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得机器人任务主表分页")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task:query')")
|
||||
public CommonResult<PageResult<RobotTaskRespVO>> getTaskPage(@Valid RobotTaskPageReqVO pageReqVO) {
|
||||
PageResult<RobotTaskDO> pageResult = taskService.getTaskPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RobotTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出机器人任务主表 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTaskExcel(@Valid RobotTaskPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RobotTaskDO> list = taskService.getTaskPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "机器人任务主表.xls", "数据", RobotTaskRespVO.class,
|
||||
BeanUtils.toBean(list, RobotTaskRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskDetailService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.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 javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 机器人任务明细")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/task-detail")
|
||||
@Validated
|
||||
public class RobotTaskDetailController {
|
||||
|
||||
@Resource
|
||||
private RobotTaskDetailService taskDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建机器人任务明细")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task-detail:create')")
|
||||
public CommonResult<Long> createTaskDetail(@Valid @RequestBody RobotTaskDetailSaveReqVO createReqVO) {
|
||||
return success(taskDetailService.createTaskDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新机器人任务明细")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task-detail:update')")
|
||||
public CommonResult<Boolean> updateTaskDetail(@Valid @RequestBody RobotTaskDetailSaveReqVO updateReqVO) {
|
||||
taskDetailService.updateTaskDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除机器人任务明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('robot:task-detail:delete')")
|
||||
public CommonResult<Boolean> deleteTaskDetail(@RequestParam("id") Long id) {
|
||||
taskDetailService.deleteTaskDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得机器人任务明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task-detail:query')")
|
||||
public CommonResult<RobotTaskDetailRespVO> getTaskDetail(@RequestParam("id") Long id) {
|
||||
RobotTaskDetailDO taskDetail = taskDetailService.getTaskDetail(id);
|
||||
return success(BeanUtils.toBean(taskDetail, RobotTaskDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得机器人任务明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task-detail:query')")
|
||||
public CommonResult<PageResult<RobotTaskDetailRespVO>> getTaskDetailPage(@Valid RobotTaskDetailPageReqVO pageReqVO) {
|
||||
PageResult<RobotTaskDetailDO> pageResult = taskDetailService.getTaskDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RobotTaskDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出机器人任务明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('robot:task-detail:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTaskDetailExcel(@Valid RobotTaskDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RobotTaskDetailDO> list = taskDetailService.getTaskDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "机器人任务明细.xls", "数据", RobotTaskDetailRespVO.class,
|
||||
BeanUtils.toBean(list, RobotTaskDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 机器人任务明细分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RobotTaskDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "机器人任务主表id", example = "9241")
|
||||
private Long robotTaskId;
|
||||
|
||||
@Schema(description = "任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)", example = "2")
|
||||
private Integer taskType;
|
||||
|
||||
@Schema(description = "放货类型(1:库位、2:线库、 3:区域)", example = "2")
|
||||
private Integer releaseType;
|
||||
|
||||
@Schema(description = "取货类型(1:库位、2:线库、 3:区域)", example = "1")
|
||||
private Integer takeType;
|
||||
|
||||
@Schema(description = "放货库位/线库/区域", example = "6223")
|
||||
private Long releaseId;
|
||||
|
||||
@Schema(description = "取货库位/线库/区域", example = "24801")
|
||||
private Long takeId;
|
||||
|
||||
@Schema(description = "AGV编号")
|
||||
private String robotNo;
|
||||
|
||||
@Schema(description = "任务状态(0:未开始、1:执行中、2:已完成、3:已取消)", example = "1")
|
||||
private Long taskStatus;
|
||||
|
||||
@Schema(description = "任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
private Long taskStage;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 机器人任务明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RobotTaskDetailRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26224")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机器人任务主表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9241")
|
||||
@ExcelProperty("机器人任务主表id")
|
||||
private Long robotTaskId;
|
||||
|
||||
@Schema(description = "任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)")
|
||||
private Integer taskType;
|
||||
|
||||
@Schema(description = "放货类型(1:库位、2:线库、 3:区域)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("放货类型(1:库位、2:线库、 3:区域)")
|
||||
private Integer releaseType;
|
||||
|
||||
@Schema(description = "取货类型(1:库位、2:线库、 3:区域)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("取货类型(1:库位、2:线库、 3:区域)")
|
||||
private Integer takeType;
|
||||
|
||||
@Schema(description = "放货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "6223")
|
||||
@ExcelProperty("放货库位/线库/区域")
|
||||
private Long releaseId;
|
||||
|
||||
@Schema(description = "取货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "24801")
|
||||
@ExcelProperty("取货库位/线库/区域")
|
||||
private Long takeId;
|
||||
|
||||
@Schema(description = "AGV编号")
|
||||
@ExcelProperty("AGV编号")
|
||||
private String robotNo;
|
||||
|
||||
@Schema(description = "任务状态(0:未开始、1:执行中、2:已完成、3:已取消)", example = "1")
|
||||
@ExcelProperty("任务状态(0:未开始、1:执行中、2:已完成、3:已取消)")
|
||||
private Long taskStatus;
|
||||
|
||||
@Schema(description = "任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
@ExcelProperty("任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
private Long taskStage;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 机器人任务明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class RobotTaskDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26224")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机器人任务主表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9241")
|
||||
@NotNull(message = "机器人任务主表id不能为空")
|
||||
private Long robotTaskId;
|
||||
|
||||
@Schema(description = "任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)不能为空")
|
||||
private Integer taskType;
|
||||
|
||||
@Schema(description = "放货类型(1:库位、2:线库、 3:区域)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "放货类型(1:库位、2:线库、 3:区域)不能为空")
|
||||
private Integer releaseType;
|
||||
|
||||
@Schema(description = "取货类型(1:库位、2:线库、 3:区域)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "取货类型(1:库位、2:线库、 3:区域)不能为空")
|
||||
private Integer takeType;
|
||||
|
||||
@Schema(description = "放货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "6223")
|
||||
@NotNull(message = "放货库位/线库/区域不能为空")
|
||||
private Long releaseId;
|
||||
|
||||
@Schema(description = "取货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "24801")
|
||||
@NotNull(message = "取货库位/线库/区域不能为空")
|
||||
private Long takeId;
|
||||
|
||||
@Schema(description = "AGV编号")
|
||||
private String robotNo;
|
||||
|
||||
@Schema(description = "任务状态(0:未开始、1:执行中、2:已完成、3:已取消)", example = "1")
|
||||
private Long taskStatus;
|
||||
|
||||
@Schema(description = "任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
private Long taskStage;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 机器人任务主表分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RobotTaskPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "是否拼接任务(0:不拼接、1:拼接)")
|
||||
private Integer montageTask;
|
||||
|
||||
@Schema(description = "拼接任务数量")
|
||||
private Integer montageNumber;
|
||||
|
||||
@Schema(description = "物料信息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料批次号")
|
||||
private String skuBatch;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Long skuNumber;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private Long priority;
|
||||
|
||||
@Schema(description = "其他信息")
|
||||
private String otherMsg;
|
||||
|
||||
@Schema(description = "循环(0:不循环、1:循环)")
|
||||
private Long doCycle;
|
||||
|
||||
@Schema(description = "是否搬空所选线库/区域(0:不搬空、1:搬空)")
|
||||
private Long doMoveAll;
|
||||
|
||||
@Schema(description = "循环次数")
|
||||
private Long cycleNumber;
|
||||
|
||||
@Schema(description = "剩余循环次数,默认1")
|
||||
private Long remainingCycleNumber;
|
||||
|
||||
@Schema(description = "任务号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务状态(0:未开始、1:执行中、2:已完成、3:已取消)", example = "2")
|
||||
private Long taskStatus;
|
||||
|
||||
@Schema(description = "任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
private Long taskStage;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot.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 com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 机器人任务主表 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RobotTaskRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15306")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "是否拼接任务(0:不拼接、1:拼接)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否拼接任务(0:不拼接、1:拼接)")
|
||||
private Integer montageTask;
|
||||
|
||||
@Schema(description = "拼接任务数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("拼接任务数量")
|
||||
private Integer montageNumber;
|
||||
|
||||
@Schema(description = "物料信息")
|
||||
@ExcelProperty("物料信息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料批次号")
|
||||
@ExcelProperty("物料批次号")
|
||||
private String skuBatch;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
@ExcelProperty("物料数量")
|
||||
private Long skuNumber;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
@ExcelProperty("优先级")
|
||||
private Long priority;
|
||||
|
||||
@Schema(description = "其他信息")
|
||||
@ExcelProperty("其他信息")
|
||||
private String otherMsg;
|
||||
|
||||
@Schema(description = "循环(0:不循环、1:循环)")
|
||||
@ExcelProperty("循环(0:不循环、1:循环)")
|
||||
private Long doCycle;
|
||||
|
||||
@Schema(description = "是否搬空所选线库/区域(0:不搬空、1:搬空)")
|
||||
@ExcelProperty("是否搬空所选线库/区域(0:不搬空、1:搬空)")
|
||||
private Long doMoveAll;
|
||||
|
||||
@Schema(description = "循环次数")
|
||||
@ExcelProperty("循环次数")
|
||||
private Long cycleNumber;
|
||||
|
||||
@Schema(description = "剩余循环次数,默认1")
|
||||
@ExcelProperty("剩余循环次数,默认1")
|
||||
private Long remainingCycleNumber;
|
||||
|
||||
@Schema(description = "任务号")
|
||||
@ExcelProperty("任务号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务状态(0:未开始、1:执行中、2:已完成、3:已取消)", example = "2")
|
||||
@ExcelProperty("任务状态(0:未开始、1:执行中、2:已完成、3:已取消)")
|
||||
private Long taskStatus;
|
||||
|
||||
@Schema(description = "任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
@ExcelProperty("任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
private Long taskStage;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.robot.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 机器人任务主表新增/修改 Request VO")
|
||||
@Data
|
||||
public class RobotTaskSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15306")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "是否拼接任务(0:不拼接、1:拼接)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否拼接任务(0:不拼接、1:拼接)不能为空")
|
||||
private Integer montageTask;
|
||||
|
||||
@Schema(description = "拼接任务数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "拼接任务数量不能为空")
|
||||
private Integer montageNumber;
|
||||
|
||||
@Schema(description = "物料信息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料批次号")
|
||||
private String skuBatch;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Long skuNumber;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private Long priority;
|
||||
|
||||
@Schema(description = "其他信息")
|
||||
private String otherMsg;
|
||||
|
||||
@Schema(description = "循环(0:不循环、1:循环)")
|
||||
private Long doCycle;
|
||||
|
||||
@Schema(description = "是否搬空所选线库/区域(0:不搬空、1:搬空)")
|
||||
private Long doMoveAll;
|
||||
|
||||
@Schema(description = "循环次数")
|
||||
private Long cycleNumber;
|
||||
|
||||
@Schema(description = "剩余循环次数,默认1")
|
||||
private Long remainingCycleNumber;
|
||||
|
||||
@Schema(description = "任务号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务状态(0:未开始、1:执行中、2:已完成、3:已取消)", example = "2")
|
||||
private Long taskStatus;
|
||||
|
||||
@Schema(description = "任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)")
|
||||
private Long taskStage;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
@ -68,6 +68,14 @@ public class HouseLocationDO extends BaseDO {
|
||||
* 物料消息
|
||||
*/
|
||||
private String skuInfo;
|
||||
/**
|
||||
* 物料批次
|
||||
*/
|
||||
private String skuBatch;
|
||||
/**
|
||||
* 物料数量
|
||||
*/
|
||||
private Integer skuNumber;
|
||||
/**
|
||||
* 启用/禁用(0:禁用、1:启用)
|
||||
*/
|
||||
@ -83,11 +91,11 @@ public class HouseLocationDO extends BaseDO {
|
||||
/**
|
||||
* 库位坐标x轴
|
||||
*/
|
||||
private BigDecimal locationX;
|
||||
private String locationX;
|
||||
/**
|
||||
* 库位坐标y轴
|
||||
*/
|
||||
private BigDecimal locationY;
|
||||
private String locationY;
|
||||
/**
|
||||
* 宽(库位上目前所放物品的宽)
|
||||
*/
|
||||
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.robot;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 机器人任务主表 DO
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@TableName("robot_task")
|
||||
@KeySequence("robot_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RobotTaskDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 是否拼接任务(0:不拼接、1:拼接)
|
||||
*/
|
||||
private Integer montageTask;
|
||||
/**
|
||||
* 拼接任务数量
|
||||
*/
|
||||
private Integer montageNumber;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private String skuInfo;
|
||||
/**
|
||||
* 物料批次号
|
||||
*/
|
||||
private String skuBatch;
|
||||
/**
|
||||
* 物料数量
|
||||
*/
|
||||
private Long skuNumber;
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
private Long priority;
|
||||
/**
|
||||
* 其他信息
|
||||
*/
|
||||
private String otherMsg;
|
||||
/**
|
||||
* 循环(0:不循环、1:循环)
|
||||
*/
|
||||
private Long doCycle;
|
||||
/**
|
||||
* 是否搬空所选线库/区域(0:不搬空、1:搬空)
|
||||
*/
|
||||
private Long doMoveAll;
|
||||
/**
|
||||
* 循环次数
|
||||
*/
|
||||
private Long cycleNumber;
|
||||
/**
|
||||
* 剩余循环次数,默认1
|
||||
*/
|
||||
private Long remainingCycleNumber;
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
/**
|
||||
* 任务状态(0:未开始、1:执行中、2:已完成、3:已取消)
|
||||
*/
|
||||
private Long taskStatus;
|
||||
/**
|
||||
* 任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)
|
||||
*/
|
||||
private Long taskStage;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.robot;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 机器人任务明细 DO
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@TableName("robot_task_detail")
|
||||
@KeySequence("robot_task_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RobotTaskDetailDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 机器人任务主表id
|
||||
*/
|
||||
private Long robotTaskId;
|
||||
/**
|
||||
* 任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)
|
||||
*/
|
||||
private Integer taskType;
|
||||
/**
|
||||
* 放货类型(1:库位、2:线库、 3:区域)
|
||||
*/
|
||||
private Integer releaseType;
|
||||
/**
|
||||
* 取货类型(1:库位、2:线库、 3:区域)
|
||||
*/
|
||||
private Integer takeType;
|
||||
/**
|
||||
* 放货库位/线库/区域
|
||||
*/
|
||||
private Long releaseId;
|
||||
/**
|
||||
* 取货库位/线库/区域
|
||||
*/
|
||||
private Long takeId;
|
||||
/**
|
||||
* AGV编号
|
||||
*/
|
||||
private String robotNo;
|
||||
/**
|
||||
* 任务状态(0:未开始、1:执行中、2:已完成、3:已取消)
|
||||
*/
|
||||
private Long taskStatus;
|
||||
/**
|
||||
* 任务阶段(0:待执行、1:前往取货、2:取货中、3:运输中、4:放货中、5:结束)
|
||||
*/
|
||||
private Long taskStage;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
@ -26,7 +26,9 @@ public interface HouseLocationMapper extends BaseMapperX<HouseLocationDO> {
|
||||
.eqIfPresent(HouseLocationDO::getLocationNo, reqVO.getLocationNo())
|
||||
.eqIfPresent(HouseLocationDO::getLocationYaw, reqVO.getLocationYaw())
|
||||
.likeIfPresent(HouseLocationDO::getGroupName, reqVO.getGroupName())
|
||||
.eqIfPresent(HouseLocationDO::getSkuInfo, reqVO.getSkuInfo())
|
||||
.likeIfPresent(HouseLocationDO::getSkuInfo, reqVO.getSkuInfo())
|
||||
.likeIfPresent(HouseLocationDO::getSkuBatch, reqVO.getSkuBatch())
|
||||
.eqIfPresent(HouseLocationDO::getSkuNumber, reqVO.getSkuNumber())
|
||||
.eqIfPresent(HouseLocationDO::getLocationEnable, reqVO.getLocationEnable())
|
||||
.eqIfPresent(HouseLocationDO::getLocationLock, reqVO.getLocationLock())
|
||||
.eqIfPresent(HouseLocationDO::getLocationUseStatus, reqVO.getLocationUseStatus())
|
||||
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.robot;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 机器人任务明细 Mapper
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Mapper
|
||||
public interface RobotTaskDetailMapper extends BaseMapperX<RobotTaskDetailDO> {
|
||||
|
||||
default PageResult<RobotTaskDetailDO> selectPage(RobotTaskDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RobotTaskDetailDO>()
|
||||
.eqIfPresent(RobotTaskDetailDO::getRobotTaskId, reqVO.getRobotTaskId())
|
||||
.eqIfPresent(RobotTaskDetailDO::getTaskType, reqVO.getTaskType())
|
||||
.eqIfPresent(RobotTaskDetailDO::getReleaseType, reqVO.getReleaseType())
|
||||
.eqIfPresent(RobotTaskDetailDO::getTakeType, reqVO.getTakeType())
|
||||
.eqIfPresent(RobotTaskDetailDO::getReleaseId, reqVO.getReleaseId())
|
||||
.eqIfPresent(RobotTaskDetailDO::getTakeId, reqVO.getTakeId())
|
||||
.eqIfPresent(RobotTaskDetailDO::getRobotNo, reqVO.getRobotNo())
|
||||
.eqIfPresent(RobotTaskDetailDO::getTaskStatus, reqVO.getTaskStatus())
|
||||
.eqIfPresent(RobotTaskDetailDO::getTaskStage, reqVO.getTaskStage())
|
||||
.betweenIfPresent(RobotTaskDetailDO::getStartTime, reqVO.getStartTime())
|
||||
.betweenIfPresent(RobotTaskDetailDO::getEndTime, reqVO.getEndTime())
|
||||
.betweenIfPresent(RobotTaskDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RobotTaskDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.robot;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 机器人任务主表 Mapper
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Mapper
|
||||
public interface RobotTaskMapper extends BaseMapperX<RobotTaskDO> {
|
||||
|
||||
default PageResult<RobotTaskDO> selectPage(RobotTaskPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RobotTaskDO>()
|
||||
.eqIfPresent(RobotTaskDO::getMontageTask, reqVO.getMontageTask())
|
||||
.eqIfPresent(RobotTaskDO::getMontageNumber, reqVO.getMontageNumber())
|
||||
.eqIfPresent(RobotTaskDO::getSkuInfo, reqVO.getSkuInfo())
|
||||
.eqIfPresent(RobotTaskDO::getSkuBatch, reqVO.getSkuBatch())
|
||||
.eqIfPresent(RobotTaskDO::getSkuNumber, reqVO.getSkuNumber())
|
||||
.eqIfPresent(RobotTaskDO::getPriority, reqVO.getPriority())
|
||||
.eqIfPresent(RobotTaskDO::getOtherMsg, reqVO.getOtherMsg())
|
||||
.eqIfPresent(RobotTaskDO::getDoCycle, reqVO.getDoCycle())
|
||||
.eqIfPresent(RobotTaskDO::getDoMoveAll, reqVO.getDoMoveAll())
|
||||
.eqIfPresent(RobotTaskDO::getCycleNumber, reqVO.getCycleNumber())
|
||||
.eqIfPresent(RobotTaskDO::getRemainingCycleNumber, reqVO.getRemainingCycleNumber())
|
||||
.eqIfPresent(RobotTaskDO::getTaskNo, reqVO.getTaskNo())
|
||||
.eqIfPresent(RobotTaskDO::getTaskStatus, reqVO.getTaskStatus())
|
||||
.eqIfPresent(RobotTaskDO::getTaskStage, reqVO.getTaskStage())
|
||||
.betweenIfPresent(RobotTaskDO::getStartTime, reqVO.getStartTime())
|
||||
.betweenIfPresent(RobotTaskDO::getEndTime, reqVO.getEndTime())
|
||||
.betweenIfPresent(RobotTaskDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RobotTaskDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.system.service.robot;
|
||||
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
|
||||
/**
|
||||
* 机器人任务明细 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface RobotTaskDetailService {
|
||||
|
||||
/**
|
||||
* 创建机器人任务明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createTaskDetail(@Valid RobotTaskDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新机器人任务明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateTaskDetail(@Valid RobotTaskDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除机器人任务明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteTaskDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得机器人任务明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 机器人任务明细
|
||||
*/
|
||||
RobotTaskDetailDO getTaskDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得机器人任务明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 机器人任务明细分页
|
||||
*/
|
||||
PageResult<RobotTaskDetailDO> getTaskDetailPage(RobotTaskDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.system.service.robot;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TASK_DETAIL_NOT_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* 机器人任务明细 Service 实现类
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RobotTaskDetailServiceImpl implements RobotTaskDetailService {
|
||||
|
||||
@Resource
|
||||
private RobotTaskDetailMapper taskDetailMapper;
|
||||
|
||||
@Override
|
||||
public Long createTaskDetail(RobotTaskDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RobotTaskDetailDO taskDetail = BeanUtils.toBean(createReqVO, RobotTaskDetailDO.class);
|
||||
taskDetailMapper.insert(taskDetail);
|
||||
// 返回
|
||||
return taskDetail.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskDetail(RobotTaskDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateTaskDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RobotTaskDetailDO updateObj = BeanUtils.toBean(updateReqVO, RobotTaskDetailDO.class);
|
||||
taskDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTaskDetail(Long id) {
|
||||
// 校验存在
|
||||
validateTaskDetailExists(id);
|
||||
// 删除
|
||||
taskDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateTaskDetailExists(Long id) {
|
||||
if (taskDetailMapper.selectById(id) == null) {
|
||||
throw exception(TASK_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RobotTaskDetailDO getTaskDetail(Long id) {
|
||||
return taskDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RobotTaskDetailDO> getTaskDetailPage(RobotTaskDetailPageReqVO pageReqVO) {
|
||||
return taskDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.system.service.robot;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
|
||||
/**
|
||||
* 机器人任务主表 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface RobotTaskService {
|
||||
|
||||
/**
|
||||
* 创建机器人任务主表
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createTask(@Valid RobotTaskSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新机器人任务主表
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateTask(@Valid RobotTaskSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除机器人任务主表
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteTask(Long id);
|
||||
|
||||
/**
|
||||
* 获得机器人任务主表
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 机器人任务主表
|
||||
*/
|
||||
RobotTaskDO getTask(Long id);
|
||||
|
||||
/**
|
||||
* 获得机器人任务主表分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 机器人任务主表分页
|
||||
*/
|
||||
PageResult<RobotTaskDO> getTaskPage(RobotTaskPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.system.service.robot;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TASK_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 机器人任务主表 Service 实现类
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RobotTaskServiceImpl implements RobotTaskService {
|
||||
|
||||
@Resource
|
||||
private RobotTaskMapper taskMapper;
|
||||
|
||||
@Override
|
||||
public Long createTask(RobotTaskSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RobotTaskDO task = BeanUtils.toBean(createReqVO, RobotTaskDO.class);
|
||||
taskMapper.insert(task);
|
||||
// 返回
|
||||
return task.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTask(RobotTaskSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateTaskExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RobotTaskDO updateObj = BeanUtils.toBean(updateReqVO, RobotTaskDO.class);
|
||||
taskMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTask(Long id) {
|
||||
// 校验存在
|
||||
validateTaskExists(id);
|
||||
// 删除
|
||||
taskMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateTaskExists(Long id) {
|
||||
if (taskMapper.selectById(id) == null) {
|
||||
throw exception(TASK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RobotTaskDO getTask(Long id) {
|
||||
return taskMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RobotTaskDO> getTaskPage(RobotTaskPageReqVO pageReqVO) {
|
||||
return taskMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user