opt:优化装箱最后一个子卷临时计数方式
This commit is contained in:
@@ -54,10 +54,10 @@ public class AutoSendVehicleToDjq {
|
||||
if (tryLock) {
|
||||
String pointCode2;
|
||||
JSONObject task = new JSONObject();
|
||||
List<BstIvtPackageinfoivt> ivtList =ibstIvtPackageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"),"");
|
||||
if (CollectionUtils.isNotEmpty(ivtList)) {
|
||||
return;
|
||||
}
|
||||
// List<BstIvtPackageinfoivt> ivtList =ibstIvtPackageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"),"");
|
||||
// if (CollectionUtils.isNotEmpty(ivtList)) {
|
||||
// return;
|
||||
// }
|
||||
//存在装箱区有空载具的点位
|
||||
List<BstIvtPackageinfoivt> zxqIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
if (CollectionUtils.isEmpty(zxqIvtList)) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapp
|
||||
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.modules.common.utils.RedisUtils;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -50,10 +51,13 @@ 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 Integer NUM = 0;
|
||||
private static final String NUM_KEY = "AutoSendZxToDjw:NUM";
|
||||
|
||||
private final RedissonClient redissonClient;
|
||||
@Resource
|
||||
private RedisUtils redisUtils;
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
@Resource
|
||||
private ZxDjwTask zxDjwTask;
|
||||
@@ -157,15 +161,25 @@ public class AutoSendZxToDjw {
|
||||
//param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
||||
//todo 木箱计划放入子卷数量,暂时默认1
|
||||
param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
||||
NUM = NUM + 1;
|
||||
if (NUM == Integer.parseInt(bstIvtBoxinfo.getNum())) {
|
||||
//todo 查询是否为最后一个子卷,暂时默认1
|
||||
Integer num = getNumFromRedis();
|
||||
num = num + 1;
|
||||
if (num.equals(Integer.parseInt(bstIvtBoxinfo.getNum()))) {
|
||||
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
NUM = 0;
|
||||
num = 0;
|
||||
} else {
|
||||
//todo 查询是否为最后一个子卷,暂时默认1
|
||||
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("否"));
|
||||
}
|
||||
// 更新计数
|
||||
redisUtils.set(NUM_KEY, num);
|
||||
//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 {
|
||||
@@ -342,7 +356,13 @@ public class AutoSendZxToDjw {
|
||||
return height;
|
||||
}
|
||||
|
||||
|
||||
private Integer getNumFromRedis() {
|
||||
Object numObj = redisUtils.get(NUM_KEY);
|
||||
if (numObj == null) {
|
||||
return 0;
|
||||
}
|
||||
return (Integer) numObj;
|
||||
}
|
||||
|
||||
|
||||
// void sendMzqToDjq() {
|
||||
|
||||
Reference in New Issue
Block a user