wcs调度系统基本框架
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 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 mydoJob
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/pushOutMydoJob")
|
||||
public AjaxResult PushOutMydoJob(@RequestBody MydoJob mydoJob) {
|
||||
return apiService.PushOutMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param genAgvSchedulingTaskRequest
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/agvMoveJob")
|
||||
public AjaxResult agvMoveJob(@RequestBody GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
return apiService.agvMoveJob(genAgvSchedulingTaskRequest);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,10 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wcs2Wms/api")
|
||||
public class Wcs2WmsController {
|
||||
|
||||
}
|
||||
@@ -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")).toString();
|
||||
/**
|
||||
* 客户端编号
|
||||
* 客户端编号,如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,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,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);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.api.service;
|
||||
|
||||
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.MydoJob;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface IApiService
|
||||
{
|
||||
/**
|
||||
* 获取任务列表
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
public List<MydoJob> getMydoJobList(MydoJob mydoJob);
|
||||
/**
|
||||
* 更新任务
|
||||
* @param mydoJob
|
||||
*/
|
||||
boolean updateMydoJob(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* WMS出库任务推送
|
||||
* @param mydoJob
|
||||
*/
|
||||
public AjaxResult PushOutMydoJob(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 取消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 genAgvSchedulingTaskRequest
|
||||
* @return
|
||||
*/
|
||||
AjaxResult agvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||
}
|
||||
@@ -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,211 @@
|
||||
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.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.SsjDevice;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@Override
|
||||
public List<MydoJob> getMydoJobList(MydoJob mydoJob) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(GET_MYDOJOB_URL, "获取任务", JSONUtil.toJsonStr(mydoJob));
|
||||
String responseBody = requestLog.getResponseBody();
|
||||
InterfaceReceive bean = JSONUtil.toBean(responseBody, InterfaceReceive.class);
|
||||
return JSONUtil.toList(JSONUtil.toJsonStr(bean.getData()), MydoJob.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenAgvSchedulingTaskResponse genAgvSchedulingTask(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(GEN_AGV_SCHEDULING_TASK, JSONUtil.toJsonStr(genAgvSchedulingTaskRequest), "生成AGV任务");
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), GenAgvSchedulingTaskResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgvCallbackResponse agvCallback(AgvCallbackRequest request) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(request), "AGV任务执行通知");
|
||||
requestLog.setRequestUrl("http://10.214.18.61:8089/external/log/outStockJob");
|
||||
AgvCallbackResponse response = new AgvCallbackResponse(0, "成功", "");
|
||||
try {
|
||||
agvCallbackInfo(request);
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(response));
|
||||
requestLog.setResponseStatus("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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult agvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
//todo 生成agvQueue队列
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueueService.insertAgvQueue(agvQueue);
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
|
||||
}
|
||||
|
||||
|
||||
private void agvCallbackInfo(AgvCallbackRequest request) {
|
||||
String taskCode = request.getTaskCode();
|
||||
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(taskCode);
|
||||
|
||||
if (ObjUtil.isNotNull(agvQueue)) {
|
||||
switch (request.getMethod()) {
|
||||
case "start":
|
||||
//任务开始
|
||||
log.info("【AGV任务开始】任务号:{}", taskCode);
|
||||
break;
|
||||
case "outbin":
|
||||
//走出储位
|
||||
if ("2".equals(agvQueue.getStatus())) {
|
||||
agvQueue.setStatus("3");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV走出储位】任务号:{}", taskCode);
|
||||
}
|
||||
break;
|
||||
case "end":
|
||||
//任务结束
|
||||
agvQueue.setStatus("4");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
if ("1".equals(agvQueue.getWmsTaskType()) || "2".equals(agvQueue.getWmsTaskType())){
|
||||
//通知wms 任务结束
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTaskNo(agvQueue.getWmsTaskNo());
|
||||
mydoJobParam.setTrayCode(agvQueue.getWmsTraycode());
|
||||
List<MydoJob> mydoJobList = getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)) {
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
//通知wms agv搬运阶段完成
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("task_no", agvQueue.getWmsTaskNo());
|
||||
param.put("tray_code", agvQueue.getWmsTraycode());
|
||||
requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
if (Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
//入库任务 暂无特殊逻辑
|
||||
} else {
|
||||
//todo 写入对应的plc 任务号
|
||||
}
|
||||
} else {
|
||||
log.info("【AGV任务结束】任务号:{},wms不存在对应的作业", taskCode);
|
||||
}
|
||||
}else if (agvQueue.getWmsTaskType().equals("3")){
|
||||
//todo 绑定点位和料架
|
||||
}
|
||||
break;
|
||||
case "cancel":
|
||||
//任务单取消
|
||||
log.info("【AGV任务单取消】任务号:{}", taskCode);
|
||||
break;
|
||||
case "apply":
|
||||
//CTU料箱取放申请
|
||||
//请求放货
|
||||
if ("0".equals(agvQueue.getRequest())) {
|
||||
agvQueue.setRequest("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
log.info("【AGV料箱取放申请】任务号:{}", taskCode);
|
||||
break;
|
||||
default:
|
||||
log.info("未知方法");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult PushOutMydoJob(MydoJob mydoJob) {
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
String reqCode = IdUtil.fastSimpleUUID();
|
||||
agvQueue.setReqCode(reqCode);
|
||||
agvQueue.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
agvQueue.setAgvType("CTU");
|
||||
agvQueue.setPositionCode1(mydoJob.getCargoSpaceId());
|
||||
agvQueue.setPositionCode2(mydoJob.getExitId());
|
||||
int i = agvQueueService.insertAgvQueue(agvQueue);
|
||||
if (i > 0) {
|
||||
log.info("向AGV下任务成功");
|
||||
return AjaxResult.success("向AGV下任务成功");
|
||||
} else {
|
||||
log.info("向AGV下任务失败");
|
||||
return AjaxResult.error("向AGV下任务失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CancelTaskResponse cancelTask(CancelTaskRequest cancelTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CANCEL_TASK_URL, "取消任务", JSONUtil.toJsonStr(cancelTaskRequest));
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), CancelTaskResponse.class);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContinueTaskResponse continueTask(ContinueTaskRequest continueTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CONTINUE_TASK_URL, "继续执行任务", JSONUtil.toJsonStr(continueTaskRequest));
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), ContinueTaskResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateMydoJob(MydoJob mydoJob) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(GET_MYDOJOB_URL, "获取任务", JSONUtil.toJsonStr(mydoJob));
|
||||
String responseBody = requestLog.getResponseBody();
|
||||
InterfaceReceive bean = JSONUtil.toBean(responseBody, InterfaceReceive.class);
|
||||
if (bean.getCode() == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
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 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
|
||||
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)
|
||||
{
|
||||
return requestLogMapper.insertRequestLog(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @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 param, String endPoint) {
|
||||
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() == 0) {
|
||||
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 {
|
||||
requestLogMapper.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