This commit is contained in:
2023-02-19 14:49:51 +08:00
parent 2f60e8ef00
commit 49be1aad2b
4 changed files with 60 additions and 37 deletions

View File

@@ -2,7 +2,6 @@ package org.nl.wms.ext.acs.service.impl;
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;
@@ -684,39 +683,58 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//查询该设备对应的输送线点位
JSONObject deliver_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '" + device_code + "'").uniqueResult(0);
if (deliver_jo != null) {
String qzzno = deliver_jo.getString("qzzno");
if (ObjectUtil.isNotEmpty(deliver_jo)) {
deliver_jo.put("point_status", "01");
deliver_jo.put("qzzno", "");
deliver_jo.put("vehicle_code", "");
WQLObject.getWQLObject("st_ivt_deliverypointivt").update(deliver_jo);
if (ObjectUtil.isNotEmpty(deliver_jo)) {
char dtl_type = device_code.charAt(device_code.length() - 1);
//判断该点位是否存在未完成的任务
/*if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0){
//如果为分切输送线上料位,判断该点位是否存在未完成的任务类型为分切输送出的任务
JSONObject left_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010401' AND point_code1 = '"+device_code+"' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
if (ObjectUtil.isEmpty(left_jo)){
log.info("shipDeviceUpdate请求参数---------------------------------------------" + whereJson.toString()+",ACS上报无货且此时LMS该点位没有任何任务");
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "反馈成功!");
return result;
}
}else {
//如果为分切输送线上料位,判断该点位是否存在未完成的任务类型为分切输送出的或载具横移任务
JSONObject right_jo = WQLObject.getWQLObject("sch_base_task").query("(task_type = '010401' OR task_type = '010406') AND point_code1 = '"+device_code+"' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
if (ObjectUtil.isEmpty(right_jo)){
log.info("shipDeviceUpdate请求参数---------------------------------------------" + whereJson.toString()+",ACS上报无货且此时LMS该点位没有任何任务");
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "反馈成功!");
return result;
}
}*/
deliver_jo.put("point_status", "01");
deliver_jo.put("qzzno", "");
deliver_jo.put("vehicle_code", "");
WQLObject.getWQLObject("st_ivt_deliverypointivt").update(deliver_jo);
//如果为靠近分切机一端的输送点,判断远离端是否需要进行横移
char dtl_type = device_code.charAt(device_code.length() - 1);
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
String point_location = deliver_jo.getString("point_location");
String product_area = deliver_jo.getString("product_area");
String sort_seq = deliver_jo.getString("sort_seq");
JSONObject right_point = WQL.getWO("PDA_02")
.addParam("point_location", point_location)
.addParam("point_code", device_code)
.addParam("product_area", product_area)
.addParam("sort_seq", sort_seq)
.addParam("find_type", "1")
.addParam("flag", "17").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(right_point) && !right_point.getString("point_status").equals("01")) {
//创建载具横移任务
String translate_code1 = right_point.getString("point_code");
String translate_code2 = device_code;
JSONObject tran_jo = new JSONObject();
tran_jo.put("point_code1", translate_code1);
tran_jo.put("point_code2", translate_code2);
tran_jo.put("vehicle_code", right_point.getString("qzzno"));
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
tran_jo.put("task_type", "010406");
cutConveyorTask.createTask(tran_jo);
}
//如果为分切输送线上料位,判断缓存位是否需要进行横移
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
String point_location = deliver_jo.getString("point_location");
String product_area = deliver_jo.getString("product_area");
String sort_seq = deliver_jo.getString("sort_seq");
JSONObject right_point = WQL.getWO("PDA_02")
.addParam("point_location", point_location)
.addParam("point_code", device_code)
.addParam("product_area", product_area)
.addParam("sort_seq", sort_seq)
.addParam("find_type", "1")
.addParam("flag", "17").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(right_point) && !right_point.getString("point_status").equals("01")) {
//创建载具横移任务
String translate_code1 = right_point.getString("point_code");
String translate_code2 = device_code;
JSONObject tran_jo = new JSONObject();
tran_jo.put("point_code1", translate_code1);
tran_jo.put("point_code2", translate_code2);
tran_jo.put("vehicle_code", right_point.getString("qzzno"));
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
tran_jo.put("task_type", "010406");
cutConveyorTask.createTask(tran_jo);
}
}
}

View File

@@ -107,7 +107,7 @@ public class OutServiceImpl implements OutService {
throw new BadRequestException("未查询到对应的分切机!");
}
if (!StrUtil.equals(rows.getJSONObject(0).getString("point_code"),cut_ivt.getString("point_code"))){
if (!StrUtil.equals(rows.getJSONObject(0).getString("point_code"), cut_ivt.getString("point_code"))) {
throw new BadRequestException("请选择和分切计划相同的设备点位进行上空轴!");
}
@@ -191,6 +191,11 @@ public class OutServiceImpl implements OutService {
throw new BadRequestException("起点不能为空!");
}
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task1)) {
throw new BadRequestException("点位:" + point_code + "存在未完成的任务!");
}
//如果查询到给ACS下发一个输送线任务
JSONObject form = new JSONObject();
form.put("point_code1", point_code);

View File

@@ -180,7 +180,7 @@
PDM_BI_SlittingProductionPlan plan
LEFT JOIN st_ivt_cutpointivt ivt ON ivt.ext_code = plan.resource_name
WHERE
plan.STATUS = 05
plan.STATUS = '05'
AND
is_child_tz_ok = 1
AND

View File

@@ -61,10 +61,10 @@
LEFT JOIN PDM_BI_RawFoilWorkOrder der ON coolIvt.container_name = der.container_name
LEFT JOIN ST_IVT_HotRegionIOMst hotMst ON hotMst.container_name = coolIvt.container_name
LEFT JOIN (
SELECT * FROM ST_IVT_HotRegionIODtl WHERE 1=1 ORDER BY confirm_time ASC LIMIT 1
SELECT * FROM ST_IVT_HotRegionIOMst WHERE 1=1 ORDER BY confirm_time ASC LIMIT 1
) AS hotDtl1 ON hotMst.iostorinv_id = hotDtl1.iostorinv_id
LEFT JOIN (
SELECT * FROM ST_IVT_HotRegionIODtl WHERE 1=1 ORDER BY confirm_time DESC LIMIT 1
SELECT * FROM ST_IVT_HotRegionIOMst WHERE 1=1 ORDER BY confirm_time DESC LIMIT 1
) AS hotDtl2 ON hotMst.iostorinv_id = hotDtl1.iostorinv_id
WHERE
coolIvt.full_point_status = '02'