7705c933 张雷

实时数据问题修改

1 个父辈 671b4a1c
......@@ -87,42 +87,46 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
if(!StringUtils.isEmpty(fields)) {
fields = fields.substring(1);
}
//获取实时数据
List<Map<String, Object>> pgDataList = pgQueryService.queryFactoryMonitorFromRealTimeData(departId, fields);
Map<String, Object> dataMap = new HashMap<String,Object>();
if(pgDataList!=null&&pgDataList.size()>0) {
dataMap = pgDataList.get(0);
}
String[] departArray = departId.split(",");
//根据厂区分别查询实时数据
int sort = 0;//序号
for(String depart : departArray) {
Map<String,Object> limitMap = new HashMap<>();
if(levelMap.get(depart)!=null){
List<Map<String,String>> limitList = (List<Map<String,String>>)levelMap.get(depart);
for (Map<String,String> lMap : limitList) {
limitMap.put(lMap.get("code"),lMap);
String[] departIdArr = departId.split(",");
for (String depart : departIdArr) {
List<WaterQualityMonitoringDetailVO> realTimelist = new ArrayList<>();
//获取实时数据
List<Map<String, Object>> pgDataList = pgQueryService.queryFactoryMonitorFromRealTimeData(depart, fields);
Map<String, Object> dataMap = new HashMap<String,Object>();
if(pgDataList!=null&&pgDataList.size()>0) {
dataMap = pgDataList.get(0);
Map<String,Object> limitMap = new HashMap<>();
if(levelMap.get(depart)!=null){
List<Map<String,String>> limitList = (List<Map<String,String>>)levelMap.get(depart);
for (Map<String,String> lMap : limitList) {
limitMap.put(lMap.get("code"),lMap);
}
}
}
if(parmType != null){
if("in".equals(parmType)){
sort++;
list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
}else if("out".equals(parmType)){
sort++;
list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
if(parmType != null){
if("in".equals(parmType)){
sort++;
realTimelist = putInWaterDataInList(sort,realTimelist,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
}else if("out".equals(parmType)){
sort++;
realTimelist = putOutWaterDataInList(sort,realTimelist,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
}else{
sort++;
realTimelist = putInWaterDataInList(sort,realTimelist,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
sort++;
realTimelist = putOutWaterDataInList(sort,realTimelist,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
}
}else{
sort++;
list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
realTimelist = putInWaterDataInList(sort,realTimelist,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
sort++;
list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
realTimelist = putOutWaterDataInList(sort,realTimelist,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
}
}else{
sort++;
list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
sort++;
list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap);
list.addAll(realTimelist);
}
}
return list;
}
......
......@@ -483,12 +483,12 @@ public class SysFactoryInfoController {
public Result queryByDepartId(@RequestParam(name = "departId", required = true) String departId) {
Result result = new Result();
SysFactoryInfoVO sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId);
JSONObject jsonObject = sysDictService.translateTDictValue(sysFactoryInfo);
JSONObject jsonObject = new JSONObject();
if (sysFactoryInfo == null) {
departId = getDepart(BaseContextHandler.getRealDepartId());
sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId);
jsonObject = sysDictService.translateTDictValue(sysFactoryInfo);
}
jsonObject = sysDictService.translateTDictValue(sysFactoryInfo);
result.setResult(jsonObject);
result.setSuccess(true);
return result;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!