流利架出库逻辑
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -12,6 +13,7 @@ import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
@@ -82,4 +84,6 @@ public interface IApiService
|
||||
* @return
|
||||
*/
|
||||
AjaxResult agvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||
|
||||
RequestLog finishMydoJob(String agvFinishUrl, String point, Map<String, Object> param);
|
||||
}
|
||||
|
||||
@@ -108,6 +108,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestLog finishMydoJob(String agvFinishUrl, String endPoint, Map<String, Object> param) {
|
||||
return requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
|
||||
private void agvCallbackInfo(AgvCallbackRequest request) {
|
||||
String taskCode = request.getTaskCode();
|
||||
@@ -134,9 +139,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//通知wms agv搬运阶段完成
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("task_no", agvQueue.getWmsTaskNo());
|
||||
param.put("tray_code", agvQueue.getWmsTraycode());
|
||||
param.put("wms_type", agvQueue.getWmsTaskType());
|
||||
|
||||
param.put("wmsType", agvQueue.getWmsTaskType());
|
||||
if ("1".equals(agvQueue.getWmsTaskType()) || "2".equals(agvQueue.getWmsTaskType())){
|
||||
//通知wms 任务结束
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
@@ -145,7 +149,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
List<MydoJob> mydoJobList = getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)) {
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
if (Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
//入库任务 暂无特殊逻辑
|
||||
RequestLog requestLog = requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
@@ -154,7 +159,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
log.info("【AGV入库任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
} else {
|
||||
@@ -166,15 +171,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
//写入信息 取货完成
|
||||
int i = PlcRead.WriteToSSJ(deviceSsj.getPlcDbWriteAddress(), bytes);
|
||||
if (i==1){
|
||||
RequestLog requestLog = requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,6 +183,10 @@ public class ApiServiceImpl implements IApiService {
|
||||
log.info("【AGV任务结束】任务号:{},wms不存在对应的作业", 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(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
@@ -196,6 +201,12 @@ public class ApiServiceImpl implements IApiService {
|
||||
break;
|
||||
case "cancel":
|
||||
//任务单取消
|
||||
agvQueue.setStatus("5");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务单取消】任务号:{}", taskCode);
|
||||
break;
|
||||
case "apply":
|
||||
|
||||
Reference in New Issue
Block a user