流利架 入库出库逻辑
This commit is contained in:
@@ -27,6 +27,14 @@ public class ToWcsApiController {
|
|||||||
toWcsService.pushOutMydoJob();
|
toWcsService.pushOutMydoJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送CTU流利架空料箱入库任务
|
||||||
|
*/
|
||||||
|
@PostMapping("/pushInMydoJob")
|
||||||
|
public void pushInMydoJob(String trayCode) {
|
||||||
|
toWcsService.pushInMydoJob(trayCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送agv搬运作业
|
* 推送agv搬运作业
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -14,4 +14,6 @@ public interface IToWcsService {
|
|||||||
void pushOutMydoJob();
|
void pushOutMydoJob();
|
||||||
|
|
||||||
AjaxResult pushAgvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
AjaxResult pushAgvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||||
|
|
||||||
|
void pushInMydoJob(String trayCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.api.service.impl;
|
package com.ruoyi.api.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.api.domain.GenAgvSchedulingTaskRequest;
|
import com.ruoyi.api.domain.GenAgvSchedulingTaskRequest;
|
||||||
@@ -39,6 +40,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
|||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
|
||||||
public static final String PUSH_OUT_MYDO_JOB = "http://localhost:8081/agv/api/receiveOutMydoJob";
|
public static final String PUSH_OUT_MYDO_JOB = "http://localhost:8081/agv/api/receiveOutMydoJob";
|
||||||
|
public static final String PUSH_IN_MYDO_JOB = "http://localhost:8081/agv/api/receiveInMydoJob";
|
||||||
public static final String PUSH_AGV_MOVE_JOB = "http://localhost:8081/agv/api/receiveAgvMoveJob";
|
public static final String PUSH_AGV_MOVE_JOB = "http://localhost:8081/agv/api/receiveAgvMoveJob";
|
||||||
|
|
||||||
|
|
||||||
@@ -71,4 +73,16 @@ public class ToWcsServiceImpl implements IToWcsService {
|
|||||||
}
|
}
|
||||||
return AjaxResult.error(requestLog.getDuration());
|
return AjaxResult.error(requestLog.getDuration());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pushInMydoJob(String trayCode) {
|
||||||
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTrayCode(trayCode);
|
||||||
|
if (ObjUtil.isNotNull(mydoJob)){
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(PUSH_IN_MYDO_JOB, JSONUtil.toJsonStr(mydoJob), "推送出库任务");
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())){
|
||||||
|
mydoJob.setStatus("2");
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
//查询拣选工位绑定的电子标签
|
//查询拣选工位绑定的电子标签
|
||||||
BasTag tagParam = new BasTag();
|
BasTag tagParam = new BasTag();
|
||||||
tagParam.setPickAdd(wmsJobRequest.getPickSsj());
|
tagParam.setPickAdd(wmsJobRequest.getPickSsj());
|
||||||
|
tagParam.setSpare3("1");
|
||||||
List<BasTag> tags = iBasTagService.selectBasTagList(tagParam);
|
List<BasTag> tags = iBasTagService.selectBasTagList(tagParam);
|
||||||
if (tags.isEmpty()){
|
if (tags.isEmpty()){
|
||||||
return AjaxResult.error("没有该拣选工位绑定的电子标签");
|
return AjaxResult.error("没有该拣选工位绑定的电子标签");
|
||||||
|
|||||||
@@ -108,7 +108,12 @@ public class TagTaskController extends BaseController
|
|||||||
* 传入电子标签信息
|
* 传入电子标签信息
|
||||||
*/
|
*/
|
||||||
//@Scheduled(fixedDelay = 2000)
|
//@Scheduled(fixedDelay = 2000)
|
||||||
public void tagManager(){
|
public void tagOutManager(){
|
||||||
tagTaskService.tagManager();
|
tagTaskService.tagOutManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void tagInManager(){
|
||||||
|
tagTaskService.tagInManager();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,5 +62,7 @@ public interface ITagTaskService
|
|||||||
/**
|
/**
|
||||||
* 电子标签管理
|
* 电子标签管理
|
||||||
*/
|
*/
|
||||||
void tagManager();
|
void tagOutManager();
|
||||||
|
|
||||||
|
void tagInManager();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ import java.util.Optional;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ruoyi.bas.tag.domain.BasTag;
|
import com.ruoyi.bas.tag.domain.BasTag;
|
||||||
import com.ruoyi.bas.tag.service.IBasTagService;
|
import com.ruoyi.bas.tag.service.IBasTagService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.out.tagTask.domain.ExecuteSocket;
|
import com.ruoyi.out.tagTask.domain.ExecuteSocket;
|
||||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||||
|
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||||
import com.ruoyi.pda.service.PdaService;
|
import com.ruoyi.pda.service.PdaService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -114,7 +116,7 @@ public class TagTaskServiceImpl implements ITagTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tagManager() {
|
public void tagOutManager() {
|
||||||
//查询所有的电子标签任务
|
//查询所有的电子标签任务
|
||||||
TagTask tagTaskParam = new TagTask();
|
TagTask tagTaskParam = new TagTask();
|
||||||
//tagTaskParam.setStatus("0");
|
//tagTaskParam.setStatus("0");
|
||||||
@@ -220,6 +222,43 @@ public class TagTaskServiceImpl implements ITagTaskService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tagInManager() {
|
||||||
|
BasTag param = new BasTag();
|
||||||
|
param.setSpare3("2");
|
||||||
|
List<BasTag> basTags = basTagService.selectBasTagList(param);
|
||||||
|
for (BasTag basTag : basTags) {
|
||||||
|
Socket socket = getSocket(basTag);
|
||||||
|
try {
|
||||||
|
/** 接收电子标签指令 */
|
||||||
|
String content = readData(socket);//读取值
|
||||||
|
if (!content.isEmpty()) {
|
||||||
|
log.info("读取电子标签值:" + content);
|
||||||
|
}
|
||||||
|
//将拍灯指令整理成数组
|
||||||
|
String[] split = content.split("5a");
|
||||||
|
for (String s : split) {
|
||||||
|
if (s.length() == 10) {
|
||||||
|
String type = s.substring(4, 6);//指令类型 01是下发成功反馈 12是拍灭绿灯指令
|
||||||
|
if ("12".equals(type)) {
|
||||||
|
//12为 绿色拍灯指令
|
||||||
|
//生成agv空料箱入库作业
|
||||||
|
TrayCodeMsg trayCodeMsg = new TrayCodeMsg();
|
||||||
|
trayCodeMsg.setTrayCode(IdUtil.fastSimpleUUID());
|
||||||
|
trayCodeMsg.setWarehouseId("02");
|
||||||
|
trayCodeMsg.setEntranceId(basTag.getPickAdd());
|
||||||
|
pdaService.emptyBoxIn(trayCodeMsg);
|
||||||
|
//推送空料箱入库作业 生成ctu队列
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取socket
|
* 获取socket
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user