|
|
@ -435,12 +435,22 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
json.put("device_name", obj.optString("device_name")); |
|
|
|
Device device = deviceAppService.findDeviceByCode(obj.optString("device_code")); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardInspectSiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardInspectSiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
result.add(json); |
|
|
|
} |
|
|
@ -461,12 +471,22 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
json.put("device_name", obj.optString("device_name")); |
|
|
|
Device device = deviceAppService.findDeviceByCode(obj.optString("device_code")); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardInspectSiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardInspectSiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
result.add(json); |
|
|
|
} |
|
|
@ -487,6 +507,43 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
json.put("device_name", obj.optString("device_name")); |
|
|
|
Device device = deviceAppService.findDeviceByCode(obj.optString("device_code")); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardInspectSiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardInspectSiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
result.add(json); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray selectDeviceListFour() { |
|
|
|
//设备基础信息表【acs_device】
|
|
|
|
JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '4'", "seq_num").getResultJSONArray(0); |
|
|
|
JSONArray result = new JSONArray(); |
|
|
|
for (int i = 0; i < arr.size(); i++) { |
|
|
|
JSONObject obj = arr.getJSONObject(i); |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_id", obj.optString("device_id")); |
|
|
|
json.put("device_code", obj.optString("device_code")); |
|
|
|
json.put("checked", false); |
|
|
|
json.put("device_name", obj.optString("device_name")); |
|
|
|
Device device = deviceAppService.findDeviceByCode(obj.optString("device_code")); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); |
|
|
@ -495,6 +552,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
json.put("quantity", standardInspectSiteDeviceDriver.getQty()); |
|
|
|
json.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); |
|
|
|
json.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
|
json.put("islock",standardInspectSiteDeviceDriver.getIslock()); |
|
|
|
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
} |
|
|
|
result.add(json); |
|
|
|
} |
|
|
|
return result; |
|
|
@ -1140,6 +1205,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
} |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setQty(quantity); |
|
|
@ -1151,6 +1217,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
device.setRemark(remark); |
|
|
|
device.setHas_goods(hasGoods); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setQty(quantity); |
|
|
|
standardInspectSiteDeviceDriver.setMaterial(material_type); |
|
|
|
standardInspectSiteDeviceDriver.setRemark(remark); |
|
|
|
standardInspectSiteDeviceDriver.setHasGoods(hasGoods); |
|
|
|
device.setMaterial_type(material_type); |
|
|
|
device.setQuantity(quantity); |
|
|
|
device.setRemark(remark); |
|
|
|
device.setHas_goods(hasGoods); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -1242,6 +1319,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
|
|
|
|
Device startDevice = deviceAppService.findDeviceByCode(start_device_code); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) startDevice.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setBranchProtocol(0); |
|
|
@ -1264,6 +1342,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
|
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setHasGoods(0); |
|
|
@ -1275,6 +1354,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
|
changeDeviceStatus(jsonjo); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setHasGoods(0); |
|
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
|
JSONObject jsonjo = new JSONObject(); |
|
|
|
jsonjo.put("device_code", device_code); |
|
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
|
changeDeviceStatus(jsonjo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -1289,6 +1379,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
String device_code = arrjo.get("device_code").toString(); |
|
|
|
|
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
@ -1301,6 +1392,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
|
changeDeviceStatus(jsonjo); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1317,6 +1414,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
String device_code = arrjo.get("device_code").toString(); |
|
|
|
|
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
@ -1329,6 +1427,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
|
changeDeviceStatus(jsonjo); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1345,6 +1449,42 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
String device_code = arrjo.get("device_code").toString(); |
|
|
|
|
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setHasGoods(0); |
|
|
|
standardOrdinarySiteDeviceDriver.setMaterial(""); |
|
|
|
standardOrdinarySiteDeviceDriver.setQty(""); |
|
|
|
standardOrdinarySiteDeviceDriver.setRemark(""); |
|
|
|
JSONObject jsonjo = new JSONObject(); |
|
|
|
jsonjo.put("device_code", device_code); |
|
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
|
changeDeviceStatus(jsonjo); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void cleans4(JSONObject json) { |
|
|
|
JSONArray array = json.optJSONArray("data"); |
|
|
|
|
|
|
|
if (array.size() == 0) { |
|
|
|
throw new RuntimeException("请选择库位"); |
|
|
|
} else { |
|
|
|
for (int i = 0; i < array.size(); i++) { |
|
|
|
JSONObject arrjo = array.getJSONObject(i); |
|
|
|
String device_code = arrjo.get("device_code").toString(); |
|
|
|
|
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
@ -1357,6 +1497,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
|
changeDeviceStatus(jsonjo); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1373,11 +1519,16 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
throw new RuntimeException("当前行的库位有任务!"); |
|
|
|
} |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock)); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setIslock(Boolean.valueOf(islock)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1393,11 +1544,41 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
|
throw new RuntimeException("当前行的库位有任务!"); |
|
|
|
} |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock)); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setIslock(Boolean.valueOf(islock)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void enterSite3(JSONObject json) { |
|
|
|
JSONArray array = json.optJSONArray("data"); |
|
|
|
String islock = json.optString("islock"); |
|
|
|
|
|
|
|
for (int i = 0; i < array.size(); i++) { |
|
|
|
JSONObject arrjo = array.getJSONObject(i); |
|
|
|
String device_code = arrjo.get("device_code").toString(); |
|
|
|
if (ObjectUtil.isNotEmpty(taskService.findByNextCode(device_code))) { |
|
|
|
throw new RuntimeException("当前行的库位有任务!"); |
|
|
|
} |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock)); |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardInspectSiteDeviceDriver.setIslock(Boolean.valueOf(islock)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|