no message

main
HUOJIN\92525 2025-03-07 12:44:11 +08:00
parent 6a6af5f0d9
commit 595af06b36
3 changed files with 30 additions and 17 deletions

View File

@ -191,4 +191,12 @@ public interface AgvTaskService {
*/
boolean isEndPointAvailable(String endPointCode, String type, String jobType);
/**
*
*
* @param stockCode
* @return boolean
*/
boolean isStockAvailable(String stockCode, String type, String jobType);
}

View File

@ -234,6 +234,18 @@ public class AgvTaskServiceImpl implements AgvTaskService {
return findByEndSlotCode(endPointCode, type, jobType);
}
@Override
public boolean isStockAvailable(String stockCode, String type, String jobType) {
String hql = " from AgvTask agv " +
" where agv.stockCode='" + stockCode + "' " +
" and agv.type='" + type + "' " +
" and agv.jobType='" + jobType + "' " +
" and agv.status in ('OPEN','ATCALL','UP_CONTAINER') ";
Query query = entityMapper.createQuery(hql);
List<AgvTask> agvTaskList = query.getResultList();
return agvTaskList.isEmpty();
}
public boolean isSrcPointAvailable(String startSlotCode, String type, String jobType) {
return findByStartSlotCode(startSlotCode, type, jobType);

View File

@ -275,27 +275,20 @@ public class TaskServiceImpl implements TaskService {
Map<String, Point> pointMap = pointService.findByCodes(endPointList);
List<String> endPoints = getValuesFromMap(endPointList, pointMap);
int taskCount = 0;
for (Task task : taskList) {
for (String endPointCode : endPoints) {
if (agvTaskService.isEndPointAvailable(endPointCode, BizStatus.CALL_PICK, "RACK_MOVE")) {
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.CALL_PICK, task.getDstStock(), task.getDstPointCode(), endPointCode, "RACK_MOVE");
agvTask.setLineSlotCode(pick.getCode());
agvTaskService.update(agvTask);
task.setCallAgvTaskId(agvTask.getId());
taskRepository.save(task);
boolean isStockAvailable = agvTaskService.isStockAvailable(task.getDstStockCode(), BizStatus.CALL_PICK, "RACK_MOVE");
if (isStockAvailable) {
for (String endPointCode : endPoints) {
if (agvTaskService.findByEndSlotCode(endPointCode, BizStatus.CALL_PICK, "RACK_MOVE")) {
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.CALL_PICK, task.getDstStock(), task.getDstPointCode(), endPointCode, "RACK_MOVE");
agvTask.setLineSlotCode(pick.getCode());
agvTaskService.update(agvTask);
task.setCallAgvTaskId(agvTask.getId());
taskRepository.save(task);
}
}
taskCount++;
if (taskCount >= taskList.size()) {
break; // 当处理的任务数量达到 taskList 的长度时,跳出内层循环
}
}
if (taskCount >= taskList.size()) {
break; // 当处理的任务数量达到 taskList 的长度时,跳出外层循环
}
}
}
public static List<String> getValuesFromMap(Set<String> endPointList, Map<String, Point> map) {