修改流利架空料箱入库逻辑
This commit is contained in:
@@ -27,11 +27,18 @@ public interface IApiService
|
||||
{
|
||||
|
||||
/**
|
||||
* 请求入库
|
||||
* 根据条码请求入库
|
||||
* @param mydoJob
|
||||
* @return 返回入库口位置
|
||||
*/
|
||||
public MydoJob requestEnter(MydoJob mydoJob);
|
||||
public MydoJob requestEnterByTrayCode(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 根据入口请求入库
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
public MydoJob requestEnterByEnterId(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* WMS出库任务推送
|
||||
|
||||
@@ -57,8 +57,26 @@ public class ApiServiceImpl implements IApiService {
|
||||
* @return 返回入库口位置
|
||||
*/
|
||||
@Override
|
||||
public MydoJob requestEnter(MydoJob mydoJob) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(REQUEST_ENTER, "请求入库", JSONUtil.toJsonStr(mydoJob));
|
||||
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 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);
|
||||
@@ -102,6 +120,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvCallbackInfo(request);
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(response));
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setIsSuccessful("1");
|
||||
return new AgvCallbackResponse(0, "成功", "");
|
||||
} catch (RuntimeException e) {
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
|
||||
@@ -9,6 +9,7 @@ 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;
|
||||
@@ -22,6 +23,7 @@ import com.ruoyi.api.service.IRequestLogService;
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RequestLogServiceImpl implements IRequestLogService
|
||||
{
|
||||
@Autowired
|
||||
@@ -60,7 +62,12 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
@Override
|
||||
public int insertRequestLog(RequestLog requestLog)
|
||||
{
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
return requestLogMapper.insertRequestLog(requestLog);
|
||||
}else {
|
||||
log.error("请求失败:" + requestLog.getErrorDetails());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +147,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseStatus("0");
|
||||
} finally {
|
||||
requestLogMapper.insertRequestLog(requestLog);
|
||||
insertRequestLog(requestLog);
|
||||
}
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public class Constant {
|
||||
|
||||
|
||||
public static final String GET_MYDOJOB_URL = "http://localhost:8080/api2wms/getJob";
|
||||
public static final String REQUEST_ENTER = "http://localhost:8080/api2wms/requestEnter";
|
||||
public static final String REQUEST_ENTER_BY_TRAYCODE = "http://localhost:8080/api2wms/requestEnterByTrayCode";
|
||||
public static final String REQUEST_ENTER_BY_ENTER_ID = "http://localhost:8080/api2wms/requestEnterByEnterId";
|
||||
public static final String UPDATE_MYDOJOB_URL = "http://127.0.0.1:8081/rcms-dps/rest/queryAgvStatus/";
|
||||
public static final String JOB_FINISH_URL = "http://localhost:8080/api2wms/jobFinish";
|
||||
public static final String CONTINUE_TASK_URL = "http://127.0.0.1:8081/rcms-dps/rest/queryAgvStatus/";
|
||||
|
||||
@@ -125,7 +125,7 @@ public class BsInSsjThread implements Runnable {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setStatus("1");
|
||||
mydoJobParam.setEntranceId(lljCode);
|
||||
MydoJob mydoJob = apiService.requestEnter(mydoJobParam);
|
||||
MydoJob mydoJob = apiService.requestEnterByEnterId(mydoJobParam);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
//生成agv队列
|
||||
AgvQueue agvQueue = apiService.createAgvQueue(lljCode, mydoJob.getCargoSpaceId(),mydoJob.getTrayCode(),mydoJob.getTaskNo(),"1");
|
||||
@@ -141,9 +141,7 @@ public class BsInSsjThread implements Runnable {
|
||||
} else {
|
||||
if (ObjUtil.isNull(mydoJob)) {
|
||||
log.info("无入库库作业 lljCode:{}", lljCode);
|
||||
}
|
||||
if ("3".equals(mydoJob.getStatus())) {
|
||||
log.info("入库库作业已下发 taskNo:{}", mydoJob.getTaskNo());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +168,7 @@ public class BsInSsjThread implements Runnable {
|
||||
mydoJobParam.setStatus("1");
|
||||
mydoJobParam.setTrayCode(inSsjDevice.getTrayCode());
|
||||
mydoJobParam.setEntranceId(inSsjDevice.getDeviceCode());
|
||||
MydoJob mydoJob = apiService.requestEnter(mydoJobParam);
|
||||
MydoJob mydoJob = apiService.requestEnterByTrayCode(mydoJobParam);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
|
||||
//生成agv队列
|
||||
|
||||
@@ -95,7 +95,7 @@ public class JsInSsjThread implements Runnable {
|
||||
mydoJobParam.setStatus("1");
|
||||
mydoJobParam.setTrayCode(inSsjDevice.getTrayCode());
|
||||
mydoJobParam.setEntranceId(inSsjDevice.getDeviceCode());
|
||||
MydoJob mydoJob = apiService.requestEnter(mydoJobParam);
|
||||
MydoJob mydoJob = apiService.requestEnterByTrayCode(mydoJobParam);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
|
||||
//生成agv队列
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SsjMonitorThread implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(15000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user