opt:优化二次分配任务类型判断逻辑
This commit is contained in:
@@ -907,10 +907,10 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//任务组id
|
//任务组id
|
||||||
String groupId = deviceCode.substring(deviceCode.lastIndexOf("_") + 1);
|
String groupId = deviceCode.substring(deviceCode.lastIndexOf("_") + 1);
|
||||||
// RLock lock = redissonClient.getLock(groupId);
|
RLock lock = redissonClient.getLock(groupId);
|
||||||
// boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||||
// try {
|
try {
|
||||||
// if (tryLock) {
|
if (tryLock) {
|
||||||
List<SchBaseTask> schBaseTaskList = new ArrayList<>();
|
List<SchBaseTask> schBaseTaskList = new ArrayList<>();
|
||||||
//确定起点,安装装箱组标识加入任务队列
|
//确定起点,安装装箱组标识加入任务队列
|
||||||
djqPoints.forEach(r -> {
|
djqPoints.forEach(r -> {
|
||||||
@@ -938,14 +938,14 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
|
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
|
||||||
taskQueue.addTasksToQueue(groupId, schBaseTaskList);
|
taskQueue.addTasksToQueue(groupId, schBaseTaskList);
|
||||||
}
|
}
|
||||||
// } else {
|
} else {
|
||||||
// log.info("待检区->装箱区任务队列正在创建被锁住。");
|
log.info("待检区->装箱区任务队列正在创建被锁住。");
|
||||||
// }
|
}
|
||||||
// } finally {
|
} finally {
|
||||||
// if (tryLock) {
|
if (tryLock) {
|
||||||
// lock.unlock();
|
lock.unlock();
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -345,6 +345,9 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
|||||||
}
|
}
|
||||||
//取货任务
|
//取货任务
|
||||||
if (actionType.equals(PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"))) {
|
if (actionType.equals(PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"))) {
|
||||||
|
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区")) ||
|
||||||
|
baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务")) ||
|
||||||
|
baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
|
||||||
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
|
||||||
//取满轴
|
//取满轴
|
||||||
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
|
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
|
||||||
@@ -371,6 +374,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
|||||||
//标记桁架任务取空载具完成
|
//标记桁架任务取空载具完成
|
||||||
baseTask.setRequest_param(IOSEnum.IS_SEND.code("是"));
|
baseTask.setRequest_param(IOSEnum.IS_SEND.code("是"));
|
||||||
taskService.update();
|
taskService.update();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//放货任务
|
//放货任务
|
||||||
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
|||||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||||
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ import javax.annotation.Resource;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -48,10 +50,10 @@ public class AutoSendToZxq {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public void sendDjqToZxq() {
|
public void sendDjqToZxq() {
|
||||||
log.info(THIS_CLASS + "-待检区->装箱区定时任务开始执行扫描。");
|
log.info(THIS_CLASS + "-待检区->装箱区定时任务开始执行扫描。");
|
||||||
// RLock lock = redissonClient.getLock(THIS_CLASS);
|
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||||
// boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||||
// try {
|
try {
|
||||||
// if (tryLock) {
|
if (tryLock) {
|
||||||
//装箱区有空位,去待检区消费合格品子卷
|
//装箱区有空位,去待检区消费合格品子卷
|
||||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
|
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
|
||||||
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
|
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
|
||||||
@@ -67,14 +69,14 @@ public class AutoSendToZxq {
|
|||||||
//taskQueueManager.processTasks(ivtList);
|
//taskQueueManager.processTasks(ivtList);
|
||||||
taskQueue.processTasks(ivtList);
|
taskQueue.processTasks(ivtList);
|
||||||
}
|
}
|
||||||
// } else {
|
} else {
|
||||||
// log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
|
log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
|
||||||
// }
|
}
|
||||||
// } finally {
|
} finally {
|
||||||
// if (tryLock) {
|
if (tryLock) {
|
||||||
// lock.unlock();
|
lock.unlock();
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMap
|
|||||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||||
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
|
||||||
import org.nl.modules.common.utils.RedisUtils;
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
Reference in New Issue
Block a user