Merge remote-tracking branch 'origin/master_merge' into master_merge
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();
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -298,12 +298,11 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
|||||||
.or()
|
.or()
|
||||||
.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)")
|
.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)")
|
||||||
)));
|
)));
|
||||||
// if (CollectionUtils.isNotEmpty(taskList)) {
|
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||||
// //todo 桁架任务取空载具动作完成
|
if (!taskList.get(0).getRequest_param().equals(IOSEnum.IS_SEND.code("是"))) {
|
||||||
// if (!taskList.get(0).getRequest_param().equals(IOSEnum.IS_SEND.code("是"))) {
|
throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
|
||||||
// throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
|
}
|
||||||
// }
|
}
|
||||||
// }
|
|
||||||
newPoint = checkIvtSBlock();
|
newPoint = checkIvtSBlock();
|
||||||
} else {
|
} else {
|
||||||
newPoint = getBstIvtPackageinfoivt(actionType, taskPointType, baseTask);
|
newPoint = getBstIvtPackageinfoivt(actionType, taskPointType, baseTask);
|
||||||
@@ -345,32 +344,36 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
|||||||
}
|
}
|
||||||
//取货任务
|
//取货任务
|
||||||
if (actionType.equals(PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"))) {
|
if (actionType.equals(PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"))) {
|
||||||
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
|
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区")) ||
|
||||||
//取满轴
|
baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务")) ||
|
||||||
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
|
baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
|
||||||
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
|
||||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
//取满轴
|
||||||
.eq(BstIvtPackageinfoivt::getPoint_code, baseTask.getPoint_code1()));
|
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
|
||||||
if (CollectionUtils.isEmpty(ivtList)) {
|
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||||
throw new BadRequestException("任务编号为:" + baseTask.getTask_code() + "取货完成的目标点位不存在!");
|
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
||||||
}
|
.eq(BstIvtPackageinfoivt::getPoint_code, baseTask.getPoint_code1()));
|
||||||
//只有子卷号相同才能清除库存
|
if (CollectionUtils.isEmpty(ivtList)) {
|
||||||
if (baseTask.getVehicle_code().equals(ivtList.get(0).getContainer_name())) {
|
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());
|
updateWrapper.eq("point_code", baseTask.getPoint_code1());
|
||||||
}
|
}
|
||||||
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务"))) {
|
updateWrapper.setSql("ivt_status = '0', container_name = null");
|
||||||
//取空轴
|
//清空起点库存状态
|
||||||
updateWrapper.eq("point_code", baseTask.getPoint_code3());
|
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
|
||||||
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
|
//标记桁架任务取空载具完成
|
||||||
//取空轴
|
baseTask.setRequest_param(IOSEnum.IS_SEND.code("是"));
|
||||||
updateWrapper.eq("point_code", baseTask.getPoint_code1());
|
taskService.update();
|
||||||
}
|
}
|
||||||
updateWrapper.setSql("ivt_status = '0', container_name = null");
|
|
||||||
//清空起点库存状态
|
|
||||||
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
|
|
||||||
//标记桁架任务取空载具完成
|
|
||||||
baseTask.setRequest_param(IOSEnum.IS_SEND.code("是"));
|
|
||||||
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,33 +50,33 @@ 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("装箱区"),
|
||||||
PackageInfoIvtEnum.IVT_STATUS.code("空"),
|
PackageInfoIvtEnum.IVT_STATUS.code("空"),
|
||||||
PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), "", "");
|
PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), "", "");
|
||||||
if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
|
if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
|
||||||
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
|
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
|
||||||
.collect(Collectors.groupingBy(
|
.collect(Collectors.groupingBy(
|
||||||
BstIvtPackageinfoivt::getBlock,
|
BstIvtPackageinfoivt::getBlock,
|
||||||
LinkedHashMap::new,
|
LinkedHashMap::new,
|
||||||
Collectors.mapping(BstIvtPackageinfoivt::getPoint_code, Collectors.toList())
|
Collectors.mapping(BstIvtPackageinfoivt::getPoint_code, Collectors.toList())
|
||||||
));
|
));
|
||||||
//taskQueueManager.processTasks(ivtList);
|
//taskQueueManager.processTasks(ivtList);
|
||||||
taskQueue.processTasks(ivtList);
|
taskQueue.processTasks(ivtList);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (tryLock) {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// } else {
|
|
||||||
// log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
|
|
||||||
// }
|
|
||||||
// } finally {
|
|
||||||
// if (tryLock) {
|
|
||||||
// lock.unlock();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ public class AutoSendZxToDjw {
|
|||||||
.list(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, boxNo).eq(PdmBiSubpackagerelation::getStatus, "0"));
|
.list(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, boxNo).eq(PdmBiSubpackagerelation::getStatus, "0"));
|
||||||
if (CollectionUtils.isEmpty(relationList)) {
|
if (CollectionUtils.isEmpty(relationList)) {
|
||||||
log.info("装箱位的木箱号" + boxNo + "对应的子卷包装关系为空,请检查子卷包装关系状态是否为0!");
|
log.info("装箱位的木箱号" + boxNo + "对应的子卷包装关系为空,请检查子卷包装关系状态是否为0!");
|
||||||
throw new BadRequestException("装箱位的木箱号" + boxNo + "对应的子卷包装关系异常,请检查子卷包装关系状态是否为0!");
|
return;
|
||||||
|
//throw new BadRequestException("装箱位的木箱号" + boxNo + "对应的子卷包装关系异常,请检查子卷包装关系状态是否为0!");
|
||||||
}
|
}
|
||||||
//获取与该木箱号匹配的子卷号
|
//获取与该木箱号匹配的子卷号
|
||||||
String containerName = relationList.get(0).getContainer_name();
|
String containerName = relationList.get(0).getContainer_name();
|
||||||
|
|||||||
@@ -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