1. 更新优化

This commit is contained in:
梁州 2025-03-30 19:25:47 +08:00
parent 74a83f2927
commit 9995ed8d02
3 changed files with 26 additions and 12 deletions

View File

@ -179,10 +179,10 @@ public class JobComponent {
// 轮询工作站台判断是否需要下发任务 // 轮询工作站台判断是否需要下发任务
List<Stand> stands = standService.list(new LambdaQueryWrapper<Stand>() List<Stand> stands = standService.list(new LambdaQueryWrapper<Stand>()
.eq(Stand::getIsLock, 0).eq(Stand::getStandStatus, 0) .eq(Stand::getIsLock, 0).eq(Stand::getStandStatus, 0)
.eq(Stand::getStandType, 2)); .eq(Stand::getStandType, 2).orderByAsc(Stand::getStandId));
for (Stand workStation : stands) { for (Stand workStation : stands) {
try { try {
// // 创建工作 // 创建工作
// workService.createWork(workStation.getStandId()); // workService.createWork(workStation.getStandId());
// 分配工作 // 分配工作
workService.distributeWorks(workStation.getStandId()); workService.distributeWorks(workStation.getStandId());

View File

@ -1635,7 +1635,7 @@ public class TaskController {
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, standId) .eq(WorkFlow::getWorkStation, standId)
.in(WorkFlow::getGoodsId, goodsIdList) .in(WorkFlow::getGoodsId, goodsIdList)
.ne(WorkFlow::getWorkStatus, 2))) { .notIn(WorkFlow::getWorkStatus, -1, 2))) {
// 需要不放行返回前台提示信息 // 需要不放行返回前台提示信息
StandPickVo pickVoEntity = new StandPickVo(); StandPickVo pickVoEntity = new StandPickVo();
pickVoEntity.setTip("当前料箱还有其他物料需要拣货"); pickVoEntity.setTip("当前料箱还有其他物料需要拣货");
@ -1659,7 +1659,7 @@ public class TaskController {
// 判断是不是已经完成工作 // 判断是不是已经完成工作
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, standId) .eq(WorkFlow::getWorkStation, standId)
.ne(WorkFlow::getWorkStatus, 2))) { .notIn(WorkFlow::getWorkStatus, -1, 2))) {
// 当前站台工作未全部完成 // 当前站台工作未全部完成
standService.update(new LambdaUpdateWrapper<Stand>() standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now()) .set(Stand::getLastUseTime, LocalDateTime.now())
@ -1698,7 +1698,7 @@ public class TaskController {
// 判断是不是已经完成工作 // 判断是不是已经完成工作
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, standId) .eq(WorkFlow::getWorkStation, standId)
.ne(WorkFlow::getWorkStatus, 2))) { .notIn(WorkFlow::getWorkStatus, -1, 2))) {
// 当前站台工作未全部完成 // 当前站台工作未全部完成
standService.update(new LambdaUpdateWrapper<Stand>() standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now()) .set(Stand::getLastUseTime, LocalDateTime.now())
@ -1815,7 +1815,7 @@ public class TaskController {
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, targetStand.getStandId()) .eq(WorkFlow::getWorkStation, targetStand.getStandId())
.in(WorkFlow::getGoodsId, goodsIdList) .in(WorkFlow::getGoodsId, goodsIdList)
.ne(WorkFlow::getWorkStatus, 2))) { .notIn(WorkFlow::getWorkStatus, -1, 2))) {
// 更新站台信息 // 更新站台信息
standService.update(new LambdaUpdateWrapper<Stand>() standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getPickGoods, "") .set(Stand::getPickGoods, "")
@ -1837,7 +1837,7 @@ public class TaskController {
// 判断是不是已经完成工作 // 判断是不是已经完成工作
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, targetStand.getStandId()) .eq(WorkFlow::getWorkStation, targetStand.getStandId())
.ne(WorkFlow::getWorkStatus, 2))) { .notIn(WorkFlow::getWorkStatus, -1, 2))) {
standService.update(new LambdaUpdateWrapper<Stand>() standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now()) .set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "") .set(Stand::getPickVehicle, "")
@ -1873,7 +1873,7 @@ public class TaskController {
// 判断是不是已经完成工作 // 判断是不是已经完成工作
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, targetStand.getStandId()) .eq(WorkFlow::getWorkStation, targetStand.getStandId())
.ne(WorkFlow::getWorkStatus, 2))) { .notIn(WorkFlow::getWorkStatus, -1, 2))) {
// 当前站台工作未全部完成 // 当前站台工作未全部完成
standService.update(new LambdaUpdateWrapper<Stand>() standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now()) .set(Stand::getLastUseTime, LocalDateTime.now())

View File

@ -267,7 +267,6 @@ public class WorkServiceImplements implements IWorkService {
List<WorkFlow> currentWorkFlowList = workFlowService.list(new LambdaQueryWrapper<WorkFlow>() List<WorkFlow> currentWorkFlowList = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, workStation) .eq(WorkFlow::getWorkStation, workStation)
.notIn(WorkFlow::getWorkStatus, -1, 2)); .notIn(WorkFlow::getWorkStatus, -1, 2));
// .ne(WorkFlow::getWorkStatus, 2));
// 没有可做的任务 // 没有可做的任务
if (currentWorkFlowList == null || currentWorkFlowList.isEmpty()) { if (currentWorkFlowList == null || currentWorkFlowList.isEmpty()) {
return; return;
@ -459,8 +458,7 @@ public class WorkServiceImplements implements IWorkService {
try { try {
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>() if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, workStation) .eq(WorkFlow::getWorkStation, workStation)
.notIn(WorkFlow::getWorkStatus, -1, 2) .notIn(WorkFlow::getWorkStatus, -1, 2))) {
.ne(WorkFlow::getWorkStatus, 2))) {
// 当前站台工作未全部完成 // 当前站台工作未全部完成
return "工作未全部做完,不允许确认完成。"; return "工作未全部做完,不允许确认完成。";
} }
@ -817,6 +815,14 @@ public class WorkServiceImplements implements IWorkService {
// 仍有未生成的平地机任务跳过 // 仍有未生成的平地机任务跳过
return; return;
} }
List<WorkFlow> doingMgWorkFlows = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, workStation)
.eq(WorkFlow::getMachineType, 2)
.ne(WorkFlow::getWorkStatus, -1));
if (!doingMgWorkFlows.isEmpty()) {
// 当前站台平地机正在做
return;
}
// 查询装载机 // 查询装载机
List<WorkFlow> mwlWorks = workFlowService.list(new LambdaQueryWrapper<WorkFlow>() List<WorkFlow> mwlWorks = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getMachineType, 1) .eq(WorkFlow::getMachineType, 1)
@ -851,6 +857,14 @@ public class WorkServiceImplements implements IWorkService {
// 仍有未生成的装载机任务跳过 // 仍有未生成的装载机任务跳过
return; return;
} }
List<WorkFlow> doingMwlWorkFlows = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, workStation)
.eq(WorkFlow::getMachineType, 1)
.ne(WorkFlow::getWorkStatus, -1));
if (!doingMwlWorkFlows.isEmpty()) {
// 当前站台装载机正在做
return;
}
// 查询平地机 // 查询平地机
List<WorkFlow> mgWorks = workFlowService.list(new LambdaQueryWrapper<WorkFlow>() List<WorkFlow> mgWorks = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getMachineType, 2) .eq(WorkFlow::getMachineType, 2)
@ -1055,7 +1069,7 @@ public class WorkServiceImplements implements IWorkService {
} }
// 查找当前站台未开始的工作流 // 查找当前站台未开始的工作流
List<WorkFlow> currentWorkFlowList = workFlowService.list(new LambdaQueryWrapper<WorkFlow>() List<WorkFlow> currentWorkFlowList = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.ne(WorkFlow::getWorkStatus, 2) .notIn(WorkFlow::getWorkStatus, -1, 2)
.in(WorkFlow::getWorkStation, standIds)); .in(WorkFlow::getWorkStation, standIds));
// 没有可做的任务 // 没有可做的任务
if (currentWorkFlowList == null || currentWorkFlowList.isEmpty()) { if (currentWorkFlowList == null || currentWorkFlowList.isEmpty()) {