Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
AND bic.point_location = #{area}
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.task_status <![CDATA[ < ]]> '07'
|
||||
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07'
|
||||
AND (t.point_code1 = bic.point_code OR t.point_code2 = bic.point_code
|
||||
OR t.point_code1 = bic.truss_point_code1 oR t.point_code2 = bic.truss_point_code1
|
||||
OR t.point_code1 = bic.truss_point_code2 oR t.point_code2 = bic.truss_point_code2)
|
||||
|
||||
@@ -360,11 +360,11 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
boxInfo.put("device_code", deviceCode);
|
||||
boxInfo.put("material_code", boxType);
|
||||
boxInfo.put("num", workIdList.size());
|
||||
//String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
stopWatch.stop();
|
||||
System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
String boxSn = "MX230118000013";
|
||||
//String boxSn = "MX230118000013";
|
||||
StopWatch stopWatch1 = new StopWatch();
|
||||
stopWatch1.start();
|
||||
//更新及子卷包装状态已分配规格及木箱规格组
|
||||
@@ -866,7 +866,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
stopWatch.stop();
|
||||
System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
//String boxSn = "MX240703000118";
|
||||
//空木箱出库测试
|
||||
//String boxSn = "33333";
|
||||
StopWatch stopWatch1 = new StopWatch();
|
||||
stopWatch1.start();
|
||||
//更新及子卷包装状态已分配规格及木箱规格组
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -15,19 +16,25 @@ import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoExecuteWaitTask {
|
||||
private final String THIS_CLASS = AutoExecuteWaitTask.class.getName();
|
||||
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private MzhcwTask mzhcwTask;
|
||||
|
||||
@@ -47,56 +54,69 @@ public class AutoExecuteWaitTask {
|
||||
/**
|
||||
* 放满与取空桁架任务
|
||||
*/
|
||||
void executeWaitTask() {
|
||||
List<SchBaseTask> taskList = taskService.list(
|
||||
new LambdaQueryWrapper<SchBaseTask>()
|
||||
.or(r -> r.eq(SchBaseTask::getTask_status, TaskStatusEnum.SURE_END.getCode())
|
||||
.and(w -> w.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))))
|
||||
.or(r -> r.eq(SchBaseTask::getTask_status, TaskStatusEnum.SURE_START.getCode())
|
||||
.and(w -> w.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("输送线->满轴缓存位"))))
|
||||
);
|
||||
for (SchBaseTask task : taskList) {
|
||||
if (task != null) {
|
||||
String taskType = task.getTask_type();
|
||||
if (PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)").equals(taskType)) {
|
||||
List<BstIvtPackageinfoivt> kzjPointList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")
|
||||
).eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("空载具"))
|
||||
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
||||
if (CollectionUtils.isEmpty(kzjPointList)) {
|
||||
return;
|
||||
@SneakyThrows
|
||||
public void executeWaitTask() {
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
List<SchBaseTask> taskList = taskService.list(
|
||||
new LambdaQueryWrapper<SchBaseTask>()
|
||||
.or(r -> r.eq(SchBaseTask::getTask_status, TaskStatusEnum.SURE_END.getCode())
|
||||
.and(w -> w.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)")).eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))))
|
||||
.or(r -> r.eq(SchBaseTask::getTask_status, TaskStatusEnum.SURE_START.getCode())
|
||||
.and(w -> w.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("输送线->满轴缓存位")).eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))))
|
||||
);
|
||||
for (SchBaseTask task : taskList) {
|
||||
if (task != null) {
|
||||
String taskType = task.getTask_type();
|
||||
if (PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)").equals(taskType)) {
|
||||
List<BstIvtPackageinfoivt> kzjPointList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")
|
||||
).eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("空载具"))
|
||||
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
||||
if (CollectionUtils.isEmpty(kzjPointList)) {
|
||||
return;
|
||||
}
|
||||
List<SchBaseTask> existTaskList = getExistTasks(taskType, task.getVehicle_code());
|
||||
if (existTaskList.size() > 1) {
|
||||
throw new BadRequestException("存在多个子卷号相同的任务!");
|
||||
}
|
||||
task.setPoint_code1(kzjPointList.get(0).getPoint_code());
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskService.updateById(task);
|
||||
ssxDjwTask.immediateNotifyAcs(null);
|
||||
} else if (PackageInfoIvtEnum.TASK_TYPE.code("输送线->满轴缓存位").equals(taskType)) {
|
||||
List<BstIvtPackageinfoivt> mzPointList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")
|
||||
).eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("空"))
|
||||
.orderByDesc(BstIvtPackageinfoivt::getSort_seq));
|
||||
if (CollectionUtils.isEmpty(mzPointList)) {
|
||||
return;
|
||||
}
|
||||
//校验相同是否存在相同子卷号任务
|
||||
List<SchBaseTask> existTaskList = getExistTasks(taskType, task.getVehicle_code());
|
||||
//如果有就不创建,没有就创建
|
||||
if (existTaskList.size() > 1) {
|
||||
throw new BadRequestException("存在多个子卷号相同的任务!");
|
||||
}
|
||||
task.setPoint_code2(mzPointList.get(0).getPoint_code());
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskService.updateById(task);
|
||||
mzhcwTask.immediateNotifyAcs(null);
|
||||
}
|
||||
}
|
||||
List<SchBaseTask> existTaskList = getExistTasks(taskType, task.getVehicle_code());
|
||||
if (existTaskList.size() > 1) {
|
||||
throw new BadRequestException("存在多个子卷号相同的任务!");
|
||||
}
|
||||
task.setPoint_code1(kzjPointList.get(0).getPoint_code());
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskService.updateById(task);
|
||||
ssxDjwTask.immediateNotifyAcs(null);
|
||||
} else if (PackageInfoIvtEnum.TASK_TYPE.code("输送线->满轴缓存位").equals(taskType)) {
|
||||
List<BstIvtPackageinfoivt> mzPointList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")
|
||||
).eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("空"))
|
||||
.orderByDesc(BstIvtPackageinfoivt::getSort_seq));
|
||||
if (CollectionUtils.isEmpty(mzPointList)) {
|
||||
return;
|
||||
}
|
||||
//校验相同是否存在相同子卷号任务
|
||||
List<SchBaseTask> existTaskList = getExistTasks(taskType, task.getVehicle_code());
|
||||
//如果有就不创建,没有就创建
|
||||
if (existTaskList.size() > 1) {
|
||||
throw new BadRequestException("存在多个子卷号相同的任务!");
|
||||
}
|
||||
task.setPoint_code2(mzPointList.get(0).getPoint_code());
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskService.updateById(task);
|
||||
mzhcwTask.immediateNotifyAcs(null);
|
||||
}
|
||||
} else {
|
||||
log.info("放满与取空桁架任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,20 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.GzqTask;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -20,6 +24,9 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendDjqToGzq {
|
||||
|
||||
private final String THIS_CLASS = AutoSendDjqToGzq.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private GzqTask gzqTask;
|
||||
|
||||
@@ -35,23 +42,36 @@ public class AutoSendDjqToGzq {
|
||||
/**
|
||||
* 普通任务
|
||||
*/
|
||||
void sendDjqToGzq() {
|
||||
//待检区有管制品且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("管制品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isEmpty(djqPackageinfoivtList)) {
|
||||
return;
|
||||
@SneakyThrows
|
||||
public void sendDjqToGzq() {
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//待检区有管制品且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("管制品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isEmpty(djqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
//管制区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> gzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(gzqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->管制区"));
|
||||
task.put("vehicle_code", djqPackageinfoivtList.get(0).getContainer_name());
|
||||
task.put("point_code1", djqPackageinfoivtList.get(0).getPoint_code());
|
||||
task.put("point_code2", gzqPackageinfoivtList.get(0).getPoint_code());
|
||||
gzqTask.createTask(task);
|
||||
} else {
|
||||
log.info("放满与取空桁架任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
//管制区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> gzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(gzqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->管制区"));
|
||||
task.put("vehicle_code", djqPackageinfoivtList.get(0).getContainer_name());
|
||||
task.put("point_code1", djqPackageinfoivtList.get(0).getPoint_code());
|
||||
task.put("point_code2", gzqPackageinfoivtList.get(0).getPoint_code());
|
||||
gzqTask.createTask(task);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,20 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.DjqTask;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -20,6 +24,9 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendGzqToDjq {
|
||||
|
||||
private final String THIS_CLASS = AutoSendGzqToDjq.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private DjqTask djqTask;
|
||||
|
||||
@@ -35,24 +42,36 @@ public class AutoSendGzqToDjq {
|
||||
/**
|
||||
* 普通任务
|
||||
*/
|
||||
|
||||
void sendGzqToDjq() {
|
||||
//管制区有合格品且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> gzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(gzqPackageinfoivtList)) {
|
||||
return;
|
||||
@SneakyThrows
|
||||
public void sendGzqToDjq() {
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//管制区有合格品且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> gzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(gzqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
//待检区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isEmpty(djqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("管制区->待检区"));
|
||||
task.put("vehicle_code", gzqPackageinfoivtList.get(0).getContainer_name());
|
||||
task.put("point_code1", gzqPackageinfoivtList.get(0).getPoint_code());
|
||||
task.put("point_code2", djqPackageinfoivtList.get(0).getPoint_code());
|
||||
djqTask.createTask(task);
|
||||
} else {
|
||||
log.info("放满与取空桁架任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
//待检区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isEmpty(djqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("管制区->待检区"));
|
||||
task.put("vehicle_code", gzqPackageinfoivtList.get(0).getContainer_name());
|
||||
task.put("point_code1", gzqPackageinfoivtList.get(0).getPoint_code());
|
||||
task.put("point_code2", djqPackageinfoivtList.get(0).getPoint_code());
|
||||
djqTask.createTask(task);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,20 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.DjqTask;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -20,6 +24,9 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendMzToDjq {
|
||||
|
||||
private final String THIS_CLASS = AutoSendMzToDjq.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private DjqTask djqTask;
|
||||
|
||||
@@ -52,31 +59,40 @@ public class AutoSendMzToDjq {
|
||||
djqTask.createTask(toDjqTask);
|
||||
|
||||
}
|
||||
void sendMzqToDjq2() {
|
||||
try {
|
||||
String pointCode2 = null;
|
||||
JSONObject task = new JSONObject();
|
||||
//满轴有子卷且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> mzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("有子卷"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货分配"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(mzqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
//待检区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(djqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
pointCode2 = djqPackageinfoivtList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("取货二次分配"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"));
|
||||
task.put("vehicle_code", mzqPackageinfoivtList.get(0).getContainer_name());
|
||||
task.put("point_code1", packageinfoivtService.getWaitPoint(mzqPackageinfoivtList.get(0).getBlock(), mzqPackageinfoivtList.get(0).getWait_point_type()));
|
||||
task.put("point_code3", mzqPackageinfoivtList.get(0).getPoint_code());
|
||||
task.put("point_code2", pointCode2);
|
||||
djqTask.createTask(task);
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("sendMzqToDjq1 error:{}", ex.getMessage());
|
||||
@SneakyThrows
|
||||
public void sendMzqToDjq2() {
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
String pointCode2 = null;
|
||||
JSONObject task = new JSONObject();
|
||||
//满轴有子卷且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> mzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("有子卷"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货分配"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(mzqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
//待检区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(djqPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
pointCode2 = djqPackageinfoivtList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("取货二次分配"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"));
|
||||
task.put("vehicle_code", mzqPackageinfoivtList.get(0).getContainer_name());
|
||||
task.put("point_code1", packageinfoivtService.getWaitPoint(mzqPackageinfoivtList.get(0).getBlock(), mzqPackageinfoivtList.get(0).getWait_point_type()));
|
||||
task.put("point_code3", mzqPackageinfoivtList.get(0).getPoint_code());
|
||||
task.put("point_code2", pointCode2);
|
||||
djqTask.createTask(task);
|
||||
} else {
|
||||
log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,19 +2,21 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.DjqToKzjhcwTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.GzqToKzjhcwTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.SendDjqKzjTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.SendGzqKzjTask;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -22,7 +24,9 @@ import java.util.stream.Collectors;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendVehicleToDjq {
|
||||
|
||||
private final String THIS_CLASS = AutoSendVehicleToDjq.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private SendDjqKzjTask sendDjqKzjTask;
|
||||
@Resource
|
||||
@@ -37,38 +41,50 @@ public class AutoSendVehicleToDjq {
|
||||
this.sendVehicleToDjqOrGzq1();
|
||||
}
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
public void sendVehicleToDjqOrGzq1() {
|
||||
//存在装箱区有空载具的点位
|
||||
String pointCode2 = null;
|
||||
JSONObject task = new JSONObject();
|
||||
List<BstIvtPackageinfoivt> zxqIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
if (CollectionUtils.isEmpty(zxqIvtList)) {
|
||||
return;
|
||||
}
|
||||
//待检区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isNotEmpty(djqPackageinfoivtList)) {
|
||||
pointCode2 = djqPackageinfoivtList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||
} else {
|
||||
//管制区有空位
|
||||
List<BstIvtPackageinfoivt> gzqList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isNotEmpty(gzqList)) {
|
||||
pointCode2 = gzqList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->管制区)"));
|
||||
}
|
||||
}
|
||||
//去装箱区搬运空载具
|
||||
if (pointCode2 != null) {
|
||||
task.put("point_code2", pointCode2);
|
||||
task.put("point_code1", zxqIvtList.get(0).getPoint_code());
|
||||
if (task.getString("task_type").equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"))) {
|
||||
sendDjqKzjTask.createTask(task);
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//存在装箱区有空载具的点位
|
||||
String pointCode2 = null;
|
||||
JSONObject task = new JSONObject();
|
||||
List<BstIvtPackageinfoivt> zxqIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
if (CollectionUtils.isEmpty(zxqIvtList)) {
|
||||
return;
|
||||
}
|
||||
//待检区有空位且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isNotEmpty(djqPackageinfoivtList)) {
|
||||
pointCode2 = djqPackageinfoivtList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||
} else {
|
||||
//管制区有空位
|
||||
List<BstIvtPackageinfoivt> gzqList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isNotEmpty(gzqList)) {
|
||||
pointCode2 = gzqList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->管制区)"));
|
||||
}
|
||||
}
|
||||
//去装箱区搬运空载具
|
||||
if (pointCode2 != null) {
|
||||
task.put("point_code2", pointCode2);
|
||||
task.put("point_code1", zxqIvtList.get(0).getPoint_code());
|
||||
if (task.getString("task_type").equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"))) {
|
||||
sendDjqKzjTask.createTask(task);
|
||||
} else {
|
||||
sendGzqKzjTask.createTask(task);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sendGzqKzjTask.createTask(task);
|
||||
log.info("装箱区->待检区或管制区补空载具任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -9,14 +10,15 @@ import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.DjqToKzjhcwTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.GzqToKzjhcwTask;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -25,6 +27,9 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendVehicleToKzj {
|
||||
|
||||
private final String THIS_CLASS = AutoSendVehicleToKzj.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private DjqToKzjhcwTask djqToKzjhcwTask;
|
||||
@Resource
|
||||
@@ -39,6 +44,7 @@ public class AutoSendVehicleToKzj {
|
||||
}
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
public void toKzjHcw() {
|
||||
//存在空载具缓存位无空载具的点位
|
||||
List<BstIvtPackageinfoivt> kzjIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
@@ -72,53 +78,66 @@ public class AutoSendVehicleToKzj {
|
||||
/**
|
||||
* 二次分配任务
|
||||
*/
|
||||
@SneakyThrows
|
||||
public void toKzjHcw2() {
|
||||
//存在空载具缓存位无空载具的点位
|
||||
String pointCode1 = null;
|
||||
JSONObject task = new JSONObject();
|
||||
List<BstIvtPackageinfoivt> kzjIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), null, PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货分配"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(kzjIvtList)) {
|
||||
return;
|
||||
}
|
||||
boolean hasEmptyVehicle = true;
|
||||
Optional<BstIvtPackageinfoivt> emptyList = kzjIvtList.stream()
|
||||
.filter(n -> n.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空")))
|
||||
.findFirst();
|
||||
//判断点位外层是否有空载具
|
||||
if (emptyList.isPresent()) {
|
||||
BigDecimal sortSeq = emptyList.get().getSort_seq();
|
||||
hasEmptyVehicle = kzjIvtList.stream()
|
||||
.anyMatch(r -> r.getSort_seq().compareTo(sortSeq) < 0 &&
|
||||
r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具")));
|
||||
}
|
||||
if (hasEmptyVehicle) {
|
||||
return;
|
||||
}
|
||||
//待检区有空载具且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isNotEmpty(djqPackageinfoivtList)) {
|
||||
pointCode1 = djqPackageinfoivtList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
|
||||
} else {
|
||||
//管制区有空位
|
||||
List<BstIvtPackageinfoivt> gzqList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
if (CollectionUtils.isNotEmpty(gzqList)) {
|
||||
pointCode1 = gzqList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"));
|
||||
}
|
||||
}
|
||||
//去待检区或管制区搬运空载具
|
||||
if (pointCode1 != null) {
|
||||
task.put("point_code1", pointCode1);
|
||||
//送空二次分配,目标点分配等待点
|
||||
task.put("point_code4", emptyList.get().getPoint_code());
|
||||
task.put("point_code2", packageinfoivtService.getWaitPoint(kzjIvtList.get(0).getBlock(), kzjIvtList.get(0).getWait_point_type()));
|
||||
if (task.getString("task_type").equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"))) {
|
||||
djqToKzjhcwTask.createTask(task);
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//存在空载具缓存位无空载具的点位
|
||||
String pointCode1 = null;
|
||||
JSONObject task = new JSONObject();
|
||||
List<BstIvtPackageinfoivt> kzjIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), null, PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货分配"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), "");
|
||||
if (CollectionUtils.isEmpty(kzjIvtList)) {
|
||||
return;
|
||||
}
|
||||
boolean hasEmptyVehicle = true;
|
||||
Optional<BstIvtPackageinfoivt> emptyList = kzjIvtList.stream()
|
||||
.filter(n -> n.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空")))
|
||||
.findFirst();
|
||||
//判断点位外层是否有空载具
|
||||
if (emptyList.isPresent()) {
|
||||
BigDecimal sortSeq = emptyList.get().getSort_seq();
|
||||
hasEmptyVehicle = kzjIvtList.stream()
|
||||
.anyMatch(r -> r.getSort_seq().compareTo(sortSeq) < 0 &&
|
||||
r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具")));
|
||||
}
|
||||
if (hasEmptyVehicle) {
|
||||
return;
|
||||
}
|
||||
//待检区有空载具且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
|
||||
if (CollectionUtils.isNotEmpty(djqPackageinfoivtList)) {
|
||||
pointCode1 = djqPackageinfoivtList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
|
||||
} else {
|
||||
//管制区有空位
|
||||
List<BstIvtPackageinfoivt> gzqList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
if (CollectionUtils.isNotEmpty(gzqList)) {
|
||||
pointCode1 = gzqList.get(0).getPoint_code();
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"));
|
||||
}
|
||||
}
|
||||
//去待检区或管制区搬运空载具
|
||||
if (pointCode1 != null) {
|
||||
task.put("point_code1", pointCode1);
|
||||
//送空二次分配,目标点分配等待点
|
||||
task.put("point_code4", emptyList.get().getPoint_code());
|
||||
task.put("point_code2", packageinfoivtService.getWaitPoint(kzjIvtList.get(0).getBlock(), kzjIvtList.get(0).getWait_point_type()));
|
||||
if (task.getString("task_type").equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"))) {
|
||||
djqToKzjhcwTask.createTask(task);
|
||||
} else {
|
||||
gzqToKzjhcwTask.createTask(task);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gzqToKzjhcwTask.createTask(task);
|
||||
log.info("待检区或管制区->空载具缓存位补空任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ManualSendToZxq {
|
||||
/**
|
||||
* 普通任务
|
||||
*/
|
||||
void sendDjqToZxq() {
|
||||
public void sendDjqToZxq() {
|
||||
JSONObject toDjqTask = new JSONObject();
|
||||
//待检区有子卷且过滤未完成任务
|
||||
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
|
||||
@@ -8,6 +8,7 @@ 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;
|
||||
@@ -61,9 +62,15 @@ public class TaskQueue {
|
||||
|
||||
private void executeTask(SchBaseTask task, String pointCode) {
|
||||
if (task != null) {
|
||||
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getTask_id, task.getTask_id())
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")).lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode()));
|
||||
//被取消或删除的任务不再执行
|
||||
//if (CollectionUtils.isEmpty(taskList)) {
|
||||
task.setPoint_code2(pointCode);
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskService.updateById(task);
|
||||
zxqTask.immediateNotifyAcs(null);
|
||||
//}
|
||||
//同步删除子卷包装关系
|
||||
LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PdmBiSubpackagerelation::getContainer_name, task.getVehicle_code());
|
||||
|
||||
@@ -316,12 +316,15 @@ public class AutoCallAirShaftTask {
|
||||
device.put("device_code", shafttubeivt.getPoint_code());
|
||||
array.add(device);
|
||||
JSONObject pointStatus = wmsToAcsService.getPointStatus(array);
|
||||
log.info("ACS反馈气胀轴库信息:{}", pointStatus);
|
||||
JSONArray data = pointStatus.getJSONArray("data");
|
||||
JSONObject jsonObject = data.getJSONObject(0);
|
||||
if (jsonObject.getInteger("qty") == 0) {
|
||||
// 没有货
|
||||
log.info("ACS告知无气胀轴,申请从气胀轴密集库出气胀轴");
|
||||
toCreatShaftCacheTask(qzzSize, location, empty);
|
||||
} else {
|
||||
log.info("开始给ACS写信号出气胀轴");
|
||||
JSONArray acsParam = new JSONArray();
|
||||
JSONObject acsQzz = new JSONObject();
|
||||
acsQzz.put("device_code", shafttubeivt.getPoint_code());
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
AND bcp.point_location = #{location}
|
||||
AND 0 = (
|
||||
SELECT COUNT(*) FROM sch_base_task t
|
||||
WHERE t.task_status <![CDATA[ < ]]> '07' AND (t.point_code2 = bcp.point_code OR t.point_code2 = bcp.truss_point_code1
|
||||
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07' AND (t.point_code2 = bcp.point_code OR t.point_code2 = bcp.truss_point_code1
|
||||
OR t.point_code4 = bcp.truss_point_code1 OR t.point_code2 = bcp.truss_point_code2 OR t.point_code4 = bcp.truss_point_code2)
|
||||
)
|
||||
ORDER BY ABS(bcp.sort_seq - #{sortSeq})
|
||||
|
||||
@@ -64,13 +64,13 @@ public class SysNoticeController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("获取未读的接收消息条数")
|
||||
// @Log("获取未读的接收消息条数")
|
||||
@GetMapping("/countByReceiveNotRead")
|
||||
public ResponseEntity<Object> countByReceiveNotRead() {
|
||||
return new ResponseEntity<>(noticeService.countByReceiveNotRead(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("接收消息分页")
|
||||
// @Log("接收消息分页")
|
||||
@GetMapping("/pageByReceive")
|
||||
public ResponseEntity<Object> pageByReceive() {
|
||||
return new ResponseEntity<>(noticeService.pageByReceive(), HttpStatus.OK);
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -57,7 +58,9 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
||||
LambdaQueryWrapper<SysLog> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(ObjectUtil.isNotEmpty(log_type), SysLog::getLog_type, log_type)
|
||||
.eq(ObjectUtil.isNotEmpty(username), SysLog::getUsername, username)
|
||||
.like(ObjectUtil.isNotEmpty(blurry), SysLog::getDescription, blurry)
|
||||
.and(ObjectUtil.isNotEmpty(blurry), la -> la.like(SysLog::getDescription, blurry)
|
||||
.or()
|
||||
.like(SysLog::getParams, blurry))
|
||||
.le(ObjectUtil.isNotEmpty(end_time), SysLog::getCreate_time, end_time)
|
||||
.ge(ObjectUtil.isNotEmpty(begin_time), SysLog::getCreate_time, begin_time)
|
||||
.orderByDesc(SysLog::getCreate_time);
|
||||
|
||||
Reference in New Issue
Block a user