agv常用请求接口实体和和设备参数获取
This commit is contained in:
@@ -6,11 +6,16 @@ public class Constant {
|
||||
/**
|
||||
* REST协议接口基础地址
|
||||
*/
|
||||
public static final String BASEURL_REST = "http://IP:PORT/rcms/services/rest/hikRpcService/";
|
||||
public static final String BASEURL = "http://127.0.0.1:8080";
|
||||
|
||||
/**
|
||||
* REST协议接口基础地址
|
||||
*/
|
||||
public static final String BASEURL_REST = BASEURL + "/rcms/services/rest/hikRpcService/";
|
||||
|
||||
/**
|
||||
* AGV状态协议接口基础地址
|
||||
*/
|
||||
public static final String BASEURL_AGV = "http://IP:PORT/rcms-dps/rest/queryAgvStatus/";
|
||||
public static final String BASEURL_AGV = BASEURL + "/rcms-dps/rest/queryAgvStatus/";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.common;
|
||||
|
||||
/**
|
||||
* 任务执行状态
|
||||
*/
|
||||
public class TaskStatusCode {
|
||||
|
||||
/**
|
||||
* 任务状态-待执行
|
||||
*/
|
||||
public static final String TASK_READY = "100";
|
||||
|
||||
/**
|
||||
* 任务状态-执行中
|
||||
*/
|
||||
public static final String TASK_RUNNING = "101";
|
||||
|
||||
/**
|
||||
* 任务状态-自动完成
|
||||
*/
|
||||
public static final String TASK_FINISH = "102";
|
||||
|
||||
/**
|
||||
* 任务状态-手动完成
|
||||
*/
|
||||
public static final String TASK_FINISH_MANUAL = "103";
|
||||
|
||||
/**
|
||||
* 任务状态-手动取消
|
||||
*/
|
||||
public static final String TASK_CANCEL = "104";
|
||||
|
||||
}
|
||||
@@ -14,11 +14,6 @@ public class ResponseBase {
|
||||
* 返回消息
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
@NotNull
|
||||
public String reqCode;
|
||||
/**
|
||||
* 自定义返回
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
package com.ruoyi.device.agv.domain.cancelTask;
|
||||
|
||||
import com.ruoyi.device.agv.domain.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CancelTaskResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
package com.ruoyi.device.agv.domain.continueTask;
|
||||
|
||||
import com.ruoyi.device.agv.domain.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ContinueTaskResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@ package com.ruoyi.device.agv.domain.genAgvSchedulingTask;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 【生成AGV任务】请求接口
|
||||
@@ -15,12 +18,12 @@ public class GenAgvSchedulingTaskRequest {
|
||||
* 同一个请求重复提交, 使用同一编号
|
||||
*/
|
||||
@NotNull
|
||||
private String reqCode;
|
||||
private String reqCode = UUID.randomUUID().toString();
|
||||
/**
|
||||
* 请求时间
|
||||
* 格式: “yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
private String reqTime;
|
||||
private String reqTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).toString();
|
||||
/**
|
||||
* 客户端编号
|
||||
* 客户端编号,如PDA,HCWMS等
|
||||
|
||||
@@ -8,6 +8,9 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class GenAgvSchedulingTaskResponse extends ResponseBase {
|
||||
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.ruoyi.device.agv.domain.genAgvSchedulingTask;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PositionCodeData {
|
||||
/**
|
||||
* 位置编号 - 单个编号不超过64位
|
||||
|
||||
@@ -8,8 +8,14 @@ import java.util.List;
|
||||
@Data
|
||||
public class QueryAgvStatusResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
private List<AgvStatusData> data;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,12 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
public class QueryTaskStatusResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.schedule.task;
|
||||
package com.ruoyi.schedule.scheduleTask;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
@@ -7,13 +7,10 @@ import com.ruoyi.common.Constant;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.device.agv.domain.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.device.agv.domain.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.device.agv.domain.queryAgvStatus.QueryAgvStatusRequest;
|
||||
import com.ruoyi.device.agv.domain.queryAgvStatus.QueryAgvStatusResponse;
|
||||
import com.ruoyi.schedule.job.mydojob.domain.MydoJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -27,10 +24,10 @@ public class Execution {
|
||||
/**
|
||||
* 查询是否有wcs任务
|
||||
*/
|
||||
@PostConstruct
|
||||
// @PostConstruct
|
||||
public List<MydoJob> getmydoJob(){
|
||||
|
||||
String url = "http://127.0.0.1:8080/job/inmydoJob/listAll";
|
||||
String url = Constant.BASEURL + "/job/inmydoJob/listAll";
|
||||
|
||||
HttpResponse response = HttpRequest.get(url).execute();
|
||||
|
||||
@@ -54,7 +51,7 @@ public class Execution {
|
||||
String jsonString = JSON.toJSONString(request);
|
||||
|
||||
//请求源数据输出日志
|
||||
log.info(jsonString);
|
||||
log.info("【下发设备指令】" + jsonString);
|
||||
|
||||
//请求接口
|
||||
HttpResponse response = HttpRequest.post(Constant.BASEURL_REST + "genAgvSchedulingTask")
|
||||
@@ -78,6 +75,7 @@ public class Execution {
|
||||
log.error("【下发设备任务】下发任务失败," + genAgvSchedulingTaskResponse.getMessage() + "!");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.ruoyi.schedule.scheduleTask;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.Constant;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.device.agv.domain.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.device.agv.domain.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.schedule.data.ConvConnection;
|
||||
import com.ruoyi.schedule.plc.domain.ConvPTLInRead;
|
||||
import com.ruoyi.schedule.plc.domain.ConvPTLOutRead;
|
||||
import com.ruoyi.schedule.task.domain.WcsTask;
|
||||
import com.ruoyi.schedule.task.service.IWcsTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取任务生成AGV指令
|
||||
*/
|
||||
@Component
|
||||
public class Generation {
|
||||
|
||||
@Autowired
|
||||
ConvConnection conv;
|
||||
|
||||
@Autowired
|
||||
Execution execution;
|
||||
|
||||
IWcsTaskService iWcsTaskService;
|
||||
|
||||
//获取PTL拣选工位入口状态
|
||||
public List<ConvPTLInRead> getConvPTLInRead() {
|
||||
|
||||
List<ConvPTLInRead> convPTLInReads=conv.getConvPTLIn();
|
||||
|
||||
for (int i = 0; i < convPTLInReads.size(); i++) {
|
||||
|
||||
//设备空闲 && 输送机任务号空
|
||||
if (convPTLInReads.get(i).getFree() == 1 && StringUtils.isBlank(convPTLInReads.get(i).getTaskId())){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return convPTLInReads;
|
||||
}
|
||||
|
||||
|
||||
//=========================获取PTL拣选工位出口状态---【CTU入库】=========================
|
||||
// @Scheduled(cron = "*/2 * * * * *")
|
||||
public List<ConvPTLOutRead> getConvPTLOutRead() {
|
||||
|
||||
List<ConvPTLOutRead> convPTLOutReads = conv.getConvPTLOut();
|
||||
|
||||
//轮询输送机状态
|
||||
for (int i = 0; i < convPTLOutReads.size(); i++) {
|
||||
|
||||
//条码不为空 && 存在任务号 && 设备占用(非空闲)
|
||||
if (StringUtils.isBlank(convPTLOutReads.get(i).getPalletId()) && StringUtils.isBlank(convPTLOutReads.get(i).getTaskId()) && convPTLOutReads.get(i).getFree() == 0) {
|
||||
|
||||
//查找mydoJob是否存在该条码的任务
|
||||
//todo 有无其他任务字段校验
|
||||
HttpResponse response = HttpRequest.get(Constant.BASEURL + "/job/inmydoJob/getTaskCount").execute();
|
||||
Integer count = JSON.parseObject(response.body(), Integer.class);
|
||||
|
||||
WcsTask task = new WcsTask();
|
||||
|
||||
iWcsTaskService.insertWcsTask(task);
|
||||
|
||||
//存在当前托盘条码的任务
|
||||
if (count > 0){
|
||||
//生成请求数据
|
||||
GenAgvSchedulingTaskRequest request = new GenAgvSchedulingTaskRequest();
|
||||
|
||||
request.setTaskTyp("F12");
|
||||
|
||||
//添加路径测试
|
||||
List<PositionCodeData> path = new ArrayList<PositionCodeData>(2);
|
||||
path.add(new PositionCodeData("G1001","05"));
|
||||
path.add(new PositionCodeData("010101","05"));
|
||||
|
||||
request.setPositionCodePath(path);
|
||||
|
||||
execution.sendCommand(request);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return convPTLOutReads;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.ruoyi.schedule.task.controller;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.TaskStatusCode;
|
||||
import com.ruoyi.device.agv.domain.ResponseBase;
|
||||
import com.ruoyi.schedule.task.mapper.WcsTaskMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.schedule.task.domain.WcsTask;
|
||||
import com.ruoyi.schedule.task.service.IWcsTaskService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 实时任务Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/schedule/task")
|
||||
@Slf4j
|
||||
public class WcsTaskController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsTaskService wcsTaskService;
|
||||
|
||||
@Autowired
|
||||
WcsTaskMapper wcsTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询实时任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:task:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsTask wcsTask)
|
||||
{
|
||||
startPage();
|
||||
List<WcsTask> list = wcsTaskService.selectWcsTaskList(wcsTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出实时任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:task:export')")
|
||||
@Log(title = "实时任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsTask wcsTask)
|
||||
{
|
||||
List<WcsTask> list = wcsTaskService.selectWcsTaskList(wcsTask);
|
||||
ExcelUtil<WcsTask> util = new ExcelUtil<WcsTask>(WcsTask.class);
|
||||
util.exportExcel(response, list, "实时任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实时任务详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:task:query')")
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable("taskId") String taskId)
|
||||
{
|
||||
return success(wcsTaskService.selectWcsTaskByTaskId(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增实时任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:task:add')")
|
||||
@Log(title = "实时任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WcsTask wcsTask)
|
||||
{
|
||||
return toAjax(wcsTaskService.insertWcsTask(wcsTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改实时任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:task:edit')")
|
||||
@Log(title = "实时任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WcsTask wcsTask)
|
||||
{
|
||||
return toAjax(wcsTaskService.updateWcsTask(wcsTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除实时任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:task:remove')")
|
||||
@Log(title = "实时任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskIds}")
|
||||
public AjaxResult remove(@PathVariable String[] taskIds)
|
||||
{
|
||||
return toAjax(wcsTaskService.deleteWcsTaskByTaskIds(taskIds));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* PTL拣选入口空---wms请求出库任务---生成wcs本地任务
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/stockOut")
|
||||
public ResponseBase stockOut(@RequestBody WcsTask task) {
|
||||
|
||||
log.info("【获取出库请求】" + JSON.toJSONString(task));
|
||||
|
||||
ResponseBase response = new ResponseBase();
|
||||
response.setCode(0);
|
||||
response.setMessage("success");
|
||||
response.setData(JSON.toJSONString(task));
|
||||
|
||||
//todo 有无信息校验
|
||||
//查询是否已经有该作业号的任务
|
||||
LambdaQueryWrapper<WcsTask> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(WcsTask::getJobId, task.getJobId());
|
||||
Long count= wcsTaskMapper.selectCount(wrapper);
|
||||
if (count > 0) {
|
||||
response.setCode(1);
|
||||
response.setMessage("failed");
|
||||
return response;
|
||||
}
|
||||
|
||||
task.setTaskStatus(TaskStatusCode.TASK_READY);
|
||||
task.setCreateTime(LocalDateTime.now().toLocalTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
wcsTaskService.insertWcsTask(task);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.schedule.task.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 实时任务对象 wcs_task
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
@Data
|
||||
public class WcsTask
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 作业号 */
|
||||
@Excel(name = "作业号")
|
||||
private String jobId;
|
||||
|
||||
/** wcs任务号 */
|
||||
private String taskId;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
/** 源站点 */
|
||||
@Excel(name = "源站点")
|
||||
private String sourceLocation;
|
||||
|
||||
/** 目标站点 */
|
||||
@Excel(name = "目标站点")
|
||||
private String targetLocation;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/** 生成时间 */
|
||||
@Excel(name = "生成时间")
|
||||
private String createTime;
|
||||
|
||||
/** 调度时间 */
|
||||
@Excel(name = "调度时间")
|
||||
private String scheduleTime;
|
||||
|
||||
/** 设备编号 */
|
||||
@Excel(name = "设备编号")
|
||||
private String deviceId;
|
||||
|
||||
/** 库区代码 */
|
||||
@Excel(name = "库区代码")
|
||||
private String areaId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.schedule.task.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.schedule.task.domain.WcsTask;
|
||||
|
||||
/**
|
||||
* 实时任务Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
public interface WcsTaskMapper extends BaseMapper<WcsTask>
|
||||
{
|
||||
/**
|
||||
* 查询实时任务
|
||||
*
|
||||
* @param taskId 实时任务主键
|
||||
* @return 实时任务
|
||||
*/
|
||||
public WcsTask selectWcsTaskByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 查询实时任务
|
||||
*
|
||||
* @param jobId wms作业号
|
||||
* @return 实时任务
|
||||
*/
|
||||
public WcsTask selectWcsTaskByJobId(String jobId);
|
||||
|
||||
/**
|
||||
* 查询实时任务列表
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 实时任务集合
|
||||
*/
|
||||
public List<WcsTask> selectWcsTaskList(WcsTask wcsTask);
|
||||
|
||||
/**
|
||||
* 新增实时任务
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsTask(WcsTask wcsTask);
|
||||
|
||||
/**
|
||||
* 修改实时任务
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsTask(WcsTask wcsTask);
|
||||
|
||||
/**
|
||||
* 删除实时任务
|
||||
*
|
||||
* @param taskId 实时任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 批量删除实时任务
|
||||
*
|
||||
* @param taskIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskByTaskIds(String[] taskIds);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.schedule.task.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.schedule.task.domain.WcsTask;
|
||||
|
||||
/**
|
||||
* 实时任务Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
public interface IWcsTaskService
|
||||
{
|
||||
/**
|
||||
* 查询实时任务
|
||||
*
|
||||
* @param taskId 实时任务主键
|
||||
* @return 实时任务
|
||||
*/
|
||||
public WcsTask selectWcsTaskByTaskId(String taskId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询实时任务
|
||||
*
|
||||
* @param jobId wms作业号
|
||||
* @return 实时任务
|
||||
*/
|
||||
public WcsTask selectWcsTaskByJobId(String jobId);
|
||||
|
||||
/**
|
||||
* 查询实时任务列表
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 实时任务集合
|
||||
*/
|
||||
public List<WcsTask> selectWcsTaskList(WcsTask wcsTask);
|
||||
|
||||
/**
|
||||
* 新增实时任务
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsTask(WcsTask wcsTask);
|
||||
|
||||
/**
|
||||
* 修改实时任务
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsTask(WcsTask wcsTask);
|
||||
|
||||
/**
|
||||
* 批量删除实时任务
|
||||
*
|
||||
* @param taskIds 需要删除的实时任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskByTaskIds(String[] taskIds);
|
||||
|
||||
/**
|
||||
* 删除实时任务信息
|
||||
*
|
||||
* @param taskId 实时任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskByTaskId(String taskId);
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.ruoyi.schedule.task.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.schedule.task.mapper.WcsTaskMapper;
|
||||
import com.ruoyi.schedule.task.domain.WcsTask;
|
||||
import com.ruoyi.schedule.task.service.IWcsTaskService;
|
||||
|
||||
/**
|
||||
* 实时任务Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
@Service
|
||||
public class WcsTaskServiceImpl implements IWcsTaskService
|
||||
{
|
||||
@Autowired
|
||||
private WcsTaskMapper wcsTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询实时任务
|
||||
*
|
||||
* @param taskId 实时任务主键
|
||||
* @return 实时任务
|
||||
*/
|
||||
@Override
|
||||
public WcsTask selectWcsTaskByTaskId(String taskId)
|
||||
{
|
||||
return wcsTaskMapper.selectWcsTaskByTaskId(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询实时任务
|
||||
*
|
||||
* @param jobId 实时任务主键
|
||||
* @return 实时任务
|
||||
*/
|
||||
@Override
|
||||
public WcsTask selectWcsTaskByJobId(String jobId)
|
||||
{
|
||||
return wcsTaskMapper.selectWcsTaskByJobId(jobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询实时任务列表
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 实时任务
|
||||
*/
|
||||
@Override
|
||||
public List<WcsTask> selectWcsTaskList(WcsTask wcsTask)
|
||||
{
|
||||
return wcsTaskMapper.selectWcsTaskList(wcsTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增实时任务
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWcsTask(WcsTask wcsTask)
|
||||
{
|
||||
wcsTask.setCreateTime(DateUtils.getNowDate().toString());
|
||||
return wcsTaskMapper.insertWcsTask(wcsTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改实时任务
|
||||
*
|
||||
* @param wcsTask 实时任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWcsTask(WcsTask wcsTask)
|
||||
{
|
||||
return wcsTaskMapper.updateWcsTask(wcsTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除实时任务
|
||||
*
|
||||
* @param taskIds 需要删除的实时任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsTaskByTaskIds(String[] taskIds)
|
||||
{
|
||||
return wcsTaskMapper.deleteWcsTaskByTaskIds(taskIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除实时任务信息
|
||||
*
|
||||
* @param taskId 实时任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsTaskByTaskId(String taskId)
|
||||
{
|
||||
return wcsTaskMapper.deleteWcsTaskByTaskId(taskId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.schedule.taskHistory.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.schedule.taskHistory.domain.WcsTaskHistory;
|
||||
import com.ruoyi.schedule.taskHistory.service.IWcsTaskHistoryService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 任务历史记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/schedule/history")
|
||||
public class WcsTaskHistoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsTaskHistoryService wcsTaskHistoryService;
|
||||
|
||||
/**
|
||||
* 查询任务历史记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:history:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
startPage();
|
||||
List<WcsTaskHistory> list = wcsTaskHistoryService.selectWcsTaskHistoryList(wcsTaskHistory);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出任务历史记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:history:export')")
|
||||
@Log(title = "任务历史记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
List<WcsTaskHistory> list = wcsTaskHistoryService.selectWcsTaskHistoryList(wcsTaskHistory);
|
||||
ExcelUtil<WcsTaskHistory> util = new ExcelUtil<WcsTaskHistory>(WcsTaskHistory.class);
|
||||
util.exportExcel(response, list, "任务历史记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务历史记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:history:query')")
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable("taskId") String taskId)
|
||||
{
|
||||
return success(wcsTaskHistoryService.selectWcsTaskHistoryByTaskId(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务历史记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:history:add')")
|
||||
@Log(title = "任务历史记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
return toAjax(wcsTaskHistoryService.insertWcsTaskHistory(wcsTaskHistory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务历史记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:history:edit')")
|
||||
@Log(title = "任务历史记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
return toAjax(wcsTaskHistoryService.updateWcsTaskHistory(wcsTaskHistory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务历史记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('schedule:history:remove')")
|
||||
@Log(title = "任务历史记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskIds}")
|
||||
public AjaxResult remove(@PathVariable String[] taskIds)
|
||||
{
|
||||
return toAjax(wcsTaskHistoryService.deleteWcsTaskHistoryByTaskIds(taskIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.schedule.taskHistory.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 任务历史记录对象 wcs_task_history
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
@Data
|
||||
public class WcsTaskHistory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 作业号 */
|
||||
@Excel(name = "作业号")
|
||||
private String jobId;
|
||||
|
||||
/** wcs任务号 */
|
||||
@Excel(name = "wcs任务号")
|
||||
private String taskId;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
/** 源站点 */
|
||||
@Excel(name = "源站点")
|
||||
private String sourceLocation;
|
||||
|
||||
/** 目标站点 */
|
||||
@Excel(name = "目标站点")
|
||||
private String targetLocation;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/** 调度时间 */
|
||||
@Excel(name = "调度时间")
|
||||
private String scheduleTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@Excel(name = "结束时间")
|
||||
private String finishTime;
|
||||
|
||||
/** 设备编号 */
|
||||
@Excel(name = "设备编号")
|
||||
private String deviceId;
|
||||
|
||||
/** 库区代码 */
|
||||
@Excel(name = "库区代码")
|
||||
private String areaId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.schedule.taskHistory.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.schedule.taskHistory.domain.WcsTaskHistory;
|
||||
|
||||
/**
|
||||
* 任务历史记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
public interface WcsTaskHistoryMapper
|
||||
{
|
||||
/**
|
||||
* 查询任务历史记录
|
||||
*
|
||||
* @param taskId 任务历史记录主键
|
||||
* @return 任务历史记录
|
||||
*/
|
||||
public WcsTaskHistory selectWcsTaskHistoryByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 查询任务历史记录列表
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 任务历史记录集合
|
||||
*/
|
||||
public List<WcsTaskHistory> selectWcsTaskHistoryList(WcsTaskHistory wcsTaskHistory);
|
||||
|
||||
/**
|
||||
* 新增任务历史记录
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsTaskHistory(WcsTaskHistory wcsTaskHistory);
|
||||
|
||||
/**
|
||||
* 修改任务历史记录
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsTaskHistory(WcsTaskHistory wcsTaskHistory);
|
||||
|
||||
/**
|
||||
* 删除任务历史记录
|
||||
*
|
||||
* @param taskId 任务历史记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskHistoryByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 批量删除任务历史记录
|
||||
*
|
||||
* @param taskIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskHistoryByTaskIds(String[] taskIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.schedule.taskHistory.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.schedule.taskHistory.domain.WcsTaskHistory;
|
||||
|
||||
/**
|
||||
* 任务历史记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
public interface IWcsTaskHistoryService
|
||||
{
|
||||
/**
|
||||
* 查询任务历史记录
|
||||
*
|
||||
* @param taskId 任务历史记录主键
|
||||
* @return 任务历史记录
|
||||
*/
|
||||
public WcsTaskHistory selectWcsTaskHistoryByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 查询任务历史记录列表
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 任务历史记录集合
|
||||
*/
|
||||
public List<WcsTaskHistory> selectWcsTaskHistoryList(WcsTaskHistory wcsTaskHistory);
|
||||
|
||||
/**
|
||||
* 新增任务历史记录
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsTaskHistory(WcsTaskHistory wcsTaskHistory);
|
||||
|
||||
/**
|
||||
* 修改任务历史记录
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsTaskHistory(WcsTaskHistory wcsTaskHistory);
|
||||
|
||||
/**
|
||||
* 批量删除任务历史记录
|
||||
*
|
||||
* @param taskIds 需要删除的任务历史记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskHistoryByTaskIds(String[] taskIds);
|
||||
|
||||
/**
|
||||
* 删除任务历史记录信息
|
||||
*
|
||||
* @param taskId 任务历史记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsTaskHistoryByTaskId(String taskId);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.schedule.taskHistory.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.schedule.taskHistory.mapper.WcsTaskHistoryMapper;
|
||||
import com.ruoyi.schedule.taskHistory.domain.WcsTaskHistory;
|
||||
import com.ruoyi.schedule.taskHistory.service.IWcsTaskHistoryService;
|
||||
|
||||
/**
|
||||
* 任务历史记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
@Service
|
||||
public class WcsTaskHistoryServiceImpl implements IWcsTaskHistoryService
|
||||
{
|
||||
@Autowired
|
||||
private WcsTaskHistoryMapper wcsTaskHistoryMapper;
|
||||
|
||||
/**
|
||||
* 查询任务历史记录
|
||||
*
|
||||
* @param taskId 任务历史记录主键
|
||||
* @return 任务历史记录
|
||||
*/
|
||||
@Override
|
||||
public WcsTaskHistory selectWcsTaskHistoryByTaskId(String taskId)
|
||||
{
|
||||
return wcsTaskHistoryMapper.selectWcsTaskHistoryByTaskId(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务历史记录列表
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 任务历史记录
|
||||
*/
|
||||
@Override
|
||||
public List<WcsTaskHistory> selectWcsTaskHistoryList(WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
return wcsTaskHistoryMapper.selectWcsTaskHistoryList(wcsTaskHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务历史记录
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWcsTaskHistory(WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
wcsTaskHistory.setCreateTime(DateUtils.getNowDate());
|
||||
return wcsTaskHistoryMapper.insertWcsTaskHistory(wcsTaskHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务历史记录
|
||||
*
|
||||
* @param wcsTaskHistory 任务历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWcsTaskHistory(WcsTaskHistory wcsTaskHistory)
|
||||
{
|
||||
return wcsTaskHistoryMapper.updateWcsTaskHistory(wcsTaskHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除任务历史记录
|
||||
*
|
||||
* @param taskIds 需要删除的任务历史记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsTaskHistoryByTaskIds(String[] taskIds)
|
||||
{
|
||||
return wcsTaskHistoryMapper.deleteWcsTaskHistoryByTaskIds(taskIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务历史记录信息
|
||||
*
|
||||
* @param taskId 任务历史记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsTaskHistoryByTaskId(String taskId)
|
||||
{
|
||||
return wcsTaskHistoryMapper.deleteWcsTaskHistoryByTaskId(taskId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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="com.ruoyi.schedule.taskHistory.mapper.WcsTaskHistoryMapper">
|
||||
|
||||
<resultMap type="WcsTaskHistory" id="WcsTaskHistoryResult">
|
||||
<result property="jobId" column="job_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="sourceLocation" column="source_location" />
|
||||
<result property="targetLocation" column="target_location" />
|
||||
<result property="taskStatus" column="task_status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="scheduleTime" column="schedule_time" />
|
||||
<result property="finishTime" column="finish_time" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="areaId" column="area_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWcsTaskHistoryVo">
|
||||
select job_id, task_id, task_type, source_location, target_location, task_status, create_time, schedule_time, finish_time, device_id, area_id from wcs_task_history
|
||||
</sql>
|
||||
|
||||
<select id="selectWcsTaskHistoryList" parameterType="WcsTaskHistory" resultMap="WcsTaskHistoryResult">
|
||||
<include refid="selectWcsTaskHistoryVo"/>
|
||||
<where>
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="sourceLocation != null and sourceLocation != ''"> and source_location = #{sourceLocation}</if>
|
||||
<if test="targetLocation != null and targetLocation != ''"> and target_location = #{targetLocation}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
|
||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWcsTaskHistoryByTaskId" parameterType="String" resultMap="WcsTaskHistoryResult">
|
||||
<include refid="selectWcsTaskHistoryVo"/>
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWcsTaskHistory" parameterType="WcsTaskHistory">
|
||||
insert into wcs_task_history
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">job_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="sourceLocation != null">source_location,</if>
|
||||
<if test="targetLocation != null">target_location,</if>
|
||||
<if test="taskStatus != null">task_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="scheduleTime != null">schedule_time,</if>
|
||||
<if test="finishTime != null">finish_time,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="sourceLocation != null">#{sourceLocation},</if>
|
||||
<if test="targetLocation != null">#{targetLocation},</if>
|
||||
<if test="taskStatus != null">#{taskStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="scheduleTime != null">#{scheduleTime},</if>
|
||||
<if test="finishTime != null">#{finishTime},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWcsTaskHistory" parameterType="WcsTaskHistory">
|
||||
update wcs_task_history
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="jobId != null">job_id = #{jobId},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="sourceLocation != null">source_location = #{sourceLocation},</if>
|
||||
<if test="targetLocation != null">target_location = #{targetLocation},</if>
|
||||
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="scheduleTime != null">schedule_time = #{scheduleTime},</if>
|
||||
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
</trim>
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWcsTaskHistoryByTaskId" parameterType="String">
|
||||
delete from wcs_task_history where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWcsTaskHistoryByTaskIds" parameterType="String">
|
||||
delete from wcs_task_history where task_id in
|
||||
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
100
ruoyi-admin/src/main/resources/mapper/schedule/WcsTaskMapper.xml
Normal file
100
ruoyi-admin/src/main/resources/mapper/schedule/WcsTaskMapper.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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="com.ruoyi.schedule.task.mapper.WcsTaskMapper">
|
||||
|
||||
<resultMap type="WcsTask" id="WcsTaskResult">
|
||||
<result property="jobId" column="job_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="sourceLocation" column="source_location" />
|
||||
<result property="targetLocation" column="target_location" />
|
||||
<result property="taskStatus" column="task_status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="scheduleTime" column="schedule_time" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="areaId" column="area_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWcsTaskVo">
|
||||
select job_id, task_id, task_type, source_location, target_location, task_status, create_time, schedule_time, device_id, area_id from wcs_task
|
||||
</sql>
|
||||
|
||||
<select id="selectWcsTaskList" parameterType="WcsTask" resultMap="WcsTaskResult">
|
||||
<include refid="selectWcsTaskVo"/>
|
||||
<where>
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="sourceLocation != null and sourceLocation != ''"> and source_location = #{sourceLocation}</if>
|
||||
<if test="targetLocation != null and targetLocation != ''"> and target_location = #{targetLocation}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</if>
|
||||
<if test="scheduleTime != null and scheduleTime != ''"> and schedule_time = #{scheduleTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWcsTaskByTaskId" parameterType="String" resultMap="WcsTaskResult">
|
||||
<include refid="selectWcsTaskVo"/>
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="selectWcsTaskByJobId" parameterType="String" resultMap="WcsTaskResult">
|
||||
<include refid="selectWcsTaskVo"/>
|
||||
where job_id = #{jobId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWcsTask" parameterType="WcsTask">
|
||||
insert into wcs_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">job_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="sourceLocation != null">source_location,</if>
|
||||
<if test="targetLocation != null">target_location,</if>
|
||||
<if test="taskStatus != null">task_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="scheduleTime != null">schedule_time,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="sourceLocation != null">#{sourceLocation},</if>
|
||||
<if test="targetLocation != null">#{targetLocation},</if>
|
||||
<if test="taskStatus != null">#{taskStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="scheduleTime != null">#{scheduleTime},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWcsTask" parameterType="WcsTask">
|
||||
update wcs_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="jobId != null">job_id = #{jobId},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="sourceLocation != null">source_location = #{sourceLocation},</if>
|
||||
<if test="targetLocation != null">target_location = #{targetLocation},</if>
|
||||
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="scheduleTime != null">schedule_time = #{scheduleTime},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
</trim>
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWcsTaskByTaskId" parameterType="String">
|
||||
delete from wcs_task where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWcsTaskByTaskIds" parameterType="String">
|
||||
delete from wcs_task where task_id in
|
||||
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user