rev:优化烘箱温度查询定时方法

This commit is contained in:
2023-07-03 13:59:20 +08:00
parent f16930b8d6
commit 4a0fae0317
3 changed files with 9 additions and 7 deletions

View File

@@ -12,6 +12,8 @@ import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.sch.tasks.URLEnum;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Slf4j
@Component
@RequiredArgsConstructor
@@ -33,8 +35,8 @@ public class AutoQueryDeviceStatus {
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"));
HashMap<String,String> map = new HashMap<>();
map.put("temperature", row.getString("temperature"));
//获取倒计时,分,秒
String countdown_house = row.getString("countdown_house");
String countdown_min = row.getString("countdown_min");
@@ -50,8 +52,8 @@ public class AutoQueryDeviceStatus {
countdown_sec = "0";
}
String last_time = countdown_house + "小时" + countdown_min + "分钟";
point_jo.put("last_time", last_time);
ivtTab.update(point_jo);
map.put("last_time", last_time);
ivtTab.update(map,"point_code = '"+device_code+"'");
}
} catch (Exception e) {
log.info(e.getMessage());

View File

@@ -188,7 +188,7 @@ public class InHotTask extends AbstractAcsTask {
log.info("入烘箱wql执行update语句");
hotIvtTab.update(jsonHotIvt);
JSONObject update_ivt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code3") + "'").uniqueResult(0);
JSONObject update_ivt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
log.info("更新完后烘箱库存为:-----------------" + update_ivt.toString());
log.info("入烘箱mybatis执行update语句");

View File

@@ -19,9 +19,9 @@ public enum URLEnum {
ACS_URL_A4("A4", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_A4").getValue()),
ACS_URL_LK("LK", () -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_LK").getValue());
private String product_area;
private final String product_area;
private Supplier<String> acs_url;
private final Supplier<String> acs_url;
public static String find(String product_area) {
for (URLEnum value : URLEnum.values()) {