Commit 92da1a2c LN

单盘入库和设备管理界面增加状态显示。

1 个父辈 9215fe6d
......@@ -25,6 +25,14 @@ public class ShelfPosInfo implements Serializable ,Comparable<ShelfPosInfo> {
@ApiModelProperty("指定库位空库位数")
private int posEmptySlots;
@ApiModelProperty("单台BOX状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试中,6入库执行中,7入仓位完成,8入库失败, 9出库执行中,10出仓位完成,11出库失败")
private int status=0;
@ApiModelProperty("是否在线")
private boolean onLine=false;
@ApiModelProperty("客户端IP")
private String clientIp;
@Override
public int compareTo(ShelfPosInfo o) {
if (this.getPosEmptySlots() != o.getPosEmptySlots()) {
......
......@@ -9,6 +9,8 @@ import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache;
......@@ -19,6 +21,7 @@ import com.neotel.smfcore.core.storage.bean.UsageItem;
import com.neotel.smfcore.core.storage.service.manager.IStorageManager;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.core.system.websocket.MsgType;
import com.neotel.smfcore.core.system.websocket.SocketMsg;
......@@ -91,7 +94,7 @@ public class SingleInController {
}
for (String groupid : mygroups) {
List<BoxStatusDto> boxStatusDtos = new ArrayList<>();
List<String> cidList =dataCache. getCidsByGroupId(groupid, false);
List<String> cidList = dataCache.getCidsByGroupId(groupid, false);
for (String cid :
cidList) {
Storage storage = dataCache.getStorage(cid);
......@@ -120,6 +123,19 @@ public class SingleInController {
shelfPosInfo.setPosTotalSlots(posTotalCount);
shelfPosInfo.setPosEmptySlots(emptyCount);
shelfPosInfo.setOnLine(false);
shelfPosInfo.setStatus(0);
StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean != null && (!bean.timeOut())) {
shelfPosInfo.setOnLine(true);
for (BoxStatusBean boxStatus : bean.getBoxStatus().values()) {
shelfPosInfo.setStatus(bean.getStatus());
shelfPosInfo.setClientIp(bean.getClientIp());
break;
}
}
if (emptyCount > 0) {
shelfPosInfos.add(shelfPosInfo);
}
......
......@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.PointUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.enums.DeviceType;
......@@ -90,29 +91,20 @@ public class StorageController {
PageData<Storage> pages=storageManager.findByPage(query,pageable);
List<StorageDto> StorageDtos=storageMapper.toDto(pages.getContent());
StorageDtos=updateDtos(StorageDtos);
// for (int i=0;i<StorageDtos.size();i++) {
// String groupId = "";
// if (StorageDtos.get(i).getGroupId() != null && (!StorageDtos.get(i).getGroupId().isEmpty())) {
// groupId = StorageDtos.get(i).getGroupId();
// }
// Group group = groupManager.get(groupId);
// if (group != null) {
// StorageDtos.get(i).setGroupName(group.getGroupName());
// } else {
// //此料仓未分组
// StorageDtos.get(i).setGroupName("");
// if (!StorageDtos.get(i).getGroupId().equals("")) {
// storageManager.updateStorageGroup(StorageDtos.get(i).getId(), "");
// log.info("料仓[" + StorageDtos.get(i).getId() + "][" + StorageDtos.get(i).getName() + "]的组不存在,修改组为空");
// }
//
// }
// //获取设备状态,设置状态和当前任务信息
// StatusBean bean = DevicesStatusUtil.getStatusBean(StorageDtos.get(i).getCid());
// if (bean != null && bean.getBoxStatus() != null) {
// StorageDtos.get(i).setClientIp(bean.getClientIp());
// }
// }
for (int i=0;i<StorageDtos.size();i++) {
StorageDtos.get(i).setOnLine(false);
StorageDtos.get(i).setStatus(0);
StatusBean bean = DevicesStatusUtil.getStatusBean(StorageDtos.get(i).getCid());
if (bean != null && (!bean.timeOut())) {
StorageDtos.get(i).setOnLine(true);
for (BoxStatusBean boxStatus : bean.getBoxStatus().values()) {
StorageDtos.get(i).setStatus(bean.getStatus());
StorageDtos.get(i).setClientIp(bean.getClientIp());
break;
}
}
}
return new PageData(StorageDtos,pages.getTotalElements());
}
......
......@@ -68,4 +68,10 @@ public class StorageDto implements Serializable {
@ApiModelProperty("是否可以合并库位")
private boolean mergePos=false;
@ApiModelProperty("单台BOX状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试中,6入库执行中,7入仓位完成,8入库失败, 9出库执行中,10出仓位完成,11出库失败")
private int status=0;
@ApiModelProperty("是否在线")
private boolean onLine=false;
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!