修改
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.sch.manage;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -13,19 +14,36 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoQueryDeviceStatus{
|
||||
public class AutoQueryDeviceStatus {
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
public void run() {
|
||||
//通过ACS接口获取温度
|
||||
JSONArray device_rows = WQL.getWO("PDA_02").addParam("flag","15").process().getResultJSONArray(0);
|
||||
JSONArray device_rows = WQL.getWO("PDA_02").addParam("flag", "15").process().getResultJSONArray(0);
|
||||
JSONObject jo = wmsToAcsService.getPointStatus(device_rows);
|
||||
WQLObject ivtTab=WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
JSONArray de_rows = jo.getJSONArray("data");
|
||||
for (int i = 0; i < de_rows.size(); i++) {
|
||||
JSONObject row = de_rows.getJSONObject(i);
|
||||
String device_code = row.getString("device_code");
|
||||
JSONObject point_jo = ivtTab.query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
point_jo.put("temperature",row.getString("temperature"));
|
||||
JSONObject point_jo = ivtTab.query("point_code = '" + device_code + "'").uniqueResult(0);
|
||||
point_jo.put("temperature", row.getString("temperature"));
|
||||
//获取倒计时,分,秒
|
||||
String countdown_house = row.getString("countdown_house");
|
||||
String countdown_min = row.getString("countdown_min");
|
||||
String countdown_sec = row.getString("countdown_sec");
|
||||
|
||||
if (StrUtil.isEmpty(countdown_house)) {
|
||||
countdown_house = "0";
|
||||
}
|
||||
if (StrUtil.isEmpty(countdown_min)) {
|
||||
countdown_min = "0";
|
||||
}
|
||||
if (StrUtil.isEmpty(countdown_sec)) {
|
||||
countdown_sec = "0";
|
||||
}
|
||||
String last_time = countdown_house + "小时" + countdown_min + "分钟";
|
||||
point_jo.put("last_time", last_time);
|
||||
ivtTab.update(point_jo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user