现场运行调整
This commit is contained in:
@@ -175,22 +175,26 @@ public class ApiServiceImpl implements IApiService {
|
||||
// }
|
||||
|
||||
// 1.wms推送的作业号是否重复
|
||||
MydoJob job = new MydoJob().builder().jobId(stockoutReceive.getJobId()).build();
|
||||
MydoJob job = mydoJobService.selectMydoJobByJobId(stockoutReceive.getJobId());
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
log.info("【提示】wms下发出库任务失败,该任务已存在,wms作业号:{}", stockoutReceive.getJobId());
|
||||
return AjaxResult.error("【提示】wms下发出库任务失败,该任务已存在,wms作业号:{}" + stockoutReceive.getJobId());
|
||||
}
|
||||
|
||||
// 2.wms推送的出库货位是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(stockoutReceive.getCargoSpaceId()).build();
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().cargoSpaceId(stockoutReceive.getCargoSpaceId()).build()
|
||||
);
|
||||
if (!jobs.isEmpty()) {
|
||||
log.info("【提示】wms下发出库任务失败,已经存在该货位的出库任务,wms作业号:{},推送出库货位:{}", stockoutReceive.getJobId(), stockoutReceive.getCargoSpaceId());
|
||||
return AjaxResult.error("【提示】wms下发出库任务失败,已经存在该货位的出库任务,wms作业号:{}" + stockoutReceive.getJobId() + ",推送出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
}
|
||||
|
||||
// 3.wms推送的出托盘号是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(stockoutReceive.getTrayCode()).build();
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().trayCode(stockoutReceive.getTrayCode()).build()
|
||||
);
|
||||
if (!jobs.isEmpty()) {
|
||||
log.info("【提示】wms下发出库任务失败,已经存在该托盘的出库任务,wms作业号:{},推送托盘号:{}", stockoutReceive.getJobId(), stockoutReceive.getTrayCode());
|
||||
return AjaxResult.error("【提示】wms下发出库任务失败,已经存在该货位的出库任务,wms作业号:{}" + stockoutReceive.getJobId() + ",推送托盘号:" + stockoutReceive.getTrayCode());
|
||||
}
|
||||
@@ -230,7 +234,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLogService.updateRequestLog(requestLog);
|
||||
return AjaxResult.success(
|
||||
"【堆垛机出库】wms下发出库作业,下发作业号:" + stockoutReceive.getJobId() + ",出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
"wms下发出库作业,等待堆垛机执行,下发作业号:" + stockoutReceive.getJobId() + ",出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
}else{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
@@ -252,15 +256,17 @@ public class ApiServiceImpl implements IApiService {
|
||||
);
|
||||
|
||||
// 1.wms推送的作业号是否重复
|
||||
MydoJob job = new MydoJob().builder().jobId(receiveInJob.getJobId()).build();
|
||||
MydoJob job = mydoJobService.selectMydoJobByJobId(receiveInJob.getJobId());
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
log.info("【请求错误】wms下发入库任务失败,该任务已存在,推送作业号:{},目标货位:{}", receiveInJob.getJobId(), receiveInJob.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发入库任务失败,该任务已存在,推送作业号:{}" + receiveInJob.getJobId() + ",目标货位:" + receiveInJob.getCargoSpaceId());
|
||||
}
|
||||
|
||||
// 2.wms推送的目标货位是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(receiveInJob.getCargoSpaceId()).build();
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().cargoSpaceId(receiveInJob.getCargoSpaceId()).build()
|
||||
);
|
||||
if (jobs.isEmpty()) {
|
||||
log.info("【请求错误】wms下发入库任务失败,已经存在该货位的入库任务,推送作业号:{},目标货位:{}", receiveInJob.getJobId(), receiveInJob.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发入库任务失败,已经存在目标货位的入库任务,目标货位:{}" + receiveInJob.getJobId() + ",目标货位:" + receiveInJob.getCargoSpaceId());
|
||||
}
|
||||
@@ -317,17 +323,17 @@ public class ApiServiceImpl implements IApiService {
|
||||
);
|
||||
|
||||
// 1.wms推送的作业号是否重复
|
||||
MydoJob job = new MydoJob().builder().jobId(receiveInJob.getJobId()).build();
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
MydoJob job = mydoJobService.selectMydoJobByJobId(receiveInJob.getJobId());
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
log.info("【请求错误】wms下发移库任务失败,该任务已存在,wms作业号:{},源货位:{},目标货位:{}", receiveInJob.getJobId(), receiveInJob.getCargoSpaceId(), receiveInJob.getTargetCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发移库任务失败,该任务已存在,推送作业号:{}" + receiveInJob.getJobId() + ",目标货位:" + receiveInJob.getCargoSpaceId());
|
||||
}
|
||||
|
||||
// 2.wms推送的目标货位是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(receiveInJob.getCargoSpaceId()).build();
|
||||
tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().cargoSpaceId(receiveInJob.getCargoSpaceId()).build()
|
||||
);
|
||||
if (jobs.isEmpty()) {
|
||||
log.info("【请求错误】wms下发移库任务失败,已经存在该货位任务,推送作业号:{},源货位:{},目标货位:{}", receiveInJob.getJobId(), receiveInJob.getCargoSpaceId(), receiveInJob.getTargetCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发移库任务失败,已经存在目标货位任务,目标货位:{}" + receiveInJob.getJobId() + ",目标货位:" + receiveInJob.getCargoSpaceId());
|
||||
}
|
||||
@@ -385,17 +391,17 @@ public class ApiServiceImpl implements IApiService {
|
||||
);
|
||||
|
||||
// 1.wms推送的作业号是否重复
|
||||
MydoJob job = new MydoJob().builder().jobId(receiveInventoryJob.getJobId()).build();
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
MydoJob job = mydoJobService.selectMydoJobByJobId(receiveInventoryJob.getJobId());
|
||||
if (ObjUtil.isNotNull(job)) {
|
||||
log.info("【请求错误】wms下发盘点任务失败,该任务已存在,推送作业号:{},目标货位:{}", receiveInventoryJob.getJobId(), receiveInventoryJob.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发盘点任务失败,该任务已存在,推送作业号:{}" + receiveInventoryJob.getJobId() + ",目标货位:" + receiveInventoryJob.getCargoSpaceId());
|
||||
}
|
||||
|
||||
// 2.wms推送的目标货位是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(receiveInventoryJob.getCargoSpaceId()).build();
|
||||
tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().trayCode(receiveInventoryJob.getTrayCode()).build()
|
||||
);
|
||||
if (jobs.isEmpty()) {
|
||||
log.info("【请求错误】wms下发盘点任务失败,已经存在该货位的入库任务,推送作业号:{},目标货位:{}", receiveInventoryJob.getJobId(), receiveInventoryJob.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发盘点任务失败,已经存在目标货位的盘点任务,目标货位:{}" + receiveInventoryJob.getJobId() + ",目标货位:" + receiveInventoryJob.getCargoSpaceId());
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class TaskHandler {
|
||||
/**
|
||||
* 【自动完成】 - 处理标记为自动完成的任务
|
||||
*/
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_3000)
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_DEFAULT)
|
||||
public void mydoJobAutoFinish() {
|
||||
//查询所有标记为【已完成】的任务
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
@@ -97,7 +97,7 @@ public class TaskHandler {
|
||||
/**
|
||||
* 【手动完成】 - 查询并处理标记为已经手动完成的任务
|
||||
*/
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_3000)
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_DEFAULT)
|
||||
public void manualFinishmydoJob() {
|
||||
//查询所有标记为【已完成】的任务
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
@@ -114,7 +114,7 @@ public class TaskHandler {
|
||||
/**
|
||||
* 【手动作废】 - 查询并处理标记为已经作废的任务
|
||||
*/
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_3000)
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_DEFAULT)
|
||||
public void cancelMydoJob(){
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().status(TASK_STATUS_INVALID).build()
|
||||
@@ -148,7 +148,7 @@ public class TaskHandler {
|
||||
/**
|
||||
* 定时扫描未回传或回传异常的任务记录
|
||||
*/
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_3000)
|
||||
@Scheduled(fixedDelay = TIMEINTERVAL_DEFAULT)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class DdjThread_1 implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class DdjThread_2 implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class PortConvThread implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.ruoyi.common.TaskType;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
@@ -48,6 +49,7 @@ public class RoadConvThread implements Runnable {
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
private IRequestLogService requestLogService;
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
@@ -66,6 +68,8 @@ public class RoadConvThread implements Runnable {
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
deviceSsjService = SpringUtils.getBean(IDeviceSsjService.class);
|
||||
requestLogService = SpringUtils.getBean(IRequestLogService.class);
|
||||
//初始化巷道口 排 列 层
|
||||
//todo 核对堆垛机取放位置的货位编码
|
||||
roadwayMap.put("L1001", Arrays.asList(2, 0, 1));
|
||||
@@ -100,7 +104,7 @@ public class RoadConvThread implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -247,10 +251,58 @@ public class RoadConvThread implements Runnable {
|
||||
*/
|
||||
private boolean roadConvCheckedForStockout(DeviceSsj outSsjDevice){
|
||||
|
||||
boolean flag = false;
|
||||
boolean flag = true;
|
||||
//---------------------------巷道口取放货输送机---------------------------
|
||||
//输送机【任务号】和【到位】校验
|
||||
if (outSsjDevice.getTaskNo() == 0 && outSsjDevice.getDw() == 0) flag = true;
|
||||
if (outSsjDevice.getTaskNo() != 0 || outSsjDevice.getDw() != 0) flag = false;
|
||||
|
||||
//无入库作业
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(new MydoJob());
|
||||
if (jobs.isEmpty() || jobs.stream().anyMatch(s -> Convert.toInt(s.getInOrOut()) < 20)){
|
||||
flag = false;
|
||||
}
|
||||
|
||||
//入口输送机无空闲和任务号
|
||||
DeviceSsj ssj;
|
||||
if (outSsjDevice.getDeviceCode().equals("L1003")){
|
||||
ssj = deviceSsjService.selectDeviceSsjByDeviceCode("L1002");
|
||||
if (ObjUtil.isNotNull(ssj)){
|
||||
if (ssj.getKx() != 1 || ssj.getTaskNo() != 0) {
|
||||
// log.info("L1002");
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (outSsjDevice.getDeviceCode().equals("L1005")){
|
||||
ssj = deviceSsjService.selectDeviceSsjByDeviceCode("L1004");
|
||||
if (ObjUtil.isNotNull(ssj)){
|
||||
if (ssj.getKx() != 1 || ssj.getTaskNo() != 0){
|
||||
// log.info("L1004");
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (outSsjDevice.getDeviceCode().equals("L1007")){
|
||||
ssj = deviceSsjService.selectDeviceSsjByDeviceCode("L1006");
|
||||
if (ObjUtil.isNotNull(ssj)){
|
||||
if (ssj.getKx() != 1 || ssj.getTaskNo() != 0) {
|
||||
// log.info("L1006");
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (outSsjDevice.getDeviceCode().equals("L1010")){
|
||||
ssj = deviceSsjService.selectDeviceSsjByDeviceCode("L1009");
|
||||
if (ObjUtil.isNotNull(ssj)){
|
||||
if (ssj.getKx() != 1 || ssj.getTaskNo() != 0) {
|
||||
// log.info("L1009");
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
@@ -455,7 +507,7 @@ public class RoadConvThread implements Runnable {
|
||||
//检查巷道口输送机是否空闲
|
||||
if(roadSsjDevice.getKx() == 1 && roadSsjDevice.getTaskNo() == 0){
|
||||
|
||||
//检查是否有入口是1#巷道的出库任务
|
||||
//检查是否有当前巷道的出库任务
|
||||
String exitId = roadSsjDevice.getDeviceCode();
|
||||
|
||||
//检查是否有出库任务
|
||||
|
||||
@@ -26,6 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select request_id, request_time, source_system, target_system, endpoint, request_url, request_method, request_headers, request_body, response_time, response_body, response_status, error_details, duration, Is_successful from request_log
|
||||
</sql>
|
||||
|
||||
<sql id="selectTop1RequestLogVo">
|
||||
select top 1 request_id, request_time, source_system, target_system, endpoint, request_url, request_method, request_headers, request_body, response_time, response_body, response_status, error_details, duration, Is_successful from request_log
|
||||
</sql>
|
||||
|
||||
<select id="selectRequestLogList" parameterType="RequestLog" resultMap="RequestLogResult">
|
||||
<include refid="selectRequestLogVo"/>
|
||||
<where>
|
||||
@@ -50,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectRequestLogByLatestTask" resultMap="RequestLogResult">
|
||||
select top 1 request_id, request_time, source_system, target_system, endpoint, request_url, request_method, request_headers, request_body, response_time, response_body, response_status, error_details, duration, Is_successful from request_log
|
||||
<include refid="selectTop1RequestLogVo"/>
|
||||
order by request_time desc
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user