增加颜色
This commit is contained in:
parent
e34380ce18
commit
96bfd3e3c3
|
|
@ -9,8 +9,10 @@ import org.jeecg.common.constant.IotConstants;
|
|||
import org.jeecg.common.constant.PollutionConstants;
|
||||
import org.jeecg.common.constant.enums.PollutionEnum;
|
||||
import org.jeecg.common.entity.ScEquZhibiao;
|
||||
import org.jeecg.common.entity.SurvConfig;
|
||||
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||
import org.jeecg.common.entity.SurvStationInfo;
|
||||
import org.jeecg.common.util.DateUtilTools;
|
||||
import org.jeecg.common.util.EntityFieldUtil;
|
||||
import org.jeecg.common.vo.*;
|
||||
import org.jeecg.common.vo.statistic.DTOIotSummray;
|
||||
|
|
@ -49,6 +51,10 @@ public class IotCommonP3ServiceImpl {
|
|||
@Autowired
|
||||
@Lazy
|
||||
private IScEquZhibiaoService zhibiaoService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private SurvConfigServiceImpl survConfigService;
|
||||
|
||||
|
||||
/**
|
||||
* 物联网设备统计
|
||||
|
|
@ -276,8 +282,33 @@ public class IotCommonP3ServiceImpl {
|
|||
|
||||
|
||||
public List<CommonDataTrans> constructOrient(SurvTransdataOrientwaterVo transdataOrientwaterVo, SurvStationInfo survStationInfo,SurvDeviceDeploy deploy){
|
||||
if (transdataOrientwaterVo == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<CommonDataTrans> listFinal = new ArrayList<>();
|
||||
if (transdataOrientwaterVo != null) {
|
||||
String timeGap = DateUtilTools.calTimeGap(transdataOrientwaterVo.getDataDateTime(), LocalDateTime.now());
|
||||
SurvConfig fSurvConfig = survConfigService.getOneByTypeWithTenant(null, IotConstants.surv_itemname);
|
||||
cn.hutool.json.JSONObject configs = null;
|
||||
if (fSurvConfig != null) {
|
||||
configs = fSurvConfig.getConfigJson();
|
||||
}
|
||||
cn.hutool.json.JSONObject desConfig = null;
|
||||
cn.hutool.json.JSONObject iconConfig = null;
|
||||
String bsIconPath = "";
|
||||
String bsIconPath2 = "";
|
||||
String h5IconPath = "";
|
||||
String appIconPath = "";
|
||||
String midIconPath = "";
|
||||
if (configs != null) {
|
||||
desConfig = configs.getJSONObject("des");
|
||||
iconConfig = configs.getJSONObject("icons");
|
||||
bsIconPath = configs.getStr("bsIconPath");
|
||||
bsIconPath2 = configs.getStr("bsIconPath2");
|
||||
h5IconPath = configs.getStr("h5IconPath");
|
||||
appIconPath = configs.getStr("appIconPath");
|
||||
midIconPath = configs.getStr("midIconPath");
|
||||
}
|
||||
|
||||
if(survStationInfo!=null) {
|
||||
transdataOrientwaterVo.setStationName(survStationInfo.getStationName());
|
||||
}
|
||||
|
|
@ -290,9 +321,40 @@ public class IotCommonP3ServiceImpl {
|
|||
PollutionEnum pollutionEnum = PollutionEnum.catchPollution(zhibiao.getEntityField());
|
||||
|
||||
CommonDataTrans tempEnt = new CommonDataTrans();
|
||||
tempEnt.setName(pollutionEnum.getDescription());
|
||||
|
||||
String iconFinalName = pollutionEnum.getIconName();
|
||||
String itemFinalName = pollutionEnum.getDescription();
|
||||
String bsIcon = pollutionEnum.getBsIcon();
|
||||
if (configs != null) {
|
||||
String itemName = desConfig != null ? desConfig.getStr(pollutionEnum.getCode()) : "";
|
||||
String iconName = iconConfig != null ? iconConfig.getStr(pollutionEnum.getCode()) : "";
|
||||
if (StringUtils.isNotBlank(itemName)) {
|
||||
itemFinalName = itemName;
|
||||
}
|
||||
if (StringUtils.isNotBlank(iconName)) {
|
||||
iconFinalName = iconName;
|
||||
}
|
||||
if (StringUtils.isNotBlank(bsIconPath)) {
|
||||
bsIcon = bsIconPath + iconFinalName;
|
||||
}
|
||||
tempEnt.setBsIconPath(bsIconPath);
|
||||
tempEnt.setBsIconPath2(bsIconPath2);
|
||||
tempEnt.setH5IconPath(h5IconPath);
|
||||
tempEnt.setAppIconPath(appIconPath);
|
||||
tempEnt.setMidIconPath(midIconPath);
|
||||
}
|
||||
|
||||
tempEnt.setUnit(pollutionEnum.getUnit());
|
||||
tempEnt.setName(itemFinalName);
|
||||
tempEnt.setColor(pollutionEnum.getColor());
|
||||
tempEnt.setIcon(pollutionEnum.getIcon());
|
||||
tempEnt.setMobileIcon(pollutionEnum.getMobileIcon());
|
||||
tempEnt.setBsIcon(bsIcon);
|
||||
tempEnt.setSurvItem(pollutionEnum.getCode());
|
||||
tempEnt.setLastUpdate(timeGap);
|
||||
tempEnt.setIconName(iconFinalName);
|
||||
tempEnt.setSurvType(IotConstants.ORIENT_DATA);
|
||||
|
||||
tempEnt.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||
if(survStationInfo!=null) {
|
||||
tempEnt.setStationName(survStationInfo.getStationName());
|
||||
|
|
@ -307,7 +369,7 @@ public class IotCommonP3ServiceImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return listFinal;
|
||||
}
|
||||
|
||||
|
|
@ -400,8 +462,34 @@ public class IotCommonP3ServiceImpl {
|
|||
|
||||
|
||||
public List<CommonDataTrans> constructLive(SurvTransdataLivestockwaterVo transdataLivestockwaterVo, SurvStationInfo survStationInfo, SurvDeviceDeploy deploy) {
|
||||
if (transdataLivestockwaterVo == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<CommonDataTrans> listFinal = new ArrayList<>();
|
||||
if (transdataLivestockwaterVo != null) {
|
||||
String timeGap = DateUtilTools.calTimeGap(transdataLivestockwaterVo.getDataDateTime(), LocalDateTime.now());
|
||||
SurvConfig fSurvConfig = survConfigService.getOneByTypeWithTenant(null, IotConstants.surv_itemname);
|
||||
cn.hutool.json.JSONObject configs = null;
|
||||
if (fSurvConfig != null) {
|
||||
configs = fSurvConfig.getConfigJson();
|
||||
}
|
||||
cn.hutool.json.JSONObject desConfig = null;
|
||||
cn.hutool.json.JSONObject iconConfig = null;
|
||||
String bsIconPath = "";
|
||||
String bsIconPath2 = "";
|
||||
String h5IconPath = "";
|
||||
String appIconPath = "";
|
||||
String midIconPath = "";
|
||||
if (configs != null) {
|
||||
desConfig = configs.getJSONObject("des");
|
||||
iconConfig = configs.getJSONObject("icons");
|
||||
bsIconPath = configs.getStr("bsIconPath");
|
||||
bsIconPath2 = configs.getStr("bsIconPath2");
|
||||
h5IconPath = configs.getStr("h5IconPath");
|
||||
appIconPath = configs.getStr("appIconPath");
|
||||
midIconPath = configs.getStr("midIconPath");
|
||||
}
|
||||
|
||||
|
||||
if(survStationInfo!=null) {
|
||||
transdataLivestockwaterVo.setStationName(survStationInfo.getStationName());
|
||||
}
|
||||
|
|
@ -414,15 +502,46 @@ public class IotCommonP3ServiceImpl {
|
|||
PollutionEnum pollutionEnum = PollutionEnum.catchPollution(zhibiao.getEntityField());
|
||||
|
||||
CommonDataTrans tempEnt = new CommonDataTrans();
|
||||
tempEnt.setName(pollutionEnum.getDescription());
|
||||
|
||||
String iconFinalName = pollutionEnum.getIconName();
|
||||
String itemFinalName = pollutionEnum.getDescription();
|
||||
String bsIcon = pollutionEnum.getBsIcon();
|
||||
if (configs != null) {
|
||||
String itemName = desConfig != null ? desConfig.getStr(pollutionEnum.getCode()) : "";
|
||||
String iconName = iconConfig != null ? iconConfig.getStr(pollutionEnum.getCode()) : "";
|
||||
if (StringUtils.isNotBlank(itemName)) {
|
||||
itemFinalName = itemName;
|
||||
}
|
||||
if (StringUtils.isNotBlank(iconName)) {
|
||||
iconFinalName = iconName;
|
||||
}
|
||||
if (StringUtils.isNotBlank(bsIconPath)) {
|
||||
bsIcon = bsIconPath + iconFinalName;
|
||||
}
|
||||
tempEnt.setBsIconPath(bsIconPath);
|
||||
tempEnt.setBsIconPath2(bsIconPath2);
|
||||
tempEnt.setH5IconPath(h5IconPath);
|
||||
tempEnt.setAppIconPath(appIconPath);
|
||||
tempEnt.setMidIconPath(midIconPath);
|
||||
}
|
||||
|
||||
tempEnt.setUnit(pollutionEnum.getUnit());
|
||||
tempEnt.setName(itemFinalName);
|
||||
tempEnt.setColor(pollutionEnum.getColor());
|
||||
tempEnt.setIcon(pollutionEnum.getIcon());
|
||||
tempEnt.setMobileIcon(pollutionEnum.getMobileIcon());
|
||||
tempEnt.setBsIcon(bsIcon);
|
||||
tempEnt.setSurvItem(pollutionEnum.getCode());
|
||||
tempEnt.setLastUpdate(timeGap);
|
||||
tempEnt.setIconName(iconFinalName);
|
||||
tempEnt.setSurvType(IotConstants.LIVE_DATA);
|
||||
|
||||
tempEnt.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||
if(survStationInfo!=null) {
|
||||
tempEnt.setStationName(survStationInfo.getStationName());
|
||||
tempEnt.setStationType(survStationInfo.getStationType());
|
||||
tempEnt.setStationCode(survStationInfo.getStationCode());
|
||||
}
|
||||
tempEnt.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||
tempEnt.setSurvItem(pollutionEnum.getCode());
|
||||
String vals = EntityFieldUtil.getFieldValue(transdataLivestockwaterVo,zhibiao.getEntityField(),String.class);
|
||||
tempEnt.setValue(vals);
|
||||
|
|
@ -432,7 +551,6 @@ public class IotCommonP3ServiceImpl {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
return listFinal;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ w * @param pageNo 非必传,虫情孢子类,杀虫灯传入
|
|||
String iconFinalName = pollutionEnum.getIconName();
|
||||
String itemFinalName = pollutionEnum.getDescription();
|
||||
String bsIcon = pollutionEnum.getBsIcon();
|
||||
//20241227增加可以按照租户自定义监测项的名称
|
||||
if (configs != null) {
|
||||
String itemName = desConfig != null ? desConfig.getStr(pollutionEnum.getCode()) : "";
|
||||
String iconName = iconConfig != null ? iconConfig.getStr(pollutionEnum.getCode()) : "";
|
||||
|
|
|
|||
|
|
@ -13,6 +13,16 @@ public interface IotConstants {
|
|||
* 水质数据
|
||||
*/
|
||||
String WATER_DATA = "water";
|
||||
|
||||
/**
|
||||
* 面源数据
|
||||
*/
|
||||
String ORIENT_DATA = "orient";
|
||||
|
||||
/**
|
||||
* 畜禽数据
|
||||
*/
|
||||
String LIVE_DATA = "live";
|
||||
/**
|
||||
* 水肥机数据
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue