opt:送空任务增加空洞校验

This commit is contained in:
zhangzq
2025-06-06 15:20:45 +08:00
parent 566a1db0f5
commit e26e5df2a2

View File

@@ -2,6 +2,7 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
@@ -60,7 +61,6 @@ public class AutoSendVehicleToKzj extends Prun{
}catch (Exception ex){ }catch (Exception ex){
log.error(ex.getMessage()); log.error(ex.getMessage());
} }
} }
@@ -83,12 +83,24 @@ public class AutoSendVehicleToKzj extends Prun{
List<BstIvtPackageinfoivt> empPoints = this.packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("")); List<BstIvtPackageinfoivt> empPoints = this.packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code(""));
List<BstIvtPackageinfoivt> vehiclePoints = this.packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具")); List<BstIvtPackageinfoivt> vehiclePoints = this.packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
if (!CollectionUtils.isEmpty(empPoints) && !CollectionUtils.isEmpty(vehiclePoints) && existTask.size() < empPoints.size()) { if (!CollectionUtils.isEmpty(empPoints) && !CollectionUtils.isEmpty(vehiclePoints) && existTask.size() < empPoints.size()) {
//增加空洞判断
//车 04 05 06
//☒☒口 ☒口☒ ☒口口:
BstIvtPackageinfoivt disPoint = empPoints.get(0);
int count = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
.lt("sort_seq", disPoint.getSort_seq())
.eq("point_status", PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"))
.eq("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具")));
if (count>0){
log.warn("当前点位存在空洞的情况"+disPoint.getPoint_code());
return;
}
JSONObject task = new JSONObject(); JSONObject task = new JSONObject();
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)")); task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配")); task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
task.put("point_code1", vehiclePoints.get(0).getPoint_code()); task.put("point_code1", vehiclePoints.get(0).getPoint_code());
task.put("point_code2", this.packageinfoivtService.getWaitPoint(empPoints.get(0).getBlock(), empPoints.get(0).getWait_point_type())); task.put("point_code2", this.packageinfoivtService.getWaitPoint(disPoint.getBlock(), disPoint.getWait_point_type()));
task.put("point_code3", empPoints.get(0).getPoint_code()); task.put("point_code3", disPoint.getPoint_code());
this.djqToKzjhcwTask.createTask(task); this.djqToKzjhcwTask.createTask(task);
} }
} }