This commit is contained in:
loujf
2022-08-17 16:57:38 +08:00
parent a3626ea095
commit a02a2279f0
4 changed files with 41 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
@@ -38,7 +39,7 @@ import java.util.Date;
@Slf4j
@Data
@RequiredArgsConstructor
public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
@Autowired
RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl");
@Autowired
@@ -385,5 +386,36 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
}
}
@Override
public JSONObject getDeviceStatusName() {
String move = "";
JSONObject jo = new JSONObject();
if (this.getHasGoods() == 0) {
move = "无货";
} else if (this.getHasGoods() == 1) {
move = "有货";
} else if (this.getHasGoods() == 2) {
move = "有托盘有货";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("move", move);
jo.put("container", this.getContainer());
jo.put("hasGoods", this.getHasGoods());
jo.put("isOnline", true);
//点击弹出
jo.put("is_click", true);
jo.put("device_type", device.getDevice_type());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
jo.put("material", this.getMaterial());
jo.put("batch", this.getBatch());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -44,6 +44,7 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService
}
obj.put("data", json);
obj.put("device_name",json.get("device_name"));
obj.put("device_code", js.get("device_code"));
obj.put("id", js.getString("id")); // 设备不存在就只保留id方便前端查看
arr.add(obj);