料架搬运任务处理
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.api.domain.RequestEnter;
|
||||||
import com.ruoyi.api.domain.WmsJobRequest;
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
import com.ruoyi.api.service.IToWmsService;
|
import com.ruoyi.api.service.IToWmsService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
|
||||||
import com.ruoyi.log.domain.RequestLog;
|
import com.ruoyi.log.domain.RequestLog;
|
||||||
import com.ruoyi.log.service.IRequestLogService;
|
import com.ruoyi.log.service.IRequestLogService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业统计 Controller
|
* 作业统计 Controller
|
||||||
@@ -32,9 +32,9 @@ public class ToWmsApiController {
|
|||||||
* 入库任务请求
|
* 入库任务请求
|
||||||
*/
|
*/
|
||||||
@PostMapping("/requestEnterByTrayCode")
|
@PostMapping("/requestEnterByTrayCode")
|
||||||
public AjaxResult requestEnterByTrayCode(@RequestBody MydoJob mydoJob) {
|
public AjaxResult requestEnterByTrayCode(@RequestBody RequestEnter requestEnter) {
|
||||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(mydoJob);
|
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(requestEnter);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "InJobByTrayCode",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "InJobByTrayCode",ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -42,20 +42,20 @@ public class ToWmsApiController {
|
|||||||
* 入库任务请求
|
* 入库任务请求
|
||||||
*/
|
*/
|
||||||
@PostMapping("/requestEnterByEnterId")
|
@PostMapping("/requestEnterByEnterId")
|
||||||
public AjaxResult requestEnterByEnterId(@RequestBody MydoJob mydoJob) {
|
public AjaxResult requestEnterByEnterId(@RequestBody RequestEnter requestEnter) {
|
||||||
AjaxResult ajaxResult = toWmsService.requestEnterByEnterId(mydoJob);
|
AjaxResult ajaxResult = toWmsService.requestEnterByEnterId(requestEnter);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "InJobByEnterId",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "InJobByEnterId",ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收开始信号
|
* 小车接收开始信号
|
||||||
*/
|
*/
|
||||||
@PostMapping("/startSignal")
|
@PostMapping("/startSignal")
|
||||||
public AjaxResult startSignal(@RequestBody MydoJob mydoJob) {
|
public AjaxResult startSignal(@RequestBody RequestEnter requestEnter) {
|
||||||
AjaxResult ajaxResult = toWmsService.startSignal(mydoJob);
|
AjaxResult ajaxResult = toWmsService.startSignal(requestEnter);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "startSignal",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "startSignal",ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -101,18 +101,6 @@ public class ToWmsApiController {
|
|||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取任务
|
|
||||||
* @param mydoJob
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/getJob")
|
|
||||||
public AjaxResult getJob(@RequestBody MydoJob mydoJob) {
|
|
||||||
AjaxResult ajaxResult = toWmsService.getJob(mydoJob);
|
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "getJob",ajaxResult);
|
|
||||||
requestLogService.insertRequestLog(requestLog);
|
|
||||||
return ajaxResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ctu取完箱子反馈
|
* ctu取完箱子反馈
|
||||||
@@ -121,7 +109,6 @@ public class ToWmsApiController {
|
|||||||
* }
|
* }
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@PostMapping("/takeCompleted")
|
@PostMapping("/takeCompleted")
|
||||||
public AjaxResult takeCompleted(@RequestBody Map<String, Object> map) {
|
public AjaxResult takeCompleted(@RequestBody Map<String, Object> map) {
|
||||||
AjaxResult ajaxResult = toWmsService.takeCompleted(map);
|
AjaxResult ajaxResult = toWmsService.takeCompleted(map);
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.api.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class RequestEnter {
|
||||||
|
private String entranceId;
|
||||||
|
private String trayCode;
|
||||||
|
private String taskNo;
|
||||||
|
private String wmsType;
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.api.service;
|
package com.ruoyi.api.service;
|
||||||
|
|
||||||
|
import com.ruoyi.api.domain.RequestEnter;
|
||||||
import com.ruoyi.api.domain.WmsJobRequest;
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
@@ -10,19 +11,44 @@ import java.util.Map;
|
|||||||
* 作业统计 Service 接口
|
* 作业统计 Service 接口
|
||||||
*/
|
*/
|
||||||
public interface IToWmsService {
|
public interface IToWmsService {
|
||||||
|
/**
|
||||||
AjaxResult requestEnterByTrayCode(MydoJob mydoJob);
|
* 入库任务请求根据托盘码
|
||||||
AjaxResult requestEnterByEnterId(MydoJob mydoJob);
|
*/
|
||||||
|
AjaxResult requestEnterByTrayCode(RequestEnter requestEnter);
|
||||||
|
/**
|
||||||
|
* 入库任务请求
|
||||||
|
*/
|
||||||
|
AjaxResult requestEnterByEnterId(RequestEnter requestEnter);
|
||||||
|
/**
|
||||||
|
* 入库、出库 任务完成回传
|
||||||
|
* Map<String, String>
|
||||||
|
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
|
||||||
|
* taskNo:出库 入库任务号
|
||||||
|
* trayCode:托盘码
|
||||||
|
* positionCode1:起点
|
||||||
|
* positionCode2:终点
|
||||||
|
* containerCode:容器编码
|
||||||
|
*
|
||||||
|
*/
|
||||||
AjaxResult jobFinish(WmsJobRequest wmsJobRequest);
|
AjaxResult jobFinish(WmsJobRequest wmsJobRequest);
|
||||||
|
/**
|
||||||
|
* 放货有货,重新分配货位
|
||||||
|
*/
|
||||||
AjaxResult reAssign(MydoJob mydoJob);
|
AjaxResult reAssign(MydoJob mydoJob);
|
||||||
|
/**
|
||||||
|
* 取货无货,重新分配物料
|
||||||
|
*/
|
||||||
AjaxResult reMaterial(MydoJob mydoJob);
|
AjaxResult reMaterial(MydoJob mydoJob);
|
||||||
|
/**
|
||||||
AjaxResult getJob(MydoJob mydoJob);
|
* 小车接收开始信号
|
||||||
|
*/
|
||||||
AjaxResult startSignal(MydoJob mydoJob);
|
AjaxResult startSignal(RequestEnter requestEnter);
|
||||||
|
/**
|
||||||
|
* ctu取完箱子反馈
|
||||||
|
* @param map{
|
||||||
|
* "lljCode"
|
||||||
|
* }
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
AjaxResult takeCompleted(Map<String, Object> map);
|
AjaxResult takeCompleted(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.ruoyi.api.service.impl;
|
package com.ruoyi.api.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.api.domain.RequestEnter;
|
||||||
import com.ruoyi.api.domain.WmsJobRequest;
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
import com.ruoyi.api.service.IToWmsService;
|
import com.ruoyi.api.service.IToWmsService;
|
||||||
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||||
@@ -14,6 +16,8 @@ import com.ruoyi.bas.tag.service.IBasTagService;
|
|||||||
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.MessageUtils;
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
|
import com.ruoyi.device.agv.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||||
@@ -27,6 +31,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -55,13 +60,15 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
private IOutStockoutDetailService outStockoutDetailService;
|
private IOutStockoutDetailService outStockoutDetailService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOutStockoutService outStockoutService;
|
private IOutStockoutService outStockoutService;
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult requestEnterByTrayCode(MydoJob param) {
|
public AjaxResult requestEnterByTrayCode(RequestEnter requestEnter) {
|
||||||
MydoJob mydoJobParam = new MydoJob();
|
MydoJob mydoJobParam = new MydoJob();
|
||||||
mydoJobParam.setTrayCode(param.getTrayCode());
|
mydoJobParam.setTrayCode(requestEnter.getTrayCode());
|
||||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||||
if(mydoJobs.isEmpty()){
|
if(mydoJobs.isEmpty()){
|
||||||
return AjaxResult.warn(MessageUtils.message("warn.message"));
|
return AjaxResult.warn(MessageUtils.message("warn.message"));
|
||||||
@@ -69,7 +76,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
MydoJob mydoJob = mydoJobs.get(0);
|
MydoJob mydoJob = mydoJobs.get(0);
|
||||||
if ("1".equals(mydoJob.getExecutionPhase())){
|
if ("1".equals(mydoJob.getExecutionPhase())){
|
||||||
mydoJob.setExecutionPhase("2");
|
mydoJob.setExecutionPhase("2");
|
||||||
mydoJob.setEntranceId(param.getEntranceId());
|
mydoJob.setEntranceId(requestEnter.getEntranceId());
|
||||||
mydoJob.setStatus("2");
|
mydoJob.setStatus("2");
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
}
|
}
|
||||||
@@ -77,9 +84,9 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult requestEnterByEnterId(MydoJob param) {
|
public AjaxResult requestEnterByEnterId(RequestEnter requestEnter) {
|
||||||
MydoJob mydoJobParam = new MydoJob();
|
MydoJob mydoJobParam = new MydoJob();
|
||||||
mydoJobParam.setEntranceId(param.getEntranceId());
|
mydoJobParam.setEntranceId(requestEnter.getEntranceId());
|
||||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||||
if(mydoJobs.isEmpty()){
|
if(mydoJobs.isEmpty()){
|
||||||
return AjaxResult.warn(MessageUtils.message("warn.message"));
|
return AjaxResult.warn(MessageUtils.message("warn.message"));
|
||||||
@@ -88,7 +95,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
for (MydoJob mydoJob : mydoJobs) {
|
for (MydoJob mydoJob : mydoJobs) {
|
||||||
if ("1".equals(mydoJob.getExecutionPhase())){
|
if ("1".equals(mydoJob.getExecutionPhase())){
|
||||||
mydoJob.setExecutionPhase("2");
|
mydoJob.setExecutionPhase("2");
|
||||||
mydoJob.setTrayCode(param.getTrayCode());
|
mydoJob.setTrayCode(requestEnter.getTrayCode());
|
||||||
mydoJob.setStatus("2");
|
mydoJob.setStatus("2");
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
}
|
}
|
||||||
@@ -188,6 +195,20 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
BasContainer basContainer = basContainers.get(0);
|
BasContainer basContainer = basContainers.get(0);
|
||||||
basContainer.setPortName(wmsJobRequest.getPositionCode2());
|
basContainer.setPortName(wmsJobRequest.getPositionCode2());
|
||||||
basContainerService.updateBasContainer(basContainer);
|
basContainerService.updateBasContainer(basContainer);
|
||||||
|
|
||||||
|
//删除agv任务
|
||||||
|
AgvContainerTask agvContainerTaskParam = new AgvContainerTask();
|
||||||
|
agvContainerTaskParam.setContainer(basContainer.getContainerId());
|
||||||
|
List<AgvContainerTask> agvContainerTasks = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTaskParam);
|
||||||
|
if (CollUtil.isNotEmpty(agvContainerTasks)){
|
||||||
|
for (AgvContainerTask agvContainerTask : agvContainerTasks) {
|
||||||
|
agvContainerTask.setStatus("3");
|
||||||
|
agvContainerTask.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||||
|
agvContainerTaskService.updateAgvContainerTask(agvContainerTask);
|
||||||
|
agvContainerTaskService.insertHistory(agvContainerTask.getId());
|
||||||
|
agvContainerTaskService.deleteAgvContainerTaskById(agvContainerTask.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log.error("作业类型错误");
|
log.error("作业类型错误");
|
||||||
@@ -227,33 +248,51 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
return outStockoutService.autoAllot(stockOutId);
|
return outStockoutService.autoAllot(stockOutId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小车接收开始信号
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getJob(MydoJob mydoJob) {
|
public AjaxResult startSignal(RequestEnter requestEnter) {
|
||||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJob);
|
switch (requestEnter.getWmsType()){
|
||||||
if (mydoJobs.isEmpty()){
|
case "1":
|
||||||
return AjaxResult.error();
|
case "2":
|
||||||
}else {
|
|
||||||
return AjaxResult.success(mydoJobs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AjaxResult startSignal(MydoJob mydoJob) {
|
|
||||||
MydoJob mydoJobParam = new MydoJob();
|
MydoJob mydoJobParam = new MydoJob();
|
||||||
mydoJobParam.setTaskNo(mydoJob.getTaskNo());
|
mydoJobParam.setTaskNo(requestEnter.getTaskNo());
|
||||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||||
if (mydoJobs.isEmpty()){
|
if (mydoJobs.isEmpty()){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}else {
|
}
|
||||||
for (MydoJob mydoJob1 : mydoJobs) {
|
for (MydoJob mydoJob1 : mydoJobs) {
|
||||||
mydoJob1.setStatus("3");
|
mydoJob1.setStatus("3");
|
||||||
mydoJob1.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
mydoJob1.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
mydoJobService.updateMydoJob(mydoJob1);
|
mydoJobService.updateMydoJob(mydoJob1);
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
case "3":
|
||||||
|
AgvContainerTask agvContainerTaskParam = new AgvContainerTask();
|
||||||
|
agvContainerTaskParam.setTaskNo(requestEnter.getTaskNo());
|
||||||
|
List<AgvContainerTask> agvContainerTasks = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTaskParam);
|
||||||
|
if (CollUtil.isEmpty(agvContainerTasks)){
|
||||||
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
for (AgvContainerTask agvContainerTask : agvContainerTasks) {
|
||||||
|
agvContainerTask.setStatus("2");
|
||||||
|
agvContainerTask.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
|
agvContainerTaskService.updateAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
default:
|
||||||
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* ctu取完箱子反馈
|
||||||
|
* @param map{
|
||||||
|
* "lljCode"
|
||||||
|
* }
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult takeCompleted(Map<String, Object> map) {
|
public AjaxResult takeCompleted(Map<String, Object> map) {
|
||||||
String lljCode = Convert.toStr(map.get("lljCode"));
|
String lljCode = Convert.toStr(map.get("lljCode"));
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.device.agv.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.device.agv.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-08-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/agv/task")
|
||||||
|
public class AgvContainerTaskController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('agv:task:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AgvContainerTask> list = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出agv料架搬运任务列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('agv:task:export')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
List<AgvContainerTask> list = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
ExcelUtil<AgvContainerTask> util = new ExcelUtil<AgvContainerTask>(AgvContainerTask.class);
|
||||||
|
util.exportExcel(response, list, "agv料架搬运任务数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取agv料架搬运任务详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('agv:task:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(agvContainerTaskService.selectAgvContainerTaskById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('agv:task:add')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.insertAgvContainerTask(agvContainerTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('agv:task:edit')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.updateAgvContainerTask(agvContainerTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('agv:task:remove')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.deleteAgvContainerTaskByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package com.ruoyi.device.agv.domain;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务对象 agv_container_task
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-08-08
|
||||||
|
*/
|
||||||
|
public class AgvContainerTask extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 容器编码 */
|
||||||
|
@Excel(name = "容器编码")
|
||||||
|
private String container;
|
||||||
|
|
||||||
|
/** 起点 */
|
||||||
|
@Excel(name = "起点")
|
||||||
|
private String startPoint;
|
||||||
|
|
||||||
|
/** 终点 */
|
||||||
|
@Excel(name = "终点")
|
||||||
|
private String endPoint;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
@Excel(name = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@Excel(name = "结束时间")
|
||||||
|
private String finishTime;
|
||||||
|
|
||||||
|
/** 任务号 */
|
||||||
|
@Excel(name = "任务号")
|
||||||
|
private String taskNo;
|
||||||
|
|
||||||
|
/** 任务状态 0-创建 1-执行中 2-完成 */
|
||||||
|
@Excel(name = "任务状态 0-创建 1-执行中 2-完成")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** */
|
||||||
|
@Excel(name = "")
|
||||||
|
private String spare1;
|
||||||
|
|
||||||
|
/** */
|
||||||
|
@Excel(name = "")
|
||||||
|
private String spare2;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContainer(String container)
|
||||||
|
{
|
||||||
|
this.container = container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContainer()
|
||||||
|
{
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartPoint(String startPoint)
|
||||||
|
{
|
||||||
|
this.startPoint = startPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartPoint()
|
||||||
|
{
|
||||||
|
return startPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndPoint(String endPoint)
|
||||||
|
{
|
||||||
|
this.endPoint = endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndPoint()
|
||||||
|
{
|
||||||
|
return endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime)
|
||||||
|
{
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime()
|
||||||
|
{
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishTime(String finishTime)
|
||||||
|
{
|
||||||
|
this.finishTime = finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFinishTime()
|
||||||
|
{
|
||||||
|
return finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskNo(String taskNo)
|
||||||
|
{
|
||||||
|
this.taskNo = taskNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskNo()
|
||||||
|
{
|
||||||
|
return taskNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare1(String spare1)
|
||||||
|
{
|
||||||
|
this.spare1 = spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare1()
|
||||||
|
{
|
||||||
|
return spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare2(String spare2)
|
||||||
|
{
|
||||||
|
this.spare2 = spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare2()
|
||||||
|
{
|
||||||
|
return spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("container", getContainer())
|
||||||
|
.append("startPoint", getStartPoint())
|
||||||
|
.append("endPoint", getEndPoint())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("startTime", getStartTime())
|
||||||
|
.append("finishTime", getFinishTime())
|
||||||
|
.append("taskNo", getTaskNo())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("spare1", getSpare1())
|
||||||
|
.append("spare2", getSpare2())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.device.agv.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.device.agv.domain.AgvContainerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-08-08
|
||||||
|
*/
|
||||||
|
public interface AgvContainerTaskMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务集合
|
||||||
|
*/
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids);
|
||||||
|
|
||||||
|
void insertHistory(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.device.agv.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.device.agv.domain.AgvContainerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-08-08
|
||||||
|
*/
|
||||||
|
public interface IAgvContainerTaskService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务集合
|
||||||
|
*/
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的agv料架搬运任务主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务信息
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
void insertHistory(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.ruoyi.device.agv.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.device.agv.mapper.AgvContainerTaskMapper;
|
||||||
|
import com.ruoyi.device.agv.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-08-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AgvContainerTaskServiceImpl implements IAgvContainerTaskService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private AgvContainerTaskMapper agvContainerTaskMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.selectAgvContainerTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
agvContainerTask.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return agvContainerTaskMapper.insertAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.updateAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.deleteAgvContainerTaskByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务信息
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAgvContainerTaskById(Long id)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.deleteAgvContainerTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertHistory(Long id) {
|
||||||
|
agvContainerTaskMapper.insertHistory(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# 设备管理目录说明
|
|
||||||
|
|
||||||
## 目录用途
|
|
||||||
存放设备管理相关的代码和配置文件
|
|
||||||
|
|
||||||
## 主要功能
|
|
||||||
- 管理仓库内各类设备信息
|
|
||||||
- 处理设备状态监控
|
|
||||||
- 设备维护和保养记录
|
|
||||||
- 设备故障诊断和处理
|
|
||||||
|
|
||||||
## 目录结构
|
|
||||||
```
|
|
||||||
device/
|
|
||||||
├── config/ # 设备配置文件
|
|
||||||
├── controller/ # 设备控制器
|
|
||||||
├── model/ # 设备数据模型
|
|
||||||
├── service/ # 设备业务逻辑
|
|
||||||
└── utils/ # 设备相关工具类
|
|
||||||
```
|
|
||||||
@@ -2,6 +2,7 @@ package com.ruoyi.pda.service;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
@@ -24,6 +25,8 @@ import com.ruoyi.check.commit.domain.CheckCommitRecord;
|
|||||||
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
|
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.MessageUtils;
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
|
import com.ruoyi.device.agv.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||||
@@ -106,6 +109,8 @@ public class PdaServiceImp implements PdaService {
|
|||||||
private IBasContainerService basContainerService;
|
private IBasContainerService basContainerService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IToWcsService iToWcsService;
|
private IToWcsService iToWcsService;
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 空托盘入库
|
* 空托盘入库
|
||||||
@@ -400,7 +405,6 @@ public class PdaServiceImp implements PdaService {
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||||
map.put("v_type", "1");
|
map.put("v_type", "1");
|
||||||
@@ -468,6 +472,7 @@ public class PdaServiceImp implements PdaService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改电子标签数量
|
* 修改电子标签数量
|
||||||
|
*
|
||||||
* @param mydoJobDetail
|
* @param mydoJobDetail
|
||||||
* @param basWarehouse
|
* @param basWarehouse
|
||||||
*/
|
*/
|
||||||
@@ -627,19 +632,31 @@ public class PdaServiceImp implements PdaService {
|
|||||||
String startPoint = basContainer1.getPortName();
|
String startPoint = basContainer1.getPortName();
|
||||||
//todo 调用agv搬运接口
|
//todo 调用agv搬运接口
|
||||||
//使用HttpUtil post请求,参数为startPoint,endPoint,和containerCode
|
//使用HttpUtil post请求,参数为startPoint,endPoint,和containerCode
|
||||||
String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", "startPoint=" + startPoint + "&endPoint=" + endPoint + "&containerCode=" + basContainer.getContainerId());
|
String taskNo = IdUtil.fastSimpleUUID();
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("startPoint", startPoint);
|
||||||
|
map.put("endPoint", startPoint);
|
||||||
|
map.put("wmsTrayCode", basContainer1.getContainerId());
|
||||||
|
map.put("taskNo", taskNo);
|
||||||
|
String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", JSONUtil.toJsonStr( map));
|
||||||
//接口的返回结果为AjaxResult,从result中获取code
|
//接口的返回结果为AjaxResult,从result中获取code
|
||||||
|
|
||||||
//获取code
|
//获取code
|
||||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
|
AgvContainerTask agvContainerTask = new AgvContainerTask();
|
||||||
|
agvContainerTask.setContainer(basContainer.getContainerId());
|
||||||
|
agvContainerTask.setStartPoint(startPoint);
|
||||||
|
agvContainerTask.setEndPoint(endPoint);
|
||||||
|
agvContainerTask.setStatus("0");
|
||||||
|
agvContainerTask.setTaskNo(taskNo);
|
||||||
|
agvContainerTask.setCreateTime(new Date());
|
||||||
|
agvContainerTaskService.insertAgvContainerTask(agvContainerTask);
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<?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.device.agv.mapper.AgvContainerTaskMapper">
|
||||||
|
|
||||||
|
<resultMap type="AgvContainerTask" id="AgvContainerTaskResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="container" column="container" />
|
||||||
|
<result property="startPoint" column="start_point" />
|
||||||
|
<result property="endPoint" column="end_point" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="finishTime" column="finish_time" />
|
||||||
|
<result property="taskNo" column="task_no" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="spare1" column="spare1" />
|
||||||
|
<result property="spare2" column="spare2" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectAgvContainerTaskVo">
|
||||||
|
select id, container, start_point, end_point, create_time, start_time, finish_time, task_no, status, spare1, spare2 from agv_container_task
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerTaskList" parameterType="AgvContainerTask" resultMap="AgvContainerTaskResult">
|
||||||
|
<include refid="selectAgvContainerTaskVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="container != null and container != ''"> and container = #{container}</if>
|
||||||
|
<if test="startPoint != null and startPoint != ''"> and start_point = #{startPoint}</if>
|
||||||
|
<if test="endPoint != null and endPoint != ''"> and end_point = #{endPoint}</if>
|
||||||
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||||
|
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||||
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||||
|
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerTaskById" parameterType="Long" resultMap="AgvContainerTaskResult">
|
||||||
|
<include refid="selectAgvContainerTaskVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAgvContainerTask" parameterType="AgvContainerTask" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into agv_container_task
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="container != null">container,</if>
|
||||||
|
<if test="startPoint != null">start_point,</if>
|
||||||
|
<if test="endPoint != null">end_point,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="startTime != null">start_time,</if>
|
||||||
|
<if test="finishTime != null">finish_time,</if>
|
||||||
|
<if test="taskNo != null">task_no,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="spare1 != null">spare1,</if>
|
||||||
|
<if test="spare2 != null">spare2,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="container != null">#{container},</if>
|
||||||
|
<if test="startPoint != null">#{startPoint},</if>
|
||||||
|
<if test="endPoint != null">#{endPoint},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="startTime != null">#{startTime},</if>
|
||||||
|
<if test="finishTime != null">#{finishTime},</if>
|
||||||
|
<if test="taskNo != null">#{taskNo},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="spare1 != null">#{spare1},</if>
|
||||||
|
<if test="spare2 != null">#{spare2},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<insert id="insertHistory">
|
||||||
|
insert into agv_container_task_finish
|
||||||
|
select * from agv_container_task where id = #{id}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateAgvContainerTask" parameterType="AgvContainerTask">
|
||||||
|
update agv_container_task
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="container != null">container = #{container},</if>
|
||||||
|
<if test="startPoint != null">start_point = #{startPoint},</if>
|
||||||
|
<if test="endPoint != null">end_point = #{endPoint},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="startTime != null">start_time = #{startTime},</if>
|
||||||
|
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
||||||
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||||
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteAgvContainerTaskById" parameterType="Long">
|
||||||
|
delete from agv_container_task where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAgvContainerTaskByIds" parameterType="String">
|
||||||
|
delete from agv_container_task where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user