修复后台设备检索
This commit is contained in:
parent
d42701c6ed
commit
c8ee79c321
|
|
@ -1005,6 +1005,7 @@ public class BigScreenController {
|
|||
List<CommonDataTrans> tpList = new ArrayList<>();
|
||||
List<CommonDataTrans> tnList = new ArrayList<>();
|
||||
List<CommonDataTrans> noList = new ArrayList<>();
|
||||
List<CommonDataTrans> codList = new ArrayList<>();
|
||||
|
||||
CommonDataTrans tpent = new CommonDataTrans();
|
||||
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
||||
|
|
@ -1022,24 +1023,35 @@ public class BigScreenController {
|
|||
tnent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||
tnent.setSurvItem(PollutionEnum.dataWaterTn.getCode());
|
||||
|
||||
CommonDataTrans noent = new CommonDataTrans();
|
||||
noent.setName(PollutionEnum.dataWaterNo.getDescription());
|
||||
noent.setUnit(PollutionEnum.dataWaterNo.getUnit());
|
||||
noent.setColor(PollutionEnum.dataWaterNo.getColor());
|
||||
noent.setStationName(survStationInfo.getStationName());
|
||||
noent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||
noent.setSurvItem(PollutionEnum.dataWaterNo.getCode());
|
||||
// CommonDataTrans noent = new CommonDataTrans();
|
||||
// noent.setName(PollutionEnum.dataWaterNo.getDescription());
|
||||
// noent.setUnit(PollutionEnum.dataWaterNo.getUnit());
|
||||
// noent.setColor(PollutionEnum.dataWaterNo.getColor());
|
||||
// noent.setStationName(survStationInfo.getStationName());
|
||||
// noent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||
// noent.setSurvItem(PollutionEnum.dataWaterNo.getCode());
|
||||
|
||||
CommonDataTrans codent = new CommonDataTrans();
|
||||
codent.setName(PollutionEnum.dataWaterCod.getDescription());
|
||||
codent.setUnit(PollutionEnum.dataWaterCod.getUnit());
|
||||
codent.setColor(PollutionEnum.dataWaterCod.getColor());
|
||||
codent.setStationName(survStationInfo.getStationName());
|
||||
codent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||
codent.setSurvItem(PollutionEnum.dataWaterCod.getCode());
|
||||
|
||||
tpent.setValue(transdataOrientwaterVo.getDataWaterTp());
|
||||
tnent.setValue(transdataOrientwaterVo.getDataWaterTn());
|
||||
noent.setValue(transdataOrientwaterVo.getDataWaterNo());
|
||||
// noent.setValue(transdataOrientwaterVo.getDataWaterNo());
|
||||
codent.setValue(transdataOrientwaterVo.getDataWaterCod());
|
||||
tpList.add(tpent);
|
||||
tnList.add(tnent);
|
||||
noList.add(noent);
|
||||
// noList.add(noent);
|
||||
codList.add(codent);
|
||||
List<CommonDataTrans> listFinal = new ArrayList<>();
|
||||
listFinal.addAll(tnList);
|
||||
listFinal.addAll(tpList);
|
||||
listFinal.addAll(noList);
|
||||
// listFinal.addAll(noList);
|
||||
listFinal.addAll(codList);
|
||||
|
||||
returnArrs = JSONArray.parseArray(JSONObject.toJSONString(listFinal));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1312,8 +1312,8 @@ public class IotCommonServiceImpl {
|
|||
}
|
||||
maps.put(ScreenIndexSummaryEnum.TNSummry.getDesc(),avgTN);
|
||||
maps.put(ScreenIndexSummaryEnum.TPSummry.getDesc(),avgTP);
|
||||
maps.put(ScreenIndexSummaryEnum.NOSummry.getDesc(),avgNO);
|
||||
// maps.put(ScreenIndexSummaryEnum.CODSummry.getDesc(),avgCOD);
|
||||
// maps.put(ScreenIndexSummaryEnum.NOSummry.getDesc(),avgNO);
|
||||
maps.put(ScreenIndexSummaryEnum.CODSummry.getDesc(),avgCOD);
|
||||
// maps.put(ScreenIndexSummaryEnum.NHSummry.getDesc(),avgNH);
|
||||
|
||||
screenIndexSummaryDetailVo.setDatas(maps);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.jeecg.common.constant.enums;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public enum PollutionEnum {
|
||||
|
|
@ -150,8 +152,13 @@ public enum PollutionEnum {
|
|||
*/
|
||||
private String iconName;
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
private static int colorIndex = 0;
|
||||
private static final Map<PollutionEnum, Integer> ORDINAL_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
ORDINAL_MAP.put(values()[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
private static class PaletteData {
|
||||
static final String[] COLORS = {
|
||||
|
|
@ -177,6 +184,8 @@ public enum PollutionEnum {
|
|||
"#90A4AE", "#7986CB", "#4DB6AC", "#DCE775", "#FFD54F",
|
||||
"#FFB74D", "#E57373", "#BA68C8", "#64B5F6", "#81C784"
|
||||
};
|
||||
int index = 0;
|
||||
|
||||
}
|
||||
|
||||
PollutionEnum(String code, String description, String unit, String icon, String type, String color, String mobileIcon, String bsIcon, String iconName) {
|
||||
|
|
@ -187,7 +196,7 @@ public enum PollutionEnum {
|
|||
this.unit = unit;
|
||||
this.icon = icon;
|
||||
this.type = type;
|
||||
this.color = palette[randomIndex];
|
||||
this.color = color;
|
||||
this.mobileIcon = mobileIcon;
|
||||
this.bsIcon = bsIcon;
|
||||
this.iconName = iconName;
|
||||
|
|
@ -268,9 +277,11 @@ public enum PollutionEnum {
|
|||
public static PollutionEnum catchMessage(String msg) {
|
||||
|
||||
PollutionEnum result = null;
|
||||
|
||||
String[] palette = PaletteData.COLORS;
|
||||
for (PollutionEnum s : values()) {
|
||||
if (s.description.equals(msg)) {
|
||||
int arrs = ORDINAL_MAP.get(s);
|
||||
s.color = palette[arrs];
|
||||
result = s;
|
||||
break;
|
||||
}
|
||||
|
|
@ -286,9 +297,11 @@ public enum PollutionEnum {
|
|||
public static PollutionEnum catchPollution(String survItem) {
|
||||
|
||||
PollutionEnum result = null;
|
||||
|
||||
String[] palette = PaletteData.COLORS;
|
||||
for (PollutionEnum s : values()) {
|
||||
if (s.code.equals(survItem)) {
|
||||
int arrs = ORDINAL_MAP.get(s);
|
||||
s.color = palette[arrs];
|
||||
result = s;
|
||||
break;
|
||||
}
|
||||
|
|
@ -301,13 +314,15 @@ public enum PollutionEnum {
|
|||
}
|
||||
|
||||
public JSONObject getJsonStr() {
|
||||
int arrs = ORDINAL_MAP.get(this);
|
||||
String[] palette = PaletteData.COLORS;
|
||||
JSONObject job = new JSONObject();
|
||||
job.put("code", this.code);
|
||||
job.put("description", this.description);
|
||||
job.put("unit", this.unit);
|
||||
job.put("type", this.type);
|
||||
job.put("icon", this.icon);
|
||||
job.put("color", this.color);
|
||||
job.put("color", palette[arrs]);
|
||||
job.put("mobileIcon", this.mobileIcon);
|
||||
job.put("bsIcon", this.bsIcon);
|
||||
job.put("iconName", this.iconName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue