代码更新

This commit is contained in:
2022-10-18 11:04:03 +08:00
parent 9ae09a91f0
commit ce661a942b

View File

@@ -125,8 +125,11 @@ public class RawFoilServiceImpl implements RawFoilService {
public JSONObject needEmptyAxis(JSONObject whereJson) { public JSONObject needEmptyAxis(JSONObject whereJson) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo"); JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "01")) throw new BadRequestException("工单状态不为开始");
String start_pint_code = ""; String start_pint_code = "";
// 2.根据就近原则查对应空卷抽 // 2.根据就近原则查对应空卷抽
@@ -157,7 +160,7 @@ public class RawFoilServiceImpl implements RawFoilService {
map4.put("point_location", raw_jo.getString("point_location")); map4.put("point_location", raw_jo.getString("point_location"));
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点 // 3.如果没找到则继续找下一节点
if (ObjectUtil.isEmpty(jsonIvt)) { if (ObjectUtil.isEmpty(jsonIvt4)) {
String point_location = raw_jo.getString("point_location"); String point_location = raw_jo.getString("point_location");
if (StrUtil.equals(point_location, "0")) { if (StrUtil.equals(point_location, "0")) {
map.put("point_location", "1"); map.put("point_location", "1");
@@ -186,6 +189,10 @@ public class RawFoilServiceImpl implements RawFoilService {
CallEmpReelTask callEmpReelTask = new CallEmpReelTask(null); CallEmpReelTask callEmpReelTask = new CallEmpReelTask(null);
String task_id = callEmpReelTask.createTask(param); String task_id = callEmpReelTask.createTask(param);
// 更新工单状态
jsonRaw.put("status", "02");
rawTab.update(jsonRaw);
// 下发任务 // 下发任务
JSONObject jsonObject = callEmpReelTask.renotifyAcs(task_id); JSONObject jsonObject = callEmpReelTask.renotifyAcs(task_id);
if (StrUtil.equals(jsonObject.getString("status"), "200")) { if (StrUtil.equals(jsonObject.getString("status"), "200")) {
@@ -201,28 +208,39 @@ public class RawFoilServiceImpl implements RawFoilService {
@Override @Override
public void confirmBlanking(JSONObject whereJson) { public void confirmBlanking(JSONObject whereJson) {
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "02")) throw new BadRequestException("工单状态不为空轴搬出");
//查询该母卷号对应的任务 //查询该母卷号对应的任务
String container_name = whereJson.getString("container_name"); String container_name = whereJson.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0); JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
//下发ACS执行取满放空的AGV动作 //下发ACS执行取满放空的AGV动作
// 更新工单状态为确认下卷
} }
@Override @Override
public JSONObject finishBlanking(JSONObject whereJson) { public JSONObject finishBlanking(JSONObject whereJson) {
String start_pint_code = whereJson.getString("point_code");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
String start_pint_code = raw_jo.getString("point_code");
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表 WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表 WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表 WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
//查询该母卷号对应的任务 //查询该母卷号对应的任务
String container_name = whereJson.getString("container_name"); String container_name = raw_jo.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0); JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0); JSONObject jsonRaw = rawTab.query("mfg_order_name = '" + raw_jo.getString("mfg_order_name") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "03")) throw new BadRequestException("工单不为确认下卷");
if (ObjectUtil.isEmpty(start_pint_code)) throw new BadRequestException("起点不能为空"); if (ObjectUtil.isEmpty(start_pint_code)) throw new BadRequestException("起点不能为空");
String end_point_code = ""; String end_point_code = "";
@@ -260,7 +278,7 @@ public class RawFoilServiceImpl implements RawFoilService {
Long currentUserId = SecurityUtils.getCurrentUserId(); Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonMater = materTab.query("material_code = '" + jsonCool.getString("product_name") + "'").uniqueResult(0); JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
JSONObject jsonRegion = new JSONObject(); JSONObject jsonRegion = new JSONObject();
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId()); jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
@@ -269,7 +287,7 @@ public class RawFoilServiceImpl implements RawFoilService {
jsonRegion.put("material_id", jsonMater.getString("material_id")); jsonRegion.put("material_id", jsonMater.getString("material_id"));
jsonRegion.put("pcsn", ""); jsonRegion.put("pcsn", "");
jsonRegion.put("vehicle_code", ""); jsonRegion.put("vehicle_code", "");
jsonRegion.put("qty", jsonCool.getString("productin_qty")); jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", ""); jsonRegion.put("qty_unit_id", "");
jsonRegion.put("bill_status", "10"); jsonRegion.put("bill_status", "10");
jsonRegion.put("start_point_code", start_pint_code); jsonRegion.put("start_point_code", start_pint_code);
@@ -282,6 +300,10 @@ public class RawFoilServiceImpl implements RawFoilService {
jsonRegion.put("create_time", DateUtil.now()); jsonRegion.put("create_time", DateUtil.now());
regionTab.insert(jsonRegion); regionTab.insert(jsonRegion);
// 更新工单状态为下卷完成
jsonRaw.put("status", "04");
rawTab.update(jsonRaw);
// 6.下发任务入库任务 // 6.下发任务入库任务
BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask(null); BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask(null);
JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_jo.getString("task_id")); JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_jo.getString("task_id"));
@@ -307,9 +329,12 @@ public class RawFoilServiceImpl implements RawFoilService {
WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0); JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonCool.getString("status"), "04")) throw new BadRequestException("工单不为下卷完成");
jsonCool.put("status", "2"); jsonCool.put("status", "2");
jsonCool.put("realend_time", DateUtil.now()); jsonCool.put("realend_time", DateUtil.now());
jsonCool.put("finish_type", "02"); jsonCool.put("finish_type", "09");
coolTab.update(jsonCool); coolTab.update(jsonCool);
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();