fix:B1生箔、烘箱、分切上料流程修改
This commit is contained in:
@@ -304,7 +304,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
/*
|
||||
* 查询mes木箱信息,插入木箱信息表
|
||||
*/
|
||||
//lmsToMesService.momGetPackingInfo(whereJson);
|
||||
lmsToMesService.momGetPackingInfo(whereJson);
|
||||
|
||||
|
||||
//查询对应的木箱信息
|
||||
|
||||
@@ -102,8 +102,8 @@ public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, Param> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@CachePenetrationProtect
|
||||
@Cached(name="paramCache-",key = "#code", expire = 3600, cacheType = CacheType.REMOTE)
|
||||
/*@CachePenetrationProtect
|
||||
@Cached(name="paramCache-",key = "#code", expire = 3600, cacheType = CacheType.REMOTE)*/
|
||||
public Param findByCode(String code) {
|
||||
QueryWrapper<Param> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("code", code);
|
||||
|
||||
@@ -939,7 +939,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到分切计划:" + row.getString("ContainerGroup"));
|
||||
}
|
||||
//如果入站的分切计划气涨轴为空,则虚拟一个气a涨轴编号
|
||||
//如果入站的分切计划气涨轴为空,则虚拟一个气涨轴编号
|
||||
if (StrUtil.isEmpty(plan_jo.getString("qzzno"))) {
|
||||
if (i == 0 || i == 2) {
|
||||
plan_jo.put("qzzno", "XN-" + plan_jo.getString("resource_name") + "A");
|
||||
|
||||
@@ -27,8 +27,8 @@ public enum RegionTypeEnum {
|
||||
TWO_FH01("24", "二期发货区", "1759453285649092608"),
|
||||
TWO_OUT01("25", "二期出库区", "1760141408548818944"),
|
||||
TWO_BZC01("26", "二期主存区", "1748219897940414464"),
|
||||
|
||||
B2_HKZC("26", "B2烘烤暂存区", "1766012860535803904");
|
||||
B1_HKZC("27", "B1烘烤暂存区", "1809497203715215360"),
|
||||
B2_HKZC("28", "B2烘烤暂存区", "1766012860535803904");
|
||||
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -21,6 +22,7 @@ import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.pda.mps.service.BakingService;
|
||||
import org.nl.wms.pda.mps.service.HandleBakingService;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.InCoolIvtTask;
|
||||
import org.nl.wms.sch.tasks.InHotTask;
|
||||
@@ -115,7 +117,12 @@ public class BakingServiceImpl implements BakingService {
|
||||
* 根据点位判断是 冷却区入烘箱还是暂存区入烘箱
|
||||
*/
|
||||
JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPointZc)) {
|
||||
|
||||
JSONObject cool_jo = coolIvtTab.query("full_point_code = '" + point_code1 + "' AND point_type = '3'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPointZc) || ObjectUtil.isNotEmpty(cool_jo)) {
|
||||
if (ObjectUtil.isEmpty(jsonPointZc)) {
|
||||
jsonPointZc = cool_jo;
|
||||
}
|
||||
if (!in_area_id.contains(jsonPointZc.getString("product_area"))) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + jsonPointZc.getString("product_area") + "】操作权限");
|
||||
}
|
||||
@@ -148,7 +155,11 @@ public class BakingServiceImpl implements BakingService {
|
||||
// 2.创建暂存位 --> 烘烤区任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("type", "2"); // 1- 冷却区入烘箱 2- 暂存位入烘箱
|
||||
if (ObjectUtil.isNotEmpty(cool_jo)) {
|
||||
param.put("point_code1", cool_jo.getString("point_code"));
|
||||
}else {
|
||||
param.put("point_code1", point_code1);
|
||||
}
|
||||
param.put("point_code2", jsonHotIvt.getString("point_code"));
|
||||
param.put("material_code", container_name);
|
||||
param.put("product_area", jsonPointZc.getString("product_area"));
|
||||
@@ -340,6 +351,25 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
// 1.查询暂存位有没有空位
|
||||
String product_area = jsonHotIvt.getString("product_area");
|
||||
|
||||
//判断区域是否属于B1,B1的出烘箱流程出到对应的半成品区
|
||||
if ("B1".equals(product_area)) {
|
||||
//查询当前点位为空且没有任务的桁架内缓存点
|
||||
JSONObject cache_param = new JSONObject();
|
||||
cache_param.put("flag", "4");
|
||||
cache_param.put("point_location", jsonHotIvt.getString("point_location"));
|
||||
cache_param.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
JSONObject cache_jo = WQL.getWO("PDA_COOLIN").addParamMap(cache_param).process().uniqueResult(0);
|
||||
|
||||
// 3.创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code1);
|
||||
param.put("point_code2", cache_jo.getString("point_code"));
|
||||
param.put("material_code", jsonHotIvt.getString("container_name"));
|
||||
param.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
outHotTask.createTask(param);
|
||||
} else {
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
@@ -394,15 +424,6 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonRaw)) {
|
||||
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
|
||||
}
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) {
|
||||
throw new BadRequestException("物料基础信息中无此物料!");
|
||||
}
|
||||
|
||||
// 3.创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code1);
|
||||
@@ -412,6 +433,15 @@ public class BakingServiceImpl implements BakingService {
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
String task_id = outHotTask.createTask(param);
|
||||
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonRaw)) {
|
||||
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
|
||||
}
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) {
|
||||
throw new BadRequestException("物料基础信息中无此物料!");
|
||||
}
|
||||
|
||||
//查询该母卷对应最近的一条入烘箱记录
|
||||
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + jsonHotIvt.getString("container_name") + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);
|
||||
|
||||
@@ -434,6 +464,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
this.createHotIoMst(hotParam);
|
||||
}
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
@@ -500,6 +531,10 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!");
|
||||
}
|
||||
|
||||
if (sb_jo.getString("product_area").equals("B1")) {
|
||||
HandleBakingService bakingService = SpringContextHolder.getBean(HandleBakingService.class);
|
||||
bakingService.checkConfirm(whereJson);
|
||||
} else {
|
||||
// 1.获取此暂存位的生产区域和上下位置
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
@@ -576,6 +611,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
coolTab.insert(jsonCool);
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
|
||||
@@ -16,9 +16,11 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.core.content.HttpContext;
|
||||
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.pda.mps.service.FeedingService;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.tasks.CoolCutTask;
|
||||
import org.nl.wms.sch.tasks.OutHotTask;
|
||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -278,6 +280,57 @@ public class FeedingServiceImpl implements FeedingService {
|
||||
if (!StrUtil.equals(cool_jo.getString("full_point_status"), "02")) {
|
||||
throw new BadRequestException("该点位上不存在母卷!");
|
||||
}
|
||||
|
||||
if (cool_jo.getString("product_area").equals("B1")) {
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
JSONObject task_jo = new JSONObject();
|
||||
task_jo.put("point_code1", cool_jo.getString("point_code"));
|
||||
String reging_id = "";
|
||||
//查询出的对接位
|
||||
switch (cool_jo.getString("product_area")) {
|
||||
case "A1":
|
||||
reging_id = RegionTypeEnum.A_HKZC.getId();
|
||||
break;
|
||||
case "A2":
|
||||
reging_id = RegionTypeEnum.B_HKZC.getId();
|
||||
break;
|
||||
case "A3":
|
||||
reging_id = RegionTypeEnum.C_HKZC.getId();
|
||||
break;
|
||||
case "A4":
|
||||
reging_id = RegionTypeEnum.D_HKZC.getId();
|
||||
break;
|
||||
case "B1":
|
||||
reging_id = RegionTypeEnum.B1_HKZC.getId();
|
||||
break;
|
||||
case "B2":
|
||||
reging_id = RegionTypeEnum.B2_HKZC.getId();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("reging_id", reging_id);
|
||||
map.put("point_location", cool_jo.getString("point_location"));
|
||||
//只找出箱点位
|
||||
map.put("point_type", "5");
|
||||
|
||||
JSONObject pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(pointArr)) {
|
||||
throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
|
||||
task_jo.put("point_code2", pointArr.getString("point_code"));
|
||||
//将分切机的点位作为目的点,桁架任务完成时,自动创建AGV任务
|
||||
task_jo.put("point_code3", next_point_code);
|
||||
task_jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
task_jo.put("product_area", cut_jo.getString("product_area"));
|
||||
task_jo.put("task_type", "010205");
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
String task_id = outHotTask.createTask(task_jo);
|
||||
} else {
|
||||
JSONObject jo = new JSONObject();
|
||||
//查询该分切机对应的点位
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
@@ -318,6 +371,9 @@ public class FeedingServiceImpl implements FeedingService {
|
||||
}
|
||||
}
|
||||
|
||||
AbstractAcsTask task = new CoolCutTask();
|
||||
String task_id = task.createTask(jo);
|
||||
|
||||
//查询该母卷号对应的生箔信息
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + cool_jo.getString("container_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
@@ -329,9 +385,6 @@ public class FeedingServiceImpl implements FeedingService {
|
||||
throw new BadRequestException("未查询到物料:" + raw_jo.getString("product_name") + "基础信息!");
|
||||
}
|
||||
|
||||
AbstractAcsTask task = new CoolCutTask();
|
||||
String task_id = task.createTask(jo);
|
||||
|
||||
//生成半成品出库单据
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
@@ -358,6 +411,7 @@ public class FeedingServiceImpl implements FeedingService {
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_CoolRegionIO").insert(jsonCool);
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.nl.modules.wql.core.content.HttpContext;
|
||||
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.tasks.CallEmpReelTask;
|
||||
@@ -163,7 +164,77 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
String start_pint_code = "";
|
||||
String point_code4 = "";
|
||||
// 2.根据就近原则查对应空卷抽
|
||||
|
||||
//二期B1、B3的生箔烘箱任务和其他不一致
|
||||
if (jsonSb.getString("product_area").equals("B1")) {
|
||||
// 2.根据就近原则查对应空卷轴
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "6");
|
||||
map.put("product_area", jsonSb.getString("product_area"));
|
||||
map.put("point_location", jsonSb.getString("point_location"));
|
||||
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 3.如果没找到则继续找下一节点
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
String point_location = jsonSb.getString("point_location");
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
throw new BadRequestException("未查询到有空轴的点位!");
|
||||
}
|
||||
}
|
||||
|
||||
//查询可用的对接位
|
||||
String reging_id = "";
|
||||
String product_area = jsonSb.getString("product_area");
|
||||
switch (product_area) {
|
||||
case "A1":
|
||||
reging_id = RegionTypeEnum.A_HKZC.getId();
|
||||
break;
|
||||
case "A2":
|
||||
reging_id = RegionTypeEnum.B_HKZC.getId();
|
||||
break;
|
||||
case "A3":
|
||||
reging_id = RegionTypeEnum.C_HKZC.getId();
|
||||
break;
|
||||
case "A4":
|
||||
reging_id = RegionTypeEnum.D_HKZC.getId();
|
||||
break;
|
||||
case "B1":
|
||||
reging_id = RegionTypeEnum.B1_HKZC.getId();
|
||||
break;
|
||||
case "B2":
|
||||
reging_id = RegionTypeEnum.B2_HKZC.getId();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
JSONObject cache_map = new JSONObject();
|
||||
cache_map.put("flag", "1");
|
||||
cache_map.put("reging_id", reging_id);
|
||||
cache_map.put("point_location", jsonSb.getString("point_location"));
|
||||
//只找入箱点位
|
||||
cache_map.put("point_type", "4");
|
||||
|
||||
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)) {
|
||||
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
// 起点和终点确定 生成任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", jsonIvt.getString("empty_point_code"));
|
||||
param.put("point_code2", jsonSb.getString("point_code") + "_K");
|
||||
param.put("point_code3", jsonSb.getString("point_code") + "_M");
|
||||
param.put("point_code4", point_code2_jo.getString("point_code"));
|
||||
param.put("task_type", "010104");
|
||||
param.put("material_code", jsonRaw.getString("container_name"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
callEmpReelTask.createTask(param);
|
||||
} else {
|
||||
// 2.根据就近原则查对应空卷轴
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("product_area", jsonSb.getString("product_area"));
|
||||
@@ -193,6 +264,7 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
callEmpReelTask.createTask(param);
|
||||
}
|
||||
|
||||
// 更新工单状态
|
||||
jsonRaw.put("status", "02");
|
||||
|
||||
@@ -216,7 +216,7 @@ IF 输入.flag = "6"
|
||||
FROM
|
||||
ST_IVT_CoolPointIvt ivt
|
||||
WHERE
|
||||
ivt.empty_point_status = '01'
|
||||
ivt.empty_point_status = '02'
|
||||
AND
|
||||
ivt.is_used = '1'
|
||||
AND NOT EXISTS (
|
||||
|
||||
@@ -111,3 +111,37 @@
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
ST_IVT_CoolPointIvt
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND point_type = '3'
|
||||
AND full_point_status = '01'
|
||||
AND empty_point_status = '01'
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = empty_point_code OR point_code2 = empty_point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
OPTION 输入.product_area <> ""
|
||||
product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_location <> ""
|
||||
point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
ORDER BY sort_seq desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -13,6 +14,7 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -74,6 +76,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
|
||||
WQLObject sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔区域点位表
|
||||
WQLObject point_tab = WQLObject.getWQLObject("sch_base_point"); // 生箔区域点位表
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
@@ -174,6 +177,35 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
jsonIvt.put("empty_vehicle_code", "");
|
||||
ivtTab.update(jsonIvt);
|
||||
|
||||
//判断任务类型,如果为二期B1生箔AGV任务则更新点位表库存
|
||||
if (jsonTask.getString("task_type").equals("010104")) {
|
||||
// 校验终点是否存在
|
||||
JSONObject jsonIvt2 = point_tab.query("point_code ='" + point_code4 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
throw new BadRequestException("终点未找到可用点位:" + point_code2);
|
||||
}
|
||||
|
||||
// 更新点位库存状态
|
||||
jsonIvt2.put("point_status", "2");
|
||||
jsonIvt2.put("material_code", jsonTask.getString("material_code"));
|
||||
point_tab.update(jsonIvt2);
|
||||
|
||||
//创建桁架任务将子卷搬运到桁架下的半成品缓存位
|
||||
//查询当前点位为空且没有任务的桁架内缓存点
|
||||
JSONObject cache_param = new JSONObject();
|
||||
cache_param.put("flag", "4");
|
||||
cache_param.put("point_location", jsonIvt.getString("point_location"));
|
||||
cache_param.put("product_area", jsonIvt.getString("product_area"));
|
||||
JSONObject cache_jo = WQL.getWO("PDA_COOLIN").addParamMap(cache_param).process().uniqueResult(0);
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code4);
|
||||
param.put("point_code2", cache_jo.getString("point_code"));
|
||||
param.put("material_code", jsonTask.getString("material_code"));
|
||||
param.put("product_area", jsonTask.getString("product_area"));
|
||||
param.put("type", "3");
|
||||
InHotTask inHotTask = SpringContextHolder.getBean(InHotTask.class);
|
||||
inHotTask.createTask(param);
|
||||
} else {
|
||||
// 校验终点是否存在
|
||||
JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
@@ -232,6 +264,8 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
jsonRegion.put("confirm_time", DateUtil.now());
|
||||
coolTab.insert(jsonRegion);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +328,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
} else {
|
||||
json.put("priority", priority_jo.getString("value"));
|
||||
}
|
||||
if ("010101".equals(form.getString("task_type"))) {
|
||||
if ("010101".equals(form.getString("task_type")) || "010104".equals(form.getString("task_type"))) {
|
||||
json.put("acs_task_type", "1");
|
||||
} else {
|
||||
json.put("acs_task_type", "3");
|
||||
|
||||
@@ -122,7 +122,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
//只有输送入的时候才调用MES
|
||||
if ("010402".equals(jsonTask.getString("task_type"))) {
|
||||
if ("010402".equals(jsonTask.getString("task_type")) && StrUtil.isNotEmpty(jsonTask.getString("vehicle_code"))) {
|
||||
//调用MES接口,通知MES运输中
|
||||
LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
|
||||
JSONArray rows = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_delete ='0' AND status < '09'").getResultJSONArray(0);
|
||||
|
||||
@@ -118,6 +118,15 @@ public class InHotTask extends AbstractAcsTask {
|
||||
String hot_point_code = "";
|
||||
// 判断此任务是否有三个点位
|
||||
if (ObjectUtil.isEmpty(jsonTask.getString("point_code3"))) {
|
||||
|
||||
if (jsonTask.getString("task_type").equals("010204")) {
|
||||
JSONObject cool_jo = coolIvtTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
cool_jo.put("full_point_status", "02");
|
||||
cool_jo.put("cool_ict_status", "01");
|
||||
cool_jo.put("container_name", jsonTask.getString("material_code"));
|
||||
coolIvtTab.update(cool_jo);
|
||||
return;
|
||||
} else {
|
||||
/*
|
||||
* 暂存区入烘箱任务
|
||||
*/
|
||||
@@ -133,13 +142,24 @@ public class InHotTask extends AbstractAcsTask {
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
hotIvtTab.update(jsonHotIvt);
|
||||
|
||||
String product_area = jsonHotIvt.getString("product_area");
|
||||
if (product_area.equals("B1")) {
|
||||
JSONObject jsonPoint = coolIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
jsonPoint.put("container_name", "");
|
||||
jsonPoint.put("full_point_status", "01");
|
||||
pointTab.update(jsonPoint);
|
||||
}else {
|
||||
// 更新暂存区点位状态为空位
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("material_code", "");
|
||||
pointTab.update(jsonPoint);
|
||||
}
|
||||
|
||||
|
||||
hot_point_code = jsonHotIvt.getString("ext_code");
|
||||
}
|
||||
|
||||
} else {
|
||||
/*
|
||||
* 冷却区入烘箱任务
|
||||
@@ -325,6 +345,38 @@ public class InHotTask extends AbstractAcsTask {
|
||||
tab.insert(json);
|
||||
task_id = json.getString("task_id");
|
||||
}
|
||||
|
||||
if (StrUtil.equals(form.getString("type"), "3")) {
|
||||
{
|
||||
String point_code1 = form.getString("point_code1");
|
||||
String point_code2 = form.getString("point_code2");
|
||||
|
||||
if (cutConveyorTask.isSingleTask(point_code1)) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||
}
|
||||
if (cutConveyorTask.isSingleTask(point_code2)) {
|
||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_type", "010204");
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("sort_seq", "1");
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("priority", "1");
|
||||
json.put("acs_task_type", "6");
|
||||
tab.insert(json);
|
||||
task_id = json.getString("task_id");
|
||||
}
|
||||
}
|
||||
immediateNotifyAcs(task_id);
|
||||
return task_id;
|
||||
}
|
||||
|
||||
@@ -100,6 +100,32 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
if (jsonTask.getString("task_type").equals("010205")) {
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + jsonTask.getString("point_code3") + "'").uniqueResult(0);
|
||||
//创建AGV任务
|
||||
if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) {
|
||||
throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!");
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
|
||||
jo.put("point_code1", jsonTask.getString("point_code2"));
|
||||
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||
jo.put("vehicle_code", jsonTask.getString("material_code"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010302");
|
||||
} else {
|
||||
/*jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", next_point_code);
|
||||
jo.put("point_code3", cut_jo.getString("empty_point_code"));
|
||||
jo.put("point_code4", cool_jo.getString("empty_point_code"));
|
||||
jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010301");*/
|
||||
}
|
||||
AbstractAcsTask task = new CoolCutTask();
|
||||
task.createTask(jo);
|
||||
}else {
|
||||
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
|
||||
// 更新主表: 什么时候更新主表
|
||||
@@ -152,6 +178,7 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
new LmsToMesServiceImpl().momRollBakeOutBound(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -187,10 +214,16 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
String task_type = form.getString("task_type");
|
||||
if (StrUtil.isNotEmpty(task_type)) {
|
||||
json.put("task_type", task_type);
|
||||
}else {
|
||||
json.put("task_type", "010202");
|
||||
}
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("point_code3", form.getString("point_code3"));
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("material_code", form.getString("material_code"));
|
||||
json.put("sort_seq", "1");
|
||||
|
||||
@@ -17,6 +17,7 @@ public enum URLEnum {
|
||||
ACS_URL_A4("A4", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_A4").getValue()),
|
||||
ACS_URL_LK("LK", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_LK").getValue()),
|
||||
ACS_URL_BLK("BLK", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_BLK").getValue()),
|
||||
ACS_URL_B1("B1", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_B2").getValue()),
|
||||
ACS_URL_B2("B2", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_B2").getValue());
|
||||
|
||||
private final String product_area;
|
||||
|
||||
Reference in New Issue
Block a user