fix:临时增加多个卷装一箱方案

This commit is contained in:
2024-07-12 17:13:45 +08:00
parent e7d376f784
commit 943acd1b4c
2 changed files with 16 additions and 33 deletions

View File

@@ -5,7 +5,6 @@ import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONObject;
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.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -421,32 +420,6 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
public List<BstIvtPackageinfoivt> checkEndPointTask1(String ivtType, String ivtStatus, String pointCode, String sortType, String taskType) {
List<BstIvtPackageinfoivt> packageinfoivtList = getBstIvtPackageinfoivts(ivtType, ivtStatus, sortType);
Set<String> pointIds = packageinfoivtList.stream().map(BstIvtPackageinfoivt::getPoint_code).collect(Collectors.toSet());
if (CollectionUtils.isEmpty(pointIds)) {
return null;
}
if (pointCode.equals("1")) {
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//起点未完成任务
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(taskType != null && !taskType.equals(""), SchBaseTask::getTask_type, taskType)
.and(
r -> r.in(SchBaseTask::getPoint_code1, pointIds)
));
return packageinfoivtList.stream().filter(r -> !taskList.stream().map(SchBaseTask::getPoint_code1).collect(Collectors.toSet()).contains(r.getPoint_code())).collect(Collectors.toList());
} else {
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//终点未完成任务
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(taskType != null && !taskType.equals(""), SchBaseTask::getTask_type, taskType)
.and(
r -> r.in(SchBaseTask::getPoint_code2, pointIds)
));
return packageinfoivtList.stream().filter(r -> !taskList.stream().map(SchBaseTask::getPoint_code2).collect(Collectors.toSet()).contains(r.getPoint_code())).collect(Collectors.toList());
}
}
/**

View File

@@ -50,6 +50,8 @@ import static org.nl.wms.util.TaskUtil.getMaxNum;
public class AutoSendZxToDjw {
private final String THIS_CLASS = AutoSendZxToDjw.class.getName();
private Integer NUM = 0;
private final RedissonClient redissonClient;
@Resource
private IschBaseTaskService taskService;
@@ -141,8 +143,8 @@ public class AutoSendZxToDjw {
jo.put("is_send", IOSEnum.IS_NOTANDYES.code(""));
//扩展参数
JSONObject param = new JSONObject();
//查询是否为最后一个子卷暂时默认1
param.put("lastOne", IOSEnum.IS_NOTANDYES.code(""));
//子卷号
param.put("barcode", containerName);
//获取木箱高度等级
param.put("heightLevel", getHeightLevel(bstIvtBoxinfo));
//获取子卷长度
@@ -151,11 +153,19 @@ public class AutoSendZxToDjw {
param.put("maxNo", bstIvtBoxinfo.getNum());
//托盘类型 1小托盘 2大托盘
param.put("containerType", bstIvtBoxinfo.getVehicle_type());
//木箱放入子卷数量
//木箱计划放入子卷数量
//param.put("boxNo", relationList.get(0).getQuanlity_in_box());
param.put("boxNo", 1);
//子卷号
param.put("barcode", containerName);
//todo 木箱计划放入子卷数量暂时默认1
param.put("boxNo", relationList.get(0).getQuanlity_in_box());
NUM = NUM + 1;
if (NUM == Integer.parseInt(bstIvtBoxinfo.getNum())) {
//todo 查询是否为最后一个子卷暂时默认1
param.put("lastOne", IOSEnum.IS_NOTANDYES.code(""));
NUM = 0;
} else {
//todo 查询是否为最后一个子卷暂时默认1
param.put("lastOne", IOSEnum.IS_NOTANDYES.code(""));
}
jo.put("request_param", param.toString());
zxDjwTask.createTask(jo);
// try {