料架搬运任务处理
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WmsJobRequest;
|
||||
import com.ruoyi.api.service.IToWmsService;
|
||||
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.service.IMydoJobService;
|
||||
import com.ruoyi.log.domain.RequestLog;
|
||||
import com.ruoyi.log.service.IRequestLogService;
|
||||
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.Objects;
|
||||
|
||||
/**
|
||||
* 作业统计 Controller
|
||||
@@ -32,9 +32,9 @@ public class ToWmsApiController {
|
||||
* 入库任务请求
|
||||
*/
|
||||
@PostMapping("/requestEnterByTrayCode")
|
||||
public AjaxResult requestEnterByTrayCode(@RequestBody MydoJob mydoJob) {
|
||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(mydoJob);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "InJobByTrayCode",ajaxResult);
|
||||
public AjaxResult requestEnterByTrayCode(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "InJobByTrayCode",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
@@ -42,20 +42,20 @@ public class ToWmsApiController {
|
||||
* 入库任务请求
|
||||
*/
|
||||
@PostMapping("/requestEnterByEnterId")
|
||||
public AjaxResult requestEnterByEnterId(@RequestBody MydoJob mydoJob) {
|
||||
AjaxResult ajaxResult = toWmsService.requestEnterByEnterId(mydoJob);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "InJobByEnterId",ajaxResult);
|
||||
public AjaxResult requestEnterByEnterId(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWmsService.requestEnterByEnterId(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "InJobByEnterId",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收开始信号
|
||||
* 小车接收开始信号
|
||||
*/
|
||||
@PostMapping("/startSignal")
|
||||
public AjaxResult startSignal(@RequestBody MydoJob mydoJob) {
|
||||
AjaxResult ajaxResult = toWmsService.startSignal(mydoJob);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "startSignal",ajaxResult);
|
||||
public AjaxResult startSignal(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWmsService.startSignal(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "startSignal",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
@@ -101,18 +101,6 @@ public class ToWmsApiController {
|
||||
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取完箱子反馈
|
||||
@@ -121,7 +109,6 @@ public class ToWmsApiController {
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/takeCompleted")
|
||||
public AjaxResult takeCompleted(@RequestBody Map<String, Object> 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;
|
||||
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WmsJobRequest;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
@@ -10,19 +11,44 @@ import java.util.Map;
|
||||
* 作业统计 Service 接口
|
||||
*/
|
||||
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 reAssign(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);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.ruoyi.api.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WmsJobRequest;
|
||||
import com.ruoyi.api.service.IToWmsService;
|
||||
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.common.core.domain.AjaxResult;
|
||||
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.service.IMydoJobService;
|
||||
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.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -55,13 +60,15 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
private IOutStockoutDetailService outStockoutDetailService;
|
||||
@Autowired
|
||||
private IOutStockoutService outStockoutService;
|
||||
@Autowired
|
||||
private IAgvContainerTaskService agvContainerTaskService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult requestEnterByTrayCode(MydoJob param) {
|
||||
public AjaxResult requestEnterByTrayCode(RequestEnter requestEnter) {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTrayCode(param.getTrayCode());
|
||||
mydoJobParam.setTrayCode(requestEnter.getTrayCode());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
if(mydoJobs.isEmpty()){
|
||||
return AjaxResult.warn(MessageUtils.message("warn.message"));
|
||||
@@ -69,7 +76,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
MydoJob mydoJob = mydoJobs.get(0);
|
||||
if ("1".equals(mydoJob.getExecutionPhase())){
|
||||
mydoJob.setExecutionPhase("2");
|
||||
mydoJob.setEntranceId(param.getEntranceId());
|
||||
mydoJob.setEntranceId(requestEnter.getEntranceId());
|
||||
mydoJob.setStatus("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
@@ -77,9 +84,9 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult requestEnterByEnterId(MydoJob param) {
|
||||
public AjaxResult requestEnterByEnterId(RequestEnter requestEnter) {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setEntranceId(param.getEntranceId());
|
||||
mydoJobParam.setEntranceId(requestEnter.getEntranceId());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
if(mydoJobs.isEmpty()){
|
||||
return AjaxResult.warn(MessageUtils.message("warn.message"));
|
||||
@@ -88,7 +95,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
for (MydoJob mydoJob : mydoJobs) {
|
||||
if ("1".equals(mydoJob.getExecutionPhase())){
|
||||
mydoJob.setExecutionPhase("2");
|
||||
mydoJob.setTrayCode(param.getTrayCode());
|
||||
mydoJob.setTrayCode(requestEnter.getTrayCode());
|
||||
mydoJob.setStatus("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
@@ -188,6 +195,20 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
BasContainer basContainer = basContainers.get(0);
|
||||
basContainer.setPortName(wmsJobRequest.getPositionCode2());
|
||||
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;
|
||||
default:
|
||||
log.error("作业类型错误");
|
||||
@@ -227,33 +248,51 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
return outStockoutService.autoAllot(stockOutId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小车接收开始信号
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getJob(MydoJob mydoJob) {
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJob);
|
||||
if (mydoJobs.isEmpty()){
|
||||
return AjaxResult.error();
|
||||
}else {
|
||||
return AjaxResult.success(mydoJobs);
|
||||
public AjaxResult startSignal(RequestEnter requestEnter) {
|
||||
switch (requestEnter.getWmsType()){
|
||||
case "1":
|
||||
case "2":
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTaskNo(requestEnter.getTaskNo());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
if (mydoJobs.isEmpty()){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
for (MydoJob mydoJob1 : mydoJobs) {
|
||||
mydoJob1.setStatus("3");
|
||||
mydoJob1.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJob1);
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult startSignal(MydoJob mydoJob) {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTaskNo(mydoJob.getTaskNo());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
if (mydoJobs.isEmpty()){
|
||||
return AjaxResult.error();
|
||||
}else {
|
||||
for (MydoJob mydoJob1 : mydoJobs) {
|
||||
mydoJob1.setStatus("3");
|
||||
mydoJob1.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJob1);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ctu取完箱子反馈
|
||||
* @param map{
|
||||
* "lljCode"
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult takeCompleted(Map<String, Object> map) {
|
||||
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.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.common.core.domain.AjaxResult;
|
||||
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.service.IMydoJobService;
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
@@ -106,6 +109,8 @@ public class PdaServiceImp implements PdaService {
|
||||
private IBasContainerService basContainerService;
|
||||
@Autowired
|
||||
private IToWcsService iToWcsService;
|
||||
@Autowired
|
||||
private IAgvContainerTaskService agvContainerTaskService;
|
||||
|
||||
/**
|
||||
* 空托盘入库
|
||||
@@ -299,12 +304,12 @@ public class PdaServiceImp implements PdaService {
|
||||
//修改拣选数量
|
||||
mydoJobDetail.setPickQuantity(mydoJobDetail.getOutQuantity());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetail);
|
||||
updateTagTaskStatus(mydoJobDetail,basWarehouse);
|
||||
updateTagTaskStatus(mydoJobDetail, basWarehouse);
|
||||
|
||||
//修改单据实际数量
|
||||
String inOrOutDId = mydoJobDetail.getInOrOutDId();
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(inOrOutDId);
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)){
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)) {
|
||||
outStockoutDetail.setAssignNum(outStockoutDetail.getAssignNum().add(Convert.toBigDecimal(mydoJobDetail.getPickQuantity())));
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
@@ -326,7 +331,7 @@ public class PdaServiceImp implements PdaService {
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
//通知wcs 出库确认
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse,mydoJob);
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse, mydoJob);
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
@@ -383,7 +388,7 @@ public class PdaServiceImp implements PdaService {
|
||||
//修改单据实际数量
|
||||
String inOrOutDId = mydoJobDetail.getInOrOutDId();
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(inOrOutDId);
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)){
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)) {
|
||||
outStockoutDetail.setAssignNum(outStockoutDetail.getAssignNum().add(Convert.toBigDecimal(mydoJobDetail.getPickQuantity())));
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
@@ -400,7 +405,6 @@ public class PdaServiceImp implements PdaService {
|
||||
if (flag) {
|
||||
|
||||
|
||||
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
map.put("v_type", "1");
|
||||
@@ -408,7 +412,7 @@ public class PdaServiceImp implements PdaService {
|
||||
iToWcsService.pushInMydoJob();
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse,mydoJob);
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse, mydoJob);
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
@@ -468,6 +472,7 @@ public class PdaServiceImp implements PdaService {
|
||||
|
||||
/**
|
||||
* 修改电子标签数量
|
||||
*
|
||||
* @param mydoJobDetail
|
||||
* @param basWarehouse
|
||||
*/
|
||||
@@ -491,8 +496,8 @@ public class PdaServiceImp implements PdaService {
|
||||
* @param trayCodeMakeSure
|
||||
* @param basWarehouse
|
||||
*/
|
||||
private void deleteTagTask(TrayCodeMakeSure trayCodeMakeSure, BasWarehouse basWarehouse,MydoJob mydoJob) {
|
||||
if ("2".equals(basWarehouse.getWarehouseType())&&"23".equals(mydoJob.getInOrOut())) {
|
||||
private void deleteTagTask(TrayCodeMakeSure trayCodeMakeSure, BasWarehouse basWarehouse, MydoJob mydoJob) {
|
||||
if ("2".equals(basWarehouse.getWarehouseType()) && "23".equals(mydoJob.getInOrOut())) {
|
||||
BasTag basTag = basTagService.selectBasTagByTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
basTag.setTrayCode("");
|
||||
basTagService.updateBasTag(basTag);
|
||||
@@ -505,12 +510,12 @@ public class PdaServiceImp implements PdaService {
|
||||
.map(TagTask::getId)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
if (mydoJob.getExitId().startsWith("fluent")){
|
||||
if (mydoJob.getExitId().startsWith("fluent")) {
|
||||
//通知wcs出库确认成功
|
||||
HashMap<String, String> outMydojobMakeSureParam = new HashMap<>();
|
||||
outMydojobMakeSureParam.put("trayCode", trayCodeMakeSure.getTrayCode());
|
||||
AjaxResult ajaxResult = iToWcsService.outMydojobMakeSure(outMydojobMakeSureParam);
|
||||
if (!ajaxResult.isSuccess()){
|
||||
if (!ajaxResult.isSuccess()) {
|
||||
throw new RuntimeException(ajaxResult.toString());
|
||||
}
|
||||
}
|
||||
@@ -627,17 +632,29 @@ public class PdaServiceImp implements PdaService {
|
||||
String startPoint = basContainer1.getPortName();
|
||||
//todo 调用agv搬运接口
|
||||
//使用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
|
||||
|
||||
//获取code
|
||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||
if(code==200){
|
||||
return AjaxResult.success(result);
|
||||
}else{
|
||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
|
||||
//获取code
|
||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||
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);
|
||||
} else {
|
||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -810,19 +827,19 @@ public class PdaServiceImp implements PdaService {
|
||||
BasContainerDetails basContainerDetails = new BasContainerDetails();
|
||||
basContainerDetails.setContainerId(startPoint);
|
||||
List<BasContainerDetails> basContainerDetails1 = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetails);
|
||||
if(basContainerDetails1.size()==0){
|
||||
if (basContainerDetails1.size() == 0) {
|
||||
return AjaxResult.error("此起点无料架,请检查");
|
||||
}
|
||||
BasContainerDetails basContainer=basContainerDetails1.get(0);
|
||||
BasContainerDetails basContainer = basContainerDetails1.get(0);
|
||||
|
||||
String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", "startPoint=" + startPoint + "&endPoint=" + endPoint + "&containerCode=" + basContainer.getContainerId());
|
||||
//接口的返回结果为AjaxResult,从result中获取code
|
||||
|
||||
//获取code
|
||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||
if(code==200){
|
||||
if (code == 200) {
|
||||
return AjaxResult.success(result);
|
||||
}else{
|
||||
} else {
|
||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user