This commit is contained in:
2023-08-28 17:28:32 +08:00
3 changed files with 28 additions and 2 deletions

View File

@@ -249,7 +249,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String device_code = ""; String device_code = "";
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + parent_device_code + "'").uniqueResult(0); JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + parent_device_code + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(device_json)) { if (!ObjectUtil.isEmpty(device_json)) {
device_code = (String) device_json.get("parent_storage_code") == null ? parent_device_code : (String) device_json.get("storage_code"); device_code = device_json.get("parent_storage_code") == null ? parent_device_code : (String) device_json.get("storage_code");
} else {
device_code = parent_device_code;
} }
Device device = deviceAppService.findDeviceByCode(device_code); Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) { if (ObjectUtil.isEmpty(device)) {
@@ -322,6 +324,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("power", driver.getElectric_qty()); jo.put("power", driver.getElectric_qty());
jo.put("error", driver.getError()); jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : driver.getError_message()); jo.put("error_msg", driver.getError() == 0 ? "" : driver.getError_message());
} else if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
AgvNdcTwoDeviceDriver driver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", driver.getStatus());
jo.put("power", driver.getElectric_qty());
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : driver.getError_message());
} else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { } else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
OvenGantryManipulatorDeviceDriver driver = (OvenGantryManipulatorDeviceDriver) device.getDeviceDriver(); OvenGantryManipulatorDeviceDriver driver = (OvenGantryManipulatorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code()); jo.put("device_code", driver.getDevice().getDevice_code());

View File

@@ -399,6 +399,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
if (type.equals("4")) { if (type.equals("4")) {
CutConveyorTask cutConveyorTask = new CutConveyorTask();
//查询该木箱对应的包装关系 //查询该木箱对应的包装关系
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0); JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) { if (ObjectUtil.isEmpty(sub_jo)) {
@@ -480,6 +482,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' and is_used = '1' order by out_order_seq ASC").getResultJSONArray(0); JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' and is_used = '1' order by out_order_seq ASC").getResultJSONArray(0);
if (pointArr.size() == flag) { if (pointArr.size() == flag) {
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0); JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0);
if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) {
continue;
}
point_code = jsonNewRow.getString("point_code"); point_code = jsonNewRow.getString("point_code");
break; break;
} }
@@ -499,6 +506,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 堵住则判断下一个 // 堵住则判断下一个
continue; continue;
} else { } else {
if (cutConveyorTask.isSingleTask(json.getString("point_code"))) {
continue;
}
// 未堵住: 跳出循环 // 未堵住: 跳出循环
point_code = json.getString("point_code"); point_code = json.getString("point_code");
break; break;
@@ -527,6 +538,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' and is_used = '1' order by out_order_seq ASC").getResultJSONArray(0); JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' and is_used = '1' order by out_order_seq ASC").getResultJSONArray(0);
if (pointArr.size() == flag) { if (pointArr.size() == flag) {
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0); JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0);
if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) {
continue;
}
point_code = jsonNewRow.getString("point_code"); point_code = jsonNewRow.getString("point_code");
break; break;
} }

View File

@@ -53,7 +53,7 @@ public class ProductionOutServiceImpl implements ProductionOutService {
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
if (ObjectUtil.isEmpty(box_no)) throw new BadRequestException("木箱不能为空"); if (ObjectUtil.isEmpty(box_no)) throw new BadRequestException("木箱不能为空");
JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1' and point_type = '9'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) { if (ObjectUtil.isEmpty(jsonPoint)) {
throw new BadRequestException("请输入正确的木箱或查看点位是否存在"); throw new BadRequestException("请输入正确的木箱或查看点位是否存在");