|
@ -34,6 +34,8 @@ import org.nl.acs.device_driver.yzja_special.YzjaSpecialDeviceDriver; |
|
|
import org.nl.acs.opc.Device; |
|
|
import org.nl.acs.opc.Device; |
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
import org.nl.acs.opc.DeviceAppServiceImpl; |
|
|
import org.nl.acs.opc.DeviceAppServiceImpl; |
|
|
|
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
|
|
|
import org.nl.acs.route.service.dto.RouteLineDto; |
|
|
import org.nl.acs.task.service.TaskService; |
|
|
import org.nl.acs.task.service.TaskService; |
|
|
import org.nl.exception.BadRequestException; |
|
|
import org.nl.exception.BadRequestException; |
|
|
import org.nl.modules.system.util.CodeUtil; |
|
|
import org.nl.modules.system.util.CodeUtil; |
|
@ -75,6 +77,8 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
private final AcsConfigService acsConfigService; |
|
|
private final AcsConfigService acsConfigService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
TaskService taskService; |
|
|
TaskService taskService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
RouteLineService routeLineService; |
|
|
|
|
|
|
|
|
List<StorageCellDto> storageCells = new ArrayList<>(); |
|
|
List<StorageCellDto> storageCells = new ArrayList<>(); |
|
|
private Map<String, Integer> storage_address = new HashMap(); |
|
|
private Map<String, Integer> storage_address = new HashMap(); |
|
@ -496,7 +500,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
@Override |
|
|
@Override |
|
|
public JSONArray selectDeviceListThree() { |
|
|
public JSONArray selectDeviceListThree() { |
|
|
//设备基础信息表【acs_device】
|
|
|
//设备基础信息表【acs_device】
|
|
|
JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '1'", "seq_num").getResultJSONArray(0); |
|
|
JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region IN ('1', '6')", "seq_num").getResultJSONArray(0); |
|
|
JSONArray result = new JSONArray(); |
|
|
JSONArray result = new JSONArray(); |
|
|
for (int i = 0; i < arr.size(); i++) { |
|
|
for (int i = 0; i < arr.size(); i++) { |
|
|
JSONObject obj = arr.getJSONObject(i); |
|
|
JSONObject obj = arr.getJSONObject(i); |
|
@ -515,6 +519,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
json.put("islock",standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods()); |
|
|
json.put("hasGood",standardOrdinarySiteDeviceDriver.getHasGoods()); |
|
|
|
|
|
json.put("next_code",standardOrdinarySiteDeviceDriver.getNext_code()); |
|
|
} |
|
|
} |
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
@ -523,6 +528,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
json.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
json.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
json.put("islock",standardInspectSiteDeviceDriver.getIslock()); |
|
|
json.put("islock",standardInspectSiteDeviceDriver.getIslock()); |
|
|
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
json.put("hasGood",standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
|
|
json.put("next_code",standardInspectSiteDeviceDriver.getNext_code()); |
|
|
} |
|
|
} |
|
|
result.add(json); |
|
|
result.add(json); |
|
|
} |
|
|
} |
|
@ -1243,6 +1249,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
//物料类型
|
|
|
//物料类型
|
|
|
String material_type = form.optString("material_type"); |
|
|
String material_type = form.optString("material_type"); |
|
|
String remark = form.optString("remark"); |
|
|
String remark = form.optString("remark"); |
|
|
|
|
|
String next_code = form.optString("next_code"); |
|
|
Integer hasGoods = 0; |
|
|
Integer hasGoods = 0; |
|
|
if (!StrUtil.equals(material_type,"")) { |
|
|
if (!StrUtil.equals(material_type,"")) { |
|
|
hasGoods = 2; |
|
|
hasGoods = 2; |
|
@ -1256,10 +1263,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
standardOrdinarySiteDeviceDriver.setMaterial(material_type); |
|
|
standardOrdinarySiteDeviceDriver.setMaterial(material_type); |
|
|
standardOrdinarySiteDeviceDriver.setRemark(remark); |
|
|
standardOrdinarySiteDeviceDriver.setRemark(remark); |
|
|
standardOrdinarySiteDeviceDriver.setHasGoods(hasGoods); |
|
|
standardOrdinarySiteDeviceDriver.setHasGoods(hasGoods); |
|
|
|
|
|
standardOrdinarySiteDeviceDriver.setNext_code(next_code); |
|
|
device.setMaterial_type(material_type); |
|
|
device.setMaterial_type(material_type); |
|
|
device.setQuantity(quantity); |
|
|
device.setQuantity(quantity); |
|
|
device.setRemark(remark); |
|
|
device.setRemark(remark); |
|
|
device.setHas_goods(hasGoods); |
|
|
device.setHas_goods(hasGoods); |
|
|
|
|
|
device.setNext_code(next_code); |
|
|
} |
|
|
} |
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|
@ -1267,10 +1276,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
standardInspectSiteDeviceDriver.setMaterial(material_type); |
|
|
standardInspectSiteDeviceDriver.setMaterial(material_type); |
|
|
standardInspectSiteDeviceDriver.setRemark(remark); |
|
|
standardInspectSiteDeviceDriver.setRemark(remark); |
|
|
standardInspectSiteDeviceDriver.setHasGoods(hasGoods); |
|
|
standardInspectSiteDeviceDriver.setHasGoods(hasGoods); |
|
|
|
|
|
standardInspectSiteDeviceDriver.setNext_code(next_code); |
|
|
device.setMaterial_type(material_type); |
|
|
device.setMaterial_type(material_type); |
|
|
device.setQuantity(quantity); |
|
|
device.setQuantity(quantity); |
|
|
device.setRemark(remark); |
|
|
device.setRemark(remark); |
|
|
device.setHas_goods(hasGoods); |
|
|
device.setHas_goods(hasGoods); |
|
|
|
|
|
device.setNext_code(next_code); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -1501,6 +1512,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
standardOrdinarySiteDeviceDriver.setMaterial(""); |
|
|
standardOrdinarySiteDeviceDriver.setMaterial(""); |
|
|
standardOrdinarySiteDeviceDriver.setQty(""); |
|
|
standardOrdinarySiteDeviceDriver.setQty(""); |
|
|
standardOrdinarySiteDeviceDriver.setRemark(""); |
|
|
standardOrdinarySiteDeviceDriver.setRemark(""); |
|
|
|
|
|
standardOrdinarySiteDeviceDriver.setNext_code(""); |
|
|
JSONObject jsonjo = new JSONObject(); |
|
|
JSONObject jsonjo = new JSONObject(); |
|
|
jsonjo.put("device_code", device_code); |
|
|
jsonjo.put("device_code", device_code); |
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
|
jsonjo.put("hasGoodStatus", "0"); |
|
@ -1511,6 +1523,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
standardInspectSiteDeviceDriver.setMaterial(""); |
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
standardInspectSiteDeviceDriver.setQty(""); |
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
standardInspectSiteDeviceDriver.setRemark(""); |
|
|
|
|
|
standardInspectSiteDeviceDriver.setNext_code(""); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -2043,4 +2056,18 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<String> selectEndPoint(String start_code) { |
|
|
|
|
|
if(StrUtil.isEmpty(start_code)){ |
|
|
|
|
|
throw new RuntimeException("起点设备为空"); |
|
|
|
|
|
} |
|
|
|
|
|
List<RouteLineDto> normal = routeLineService.getShortPathLinesByCode(start_code, "normal"); |
|
|
|
|
|
List<String> list = new ArrayList<>(); |
|
|
|
|
|
for (RouteLineDto routeLineDto : normal) { |
|
|
|
|
|
list.add(routeLineDto.getNext_device_code()); |
|
|
|
|
|
} |
|
|
|
|
|
return list; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|