fix:增加任务校验

This commit is contained in:
2024-07-03 17:32:25 +08:00
parent 24678f2a47
commit c77a5f03e5
3 changed files with 8 additions and 6 deletions

View File

@@ -854,11 +854,11 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
boxInfo.put("device_code", deviceCode); boxInfo.put("device_code", deviceCode);
boxInfo.put("material_code", boxType); boxInfo.put("material_code", boxType);
boxInfo.put("num", workIdList.size()); boxInfo.put("num", workIdList.size());
String boxSn = outBoxManageService.outBox(boxInfo); //String boxSn = outBoxManageService.outBox(boxInfo);
stopWatch.stop(); stopWatch.stop();
System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis()); System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis()); log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
//String boxSn = "MX240702000169"; String boxSn = "MX240703000118";
StopWatch stopWatch1 = new StopWatch(); StopWatch stopWatch1 = new StopWatch();
stopWatch1.start(); stopWatch1.start();
//更新及子卷包装状态已分配规格及木箱规格组 //更新及子卷包装状态已分配规格及木箱规格组
@@ -902,7 +902,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
djqPoints.forEach(r -> { djqPoints.forEach(r -> {
//校验重复任务 //校验重复任务
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, r.getContainer_name()).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区")) List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, r.getContainer_name()).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"))
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))); .eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("")).lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED));
if (CollectionUtils.isEmpty(taskList)) { if (CollectionUtils.isEmpty(taskList)) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区")); jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));

View File

@@ -27,6 +27,7 @@ import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl; import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -114,7 +115,7 @@ public class AutoSendZxToDjw {
throw new BadRequestException("装箱区的子卷号为" + containerName + "无对应的分切计划信息,请检查!"); throw new BadRequestException("装箱区的子卷号为" + containerName + "无对应的分切计划信息,请检查!");
} }
//校验是否存在相同子卷号任务 //校验是否存在相同子卷号任务
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, containerName).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位")).eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))); List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, containerName).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位")).eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("")).lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode()));
if (CollectionUtils.isEmpty(taskList)) { if (CollectionUtils.isEmpty(taskList)) {
//创建搬运任务到装箱位 //创建搬运任务到装箱位
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
@@ -159,7 +160,7 @@ public class AutoSendZxToDjw {
* 传输子卷包装关系至MES * 传输子卷包装关系至MES
*/ */
public void transferBoxPackageToMes(List<PdmBiSubpackagerelation> packagerelationList, BstIvtBoxinfo bstIvtBoxinfo) { public void transferBoxPackageToMes(List<PdmBiSubpackagerelation> packagerelationList, BstIvtBoxinfo bstIvtBoxinfo) {
if (StringUtils.isBlank(packagerelationList.get(0).getPackage_box_sn()) || packagerelationList.get(0).getBox_weight() == null) { if (StringUtils.isBlank(packagerelationList.get(0).getPackage_box_sn())) {
log.info("transferBoxPackageToMes接口的子卷号" + packagerelationList.get(0).getContainer_name() + ",子卷未确定木箱规格信息"); log.info("transferBoxPackageToMes接口的子卷号" + packagerelationList.get(0).getContainer_name() + ",子卷未确定木箱规格信息");
throw new BadRequestException("子卷未确定木箱规格信息!"); throw new BadRequestException("子卷未确定木箱规格信息!");
} }

View File

@@ -1939,7 +1939,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return taskService.list(new LambdaQueryWrapper<SchBaseTask>() return taskService.list(new LambdaQueryWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_type, taskType) .eq(SchBaseTask::getTask_type, taskType)
.eq(SchBaseTask::getVehicle_code, containerName) .eq(SchBaseTask::getVehicle_code, containerName)
.gt(SchBaseTask::getCreate_time, startTime) //.gt(SchBaseTask::getCreate_time, startTime)
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("")) .eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))
); );