Browse Source

更新

master
gengby 2 years ago
parent
commit
3302c9ba91
  1. 25
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

25
hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

@ -42,6 +42,7 @@ import org.nl.exception.BadRequestException;
import org.nl.logger.BusinessLogger; import org.nl.logger.BusinessLogger;
import org.nl.start.auto.run.NDCSocketConnectionAutoRun; import org.nl.start.auto.run.NDCSocketConnectionAutoRun;
import org.nl.utils.SpringContextHolder; import org.nl.utils.SpringContextHolder;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -266,21 +267,29 @@ public class AgvServiceImpl implements AgvService {
String compound_inst_data = inst.getCompound_inst_data(); String compound_inst_data = inst.getCompound_inst_data();
String[] str = null; String[] str = null;
List<String> pathlist = null; List<String> pathlist = null;
WQLObject wo = WQLObject.getWQLObject("acs_device_extra");
if (StrUtil.equals("2", inst.getInstruction_type()) && !StrUtil.isEmpty(compound_inst_data)) { if (StrUtil.equals("2", inst.getInstruction_type()) && !StrUtil.isEmpty(compound_inst_data)) {
str = compound_inst_data.split("->"); str = compound_inst_data.split("->");
pathlist = Arrays.asList(str); pathlist = Arrays.asList(str);
for (int i = 0; i < pathlist.size(); i++) { for (int i = 0; i < pathlist.size(); i++) {
String device_code = pathlist.get(i); String device_code = pathlist.get(i);
Device device = deviceAppService.findDeviceByCode(device_code); Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) { if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("未找到该设备【" + device_code + "】"); throw new BadRequestException("未找到该设备【" + device_code + "】");
} }
String inspect_in_stocck = device.getExtraValue().get("inspect_in_stocck").toString();
if (i == 0) { if (i == 0) {
ja.add(destination(device_code, "Load", "1", "1")); if (!StrUtil.equals(inspect_in_stocck,"true")){
ja.add(destination(device_code, "Load", "1", "1"));
} else {
ja.add(destination(device_code, "OP_PICK", "1", "1"));
}
} else if (i == pathlist.size() - 1) { } else if (i == pathlist.size() - 1) {
ja.add(destination(device_code, "Unload", "1", "1")); if (!StrUtil.equals(inspect_in_stocck,"true")){
ja.add(destination(device_code, "Unload", "1", "1"));
} else {
ja.add(destination(device_code, "OP_DUMP", "1", "1"));
}
} else { } else {
ja.add(destination(device_code, "OP_DUMP", "1", "4")); ja.add(destination(device_code, "OP_DUMP", "1", "4"));
} }
@ -571,7 +580,7 @@ public class AgvServiceImpl implements AgvService {
if (result.getStatus() == 200) { if (result.getStatus() == 200) {
arr.add(result.body()); arr.add(result.body());
} }
} catch (Exception e ){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -876,7 +885,7 @@ public class AgvServiceImpl implements AgvService {
yzjaSpecialDeviceDriver.setManua_confirm(0); yzjaSpecialDeviceDriver.setManua_confirm(0);
inst.setExecute_status("1"); inst.setExecute_status("1");
is_feedback = true; is_feedback = true;
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("1")){ } else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("1")) {
yzjaSpecialDeviceDriver.setManua_confirm(1); yzjaSpecialDeviceDriver.setManua_confirm(1);
} }
} else { } else {
@ -892,7 +901,7 @@ public class AgvServiceImpl implements AgvService {
yzjaSpecialDeviceDriver.setManua_confirm(0); yzjaSpecialDeviceDriver.setManua_confirm(0);
inst.setExecute_status("3"); inst.setExecute_status("3");
is_feedback = true; is_feedback = true;
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("3")){ } else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("3")) {
yzjaSpecialDeviceDriver.setManua_confirm(1); yzjaSpecialDeviceDriver.setManua_confirm(1);
} }
} else { } else {
@ -1106,7 +1115,7 @@ public class AgvServiceImpl implements AgvService {
//请求进 //请求进
if (StrUtil.equals(type, "07") && address.endsWith("IQ")) { if (StrUtil.equals(type, "07") && address.endsWith("IQ")) {
sandardManipulatorInspectSiteDeviceDriver.writing(1, 7); sandardManipulatorInspectSiteDeviceDriver.writing(1, 7);
if ( sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 1 if (sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 1
|| sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 3) { || sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 3) {
is_feedback = true; is_feedback = true;
} }

Loading…
Cancel
Save