wcs项目初始化
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Agv操作请求
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agv/api")
|
||||
@Slf4j
|
||||
public class AgvController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
|
||||
/**
|
||||
* agv执行状态返回接口
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/agvCallback")
|
||||
public AgvCallbackResponse agvCallback(@RequestBody AgvCallbackRequest request) {
|
||||
return apiService.agvCallback(request);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param genAgvSchedulingTaskRequest
|
||||
* @return
|
||||
@PostMapping("/receiveAgvMoveJob")
|
||||
public AjaxResult receiveAgvMoveJob(@RequestBody GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
return apiService.receiveAgvMoveJob(genAgvSchedulingTaskRequest);
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param param{
|
||||
* startPoint:起始点
|
||||
* endPoint:结束点
|
||||
* containerCode:容器编号
|
||||
* taskNo:任务号
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/receiveAgvMoveJob")
|
||||
public AjaxResult receiveAgvMoveJob(@RequestBody Map<String, String> param) {
|
||||
return apiService.receiveAgvMoveJob(param);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.ruoyi.api.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.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IRequestLogService;
|
||||
import com.ruoyi.device.DeviceCar.domain.DeviceCar;
|
||||
import com.ruoyi.device.DeviceCar.service.IDeviceCarService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 接口记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/api")
|
||||
public class RequestLogController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
@Autowired
|
||||
private IDeviceCarService deviceCarService;
|
||||
|
||||
/**
|
||||
* 查询所有设备信息
|
||||
*/
|
||||
@GetMapping("/devicecar/list")
|
||||
public AjaxResult listAllDeviceCar()
|
||||
{
|
||||
List<DeviceCar> list = deviceCarService.selectDeviceCarList(new DeviceCar());
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RequestLog requestLog)
|
||||
{
|
||||
startPage();
|
||||
List<RequestLog> list = requestLogService.selectRequestLogList(requestLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出接口记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:export')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RequestLog requestLog)
|
||||
{
|
||||
List<RequestLog> list = requestLogService.selectRequestLogList(requestLog);
|
||||
ExcelUtil<RequestLog> util = new ExcelUtil<RequestLog>(RequestLog.class);
|
||||
util.exportExcel(response, list, "接口记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接口记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:query')")
|
||||
@GetMapping(value = "/{requestId}")
|
||||
public AjaxResult getInfo(@PathVariable("requestId") Long requestId)
|
||||
{
|
||||
return success(requestLogService.selectRequestLogByRequestId(requestId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:add')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RequestLog requestLog)
|
||||
{
|
||||
return toAjax(requestLogService.insertRequestLog(requestLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:edit')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RequestLog requestLog)
|
||||
{
|
||||
return toAjax(requestLogService.updateRequestLog(requestLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接口记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:remove')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{requestIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] requestIds)
|
||||
{
|
||||
return toAjax(requestLogService.deleteRequestLogByRequestIds(requestIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wcs2Wms/api")
|
||||
public class Wcs2WmsController {
|
||||
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
|
||||
/**
|
||||
* 接收出库任务
|
||||
*
|
||||
* @param receiveOutJob
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/receiveOutMydoJob")
|
||||
public AjaxResult receiveOutMydoJob(@RequestBody ReceiveJob receiveOutJob) {
|
||||
return apiService.receiveOutMydoJob(receiveOutJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收流利架空料箱入库任务
|
||||
*
|
||||
* @param receiveInJob
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/receiveInMydoJob")
|
||||
public AjaxResult receiveInMydoJob(@RequestBody ReceiveJob receiveInJob) {
|
||||
return apiService.receiveInMydoJob(receiveInJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流利架出库确认,清空状态记录表
|
||||
*
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/outMydojobMakesure")
|
||||
public AjaxResult outMydojobMakesure(@RequestBody JobParam jobParam) {
|
||||
return apiService.outMydojobMakesure(jobParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消ctu任务
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/cancelMydoJob")
|
||||
public AjaxResult cancelMydoJob(@RequestBody JobParam jobParam) {
|
||||
return apiService.cancelMydoJob(jobParam);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.api.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 接口接收类
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@ToString
|
||||
public class InterfaceReceive {
|
||||
|
||||
private Integer code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
|
||||
}
|
||||
247
ruoyi-admin/src/main/java/com/ruoyi/api/domain/RequestLog.java
Normal file
247
ruoyi-admin/src/main/java/com/ruoyi/api/domain/RequestLog.java
Normal file
@@ -0,0 +1,247 @@
|
||||
package com.ruoyi.api.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;
|
||||
|
||||
/**
|
||||
* 接口记录对象 request_log
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public class RequestLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 请求id */
|
||||
private Long requestId;
|
||||
|
||||
/** 请求时间 */
|
||||
@Excel(name = "请求时间")
|
||||
private String requestTime;
|
||||
|
||||
/** 来源系统 */
|
||||
@Excel(name = "来源系统")
|
||||
private String sourceSystem;
|
||||
|
||||
/** 目标系统 */
|
||||
@Excel(name = "目标系统")
|
||||
private String targetSystem;
|
||||
|
||||
/** 接口名称 */
|
||||
@Excel(name = "接口名称")
|
||||
private String endpoint;
|
||||
|
||||
/** url路径 */
|
||||
@Excel(name = "url路径")
|
||||
private String requestUrl;
|
||||
|
||||
/** 请求方式 */
|
||||
@Excel(name = "请求方式")
|
||||
private String requestMethod;
|
||||
|
||||
/** 请求头信息 */
|
||||
@Excel(name = "请求头信息")
|
||||
private String requestHeaders;
|
||||
|
||||
/** 请求参数 */
|
||||
@Excel(name = "请求参数")
|
||||
private String requestBody;
|
||||
|
||||
/** 响应时间 */
|
||||
@Excel(name = "响应时间")
|
||||
private String responseTime;
|
||||
|
||||
/** 响应主体 */
|
||||
@Excel(name = "响应主体")
|
||||
private String responseBody;
|
||||
|
||||
/** 响应状态 */
|
||||
@Excel(name = "响应状态")
|
||||
private String responseStatus;
|
||||
|
||||
/** 错误信息 */
|
||||
@Excel(name = "错误信息")
|
||||
private String errorDetails;
|
||||
|
||||
/** 耗时 */
|
||||
@Excel(name = "耗时")
|
||||
private String duration;
|
||||
|
||||
/** 是否成功 */
|
||||
@Excel(name = "是否成功",dictType = "interface_status")
|
||||
private String isSuccessful;
|
||||
|
||||
public void setRequestId(Long requestId)
|
||||
{
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public Long getRequestId()
|
||||
{
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestTime(String requestTime)
|
||||
{
|
||||
this.requestTime = requestTime;
|
||||
}
|
||||
|
||||
public String getRequestTime()
|
||||
{
|
||||
return requestTime;
|
||||
}
|
||||
|
||||
public void setSourceSystem(String sourceSystem)
|
||||
{
|
||||
this.sourceSystem = sourceSystem;
|
||||
}
|
||||
|
||||
public String getSourceSystem()
|
||||
{
|
||||
return sourceSystem;
|
||||
}
|
||||
|
||||
public void setTargetSystem(String targetSystem)
|
||||
{
|
||||
this.targetSystem = targetSystem;
|
||||
}
|
||||
|
||||
public String getTargetSystem()
|
||||
{
|
||||
return targetSystem;
|
||||
}
|
||||
|
||||
public void setEndpoint(String endpoint)
|
||||
{
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public String getEndpoint()
|
||||
{
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
public void setRequestUrl(String requestUrl)
|
||||
{
|
||||
this.requestUrl = requestUrl;
|
||||
}
|
||||
|
||||
public String getRequestUrl()
|
||||
{
|
||||
return requestUrl;
|
||||
}
|
||||
|
||||
public void setRequestMethod(String requestMethod)
|
||||
{
|
||||
this.requestMethod = requestMethod;
|
||||
}
|
||||
|
||||
public String getRequestMethod()
|
||||
{
|
||||
return requestMethod;
|
||||
}
|
||||
|
||||
public void setRequestHeaders(String requestHeaders)
|
||||
{
|
||||
this.requestHeaders = requestHeaders;
|
||||
}
|
||||
|
||||
public String getRequestHeaders()
|
||||
{
|
||||
return requestHeaders;
|
||||
}
|
||||
|
||||
public void setRequestBody(String requestBody)
|
||||
{
|
||||
this.requestBody = requestBody;
|
||||
}
|
||||
|
||||
public String getRequestBody()
|
||||
{
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
public void setResponseTime(String responseTime)
|
||||
{
|
||||
this.responseTime = responseTime;
|
||||
}
|
||||
|
||||
public String getResponseTime()
|
||||
{
|
||||
return responseTime;
|
||||
}
|
||||
|
||||
public void setResponseBody(String responseBody)
|
||||
{
|
||||
this.responseBody = responseBody;
|
||||
}
|
||||
|
||||
public String getResponseBody()
|
||||
{
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
public void setResponseStatus(String responseStatus)
|
||||
{
|
||||
this.responseStatus = responseStatus;
|
||||
}
|
||||
|
||||
public String getResponseStatus()
|
||||
{
|
||||
return responseStatus;
|
||||
}
|
||||
|
||||
public void setErrorDetails(String errorDetails)
|
||||
{
|
||||
this.errorDetails = errorDetails;
|
||||
}
|
||||
|
||||
public String getErrorDetails()
|
||||
{
|
||||
return errorDetails;
|
||||
}
|
||||
|
||||
public void setDuration(String duration)
|
||||
{
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getDuration()
|
||||
{
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setIsSuccessful(String isSuccessful)
|
||||
{
|
||||
this.isSuccessful = isSuccessful;
|
||||
}
|
||||
|
||||
public String getIsSuccessful()
|
||||
{
|
||||
return isSuccessful;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("requestId", getRequestId())
|
||||
.append("requestTime", getRequestTime())
|
||||
.append("sourceSystem", getSourceSystem())
|
||||
.append("targetSystem", getTargetSystem())
|
||||
.append("endpoint", getEndpoint())
|
||||
.append("requestUrl", getRequestUrl())
|
||||
.append("requestMethod", getRequestMethod())
|
||||
.append("requestHeaders", getRequestHeaders())
|
||||
.append("requestBody", getRequestBody())
|
||||
.append("responseTime", getResponseTime())
|
||||
.append("responseBody", getResponseBody())
|
||||
.append("responseStatus", getResponseStatus())
|
||||
.append("errorDetails", getErrorDetails())
|
||||
.append("duration", getDuration())
|
||||
.append("isSuccessful", getIsSuccessful())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.api.domain.agv;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ResponseBase {
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 返回消息
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 自定义返回
|
||||
*/
|
||||
private Object data;
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.ruoyi.api.domain.agv.agvCallback;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AgvCallbackRequest {
|
||||
|
||||
/**
|
||||
* 请求编号,每个请求都要一个唯一编号,同一个请求重复提交,使用同一编号
|
||||
*/
|
||||
private String reqCode;
|
||||
|
||||
/**
|
||||
* 请求时间戳,格式: “yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
private String reqTime;
|
||||
|
||||
/**
|
||||
* 地码 X 坐标(mm):任务完成时有值
|
||||
*/
|
||||
private Number cooX;
|
||||
|
||||
/**
|
||||
* 地码 Y 坐标(mm):任务完成时有值
|
||||
*/
|
||||
private Number cooY;
|
||||
|
||||
/**
|
||||
* 当前位置编号
|
||||
* 任务开始:该位置为任务起点
|
||||
* 走出储位:该位置为任务起点
|
||||
* 任务单取消:该位置为工作位编号
|
||||
* 任务结束:该位置为任务终点
|
||||
* 取放申请:取放料箱的点
|
||||
*/
|
||||
private String currentPositionCode;
|
||||
|
||||
/**
|
||||
* 自定义字段,不超过2000个字符
|
||||
*/
|
||||
private String data;
|
||||
|
||||
/**
|
||||
* 地图编号
|
||||
*/
|
||||
private String mapCode;
|
||||
|
||||
/**
|
||||
* 地码编号:任务完成时有值
|
||||
*/
|
||||
private String mapDataCode;
|
||||
|
||||
/**
|
||||
* 仓位编号:叉车与CTU任务时有值
|
||||
*/
|
||||
private String stgBinCode;
|
||||
|
||||
/**
|
||||
* 方法名, 可使用任务类型做为方法名
|
||||
* 默认使用方式:
|
||||
* start : 任务开始
|
||||
* outbin : 走出储位
|
||||
* end : 任务结束
|
||||
* cancel : 任务单取消
|
||||
* apply:CTU料箱取放申请
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 货架编号:背货架时有值
|
||||
*/
|
||||
private String podCode;
|
||||
|
||||
/**
|
||||
* 方向:“180”,”0”,”90”,”-90” 分别对应地图的”左”,”右”,”上”,”下”:任务完成时有值
|
||||
*/
|
||||
private String podDir;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialLot;
|
||||
|
||||
/**
|
||||
* AGV编号(同 agvCode )
|
||||
*/
|
||||
private String robotCode;
|
||||
|
||||
/**
|
||||
* 当前任务单号
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 工作位,与RCS-2000端配置的位置名称一致。任务完成时有值,与生成任务单接口中的wbCode一致。
|
||||
*/
|
||||
private String wbCode;
|
||||
|
||||
/**
|
||||
* 容器编号
|
||||
*/
|
||||
private String ctnrCode;
|
||||
|
||||
/**
|
||||
* 容器类型
|
||||
*/
|
||||
private String ctnrType;
|
||||
|
||||
/**
|
||||
* 巷道编号
|
||||
*/
|
||||
private String roadWayCode;
|
||||
|
||||
/**
|
||||
* 巷道内顺序号
|
||||
* 巷道尾是0,到巷道头依次递增1
|
||||
*/
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* 设备编号,如梳齿式工作站、输送线等,一般使用于CTU场景。
|
||||
* 系统根据仓位定位到关联的设备编号。
|
||||
*/
|
||||
private String eqpCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.api.domain.agv.agvCallback;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AgvCallbackResponse {
|
||||
|
||||
/**
|
||||
* 响应码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 响应信息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
private String reqCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.api.domain.agv.cancelTask;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 【取消任务】请求接口
|
||||
*/
|
||||
@Data
|
||||
public class CancelTaskRequest {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
@NotBlank(message = "请求编号不能为空")
|
||||
@Size(max = 32, message = "请求编号不能超过32位")
|
||||
private String reqCode;
|
||||
|
||||
/**
|
||||
* 请求时间戳
|
||||
* 格式: “yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@Size(max = 20, message = "请求时间格式应为 yyyy-MM-dd HH:mm:ss")
|
||||
private String reqTime;
|
||||
|
||||
/**
|
||||
* 客户端编号
|
||||
*/
|
||||
@Size(max = 16, message = "客户端编号不能超过16位")
|
||||
private String clientCode;
|
||||
|
||||
/**
|
||||
* 令牌号, 由调度系统颁发,由RCS-2000告知上层系统
|
||||
*/
|
||||
@Size(max = 64, message = "令牌号不能超过64位")
|
||||
private String tokenCode;
|
||||
|
||||
/**
|
||||
* 取消类型
|
||||
* 0表示:取消后货架直接放地上
|
||||
* 1表示:AGV仍然背着货架, 根据回库区域执行回库指令, 只有潜伏车和CTU车支持。
|
||||
* 若不传值,默认的取消模式为0
|
||||
*/
|
||||
@Size(max = 16, message = "取消类型不能超过16位")
|
||||
private String forceCancel;
|
||||
|
||||
/**
|
||||
* forcecancel=1时有意义,
|
||||
* 回库区域编号,
|
||||
* 如果为空,采用货架配置的库区
|
||||
*/
|
||||
@Size(max = 16, message = "回库区域编号不能超过16位")
|
||||
private String matterArea;
|
||||
|
||||
/**
|
||||
* 取消该AGV正在执行的任务单
|
||||
*/
|
||||
@Size(max = 5, message = "AGV编号不能超过5位")
|
||||
private String agvCode;
|
||||
|
||||
/**
|
||||
* 任务单编号, 取消该任务单
|
||||
*/
|
||||
@Size(max = 64, message = "任务单编号不能超过64位")
|
||||
private String taskCode;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.api.domain.agv.cancelTask;
|
||||
|
||||
import com.ruoyi.api.domain.agv.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CancelTaskResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.api.domain.agv.continueTask;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 【继续执行任务】请求接口
|
||||
*/
|
||||
@Data
|
||||
public class ContinueTaskRequest {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
* 每个请求都要一个唯一编号,同一个请求重复提交,使用同一编号。
|
||||
*/
|
||||
private String reqCode;
|
||||
|
||||
/**
|
||||
* 请求时间截
|
||||
* 格式:"yyyy-MM-dd HH:mm:ss"
|
||||
*/
|
||||
private String reqTime;
|
||||
|
||||
/**
|
||||
* 客户端编号
|
||||
* 如PDA,HCWMS等。
|
||||
*/
|
||||
private String clientCode;
|
||||
|
||||
/**
|
||||
* 令牌号
|
||||
* 由调度系统颁发。
|
||||
*/
|
||||
private String tokenCode;
|
||||
|
||||
/**
|
||||
* 工作位
|
||||
* 与RCS-2000端配置的位置名称一致。
|
||||
*/
|
||||
private String wbCode;
|
||||
|
||||
/**
|
||||
* 货架号
|
||||
* 采用货架号触发的方式。
|
||||
*/
|
||||
private String podCode;
|
||||
|
||||
/**
|
||||
* AGV编号
|
||||
* 采用AGV编号触发的方式。
|
||||
*/
|
||||
private String agvCode;
|
||||
|
||||
/**
|
||||
* 任务单号
|
||||
* 选填,不填系统自动生成,必须为64位UUID。
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 下一个子任务的序列
|
||||
* 指定第几个子任务开始执行,校验子任务执行是否正确。不填默认执行下一个子任务。
|
||||
*/
|
||||
private String taskSeq;
|
||||
|
||||
/**
|
||||
* 下一个位置信息
|
||||
* 在任务类型中配置外部设置时需要传入,否则不需要设置。待现场地图部署、配置完成后可获取。
|
||||
*/
|
||||
private NextPositionCodeData nextPositionCode;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.api.domain.agv.continueTask;
|
||||
|
||||
import com.ruoyi.api.domain.agv.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ContinueTaskResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.api.domain.agv.continueTask;
|
||||
|
||||
public class NextPositionCodeData {
|
||||
|
||||
/**
|
||||
* 位置编号
|
||||
*/
|
||||
private String positionCode;
|
||||
|
||||
/**
|
||||
* 对象类型定义
|
||||
* 00:代表nextPositionCode是一个位置
|
||||
* 02:代表nextPositionCode是一个策略
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.ruoyi.api.domain.agv.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任务】请求接口
|
||||
*/
|
||||
@Data
|
||||
public class GenAgvSchedulingTaskRequest {
|
||||
/**
|
||||
* 请求编号
|
||||
* 同一个请求重复提交, 使用同一编号
|
||||
*/
|
||||
@NotNull
|
||||
private String reqCode = UUID.randomUUID().toString();
|
||||
/**
|
||||
* 请求时间
|
||||
* 格式: “yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
private String reqTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
/**
|
||||
* 客户端编号
|
||||
* 客户端编号,如PDA,HCWMS等
|
||||
*/
|
||||
private String clientCode;
|
||||
/**
|
||||
* 令牌号
|
||||
* 由调度系统颁发
|
||||
*/
|
||||
private String tokenCode;
|
||||
/**
|
||||
* 任务类型
|
||||
* 内置任务类型:
|
||||
* 厂内货架搬运: F01
|
||||
* 厂内货架空满交换: F02
|
||||
* 辊筒搬运接驳:F03
|
||||
* 厂内货架出库AGV待命:F04
|
||||
* 旋转货架: F05
|
||||
* 厂内电梯任务: F06
|
||||
* 以下为叉车专用任务类型
|
||||
* 高位货架到工作台: F11
|
||||
* 工作台到高位货架: F12
|
||||
* 巷道到工作台: F13
|
||||
* 工作台到巷道: F14
|
||||
* 高位货架到工作台(接驳) : F15
|
||||
* 工作台到高位货架 (接驳) : F16
|
||||
* 巷道到工作台(接驳) : F17
|
||||
* 工作台到巷道(接驳) : F18
|
||||
* 叉车电梯主任务: F20
|
||||
*/
|
||||
@NotNull
|
||||
private String taskTyp;
|
||||
/**
|
||||
* 容器类型(叉车/CTU专用) 叉车项目必传
|
||||
*/
|
||||
private String ctnrTyp;
|
||||
/**
|
||||
* 容器编号 (叉车/CTU专用)
|
||||
*/
|
||||
private String ctnrCode; //
|
||||
/**
|
||||
* 容器数量(叉车堆叠专用),默认值1,仅记录堆叠的数量不记录堆叠的每个容器号
|
||||
*/
|
||||
private String ctnrNum;
|
||||
/**
|
||||
* 任务模式
|
||||
* 0-普通move 1-出库move 2-入库move 3-移库move
|
||||
*/
|
||||
private String taskMode;
|
||||
/**
|
||||
* 工作位
|
||||
* 与RCS-2000端配置的位置名称一致, 工作位名称为字母\数字\或组合
|
||||
*/
|
||||
private String wbCode;
|
||||
/**
|
||||
* 位置路径
|
||||
* AGV关键路径位置集合,与任务类型中模板配置的位置路径一一对应。待现场地图部署、配置完成后可获取
|
||||
*/
|
||||
private List<PositionCodeData> positionCodePath;
|
||||
/**
|
||||
* 货架编号
|
||||
* 不指定货架可以为空
|
||||
*/
|
||||
private String podCode;
|
||||
/**
|
||||
* 货架方向
|
||||
* “180”,”0”,”90”,”-90” 分别对应地图的”左”,”右”,”上”,”下”
|
||||
* 不指定方向可以为空
|
||||
* 如果终点不是工作台或工作台未配置操作方向则货架拣货方向podDir作为终点方向
|
||||
* 如果工作台配有操作方向,则系统会根据货架拣货方向podDir和工作台操作方向计算货架终点方向
|
||||
*/
|
||||
private String podDir;
|
||||
/**
|
||||
* 货架类型, 传空时表示随机找个货架
|
||||
* 找空货架传参方式如下:
|
||||
* -1: 代表不关心货架类型, 找到空货架即可.
|
||||
* -2: 代表从工作位获取关联货架类型, 如果未配置, 只找空货架.
|
||||
* 货架类型编号: 只找该货架类型的空货架
|
||||
*/
|
||||
private String podTyp;
|
||||
/**
|
||||
* 物料批次
|
||||
* 物料批次或货架上的物料唯一编码,生成任务单时,货架与物料直接绑定时使用. (通过同时传podCode和materialLot来绑定或通过 wbCode 找到位置上的货架和materialLot来绑定)
|
||||
* 如果是区域/策略内查找货架,可以匹配对应物料批次的货架,支持以下值:
|
||||
* 0:区域/策略内查找空货架
|
||||
* 1:区域/策略内查找满货架
|
||||
* 其他值:查找指定物料批次对应的货架
|
||||
* 巷道任务通过该字段传入特征值
|
||||
*/
|
||||
private String materialLot;
|
||||
/**
|
||||
* 优先级
|
||||
* 从(1~127)级,最大优先级最高。为空时,采用任务模板的优先级
|
||||
*/
|
||||
private String priority;
|
||||
/**
|
||||
* AGV编号
|
||||
* 填写表示指定某一编号的AGV执行该任务
|
||||
*/
|
||||
private String agvCode;
|
||||
/**
|
||||
* 任务单号
|
||||
* 选填, 不填系统自动生成
|
||||
*/
|
||||
private String taskCode;
|
||||
/**
|
||||
* 组编号
|
||||
* CTU场景下用于按组出库,同组任务优先拼车。 如业务需要任务组间或组内按顺序出库,则需调用料箱顺序出库(CTU)接口。
|
||||
* 潜伏式场景下,通过组号来管理顺序出库的顺序,组号小的优先出库。
|
||||
*/
|
||||
private String groupId;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String agvTyp;
|
||||
/**
|
||||
* 选择策略
|
||||
* 区域/策略中挑选货架以及根据物料批次挑选货架时的先进先出规则,支持以下4个值:
|
||||
* 1:按照货架到达储位的时间顺序,先进先出
|
||||
* 2:按照货架到达储位的时间顺序,先进后出
|
||||
* 9:按照货架绑定物料批次的时间顺序,先进先出
|
||||
* 10:按照货架绑定物料批次的时间顺序,先进后出
|
||||
*/
|
||||
private String positionSelStrategy;
|
||||
/**
|
||||
* 自定义数据
|
||||
*/
|
||||
private String data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.api.domain.agv.genAgvSchedulingTask;
|
||||
|
||||
import com.ruoyi.api.domain.agv.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GenAgvSchedulingTaskResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ruoyi.api.domain.agv.genAgvSchedulingTask;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PositionCodeData {
|
||||
/**
|
||||
* 位置编号 - 单个编号不超过64位
|
||||
*/
|
||||
private String positionCode;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 位置类型说明:
|
||||
* 00表示:位置编号
|
||||
* 01表示:物料批次号
|
||||
* 02表示:策略编号(含多个区域) 如:第一个区域放不下, 可以放第二个区域
|
||||
* 03表示:货架编号,通过货架编号找到货架所在位置
|
||||
* 04表示:区域编号,在区域中查找可用位置
|
||||
* 05表示:仓位编号(叉车/CTU专用)
|
||||
* 06表示:巷道编号
|
||||
* 07表示:容器编号
|
||||
* 08表示:巷道策略
|
||||
* 09表示:巷道区域
|
||||
* 10表示:巷道仓位
|
||||
* 11表示:输送线(机台)编号
|
||||
* 12表示:CTU工作台(梳齿工作站)编号
|
||||
* 13表示:搬运巷道指定货架出库
|
||||
*/
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.api.domain.agv.queryAgvStatus;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AgvStatusData {
|
||||
|
||||
/**
|
||||
* 机器人编号
|
||||
*/
|
||||
private String robotCode;
|
||||
|
||||
/**
|
||||
* 机器人方向 (范围 -180~360度)
|
||||
*/
|
||||
private String robotDir;
|
||||
|
||||
/**
|
||||
* 机器人IP
|
||||
*/
|
||||
private String robotIp;
|
||||
|
||||
/**
|
||||
* 机器人电量, 范围: 0-100
|
||||
*/
|
||||
private String battery;
|
||||
|
||||
/**
|
||||
* 机器人 x 坐标,单位:毫米
|
||||
*/
|
||||
private String posX;
|
||||
|
||||
/**
|
||||
* 机器人 y 坐标,单位:毫米
|
||||
*/
|
||||
private String posY;
|
||||
|
||||
/**
|
||||
* 机器人所在地图
|
||||
*/
|
||||
private String mapCode;
|
||||
|
||||
/**
|
||||
* 机器人当前速度, 单位: mm/s
|
||||
*/
|
||||
private String speed;
|
||||
|
||||
/**
|
||||
* 机器人状态
|
||||
* AGV常见状态编号和描述见附件6.1
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否已被排除,被排除后不接受新任务(1-排除,0-正常)
|
||||
*/
|
||||
private String exclType;
|
||||
|
||||
/**
|
||||
* 是否暂停 0-否 1-是
|
||||
*/
|
||||
private String stop;
|
||||
|
||||
/**
|
||||
* 背货架的编号
|
||||
*/
|
||||
private String podCode;
|
||||
|
||||
/**
|
||||
* 背货架的方向
|
||||
*/
|
||||
private String podDir;
|
||||
|
||||
/**
|
||||
* 执行路径,单位是毫米, 格式[x,y,dir]
|
||||
* 示例:["[x,y,dir]","[x,y,dir]"]
|
||||
*/
|
||||
private List<String> path;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.api.domain.agv.queryAgvStatus;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 通过请求参数, 查询 AGV 状态信息,包括电池电量。
|
||||
* 调用频次: 100车以下:5秒, 100~200车:10秒, 200 ~300车:15秒
|
||||
* 调用路径示例: http://IP:8182/rcms-dps/rest/queryAgvStatus
|
||||
*/
|
||||
@Data
|
||||
public class QueryAgvStatusRequest {
|
||||
|
||||
/**
|
||||
* 请求编号,每个请求都要一个唯一编号,同一个请求重复提交,使用同一编号。
|
||||
*/
|
||||
private String reqCode;
|
||||
|
||||
/**
|
||||
* 请求时间戳,格式: "yyyy-MM-dd HH:mm:ss"
|
||||
*/
|
||||
private String reqTime;
|
||||
|
||||
/**
|
||||
* 客户端编号,如PDA,HCWMS等。
|
||||
*/
|
||||
private String clientCode;
|
||||
|
||||
/**
|
||||
* 令牌号,由调度系统颁发。
|
||||
*/
|
||||
private String tokenCode;
|
||||
|
||||
/**
|
||||
* 地图编号
|
||||
*/
|
||||
private String mapCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.api.domain.agv.queryAgvStatus;
|
||||
|
||||
import com.ruoyi.api.domain.agv.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class QueryAgvStatusResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
private List<AgvStatusData> data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.api.domain.agv.queryTaskStatus;
|
||||
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通过任务编号查询任务当前执行状态,支持批量查询。
|
||||
* 参数错误或者任务单未找到返回均为成功。
|
||||
*/
|
||||
@Data
|
||||
public class QueryTaskStatusRequest {
|
||||
|
||||
/**
|
||||
* 请求编号,每个请求都要一个唯一编号,同一个请求重复提交,使用同一编号。
|
||||
*/
|
||||
private String reqCode = UUID.randomUUID().toString();
|
||||
|
||||
/**
|
||||
* 请求时间戳,格式: "yyyy-MM-dd HH:mm:ss"
|
||||
*/
|
||||
private String reqTime;
|
||||
|
||||
/**
|
||||
* 客户端编号,如PDA,HCWMS等。
|
||||
*/
|
||||
private String clientCode;
|
||||
|
||||
/**
|
||||
* 令牌号,由调度系统颁发。
|
||||
*/
|
||||
private String tokenCode;
|
||||
|
||||
/**
|
||||
* AGV编号
|
||||
*/
|
||||
private String agvCode;
|
||||
|
||||
/**
|
||||
* 任务单编号数组,任务单编号与AGV编号只能传其中之一
|
||||
*/
|
||||
private List<String> taskCodes;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.api.domain.agv.queryTaskStatus;
|
||||
|
||||
import com.ruoyi.api.domain.agv.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class QueryTaskStatusResponse extends ResponseBase {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
private List<TaskStatusData> data;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.api.domain.agv.queryTaskStatus;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskStatusData {
|
||||
/**
|
||||
* 任务单编号
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String taskTyp;
|
||||
|
||||
/**
|
||||
* 任务状态:1-已创建,2-正在执行,5-取消完成,9-已结束, 10-被打断
|
||||
*/
|
||||
private String taskStatus;
|
||||
|
||||
/**
|
||||
* AGV编号, 任务分配车后有值
|
||||
*/
|
||||
private String agvCode;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.api.domain.wcs2wms;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JobParam {
|
||||
private String jobId;
|
||||
private String trayCode;
|
||||
private String taskNo;
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.ruoyi.api.domain.wcs2wms;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 任务表对象 mydo_job
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class MydoJob extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 任务ID */
|
||||
@Excel(name = "任务ID")
|
||||
private String jobId;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态",dictType = "mydo_job_status")
|
||||
private String status;
|
||||
|
||||
/** 上线类型 */
|
||||
@Excel(name = "上线类型",dictType = "on_line_type")
|
||||
private String onLineType;
|
||||
|
||||
/** 任务号 */
|
||||
@Excel(name = "任务号")
|
||||
private String taskNo;
|
||||
|
||||
/** 供应商ID */
|
||||
@Excel(name = "供应商ID")
|
||||
private String supplierId;
|
||||
@Excel(name = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
private String customerId;
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门ID")
|
||||
private String departmentId;
|
||||
@Excel(name = "部门")
|
||||
private String departmentName;
|
||||
|
||||
/** 托盘码 */
|
||||
@Excel(name = "托盘码")
|
||||
private String trayCode;
|
||||
|
||||
/** 巷道ID */
|
||||
@Excel(name = "巷道ID")
|
||||
private String roadwayId;
|
||||
|
||||
/** 货位ID */
|
||||
@Excel(name = "货位ID")
|
||||
private String cargoSpaceId;
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 目标巷道ID */
|
||||
@Excel(name = "目标巷道ID")
|
||||
private String targetRoadwayId;
|
||||
|
||||
/** 目标货位ID */
|
||||
@Excel(name = "目标货位ID")
|
||||
private String targetCargoSpaceId;
|
||||
@Excel(name = "目标货位名称")
|
||||
private String targetCargoSpaceName;
|
||||
|
||||
/** 产线ID */
|
||||
@Excel(name = "产线ID")
|
||||
private String lineId;
|
||||
|
||||
/** 车间ID */
|
||||
@Excel(name = "车间ID")
|
||||
private String workshopId;
|
||||
|
||||
/** 优先级 */
|
||||
@Excel(name = "优先级")
|
||||
private Long priority;
|
||||
|
||||
/** 执行阶段 */
|
||||
@Excel(name = "执行阶段",dictType = "execution_phase_type")
|
||||
private String executionPhase;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型",dictType = "in_or_out_type")
|
||||
private String inOrOut;
|
||||
|
||||
|
||||
|
||||
/** 开始时间 */
|
||||
@Excel(name = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@Excel(name = "结束时间")
|
||||
private String finishTime;
|
||||
|
||||
/** 入口ID */
|
||||
@Excel(name = "入口ID")
|
||||
private String entranceId;
|
||||
|
||||
/** 出口ID */
|
||||
@Excel(name = "出口ID")
|
||||
private String exitId;
|
||||
|
||||
/** 班组ID */
|
||||
@Excel(name = "班组ID")
|
||||
private String classId;
|
||||
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private String warehouseId;
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 重分标记 */
|
||||
@Excel(name = "重分标记")
|
||||
private String faultFlag;
|
||||
|
||||
private String inOut;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.api.domain.wcs2wms;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReceiveJob {
|
||||
private String taskNo;
|
||||
private String cargoSpaceId;
|
||||
private String exitId;
|
||||
private String trayCode;
|
||||
private String entranceId;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.api.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
|
||||
/**
|
||||
* 接口记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface RequestLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 接口记录
|
||||
*/
|
||||
public RequestLog selectRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 接口记录集合
|
||||
*/
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 删除接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 批量删除接口记录
|
||||
*
|
||||
* @param requestIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds);
|
||||
}
|
||||
149
ruoyi-admin/src/main/java/com/ruoyi/api/service/IApiService.java
Normal file
149
ruoyi-admin/src/main/java/com/ruoyi/api/service/IApiService.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.ruoyi.api.service;
|
||||
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface IApiService
|
||||
{
|
||||
|
||||
/**
|
||||
* 根据条码请求入库
|
||||
* @param mydoJob
|
||||
* @return 返回入库口位置
|
||||
*/
|
||||
public MydoJob requestEnterByTrayCode(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 根据入口请求入库
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
public List<MydoJob> requestEnterByEnterId(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* WMS出库任务推送
|
||||
* @param receiveOutJob
|
||||
*/
|
||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob);
|
||||
|
||||
/**
|
||||
* 生成agv队列
|
||||
* @param code1 起点
|
||||
* @param code2 终点
|
||||
* @param wmsTrayCode 容器码 托盘料箱码/容器码
|
||||
* @param wmsTaskNo mydojob 任务
|
||||
* @param wmsTaskType 1-入库 2-出库 3-agv搬运
|
||||
* @return
|
||||
*/
|
||||
public AgvQueue createAgvQueue(String code1,String code2,String wmsTrayCode,String wmsTaskNo,String wmsTaskType);
|
||||
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
* @param cancelTaskRequest
|
||||
* @return
|
||||
*/
|
||||
public CancelTaskResponse cancelTask(CancelTaskRequest cancelTaskRequest);
|
||||
|
||||
/**
|
||||
* 继续AGV任务
|
||||
* @param continueTaskRequest
|
||||
* @return
|
||||
*/
|
||||
public ContinueTaskResponse continueTask(ContinueTaskRequest continueTaskRequest);
|
||||
|
||||
/**
|
||||
* 生成AGV生成任务
|
||||
*
|
||||
* @param genAgvSchedulingTaskRequest
|
||||
* @return
|
||||
*/
|
||||
public GenAgvSchedulingTaskResponse genAgvSchedulingTask(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||
|
||||
/**
|
||||
* agv任务状态推送
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
AgvCallbackResponse agvCallback(AgvCallbackRequest request);
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult receiveAgvMoveJob(Map<String, String> param);
|
||||
|
||||
/**
|
||||
* 任务到达拣选口
|
||||
* @param agvFinishUrl
|
||||
* @param point
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
RequestLog finishMydoJob(String agvFinishUrl, String point, Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 发送agv开始状态
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult sendOutMydoJobStatus(Map<String, Object> param) ;
|
||||
|
||||
|
||||
/**
|
||||
* 发送ctu 取货完成信号
|
||||
* @param param{
|
||||
* "lljCode":""流利架位置
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult takeCompleted(Map<String, Object> param) ;
|
||||
|
||||
/**
|
||||
* 下发agv任务
|
||||
* @param agvQueue
|
||||
* @return
|
||||
*/
|
||||
public GenAgvSchedulingTaskResponse requestAgvQueue(AgvQueue agvQueue);
|
||||
/**
|
||||
* WMS流利架入库任务推送
|
||||
* @param receiveInJob
|
||||
*/
|
||||
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
|
||||
|
||||
/**
|
||||
* 流利架状态清空表
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
AjaxResult outMydojobMakesure(JobParam jobParam);
|
||||
/**
|
||||
* 取消ctu任务
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
AjaxResult cancelMydoJob(JobParam jobParam);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.api.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface IRequestLogService
|
||||
{
|
||||
/**
|
||||
* 查询接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 接口记录
|
||||
*/
|
||||
public RequestLog selectRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 接口记录集合
|
||||
*/
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 批量删除接口记录
|
||||
*
|
||||
* @param requestIds 需要删除的接口记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds);
|
||||
|
||||
/**
|
||||
* 删除接口记录信息
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 发送请求,并插入日志
|
||||
* @param url
|
||||
* @param param
|
||||
* @param endPoint
|
||||
* @return
|
||||
*/
|
||||
public RequestLog getRequestLog(String url, String param, String endPoint);
|
||||
|
||||
/**
|
||||
* 接收请求,并插入日志
|
||||
* @param url
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public RequestLog getRequestLog(String url, String param);
|
||||
}
|
||||
@@ -0,0 +1,544 @@
|
||||
package com.ruoyi.api.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.InterfaceReceive;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.fluent.domain.BasFluentFrame;
|
||||
import com.ruoyi.bas.fluent.service.IBasFluentFrameService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.SendData;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.Constant.*;
|
||||
|
||||
/**
|
||||
* 接口记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ApiServiceImpl implements IApiService {
|
||||
@Autowired
|
||||
private RequestLogServiceImpl requestLogService;
|
||||
@Autowired
|
||||
private IAgvQueueService agvQueueService;
|
||||
@Autowired
|
||||
private IBasFluentFrameService fluentFrameService;
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
/**
|
||||
* 请求入库
|
||||
* @param mydoJob
|
||||
* @return 返回入库口位置
|
||||
*/
|
||||
@Override
|
||||
public MydoJob requestEnterByTrayCode(MydoJob mydoJob) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(REQUEST_ENTER_BY_TRAYCODE, "根据条码请求入库", JSONUtil.toJsonStr(mydoJob));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
String responseBody = requestLog.getResponseBody();
|
||||
InterfaceReceive bean = JSONUtil.toBean(responseBody, InterfaceReceive.class);
|
||||
return JSONUtil.toBean(JSONUtil.toJsonStr(bean.getData()), MydoJob.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求入库
|
||||
* @param mydoJob
|
||||
* @return 返回入库口位置
|
||||
*/
|
||||
@Override
|
||||
public List<MydoJob> requestEnterByEnterId(MydoJob mydoJob) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(REQUEST_ENTER_BY_ENTER_ID, "根据入口请求入库", JSONUtil.toJsonStr(mydoJob));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
String responseBody = requestLog.getResponseBody();
|
||||
InterfaceReceive bean = JSONUtil.toBean(responseBody, InterfaceReceive.class);
|
||||
return JSONUtil.toList(JSONUtil.toJsonStr(bean.getData()), MydoJob.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下发agv编码
|
||||
*
|
||||
* @param genAgvSchedulingTaskRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public GenAgvSchedulingTaskResponse genAgvSchedulingTask(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(GEN_AGV_SCHEDULING_TASK, "生成AGV任务", JSONUtil.toJsonStr(genAgvSchedulingTaskRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), GenAgvSchedulingTaskResponse.class);
|
||||
} else {
|
||||
//todo 需要调试
|
||||
GenAgvSchedulingTaskResponse response = new GenAgvSchedulingTaskResponse();
|
||||
response.setCode(500);
|
||||
response.setMessage("请求失败");
|
||||
//todo 需要调试小车请求
|
||||
response.setCode(0);
|
||||
response.setMessage("模拟测试");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* agv执行状态返回接口
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AgvCallbackResponse agvCallback(AgvCallbackRequest request) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(request), "AGV任务执行通知");
|
||||
AgvCallbackResponse response = new AgvCallbackResponse(0, "成功", "");
|
||||
try {
|
||||
agvCallbackInfo(request);
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(response));
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setIsSuccessful("1");
|
||||
return new AgvCallbackResponse(0, "成功", "");
|
||||
} catch (RuntimeException e) {
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(response));
|
||||
requestLog.setResponseStatus("0");
|
||||
return new AgvCallbackResponse(1, "失败", "");
|
||||
} finally {
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult receiveAgvMoveJob(Map<String, String> param) {
|
||||
String startPoint = param.get("startPoint");
|
||||
String endPoint = param.get("endPoint");
|
||||
//todo 待调试
|
||||
WcsPort startWcsPort = wcsPortService.selectWcsPortByPortCode(startPoint);
|
||||
WcsPort endWcsPort = wcsPortService.selectWcsPortByPortCode(endPoint);
|
||||
if (ObjUtil.isNull(startWcsPort)){
|
||||
return AjaxResult.error("起始点不存在");
|
||||
}
|
||||
if (ObjUtil.isNull(endWcsPort)){
|
||||
return AjaxResult.error("结束点不存在");
|
||||
}
|
||||
if ("1".equals(startWcsPort.getStatus()) && "0".equals(endWcsPort.getStatus())){
|
||||
AgvQueue agvQueue = createAgvQueue(startWcsPort.getSpare2(),endWcsPort.getSpare2(), param.get("containerCode"), param.get("taskNo"), "3");
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = requestAgvQueue(agvQueue);
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
|
||||
}
|
||||
if ("0".equals(startWcsPort.getStatus())){
|
||||
return AjaxResult.error("起始点位无容器");
|
||||
}
|
||||
if ("1".equals(endWcsPort.getStatus())){
|
||||
return AjaxResult.error("目标点位有容器");
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库到达拣选口
|
||||
* @param agvFinishUrl
|
||||
* @param endPoint
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public RequestLog finishMydoJob(String agvFinishUrl, String endPoint, Map<String, Object> param) {
|
||||
return requestLogService.getRequestLog(JOB_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送出库任务状态
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult sendOutMydoJobStatus(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(SEND_TASK_STARTED, "发送任务开始信号", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 料箱取货完成
|
||||
* @param param{
|
||||
* "lljCode":""流利架位置
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult takeCompleted(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(TAKE_COMPLETED, "ctu取货完成信号", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理agv状态返回
|
||||
* @param request
|
||||
*/
|
||||
private void agvCallbackInfo(AgvCallbackRequest request) {
|
||||
String taskCode = request.getTaskCode();
|
||||
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(taskCode);
|
||||
//通知wms agv搬运阶段完成
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
if (ObjUtil.isNotNull(agvQueue)) {
|
||||
switch (request.getMethod()) {
|
||||
case "start":
|
||||
//任务开始
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV任务开始】任务号:{}", taskCode);
|
||||
//通知wms
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("wmsType", agvQueue.getWmsTaskType());
|
||||
sendOutMydoJobStatus(param);
|
||||
break;
|
||||
case "outbin":
|
||||
//走出储位
|
||||
agvQueue.setStatus("3");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV走出储位】任务号:{}", taskCode);
|
||||
break;
|
||||
case "end":
|
||||
//任务结束
|
||||
agvQueue.setStatus("4");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
|
||||
|
||||
param.put("wmsType", agvQueue.getWmsTaskType());
|
||||
|
||||
if ("1".equals(agvQueue.getWmsTaskType())) {
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
//入库任务 暂无特殊逻辑
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JOB_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV入库任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
} else if ("2".equals(agvQueue.getWmsTaskType())) {
|
||||
if (agvQueue.getPositionCode2().startsWith("fluent")){
|
||||
//流利架出库 同步电子标签
|
||||
Map<String, Object> fluentPickParam = new HashMap<>();
|
||||
fluentPickParam.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
fluentPickParam.put("wmsType", "2");
|
||||
fluentPickParam.put("pickSsj", agvQueue.getPositionCode2());
|
||||
RequestLog requestLog = finishMydoJob(JOB_FINISH_URL, "流利架任务到达拣选口", fluentPickParam);
|
||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||
}else {
|
||||
//输送机出库 PLC写入任务号
|
||||
//通知wms 任务结束
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
//写入对应的plc 任务号
|
||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(agvQueue.getPositionCode2());
|
||||
if (ObjUtil.isNotNull(deviceSsj)) {
|
||||
SendData rwh = new SendData(Tools.DINT, agvQueue.getWmsTaskNo());
|
||||
byte[] bytes = Tools.sendData(rwh);
|
||||
//写入信息 取货完成
|
||||
int i = PlcRead.WriteToSSJ(deviceSsj.getPlcDbWriteAddress(), bytes);
|
||||
if (i == 1) {
|
||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("3".equals(agvQueue.getWmsTaskType())) {
|
||||
param.put("positionCode1", agvQueue.getPositionCode1());
|
||||
param.put("positionCode2", agvQueue.getPositionCode2());
|
||||
param.put("containerCode", agvQueue.getWmsTraycode());
|
||||
|
||||
//绑定点位和料架
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JOB_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
//修改点位状态
|
||||
WcsPort wcsPort = wcsPortService.selectWcsPortByPortCode(agvQueue.getPositionCode2());
|
||||
wcsPort.setStatus("1");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "cancel":
|
||||
//任务单取消
|
||||
agvQueue.setStatus("5");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务单取消】任务号:{}", taskCode);
|
||||
break;
|
||||
case "apply":
|
||||
//CTU料箱取放申请
|
||||
//请求放货
|
||||
if ("0".equals(agvQueue.getRequest())) {
|
||||
agvQueue.setRequest("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
log.info("【AGV料箱取放申请】任务号:{}", taskCode);
|
||||
break;
|
||||
case "takeCompleted":
|
||||
//ctu取货完成
|
||||
HashMap<String, Object> takeCompletedParam = new HashMap<>();
|
||||
takeCompletedParam.put("portCode",agvQueue.getPositionCode1());
|
||||
takeCompletedParam.put("wmsType",agvQueue.getWmsTaskType());
|
||||
takeCompleted(takeCompletedParam);
|
||||
if ("3".equals(agvQueue.getWmsTaskType())){
|
||||
//修改点位状态
|
||||
WcsPort wcsPort = wcsPortService.selectWcsPortByPortCode(agvQueue.getPositionCode1());
|
||||
wcsPort.setStatus("0");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
log.info("未知方法");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送AGV任务
|
||||
* @param receiveOutJob
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||
AgvQueue agvQueue = createAgvQueue(receiveOutJob.getCargoSpaceId(),receiveOutJob.getExitId(),receiveOutJob.getTrayCode(),receiveOutJob.getTaskNo(),"2");
|
||||
if (agvQueue != null){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error("生成agv任务失败");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 接收流利架空料箱入库任务
|
||||
*
|
||||
* @param receiveInJob
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult receiveInMydoJob(ReceiveJob receiveInJob) {
|
||||
AgvQueue agvQueue = createAgvQueue(receiveInJob.getEntranceId(),receiveInJob.getCargoSpaceId(),receiveInJob.getTrayCode(),receiveInJob.getTaskNo(),"1");
|
||||
if (agvQueue != null){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error("生成agv任务失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 流利架出库确认,清空流利架状态信息
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult outMydojobMakesure(JobParam jobParam) {
|
||||
BasFluentFrame param = new BasFluentFrame();
|
||||
param.setTrayCode(jobParam.getTrayCode());
|
||||
List<BasFluentFrame> basFluentFrames = fluentFrameService.selectBasFluentFrameList(param);
|
||||
if (CollUtil.isEmpty(basFluentFrames)){
|
||||
return AjaxResult.error("无流利架信息");
|
||||
}
|
||||
BasFluentFrame basFluentFrame = basFluentFrames.get(0);
|
||||
basFluentFrame.setTrayCode("");
|
||||
basFluentFrame.setAllotNum(0L);
|
||||
fluentFrameService.updateBasFluentFrame(basFluentFrame);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
/**
|
||||
* 取消ctu任务
|
||||
*
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult cancelMydoJob(JobParam jobParam) {
|
||||
AgvQueue param = new AgvQueue();
|
||||
param.setWmsTaskNo(jobParam.getTaskNo());
|
||||
for (AgvQueue agvQueue : agvQueueService.selectAgvQueueList(param)) {
|
||||
CancelTaskRequest cancelTaskRequest = new CancelTaskRequest();
|
||||
cancelTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
CancelTaskResponse cancelTaskResponse = cancelTask(cancelTaskRequest);
|
||||
if (cancelTaskResponse.getCode() == 0){
|
||||
agvQueue.setStatus("5");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务单取消】 wms任务号:{} agv任务号:{}", agvQueue.getWmsTaskNo(), agvQueue.getTaskCode());
|
||||
}
|
||||
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成agv队列
|
||||
* @param code1 起点
|
||||
* @param code2 终点
|
||||
* @param wmsTrayCode 容器码 托盘料箱码/容器码
|
||||
* @param wmsTaskNo mydojob 任务
|
||||
* @param wmsTaskType 1-入库 2-出库 3-agv搬运
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AgvQueue createAgvQueue(String code1,String code2,String wmsTrayCode,String wmsTaskNo,String wmsTaskType) {
|
||||
//生成ctu执行队列
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
String reqCode = IdUtil.fastSimpleUUID();
|
||||
String taskCode = IdUtil.fastSimpleUUID();
|
||||
agvQueue.setReqCode(reqCode);
|
||||
agvQueue.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
agvQueue.setAgvType("CTU");
|
||||
agvQueue.setPositionCode1(code1);
|
||||
agvQueue.setPositionCode2(code2);
|
||||
agvQueue.setTaskType("F01");
|
||||
agvQueue.setCtnrType("0");
|
||||
agvQueue.setCtnrCode("0");
|
||||
agvQueue.setCtnrNum("0");
|
||||
agvQueue.setTaskMode("0");
|
||||
agvQueue.setPriority("10");
|
||||
agvQueue.setRequest("0");
|
||||
agvQueue.setWmsTraycode(wmsTrayCode);
|
||||
agvQueue.setWmsTaskNo(wmsTaskNo);
|
||||
agvQueue.setStatus("0");
|
||||
agvQueue.setTaskCode(taskCode);
|
||||
agvQueue.setWmsTaskType(wmsTaskType);
|
||||
agvQueueService.insertAgvQueue(agvQueue);
|
||||
return agvQueue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消AGV任务
|
||||
* @param cancelTaskRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CancelTaskResponse cancelTask(CancelTaskRequest cancelTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CANCEL_TASK_URL, "取消任务", JSONUtil.toJsonStr(cancelTaskRequest));
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), CancelTaskResponse.class);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续agv任务
|
||||
* @param continueTaskRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ContinueTaskResponse continueTask(ContinueTaskRequest continueTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CONTINUE_TASK_URL, "继续执行任务", JSONUtil.toJsonStr(continueTaskRequest));
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), ContinueTaskResponse.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 请求海康生成agv任务,并修改wms任务状态
|
||||
*
|
||||
* @param agvQueue
|
||||
*/
|
||||
@Override
|
||||
public GenAgvSchedulingTaskResponse requestAgvQueue(AgvQueue agvQueue) {
|
||||
//todo 请求ctu
|
||||
GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest = new GenAgvSchedulingTaskRequest();
|
||||
genAgvSchedulingTaskRequest.setReqCode(agvQueue.getReqCode());
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setPriority("10");
|
||||
genAgvSchedulingTaskRequest.setTaskTyp("F01");
|
||||
genAgvSchedulingTaskRequest.setCtnrCode("0");
|
||||
genAgvSchedulingTaskRequest.setCtnrNum("0");
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setTaskCode(agvQueue.getWmsTaskNo());
|
||||
genAgvSchedulingTaskRequest.setAgvTyp("CTU");
|
||||
genAgvSchedulingTaskRequest.setPositionSelStrategy("0");
|
||||
genAgvSchedulingTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
List<PositionCodeData> positionCodePath = new ArrayList<>();
|
||||
positionCodePath.add(new PositionCodeData(agvQueue.getPositionCode1(), "0"));
|
||||
positionCodePath.add(new PositionCodeData(agvQueue.getPositionCode2(), "0"));
|
||||
genAgvSchedulingTaskRequest.setPositionCodePath(positionCodePath);
|
||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.ruoyi.api.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.InterfaceReceive;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.api.mapper.RequestLogMapper;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IRequestLogService;
|
||||
|
||||
/**
|
||||
* 接口记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RequestLogServiceImpl implements IRequestLogService
|
||||
{
|
||||
@Autowired
|
||||
private RequestLogMapper requestLogMapper;
|
||||
|
||||
/**
|
||||
* 查询接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 接口记录
|
||||
*/
|
||||
@Override
|
||||
public RequestLog selectRequestLogByRequestId(Long requestId)
|
||||
{
|
||||
return requestLogMapper.selectRequestLogByRequestId(requestId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 接口记录
|
||||
*/
|
||||
@Override
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog)
|
||||
{
|
||||
return requestLogMapper.selectRequestLogList(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRequestLog(RequestLog requestLog)
|
||||
{
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
return requestLogMapper.insertRequestLog(requestLog);
|
||||
}else {
|
||||
//log.error("请求失败:" + requestLog.getErrorDetails());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRequestLog(RequestLog requestLog)
|
||||
{
|
||||
return requestLogMapper.updateRequestLog(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除接口记录
|
||||
*
|
||||
* @param requestIds 需要删除的接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds)
|
||||
{
|
||||
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接口记录信息
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRequestLogByRequestId(Long requestId)
|
||||
{
|
||||
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
* @param url 请求url
|
||||
* @param param 参数
|
||||
* @return requestLog
|
||||
*/
|
||||
@Override
|
||||
public RequestLog getRequestLog(String url, String endPoint,String param) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setSourceSystem("wcs");
|
||||
requestLog.setTargetSystem("wms");
|
||||
requestLog.setEndpoint(endPoint);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setRequestHeaders(null);
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setRequestUrl(url);
|
||||
try {
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
Date responseTime =new Date();
|
||||
if (bean.getCode() == 200) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
requestLog.setIsSuccessful("1");
|
||||
}else {
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setErrorDetails(bean.getMsg());
|
||||
requestLog.setIsSuccessful("0");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseStatus("0");
|
||||
} finally {
|
||||
insertRequestLog(requestLog);
|
||||
}
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
* @return requestLog
|
||||
*/
|
||||
@Override
|
||||
public RequestLog getRequestLog(String param, String endPoint) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setSourceSystem("wms");
|
||||
requestLog.setTargetSystem("wcs");
|
||||
requestLog.setEndpoint(endPoint);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setResponseTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
||||
return requestLog;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user