|
|
@ -205,33 +205,25 @@ public class CockpitServiceImpl implements CockpitService{ |
|
|
|
public List<DeviceInfoDto> deviceMonitor() { |
|
|
|
List<DeviceInfoDto> res; |
|
|
|
ConcurrentHashMap<String,List<DeviceInfoDto>> map = new ConcurrentHashMap<>(); |
|
|
|
JSONArray result = WQL.getWO("COCKPIT_DEVICE").addParam("flag", "3").process().getResultJSONArray(0); |
|
|
|
if(ObjectUtil.isNotEmpty(result)) { |
|
|
|
JSONArray result = WQL.getWO("COCKPIT_DEVICE") |
|
|
|
.addParam("flag", "3") |
|
|
|
.process() |
|
|
|
.getResultJSONArray(0); |
|
|
|
// JSONObject devicesStatus = PointUpdateUtil.getDevicesStatus(result);
|
|
|
|
// if (ObjectUtil.isEmpty(devicesStatus)) {
|
|
|
|
// return null;
|
|
|
|
// }
|
|
|
|
// JSONArray data = ObjectUtil.isNotEmpty(
|
|
|
|
// devicesStatus.getJSONArray("data"))?devicesStatus.getJSONArray("data"):null;
|
|
|
|
// if (ObjectUtil.isEmpty(data)) {
|
|
|
|
// return null;
|
|
|
|
// }
|
|
|
|
if(ObjectUtil.isNotEmpty(result)) { //todo: result -> data
|
|
|
|
res = result.toJavaList(DeviceInfoDto.class); |
|
|
|
res.forEach(d -> { |
|
|
|
if (ObjectUtil.isNotEmpty(d.getRealproducestart_date())) { |
|
|
|
// 如果时间存在
|
|
|
|
LocalDateTime dateTime = LocalDateTimeUtil.parse(d.getRealproducestart_date().replace(" ", "T")); |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
Duration duration = Duration.between(dateTime, now); |
|
|
|
d.setWork_time(duration.toHours() + ""); |
|
|
|
} |
|
|
|
// 设置设备状态
|
|
|
|
// d.setDevice_status(PointUpdateUtil.getDeviceStatus(d.getDevice_code()));
|
|
|
|
DeviceEnum deviceEnum = DeviceEnum.get(d.getDevice_model(), d.getDevice_code()); |
|
|
|
// 添加图片名字
|
|
|
|
d.setDevice_url(deviceEnum.getPictureName()); |
|
|
|
// todo: 区分窑与其他设备
|
|
|
|
if (d.getDevice_model().equals(DeviceEnum.YAO.getModel())) { |
|
|
|
// acs上报
|
|
|
|
d.setVehicle_qty(15); |
|
|
|
d.setVehicle_max_qty(42); // 最大值 已确认
|
|
|
|
} |
|
|
|
// todo: RGV
|
|
|
|
if (d.getDevice_model().equals(DeviceEnum.RGV.getModel())) { |
|
|
|
d.setDevice_status_name("空位无车,满位有车"); |
|
|
|
} |
|
|
|
// todo: 包装机、碟盘机
|
|
|
|
}); |
|
|
|
return res; |
|
|
|
} |
|
|
|