Commit 79c06d27 LN

duo有异常任务时显示感叹号

1 个父辈 893c7b27
......@@ -59,6 +59,8 @@ public class ElecKanbanBoxStatusDto {
private List<DataLog> taskList = new ArrayList<>();
@ApiModelProperty("异常任务数,>0表示有异常")
private int abnormalTasks=0;
@ApiModelProperty("消息")
public String msg="";
......
......@@ -116,7 +116,11 @@ public class SmdBoxController {
} else {
dto.setType(1);
}
int usage = (storage.getTotalSlots() - storage.getEmptySlots()) * 100 / storage.getTotalSlots();
int usage=0;
if(storage.getTotalSlots()>0){
usage = (storage.getTotalSlots() - storage.getEmptySlots()) * 100 / storage.getTotalSlots();
}
dto.setUsage(usage);
int inCount = getTodayInOutCount(storage.getId(), inOutDataList, true);
......@@ -126,12 +130,21 @@ public class SmdBoxController {
dto.setName(storage.getName());
dto.setId(storage.getId());
dto.setCid(storage.getCid());
int abnormalTasks=0;
Collection<DataLog> queueTasks = taskService.getQueueTasks(theCid);
if (queueTasks != null){
for (DataLog log :
queueTasks) {
if(log.isAbnormal()){
abnormalTasks+=1;
}
}
dto.setTaskList((List<DataLog>) queueTasks);
} else {
dto.setTaskList(new ArrayList<>());
}
dto.setAbnormalTasks(abnormalTasks);
dto.setMinHumidity(msdSettiings.getMinHumidity());
dto.setMaxHumidity(msdSettiings.getMaxHumidity());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!