opt:优化装箱最后一个子卷临时计数方式
This commit is contained in:
@@ -54,10 +54,10 @@ public class AutoSendVehicleToDjq {
|
|||||||
if (tryLock) {
|
if (tryLock) {
|
||||||
String pointCode2;
|
String pointCode2;
|
||||||
JSONObject task = new JSONObject();
|
JSONObject task = new JSONObject();
|
||||||
List<BstIvtPackageinfoivt> ivtList =ibstIvtPackageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"),"");
|
// List<BstIvtPackageinfoivt> ivtList =ibstIvtPackageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"),"");
|
||||||
if (CollectionUtils.isNotEmpty(ivtList)) {
|
// if (CollectionUtils.isNotEmpty(ivtList)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
//存在装箱区有空载具的点位
|
//存在装箱区有空载具的点位
|
||||||
List<BstIvtPackageinfoivt> zxqIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
List<BstIvtPackageinfoivt> zxqIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||||
if (CollectionUtils.isEmpty(zxqIvtList)) {
|
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.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
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.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
@@ -50,10 +51,13 @@ import static org.nl.wms.util.TaskUtil.getMaxNum;
|
|||||||
public class AutoSendZxToDjw {
|
public class AutoSendZxToDjw {
|
||||||
private final String THIS_CLASS = AutoSendZxToDjw.class.getName();
|
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;
|
private final RedissonClient redissonClient;
|
||||||
@Resource
|
@Resource
|
||||||
|
private RedisUtils redisUtils;
|
||||||
|
@Resource
|
||||||
private IschBaseTaskService taskService;
|
private IschBaseTaskService taskService;
|
||||||
@Resource
|
@Resource
|
||||||
private ZxDjwTask zxDjwTask;
|
private ZxDjwTask zxDjwTask;
|
||||||
@@ -157,15 +161,25 @@ public class AutoSendZxToDjw {
|
|||||||
//param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
//param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
||||||
//todo 木箱计划放入子卷数量,暂时默认1
|
//todo 木箱计划放入子卷数量,暂时默认1
|
||||||
param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
||||||
NUM = NUM + 1;
|
Integer num = getNumFromRedis();
|
||||||
if (NUM == Integer.parseInt(bstIvtBoxinfo.getNum())) {
|
num = num + 1;
|
||||||
//todo 查询是否为最后一个子卷,暂时默认1
|
if (num.equals(Integer.parseInt(bstIvtBoxinfo.getNum()))) {
|
||||||
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("是"));
|
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("是"));
|
||||||
NUM = 0;
|
num = 0;
|
||||||
} else {
|
} else {
|
||||||
//todo 查询是否为最后一个子卷,暂时默认1
|
|
||||||
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("否"));
|
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());
|
jo.put("request_param", param.toString());
|
||||||
zxDjwTask.createTask(jo);
|
zxDjwTask.createTask(jo);
|
||||||
// try {
|
// try {
|
||||||
@@ -342,7 +356,13 @@ public class AutoSendZxToDjw {
|
|||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Integer getNumFromRedis() {
|
||||||
|
Object numObj = redisUtils.get(NUM_KEY);
|
||||||
|
if (numObj == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return (Integer) numObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// void sendMzqToDjq() {
|
// void sendMzqToDjq() {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
<el-table-column prop="vehicle_code" label="载具编码1" width="130" show-overflow-tooltip />
|
<el-table-column prop="vehicle_code" label="载具编码1" width="130" show-overflow-tooltip />
|
||||||
<el-table-column prop="vehicle_code2" label="载具编码2" width="100" show-overflow-tooltip />
|
<el-table-column prop="vehicle_code2" label="载具编码2" width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="request_param" label="请求参数" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="request_param" label="请求参数" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="response_param" label="返回参数" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="response_param" label="响应参数" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="task_name" label="任务描述" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="task_name" label="任务描述" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="create_name" label="创建人" width="135" show-overflow-tooltip />
|
<el-table-column prop="create_name" label="创建人" width="135" show-overflow-tooltip />
|
||||||
<el-table-column prop="create_time" label="创建时间" width="135" show-overflow-tooltip />
|
<el-table-column prop="create_time" label="创建时间" width="135" show-overflow-tooltip />
|
||||||
|
|||||||
Reference in New Issue
Block a user