fix: 大屏分拣拆码垛位

This commit is contained in:
2023-07-02 17:32:45 +08:00
parent ae497594fc
commit 50922a29bf

View File

@@ -211,12 +211,12 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) {
JSONObject jsonObject = data.getJSONObject(i);
if (jsonObject.getInteger("move") == 1
if (jsonObject.getInteger("move") != 0
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
&& jsonObject.getInteger("encoder_qty") > 0) {
// 绿色
jsonObject.put("color_status", ColorEnum.GREEN.getIndex());
} else if (jsonObject.getInteger("move") == 1
} else if (jsonObject.getInteger("move") != 0
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
&& jsonObject.getInteger("encoder_qty") == 0) {
// 黄色
@@ -349,12 +349,12 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) {
JSONObject jsonObject = data.getJSONObject(i);
if (jsonObject.getInteger("move") == 1
if (jsonObject.getInteger("move") != 0
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
&& jsonObject.getInteger("encoder_qty") > 0) {
// 绿色
jsonObject.put("color_status", ColorEnum.GREEN.getIndex());
} else if (jsonObject.getInteger("move") == 1
} else if (jsonObject.getInteger("move") != 0
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
&& jsonObject.getInteger("encoder_qty") == 0) {
// 黄色