Merge remote-tracking branch 'origin/master_merge' into master_merge

This commit is contained in:
2024-07-08 15:50:22 +08:00
5 changed files with 74 additions and 69 deletions

View File

@@ -907,10 +907,10 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.collect(Collectors.toList());
//任务组id
String groupId = deviceCode.substring(deviceCode.lastIndexOf("_") + 1);
// RLock lock = redissonClient.getLock(groupId);
// boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
// try {
// if (tryLock) {
RLock lock = redissonClient.getLock(groupId);
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
List<SchBaseTask> schBaseTaskList = new ArrayList<>();
//确定起点,安装装箱组标识加入任务队列
djqPoints.forEach(r -> {
@@ -938,14 +938,14 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
taskQueue.addTasksToQueue(groupId, schBaseTaskList);
}
// } else {
// log.info("待检区->装箱区任务队列正在创建被锁住。");
// }
// } finally {
// if (tryLock) {
// lock.unlock();
// }
// }
} else {
log.info("待检区->装箱区任务队列正在创建被锁住。");
}
} finally {
if (tryLock) {
lock.unlock();
}
}
}

View File

@@ -298,12 +298,11 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
.or()
.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)")
)));
// if (CollectionUtils.isNotEmpty(taskList)) {
// //todo 桁架任务取空载具动作完成
// if (!taskList.get(0).getRequest_param().equals(IOSEnum.IS_SEND.code("是"))) {
// throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
// }
// }
if (CollectionUtils.isNotEmpty(taskList)) {
if (!taskList.get(0).getRequest_param().equals(IOSEnum.IS_SEND.code(""))) {
throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
}
}
newPoint = checkIvtSBlock();
} else {
newPoint = getBstIvtPackageinfoivt(actionType, taskPointType, baseTask);
@@ -345,32 +344,36 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
//取货任务
if (actionType.equals(PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"))) {
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
//取满轴
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
.eq(BstIvtPackageinfoivt::getPoint_code, baseTask.getPoint_code1()));
if (CollectionUtils.isEmpty(ivtList)) {
throw new BadRequestException("任务编号为:" + baseTask.getTask_code() + "取货完成的目标点位不存在!");
}
//只有子卷号相同才能清除库存
if (baseTask.getVehicle_code().equals(ivtList.get(0).getContainer_name())) {
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<>();
//取满轴
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
.eq(BstIvtPackageinfoivt::getPoint_code, baseTask.getPoint_code1()));
if (CollectionUtils.isEmpty(ivtList)) {
throw new BadRequestException("任务编号为:" + baseTask.getTask_code() + "取货完成的目标点位不存在!");
}
//只有子卷号相同才能清除库存
if (baseTask.getVehicle_code().equals(ivtList.get(0).getContainer_name())) {
updateWrapper.eq("point_code", baseTask.getPoint_code1());
}
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务"))) {
//取空轴
updateWrapper.eq("point_code", baseTask.getPoint_code3());
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
//取空轴
updateWrapper.eq("point_code", baseTask.getPoint_code1());
}
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务"))) {
//取空轴
updateWrapper.eq("point_code", baseTask.getPoint_code3());
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
//取空轴
updateWrapper.eq("point_code", baseTask.getPoint_code1());
updateWrapper.setSql("ivt_status = '0', container_name = null");
//清空起点库存状态
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
//标记桁架任务取空载具完成
baseTask.setRequest_param(IOSEnum.IS_SEND.code(""));
taskService.update();
}
updateWrapper.setSql("ivt_status = '0', container_name = null");
//清空起点库存状态
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
//标记桁架任务取空载具完成
baseTask.setRequest_param(IOSEnum.IS_SEND.code(""));
taskService.update();
} else {
//放货任务
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()

View File

@@ -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.tasks.first_floor_area.ZxqTask;
import org.nl.common.enums.PackageInfoIvtEnum;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
@@ -15,6 +16,7 @@ import javax.annotation.Resource;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -48,33 +50,33 @@ public class AutoSendToZxq {
@SneakyThrows
public void sendDjqToZxq() {
log.info(THIS_CLASS + "-待检区->装箱区定时任务开始执行扫描。");
// RLock lock = redissonClient.getLock(THIS_CLASS);
// boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
// try {
// if (tryLock) {
//装箱区有空位,去待检区消费合格品子卷
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
PackageInfoIvtEnum.IVT_STATUS.code(""),
PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), "", "");
if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
.collect(Collectors.groupingBy(
BstIvtPackageinfoivt::getBlock,
LinkedHashMap::new,
Collectors.mapping(BstIvtPackageinfoivt::getPoint_code, Collectors.toList())
));
//taskQueueManager.processTasks(ivtList);
taskQueue.processTasks(ivtList);
RLock lock = redissonClient.getLock(THIS_CLASS);
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
//装箱区有空位,去待检区消费合格品子卷
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
PackageInfoIvtEnum.IVT_STATUS.code(""),
PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), "", "");
if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
.collect(Collectors.groupingBy(
BstIvtPackageinfoivt::getBlock,
LinkedHashMap::new,
Collectors.mapping(BstIvtPackageinfoivt::getPoint_code, Collectors.toList())
));
//taskQueueManager.processTasks(ivtList);
taskQueue.processTasks(ivtList);
}
} else {
log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
}
} finally {
if (tryLock) {
lock.unlock();
}
}
// } else {
// log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
// }
// } finally {
// if (tryLock) {
// lock.unlock();
// }
// }
}
}

View File

@@ -109,7 +109,8 @@ public class AutoSendZxToDjw {
.list(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, boxNo).eq(PdmBiSubpackagerelation::getStatus, "0"));
if (CollectionUtils.isEmpty(relationList)) {
log.info("装箱位的木箱号" + boxNo + "对应的子卷包装关系为空,请检查子卷包装关系状态是否为0!");
throw new BadRequestException("装箱位的木箱号" + boxNo + "对应的子卷包装关系异常,请检查子卷包装关系状态是否为0!");
return;
//throw new BadRequestException("装箱位的木箱号" + boxNo + "对应的子卷包装关系异常,请检查子卷包装关系状态是否为0!");
}
//获取与该木箱号匹配的子卷号
String containerName = relationList.get(0).getContainer_name();

View File

@@ -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.service.IschBaseTaskService;
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.wms.sch.manage.TaskStatusEnum;
import org.springframework.stereotype.Service;