fix:分切上料排队
This commit is contained in:
@@ -14,6 +14,7 @@ import org.redisson.api.RLock;
|
|||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -70,10 +71,11 @@ public class AutoSendToZxq extends Prun{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//装箱区有空位,去待检区消费合格品子卷
|
//装箱区有空位,去待检区消费合格品子卷
|
||||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
|
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空"));
|
||||||
|
/* List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
|
||||||
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
|
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
|
||||||
PackageInfoIvtEnum.IVT_STATUS.code("空"),
|
PackageInfoIvtEnum.IVT_STATUS.code("空"),
|
||||||
PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), "", "");
|
PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), "", "");*/
|
||||||
if (ObjectUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
|
if (ObjectUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
|
||||||
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
|
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
|
||||||
.collect(Collectors.groupingBy(
|
.collect(Collectors.groupingBy(
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import org.nl.wms.ext.mes.service.LmsToMesService;
|
|||||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||||
import org.nl.wms.pda.mps.service.FeedingService;
|
import org.nl.wms.pda.mps.service.FeedingService;
|
||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
import org.nl.wms.sch.tasks.CoolCutTask;
|
import org.nl.wms.sch.tasks.CoolCutTask;
|
||||||
import org.nl.wms.sch.tasks.OutHotTask;
|
import org.nl.wms.sch.tasks.OutHotTask;
|
||||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||||
@@ -416,17 +417,17 @@ public class FeedingServiceImpl implements FeedingService {
|
|||||||
//只找入箱点位
|
//只找入箱点位
|
||||||
map.put("point_type", "5");
|
map.put("point_type", "5");
|
||||||
|
|
||||||
|
boolean status_flag = false;
|
||||||
JSONObject pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
JSONObject pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(pointArr)) {
|
if (ObjectUtil.isEmpty(pointArr)) {
|
||||||
map.put("point_location", cool_jo.getString("point_location").equals("0") ? "1" : "0");
|
map.put("point_location", cool_jo.getString("point_location").equals("0") ? "1" : "0");
|
||||||
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(pointArr)) {
|
if (ObjectUtil.isEmpty(pointArr)) {
|
||||||
throw new BadRequestException("出烘箱对接位,被货物或任务占用,请检查处理或等待!!");
|
status_flag = true;
|
||||||
|
// throw new BadRequestException("出烘箱对接位,被货物或任务占用,请检查处理或等待!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
task_jo.put("point_code2", pointArr.getString("point_code"));
|
|
||||||
// 2.找冷却区空货位
|
// 2.找冷却区空货位
|
||||||
JSONObject cool_map = new JSONObject();
|
JSONObject cool_map = new JSONObject();
|
||||||
cool_map.put("flag", "2");
|
cool_map.put("flag", "2");
|
||||||
@@ -448,11 +449,15 @@ public class FeedingServiceImpl implements FeedingService {
|
|||||||
task_jo.put("material_code", cool_jo.getString("container_name"));
|
task_jo.put("material_code", cool_jo.getString("container_name"));
|
||||||
task_jo.put("product_area", cool_jo.getString("product_area"));
|
task_jo.put("product_area", cool_jo.getString("product_area"));
|
||||||
task_jo.put("task_type", "010205");
|
task_jo.put("task_type", "010205");
|
||||||
OutHotTask outHotTask = new OutHotTask();
|
if (status_flag) {
|
||||||
|
task_jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
|
||||||
|
}else {
|
||||||
|
task_jo.put("point_code2", pointArr.getString("point_code"));
|
||||||
|
}
|
||||||
|
OutHotTask outHotTask = SpringContextHolder.getBean(OutHotTask.class);
|
||||||
String task_id = outHotTask.createTask(task_jo);
|
String task_id = outHotTask.createTask(task_jo);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
//查询该分切机对应的点位
|
//查询该分切机对应的点位
|
||||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import org.nl.common.utils.SecurityUtils;
|
|||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||||
|
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||||
import org.nl.wms.sch.AcsTaskDto;
|
import org.nl.wms.sch.AcsTaskDto;
|
||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
@@ -168,6 +170,43 @@ public class CoolCutTask extends AbstractAcsTask {
|
|||||||
jsonCoolIvt2.put("update_optname", currentUsername);
|
jsonCoolIvt2.put("update_optname", currentUsername);
|
||||||
jsonCoolIvt2.put("update_time", DateUtil.now());
|
jsonCoolIvt2.put("update_time", DateUtil.now());
|
||||||
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
|
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
|
||||||
|
|
||||||
|
//判断是存在确定起点的该任务类型
|
||||||
|
JSONArray issue_arr = taskTab.query("task_type = '010205' AND task_status = '02' AND is_delete= '0'").getResultJSONArray(0);
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "4");
|
||||||
|
map.put("reging_id", RegionTypeEnum.B1_HKZC.getId());
|
||||||
|
//只找入箱点位
|
||||||
|
map.put("point_type", "5");
|
||||||
|
JSONArray canuse_point = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
for (int i = 0; i < issue_arr.size(); i++) {
|
||||||
|
JSONObject issue_jo = issue_arr.getJSONObject(i);
|
||||||
|
JSONObject goal_point = WQLObject.getWQLObject("st_ivt_coolpointivt").query("point_code = '" + issue_jo.getString("point_code1") + "'").uniqueResult(0);
|
||||||
|
for (int j = 0; j < canuse_point.size(); j++) {
|
||||||
|
JSONObject canuse_point_jo = canuse_point.getJSONObject(j);
|
||||||
|
if (canuse_point_jo.getString("point_location").equals(goal_point.getString("point_location"))) {
|
||||||
|
issue_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
|
issue_jo.put("point_code2", canuse_point_jo.getString("point_code"));
|
||||||
|
canuse_point.remove(canuse_point_jo);
|
||||||
|
taskTab.update(issue_jo);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!issue_jo.getString("task_status").equals(TaskStatusEnum.START_AND_POINT.getCode())) {
|
||||||
|
for (int j = 0; j < canuse_point.size(); j++) {
|
||||||
|
JSONObject canuse_point_jo = canuse_point.getJSONObject(j);
|
||||||
|
if (!canuse_point_jo.getString("point_location").equals(goal_point.getString("point_location"))) {
|
||||||
|
issue_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
|
issue_jo.put("point_code2", canuse_point_jo.getString("point_code"));
|
||||||
|
canuse_point.remove(canuse_point_jo);
|
||||||
|
taskTab.update(issue_jo);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//下发任务
|
||||||
|
SpringContextHolder.getBean(OutHotTask.class).immediateNotifyAcs(null);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 更新主表状态
|
// 更新主表状态
|
||||||
JSONObject coolMst = ivtTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
JSONObject coolMst = ivtTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public class OutHotTask extends AbstractAcsTask {
|
|||||||
jo.put("product_area", cut_jo.getString("product_area"));
|
jo.put("product_area", cut_jo.getString("product_area"));
|
||||||
jo.put("task_type", "010301");
|
jo.put("task_type", "010301");
|
||||||
}
|
}
|
||||||
AbstractAcsTask task = new CoolCutTask();
|
CoolCutTask task = SpringContextHolder.getBean(CoolCutTask.class);
|
||||||
task.createTask(jo);
|
task.createTask(jo);
|
||||||
} else {
|
} else {
|
||||||
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user