更新
This commit is contained in:
@@ -20,6 +20,7 @@ import org.nl.acs.device_driver.magic3.Magic3DeviceDriver;
|
||||
import org.nl.acs.device_driver.ndxy_special_two.NdxySpecialTwoDeviceDriver;
|
||||
import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
@@ -811,20 +812,40 @@ public class AgvServiceImpl implements AgvService {
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
SpecialOrdinarySiteDeviceDriver specialOrdinarySiteDeviceDriver;
|
||||
YzjaSpecialDeviceDriver yzjaSpecialDeviceDriver;
|
||||
StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver;
|
||||
//请求进入
|
||||
if ("onEntry".equals(type)) {
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
|
||||
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//请求取货
|
||||
if ("Load".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() > 0) {
|
||||
if (standardEmptyPalletSiteDeviceDriver.getMode() == 2 && standardEmptyPalletSiteDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_status("1");
|
||||
is_feedback = true;
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||
int number = standardEmptyPalletSiteDeviceDriver.getNumber();
|
||||
int max_emptypalletnum = standardEmptyPalletSiteDeviceDriver.getMax_emptypalletnum();
|
||||
if (standardEmptyPalletSiteDeviceDriver.getMode() == 2 && number < max_emptypalletnum) {
|
||||
inst.setExecute_status("3");
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//请求取货
|
||||
if ("Load".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_status("1");
|
||||
is_feedback = true;
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
is_feedback = true;
|
||||
}
|
||||
@@ -851,16 +872,16 @@ public class AgvServiceImpl implements AgvService {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//请求取货
|
||||
if ("Load".equals(action)) {
|
||||
if (addressdevice.getHas_goods() > 0) {
|
||||
//if (addressdevice.getHas_goods() > 0) {
|
||||
inst.setExecute_status("1");
|
||||
is_feedback = true;
|
||||
}
|
||||
// }
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (addressdevice.getHas_goods() == 0) {
|
||||
//if (addressdevice.getHas_goods() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
is_feedback = true;
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (addressdevice.getDeviceDriver() instanceof YzjaSpecialDeviceDriver) {
|
||||
@@ -919,23 +940,52 @@ public class AgvServiceImpl implements AgvService {
|
||||
} else if ("onStation".equals(type)) {
|
||||
|
||||
System.out.println("取放货完成");
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
|
||||
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
Integer beforeNUm = 0;
|
||||
String start_point_code = inst.getStart_point_code();
|
||||
if (start_point_code.contains(".")){
|
||||
String[] split = start_point_code.split("\\.");
|
||||
beforeNUm = Integer.parseInt(split[split.length - 1]);
|
||||
}
|
||||
//取货完成
|
||||
if ("Load".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||
if (standardEmptyPalletSiteDeviceDriver.getMode() == 2 && (standardEmptyPalletSiteDeviceDriver.getMove() == 0 || beforeNUm > standardEmptyPalletSiteDeviceDriver.getNumber())) {
|
||||
inst.setExecute_device_code(processingVehicle);
|
||||
inst.setExecute_status("2");
|
||||
is_feedback = true;
|
||||
}
|
||||
//放货完成
|
||||
//放过完成
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() > 0) {
|
||||
int number = standardEmptyPalletSiteDeviceDriver.getNumber();
|
||||
if (standardEmptyPalletSiteDeviceDriver.getMode() == 2 && number > beforeNUm) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//取货完成
|
||||
if ("Load".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_device_code(processingVehicle);
|
||||
inst.setExecute_status("2");
|
||||
standardInspectSiteDeviceDriver.writing(1,2);
|
||||
is_feedback = true;
|
||||
}
|
||||
//放货完成
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
standardInspectSiteDeviceDriver.writing(1,3);
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
@@ -988,7 +1038,7 @@ public class AgvServiceImpl implements AgvService {
|
||||
String param = "";
|
||||
JSONObject jo = new JSONObject();
|
||||
if (str.length() > 0) {
|
||||
backaddress = backaddress + str;
|
||||
backaddress = address + str;
|
||||
}
|
||||
if ("onEntry".equals(type)) {
|
||||
param = "EntryPermitted-" + backaddress + action;
|
||||
|
||||
@@ -946,14 +946,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
}
|
||||
removeByCodeFromCache(entity.getInstruction_code());
|
||||
JSONObject jo1 = new JSONObject();
|
||||
jo1.put("device_code",task.getStart_device_code());
|
||||
jo1.put("islock", "0");
|
||||
deviceService.changeDeviceStatus(jo1);
|
||||
JSONObject jo2 = new JSONObject();
|
||||
jo2.put("device_code",task.getNext_device_code());
|
||||
jo2.put("islock", "0");
|
||||
deviceService.changeDeviceStatus(jo2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1128,6 +1128,14 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
agvService.markComplete(entity.getTask_code());
|
||||
}
|
||||
}
|
||||
JSONObject jo1 = new JSONObject();
|
||||
jo1.put("device_code",entity.getStart_device_code());
|
||||
jo1.put("islock", "0");
|
||||
deviceService.changeDeviceStatus(jo1);
|
||||
JSONObject jo2 = new JSONObject();
|
||||
jo2.put("device_code",entity.getNext_device_code());
|
||||
jo2.put("islock", "0");
|
||||
deviceService.changeDeviceStatus(jo2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user