|
@ -2,6 +2,7 @@ package org.nl.wms.cockpit.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
|
import com.alibaba.fastjson.JSONException; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
@ -38,6 +39,7 @@ import java.util.concurrent.ThreadPoolExecutor; |
|
|
public class BigScreenServiceImpl implements BigScreenService { |
|
|
public class BigScreenServiceImpl implements BigScreenService { |
|
|
|
|
|
|
|
|
private final WmsToAcsService wmsToAcsService; |
|
|
private final WmsToAcsService wmsToAcsService; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 車间情况大屏信息 |
|
|
* 車间情况大屏信息 |
|
|
* |
|
|
* |
|
@ -385,7 +387,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; |
|
|
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; |
|
|
for (int i = 0; i < data.size(); i++) { |
|
|
for (int i = 0; i < data.size(); i++) { |
|
|
JSONObject object = data.getJSONObject(i); |
|
|
JSONObject object = data.getJSONObject(i); |
|
|
object.put("color_status", ColorEnum.getColorEnumByIndex(object.getInteger("status"))); |
|
|
object.put("color_status", object.getInteger("status")); |
|
|
} |
|
|
} |
|
|
return data; |
|
|
return data; |
|
|
}, pool); |
|
|
}, pool); |
|
@ -1313,6 +1315,18 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
JSONArray res = new JSONArray(); |
|
|
JSONArray res = new JSONArray(); |
|
|
JSONObject jsonObject = wmsToAcsService.queryBzx(); |
|
|
JSONObject jsonObject = wmsToAcsService.queryBzx(); |
|
|
res = jsonObject.getJSONArray("data"); |
|
|
res = jsonObject.getJSONArray("data"); |
|
|
|
|
|
res.sort((o1, o2) -> { |
|
|
|
|
|
try { |
|
|
|
|
|
JSONObject obj1 = (JSONObject) o1; |
|
|
|
|
|
JSONObject obj2 = (JSONObject) o2; |
|
|
|
|
|
String deviceCode1 = obj1.getString("device_code"); |
|
|
|
|
|
String deviceCode2 = obj2.getString("device_code"); |
|
|
|
|
|
return deviceCode1.compareTo(deviceCode2); |
|
|
|
|
|
} catch (JSONException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
return 0; |
|
|
|
|
|
}); |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
JSONObject BZX = res.getJSONObject(i); |
|
|
JSONObject BZX = res.getJSONObject(i); |
|
|
int vehicleType = BZX.getInteger("vehicle_type") + 2; |
|
|
int vehicleType = BZX.getInteger("vehicle_type") + 2; |
|
@ -1323,7 +1337,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail"); |
|
|
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail"); |
|
|
JSONObject object = vdTab.query("vehicle_type = '" + vehicleType + "'" + |
|
|
JSONObject object = vdTab.query("vehicle_type = '" + vehicleType + "'" + |
|
|
" AND vehicle_code = '" + vehicleCode + "'").uniqueResult(0); |
|
|
" AND vehicle_code = '" + vehicleCode + "'").uniqueResult(0); |
|
|
BZX.put("qty", object.getString("qty")); |
|
|
BZX.put("qty", ObjectUtil.isNotEmpty(object) ? object.getString("qty") : ""); |
|
|
} |
|
|
} |
|
|
return res; |
|
|
return res; |
|
|
}, pool); |
|
|
}, pool); |
|
|