no message

main
HUOJIN\92525 2025-02-25 09:11:10 +08:00
parent 36ef278386
commit 3ef84b1940
4 changed files with 53 additions and 40 deletions

View File

@ -504,7 +504,7 @@ public class BydAppServiceImpl implements BydAppService {
// 没有空车的处理逻辑
if (agvTaskService.isEndPointAvailable(endPoint.getCode(), BizStatus.FB_RETURN, "FORKLIFT_MOVE")) {
// 生成agv任务进行等待
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.FB_RETURN, task.getSrcStock(), task.getDstPointCode(), endPoint.getCode(), "FORKLIFT_MOVE");
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.FB_RETURN, task.getSrcStock(),task.getSrcStock().getPoint().getCode() , endPoint.getCode(), "FORKLIFT_MOVE");
pointService.usedPoint(endPoint);
kmReService.sendAgvTask(agvTask, kmReService.sendAgvTaskCcJson(agvTask));
}

View File

@ -136,7 +136,7 @@ public class MesServiceImpl implements MesService {
if (pick.getCallPoint() == null || pick.getCallPoint().length() <= 0) {
pick.setCallPoint(pointCode);
} else {
return gdNo + ":" + itemCode + ":" + station + "工单已叫料,请稍等!";
pick.setCallPoint(pick.getCallPoint() + "," + pointCode);
}
pick.setIsCall(true);
pickRepository.save(pick);
@ -153,7 +153,7 @@ public class MesServiceImpl implements MesService {
if (pick.getCallPoint() == null || pick.getCallPoint().length() <= 0) {
pick.setCallPoint(pointCode);
} else {
return gdNo + ":" + completeCode + ":" + station + "工单已叫料,请稍等!";
pick.setCallPoint(pick.getCallPoint() + "," + pointCode);
}
pick.setIsCall(true);
pickRepository.save(pick);
@ -288,7 +288,6 @@ public class MesServiceImpl implements MesService {
}
private String moveCpOffLine(TransTask transTask) {
Point srcPoint = pointRepository.findByCode(transTask.getPointCode());
if (srcPoint == null) {

View File

@ -271,33 +271,44 @@ public class TaskServiceImpl implements TaskService {
throw new BadRequestException(pick.getGdCode() + "工单没有进行叫料!");
}
//终点
String[] points = pick.getCallPoint().split(",");
String endPointCode = points[points.length - 1];
Point endPoint = pointService.queryPoint(endPointCode, null, null, null);
Set<String> endPointList = new HashSet<>(Arrays.asList(pick.getCallPoint().split(",")));
Map<String, Point> pointMap = pointService.findByCodes(endPointList);
/* AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.CALL_PICK, stock, srcPoint.getCode(), endPoint.getCode(), "RACK_MOVE");
agvTask.setLineSlotCode(pick.getCode());
agvTaskService.update(agvTask);*/
AgvTask agvTask = null;
for (Task task : taskList) {
List<AgvTask> agvTasks = agvTaskService.findRepeat(task.getDstStockCode(), task.getDstPointCode(), endPoint.getCode());
if (agvTasks.isEmpty()) {
//创建任务
agvTask = agvTaskService.createAgvTask(BizStatus.CALL_PICK, task.getDstStock(), task.getDstPointCode(), endPoint.getCode(), "RACK_MOVE");
agvTask.setLineSlotCode(pick.getCode());
agvTaskService.update(agvTask);
} else {
agvTask = agvTasks.get(0);
for (Map.Entry<String, Point> entry : pointMap.entrySet()) {
if (agvTaskService.isEndPointAvailable(entry.getValue().getCode(), BizStatus.CALL_PICK, "RACK_MOVE")) {
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.CALL_PICK, task.getDstStock(), task.getDstPointCode(), entry.getValue().getCode(), "RACK_MOVE");
agvTask.setLineSlotCode(pick.getCode());
agvTaskService.update(agvTask);
task.setCallAgvTaskId(agvTask.getId());
taskRepository.save(task);
}
}
task.setCallAgvTaskId(agvTask.getId());
taskRepository.save(task);
}
}
public static List<String> getValuesFromMap(List<String> list, Map<String, String> map) {
List<String> values = new ArrayList<>();
int count = list.size();
int index = 0;
// 遍历 map 的键值对
for (Map.Entry<String, String> entry : map.entrySet()) {
if (index >= count) {
break;
}
values.add(entry.getValue());
index++;
}
return values;
}
@Override
@Transactional(rollbackFor = Exception.class)
public String allocate(long id, double quantity) {

View File

@ -1,6 +1,7 @@
package com.youchain;
import com.youchain.basicdata.domain.BigItem;
import com.youchain.basicdata.domain.Point;
import com.youchain.basicdata.vo.BarCodeVo;
import com.youchain.businessdata.domain.PickDetail;
import com.youchain.exception.BadRequestException;
@ -23,33 +24,35 @@ public class EladminSystemApplicationTests {
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("DJ001");
list.add("DJ002");
list.add("DJ003");
list.add("DJ004");
list.add("DJ005");
list.add("DJ006");
list.add("DJ007");
list.add("1");
Map<String, String> map = new HashMap<>();
map.put("1001","DJ001");
map.put("1003","DJ003");
map.put("1004","DJ004");
map.put("JL001","2");
map.put("JL002","3");
List<String> result = new ArrayList<>();
for (String element : list) {
// 检查 map 的值中是否包含当前元素
if (!map.containsValue(element)) {
// 如果不包含,则将该元素添加到结果列表中
result.add(element);
}
List<String> result = getValuesFromMap(list, map);
for (String value : result) {
System.out.println(value);
}
List<String> strings= list.stream()
.filter(pointCode -> !map.containsValue(pointCode))
.collect(Collectors.toList());
}
System.out.println(strings);
public static List<String> getValuesFromMap(List<String> list, Map<String, String> map) {
List<String> values = new ArrayList<>();
int count = list.size();
int index = 0;
// 遍历 map 的键值对
for (Map.Entry<String, String> entry : map.entrySet()) {
if (index >= count) {
break;
}
values.add(entry.getValue());
index++;
}
return values;
}
static Set bb(Set set1, Set set2) {