no message

main
HUOJIN\92525 2024-11-22 15:51:58 +08:00
parent 63f799e345
commit fff16759ea
6 changed files with 30 additions and 23 deletions

View File

@ -35,8 +35,8 @@ public interface AgvTaskRepository extends JpaRepository<AgvTask, Long>, JpaSpec
*
* @param stockCode
*/
@Query(value = " from AgvTask agv where agv.stockCode=:stockCode and agv.status not in ('CANCEL','FINISH') ")
List<AgvTask> findRepeat(String stockCode);
@Query(value = " from AgvTask agv where agv.stockCode=:stockCode and agv.startSlotCode=:srcPointCode and agv.endSlotCode=:endPointCode and agv.status not in ('CANCEL','FINISH') ")
List<AgvTask> findRepeat(String stockCode,String srcPointCode,String endPointCode);
/**
*

View File

@ -106,7 +106,7 @@ public interface AgvTaskService {
*
* @param stockCode
*/
List<AgvTask> findRepeat(String stockCode);
List<AgvTask> findRepeat(String stockCode, String srcPointCode, String endPointCode);
/**
*

View File

@ -135,8 +135,8 @@ public class AgvTaskServiceImpl implements AgvTaskService {
}
@Override
public List<AgvTask> findRepeat(String stockCode) {
return agvTaskRepository.findRepeat(stockCode);
public List<AgvTask> findRepeat(String stockCode, String srcPointCode, String endPointCode) {
return agvTaskRepository.findRepeat(stockCode, srcPointCode, endPointCode);
}
@Override

View File

@ -520,7 +520,7 @@ public class KMReServiceImpl implements KMReService {
* @param agvTask
*/
private synchronized void handleResendTask(AgvTask agvTask) {
List<AgvTask> repeatList = agvTaskService.findRepeat(agvTask.getStockCode());
List<AgvTask> repeatList = agvTaskService.findRepeat(agvTask.getStockCode(),agvTask.getStartSlotCode(),agvTask.getEndSlotCode());
if (!repeatList.isEmpty()) {
throw new BadRequestException("任务已重新生成,请勿重复操作! ");
}

View File

@ -253,7 +253,7 @@ public class MesServiceImpl implements MesService {
return pickDetail;
}
private void moveCpOffUp(String pointCode) {
private synchronized void moveCpOffUp(String pointCode) {
// 如果成品入库缓存区没有空车,则从入库区查询
List<Stock> emptyStockList = stockService.findByKongStock(AreaNameDic.CPRKQ);
@ -267,10 +267,10 @@ public class MesServiceImpl implements MesService {
Point endPoint = pointService.validatePoint(pointCode);//终点
// 创建并下发任务
List<AgvTask> agvTaskList = agvTaskService.findRepeat(emptyStock.getCode());
List<AgvTask> agvTaskList = agvTaskService.findRepeat(emptyStock.getCode(),srcPoint.getCode(),endPoint.getCode());
if (agvTaskList.isEmpty()) {
//生成任务
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.EMPTY_IN, emptyStock, srcPoint, endPoint, "RACK_MOVE");
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.Cp_Off_Up, emptyStock, srcPoint, endPoint, "RACK_MOVE");
// 更新点位状态
pointService.usedPoint(endPoint);
@ -280,7 +280,7 @@ public class MesServiceImpl implements MesService {
}
}
private void moveCpOffLine(TransTask transTask) {
private synchronized void moveCpOffLine(TransTask transTask) {
Point srcPoint = pointService.validatePoint(transTask.getPointCode());//起点
Stock stock = stockService.findByPointCode(srcPoint.getCode());
if (stock == null) {
@ -291,7 +291,9 @@ public class MesServiceImpl implements MesService {
throw new BadRequestException("成品入库区没有空闲点位!");
}
Point endPoint = endPointList.get(0);
//生成任务
// 创建并下发任务
List<AgvTask> agvTaskList = agvTaskService.findRepeat(stock.getCode(),srcPoint.getCode(),endPoint.getCode());
if (agvTaskList.isEmpty()) {
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.Cp_Off_Line, stock, srcPoint, endPoint, "RACK_MOVE");
//占用容器
@ -301,6 +303,9 @@ public class MesServiceImpl implements MesService {
kmReService.sendAgvTask(agvTask, kmReService.sendAgvTaskHjJson(agvTask));
}
}
private void moveFxOffLine(TransTask transTask) {
Point srcPoint = pointService.validatePoint(transTask.getPointCode());//起点
List<Point> pointList = pointService.queryPoints(null, BaseStatus.FREE, BaseStatus.BOX, AreaNameDic.FXSXQ);

View File

@ -211,7 +211,7 @@ public class TaskServiceImpl implements TaskService {
List<Task> taskList = this.findByPickNotAllTask(pick.getId());
for (Task task : taskList) {
/*生成搬运任务*/
List<AgvTask> agvTaskList = agvTaskService.findRepeat(task.getSrcStockCode());
List<AgvTask> agvTaskList = agvTaskService.findRepeat(task.getSrcStockCode(),task.getSrcPointCode(),task.getDstPointCode());
if (agvTaskList.isEmpty()) {
//创建任务
agvTask = agvTaskService.createAgvTask(BizStatus.PICK, task.getSrcStock(), task.getSrcPoint(), task.getDstPoint(), "FORKLIFT_MOVE");
@ -248,12 +248,6 @@ public class TaskServiceImpl implements TaskService {
//容器
Stock stock = emptyStock.get(0);
//有任务则直接返回
List<AgvTask> agvTaskList = agvTaskService.findRepeat(stock.getCode());
if (!agvTaskList.isEmpty()) {
return;
}
//起点
Point srcPoint = stock.getPoint();
@ -264,6 +258,14 @@ public class TaskServiceImpl implements TaskService {
}
Point endPoint = pointList.get(0);
//有任务则直接返回
List<AgvTask> agvTaskList = agvTaskService.findRepeat(stock.getCode(),srcPoint.getCode(),endPoint.getCode());
if (!agvTaskList.isEmpty()) {
return;
}
//创建任务
agvTaskService.createAgvTask(BizStatus.CALL_RETURN, stock, srcPoint, endPoint, "RACK_MOVE");