This commit is contained in:
loujf
2022-09-14 10:48:02 +08:00
parent b0e317864b
commit ed426d4fa5
3 changed files with 180 additions and 2 deletions

View File

@@ -855,6 +855,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
SpecialOrdinarySiteDeviceDriver specialOrdinarySiteDeviceDriver;
StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver;
NdxySpecialTwoDeviceDriver ndxySpecialTwoDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if (!StrUtil.isEmpty(hasGoodStatus)) {
@@ -940,6 +941,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
device.setMaterial_type(material_type);
device.setQuantity(quantity);
device.setRemark(remark);
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.setMaterial(material_type);
standardInspectSiteDeviceDriver.setQty(quantity);
standardInspectSiteDeviceDriver.setRemark(remark);
device.setMaterial_type(material_type);
device.setQuantity(quantity);
device.setRemark(remark);
if (ObjectUtil.isNotEmpty(islock)) {
device.setIslock(islock);
}
}
}

View File

@@ -421,7 +421,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMode() != 2 || standardInspectSiteDeviceDriver.getMove() != 0) {
throw new Exception("任务终点需满足待机无货!");
// throw new Exception("任务终点需满足待机无货!");
}
}

View File

@@ -122,6 +122,8 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
//普通站点
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//检测站点
StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver;
if (device == null) {
jo.put("status", status);
@@ -130,7 +132,6 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
jo.put("device_name", devicejo.optString("device_code"));
jo.put("allow_update", "1");
} else {
//检测站点
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
@@ -177,6 +178,40 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
jo.put("device_type", devicejo.optString("device_type"));
resultArr.add(jo);
}
//检测站点
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (StrUtil.equals(device.getIslock(), "true")) {
status = "3";
move = "有任务";
} else {
if (standardInspectSiteDevicedriver.getHasGoods() == 0) {
status = "0";
move = "无货";
} else if (standardInspectSiteDevicedriver.getHasGoods() == 1) {
status = "1";
move = "有托盘";
} else if (standardInspectSiteDevicedriver.getHasGoods() == 2) {
status = "2";
move = "有托盘有货";
}
}
material = device.getMaterial_type();
if (StrUtil.isNullOrUndefined(material)) {
material = "";
}
jo.put("material_type", material);
jo.put("status_name", move);
jo.put("status", status);
jo.put("device_id", devicejo.optString("device_id"));
jo.put("device_code", devicejo.optString("device_code"));
jo.put("device_name", devicejo.optString("device_name"));
jo.put("allow_update", "0");
jo.put("input_material", input_material);
resultArr.add(jo);
}
}
}
} else if (StrUtil.equals(region,"91")) {
@@ -190,6 +225,8 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
//普通站点
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//检测站点
StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver;
if (device == null) {
jo.put("status", status);
@@ -245,6 +282,39 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
jo.put("device_type", devicejo.optString("device_type"));
resultArr.add(jo);
}
//检测站点
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (StrUtil.equals(device.getIslock(), "true")) {
status = "3";
move = "有任务";
} else {
if (standardInspectSiteDevicedriver.getHasGoods() == 0) {
status = "0";
move = "无货";
} else if (standardInspectSiteDevicedriver.getHasGoods() == 1) {
status = "1";
move = "有托盘";
} else if (standardInspectSiteDevicedriver.getHasGoods() == 2) {
status = "2";
move = "有托盘有货";
}
}
material = device.getMaterial_type();
if (StrUtil.isNullOrUndefined(material)) {
material = "";
}
jo.put("material_type", material);
jo.put("status_name", move);
jo.put("status", status);
jo.put("device_id", devicejo.optString("device_id"));
jo.put("device_code", devicejo.optString("device_code"));
jo.put("device_name", devicejo.optString("device_name"));
jo.put("allow_update", "0");
jo.put("input_material", input_material);
resultArr.add(jo);
}
}
}
} else if (StrUtil.equals(region,"92")) {
@@ -258,6 +328,8 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
//普通站点
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//检测站点
StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver;
if (device == null) {
jo.put("status", status);
@@ -313,6 +385,40 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
jo.put("device_type", devicejo.optString("device_type"));
resultArr.add(jo);
}
//检测站点
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (StrUtil.equals(device.getIslock(), "true")) {
status = "3";
move = "有任务";
} else {
if (standardInspectSiteDevicedriver.getHasGoods() == 0) {
status = "0";
move = "无货";
} else if (standardInspectSiteDevicedriver.getHasGoods() == 1) {
status = "1";
move = "有托盘";
} else if (standardInspectSiteDevicedriver.getHasGoods() == 2) {
status = "2";
move = "有托盘有货";
}
}
material = device.getMaterial_type();
if (StrUtil.isNullOrUndefined(material)) {
material = "";
}
jo.put("material_type", material);
jo.put("status_name", move);
jo.put("status", status);
jo.put("device_id", devicejo.optString("device_id"));
jo.put("device_code", devicejo.optString("device_code"));
jo.put("device_name", devicejo.optString("device_name"));
jo.put("allow_update", "0");
jo.put("input_material", input_material);
resultArr.add(jo);
}
}
}
}
@@ -327,6 +433,8 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
//普通站点
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//检测站点
StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver;
if (device == null) {
jo.put("status", status);
@@ -382,6 +490,37 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
jo.put("device_type", devicejo.optString("device_type"));
resultArr.add(jo);
}
//检测站点
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (StrUtil.equals(device.getIslock(), "true")) {
status = "3";
move = "有任务";
} else {
if (standardInspectSiteDevicedriver.getHasGoods() == 0) {
status = "0";
move = "无货";
} else if (standardInspectSiteDevicedriver.getHasGoods() != 0) {
status = "2";
move = "有货";
}
}
material = device.getMaterial_type();
if (StrUtil.isNullOrUndefined(material)) {
material = "";
}
jo.put("material_type", material);
jo.put("status_name", move);
jo.put("status", status);
jo.put("device_id", devicejo.optString("device_id"));
jo.put("device_code", devicejo.optString("device_code"));
jo.put("device_name", devicejo.optString("device_name"));
jo.put("allow_update", "0");
jo.put("input_material", input_material);
resultArr.add(jo);
}
}
}
}
@@ -643,6 +782,9 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
// }
//普通站点
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//检测站点
StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver;
if (StrUtil.equals(status,"3")) {
resultJson.put("code", "2");
resultJson.put("desc", "不可手动改为任务状态!");
@@ -675,6 +817,18 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
device.setQuantity(quantity);
device.setRemark(remark);
}
//检测站点
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (!StrUtil.isEmpty(material_type)) {
standardInspectSiteDevicedriver.setMaterial(material_type);
standardInspectSiteDevicedriver.setQty(quantity);
standardInspectSiteDevicedriver.setRemark(remark);
device.setMaterial_type(material_type);
device.setQuantity(quantity);
device.setRemark(remark);
}
}
}
//清空
if (type.equals("2")) {
@@ -689,6 +843,18 @@ public class NdxyTwoHandServiceImpl implements NdxyTwoHandService {
device.setQuantity("");
device.setRemark("");
}
//检测站点
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (!StrUtil.isEmpty(material_type)) {
standardInspectSiteDevicedriver.setMaterial("");
standardInspectSiteDevicedriver.setQty("");
standardInspectSiteDevicedriver.setRemark("");
device.setMaterial_type("");
device.setQuantity("");
device.setRemark("");
}
}
}
resultJson.put("code", "1");
resultJson.put("desc", "更新成功");