Commit 37eeb4dd authored by KeYong's avatar KeYong

Merge branch 'developer' of http://36.40.66.175:5000/moa/amos-boot-biz into developer

parents 4ab95f48 ecfce0c2
......@@ -633,6 +633,8 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
* @return
*/
public HashMap<String,Object> getWaringCycleAndMaxValueByWaring(String warningPeriod,String warningContenct,String pointName){
// 汇流箱机内温度连续30分钟健康指数≤74.0
HashMap<String,Object> result = new HashMap<>();
warningContenct=warningContenct.replace(pointName+"连续","");
String spiltStr =CommonConstans.waringPeriodTowaringCycle.get(warningPeriod);
......@@ -645,8 +647,8 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
}else {
warningCycle=Integer.valueOf(strings[0].replace(".0", ""));
}
if(strings[1].contains("<")){
maxValue = Double.valueOf(strings[1].split("<")[1]);
if(strings[1].contains("")){
maxValue = Double.valueOf(strings[1].split("")[1]);
}
}
result.put("maxValue",maxValue);
......
......@@ -249,7 +249,7 @@ public class HealthStatusIndicatorServiceImpl {
// redisUtils.set(gateWayId+"_"+address+"_health_notice_minute","notice");
level ="注意";
num = ""+healthValueNotice;
content = healthValueNotice*10 + "分钟";
content = healthValueNoticeCount*10 + "分钟";
}else if (warnNum == healthValueWarnCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_warn_minute","warn");
level ="警告";
......@@ -284,7 +284,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数"+num );
idxBizPvWarningRecord.setRecDate(time);
idxBizPvWarningRecord.setWarningPeriod("按时刻");
idxBizPvWarningRecord.setManufacturer(idxBizPvHealthIndices.get(0).getManufacturer());
......@@ -451,7 +451,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数"+num );
idxBizPvWarningRecord.setRecDate(time);
idxBizPvWarningRecord.setWarningPeriod("按小时");
idxBizPvWarningRecord.setManufacturer(idxBizPvHealthIndices.get(0).getManufacturer());
......@@ -616,7 +616,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数"+num );
idxBizPvWarningRecord.setRecDate(time);
idxBizPvWarningRecord.setWarningPeriod("按天");
idxBizPvWarningRecord.setManufacturer(idxBizPvHealthIndices.get(0).getManufacturer());
......@@ -785,7 +785,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数"+num );
idxBizFanWarningRecord.setRecDate(time);
idxBizFanWarningRecord.setWarningPeriod("按时刻");
idxBizFanWarningRecord.setNumber(idxBizFanHealthIndices.get(0).getNumber());
......@@ -953,7 +953,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数"+num );
idxBizFanWarningRecord.setRecDate(time);
idxBizFanWarningRecord.setWarningPeriod("按小时");
idxBizFanWarningRecord.setNumber(idxBizFanHealthIndices.get(0).getNumber());
......@@ -1124,7 +1124,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数"+num );
idxBizFanWarningRecord.setRecDate(time);
idxBizFanWarningRecord.setWarningPeriod("按天");
idxBizFanWarningRecord.setNumber(idxBizFanHealthIndices.get(0).getNumber());
......
......@@ -97,7 +97,9 @@ public class CommonServiceImpl {
public Double getAvagerByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).average().getAsDouble();
if(!ObjectUtils.isEmpty(equipments)) {
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).average().getAsDouble();
}
return result;
}
......@@ -128,7 +130,9 @@ public class CommonServiceImpl {
// }
public Double getTotalByIndicatior(List<Map<String, Object>> mapList, String indicator) {
Double totalvalue = 0.0;
totalvalue = mapList.stream().filter(stringObjectMap -> stringObjectMap.get("equipmentIndexName").toString().contains(indicator) && !ObjectUtils.isEmpty(stringObjectMap.get("value"))).mapToDouble(l -> Double.parseDouble((String) l.get("value"))).sum();
if(!ObjectUtils.isEmpty(mapList)) {
totalvalue = mapList.stream().filter(stringObjectMap -> stringObjectMap.get("equipmentIndexName").toString().contains(indicator) && !ObjectUtils.isEmpty(stringObjectMap.get("value"))).mapToDouble(l -> Double.parseDouble((String) l.get("value"))).sum();
}
return Double.valueOf(String.format("%.2f", totalvalue));
}
......@@ -139,7 +143,9 @@ public class CommonServiceImpl {
*/
public Double getAvgvalueByIndicatior(List<Map<String, Object>> mapList, String indicator) {
Double avageValue = 0.0;
avageValue = mapList.stream().filter(stringObjectMap -> stringObjectMap.get("equipmentIndexName").toString().contains(indicator) && !ObjectUtils.isEmpty(stringObjectMap.get("value"))).mapToDouble(l -> Double.parseDouble((String) l.get("value"))).sum();
if(!ObjectUtils.isEmpty(mapList)) {
avageValue = mapList.stream().filter(stringObjectMap -> stringObjectMap.get("equipmentIndexName").toString().contains(indicator) && !ObjectUtils.isEmpty(stringObjectMap.get("value"))).mapToDouble(l -> Double.parseDouble((String) l.get("value"))).sum();
}
return Double.valueOf(String.format("%.2f", avageValue));
}
......@@ -232,7 +238,11 @@ public class CommonServiceImpl {
stationCacheInfoDto.setStationType(stationBasic.getStationType());
stationCacheInfoDto.setBelongProvince(regionList.stream().filter(region -> region.getRegionCode().toString().equals(stationBasic.getBelongArea().replace("[", "").split(",")[0])).map(region -> region.getRegionName()).collect(Collectors.toList()).get(0));
stationCacheInfoDto.setBelongArea(mapRegionList.stream().filter(mapRegion -> mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 2)) || mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 3))).map(mapRegion -> mapRegion.getName()).collect(Collectors.toList()).get(0));
stationCacheInfoDto.setInstalledCapacity(String.format("%.2f", sjglZsjZsbtzMapper.getStationCapactityByStationWerks(stationBasic.getStationNumber())));
Double installedCapacity = 0.0d;
if(!ObjectUtils.isEmpty(sjglZsjZsbtzMapper.getStationCapactityByStationWerks(stationBasic.getStationNumber()))){
installedCapacity =sjglZsjZsbtzMapper.getStationCapactityByStationWerks(stationBasic.getStationNumber());
}
stationCacheInfoDto.setInstalledCapacity(String.format("%.2f", installedCapacity));
stationCacheInfoDto.setFanGatewayId(stationBasic.getFanGatewayId());
stationCacheInfoDto.setAreaCode(mapRegionList.stream().filter(mapRegion -> mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 2)) || mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 3))).map(mapRegion -> mapRegion.getAreaCode()).collect(Collectors.toList()).get(0));
stationCacheInfoDto.setBoosterGatewayId(stationBasic.getBoosterGatewayId());
......@@ -371,7 +381,10 @@ public class CommonServiceImpl {
public Double getSumByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).sum();
if(equipments!=null)
{
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).sum();
}
return result;
}
......
......@@ -868,9 +868,8 @@ public Map<String,Object> gettimedateyfd( ){
// List<String> fdGatewayId = stationBasicListfd.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.joining(","));
// List<String> gfGatewayId = stationBasicListgf.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.toList());
String fdGatewayIds= stationBasicListfd.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.joining(","));
String gfGatewayIds=stationBasicListgf.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.joining(","));
String fdGatewayIds= stationBasicListfd.stream().map(stationBasic -> "'"+stationBasic.getBoosterGatewayId()+"'").collect(Collectors.joining(","));
String gfGatewayIds=stationBasicListgf.stream().map(stationBasic -> "'"+stationBasic.getBoosterGatewayId()+"'").collect(Collectors.joining(","));
List<StationBasic> stationBasicListAll=new ArrayList<>();
......@@ -891,22 +890,22 @@ public Map<String,Object> gettimedateyfd( ){
List<IndicatorData> activePowerListGF = new ArrayList<>();
// String startTime = cn.hutool.core.date.DateUtil.today() + " 00:00:00";
// String endTime = cn.hutool.core.date.DateUtil.today() + " 23:59:59";
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String startTime = sdf.format(currentDayStartTime);
String endTime= sdf.format(currentDayEndTime);
// Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
// Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
// Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
// sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// String startTime = sdf.format(currentDayStartTime);
// String endTime= sdf.format(currentDayEndTime);
activePowerListFD = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqg(CommonConstans.xiazaoActivePowerPoint, startTime, endTime, fdGatewayIds);
activePowerListFD = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqgNew(CommonConstans.xiazaoActivePowerPoint, fdGatewayIds);
activePowerListGF = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqg(CommonConstans.taiheActivePowerPoint, startTime, endTime, gfGatewayIds);
activePowerListGF = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqgNew(CommonConstans.taiheActivePowerPoint, gfGatewayIds);
System.out.println(JSON.toJSONString(activePowerListFD));
for (int i = 0; i < activePowerListFD.size(); i++) {
IndicatorData indicatorData = activePowerListFD.get(i);
IndicatorData indicatorData2 = activePowerListGF.get(i);
time.add(indicatorData.getXtime());
time.add(cn.hutool.core.date.DateUtil.format(indicatorData.getCreatedTime(), "HH:mm"));
// Double vl= indicatorData.getValueF()+indicatorData2.getValueF() * CommonConstans.kwToMv;
Double vl= Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData.getValueF()))+
Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData2.getValueF() * CommonConstans.kwToMv));
......
......@@ -1936,17 +1936,20 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Double powerOfDay = 0.0000;
Double powerOfMonth = 0.0000;
Double powerOfAnnual = 0.0000;
if(ObjectUtils.isEmpty(query)){
powerOfDay = powerOfDay + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
powerOfMonth = powerOfMonth + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
powerOfAnnual = powerOfAnnual + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
}else {
powerOfDay = powerOfDay + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay));
powerOfMonth = powerOfMonth + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth));
powerOfAnnual = powerOfAnnual + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
}
if(result!=null)
{
if(ObjectUtils.isEmpty(query)){
powerOfDay = powerOfDay + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
powerOfMonth = powerOfMonth + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
powerOfAnnual = powerOfAnnual + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
}else {
powerOfDay = powerOfDay + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay));
powerOfMonth = powerOfMonth + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth));
powerOfAnnual = powerOfAnnual + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
}
}
Map<String, Object> hashMap = new HashMap<>();
hashMap.put("日发电量",powerOfDay);
hashMap.put("月发电量",powerOfMonth);
......
......@@ -25,7 +25,11 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select sum(valueFs) valueF,xtime from (select SUBSTR(`created_time`, 11,6) xtime, `value_f` as valueFs from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and ts >= #{startTime} and ts <= #{endTime} and gateway_id in (#{gatewayId})) group by xtime order by xtime ")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeqg(@Param("equipmentIndexName") String equipmentIndexName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id =#{gatewayId}")
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and ts >= TODAY()-8h and gateway_id in ( ${gatewayId} )")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeqgNew(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id = #{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("equipmentIndexName") String equipmentIndexName, @Param("equipmentNumber") String equipmentNumber, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF, equipment_index_name from iot_data.indicator_data where equipment_index_name like '%路电流%' and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id =#{gatewayId}")
......
......@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
@Slf4j
public class CommonServiceImpl {
// @Autowired
// @Autowired
// InfluxdbUtil influxdbUtil;
@Autowired
SjglZsjZsbtzMapper sjglZsjZsbtzMapper;
......@@ -246,7 +246,7 @@ public class CommonServiceImpl {
} catch (Exception e) {
return totalvalue;
}
return Double.valueOf(String.format("%.4f", totalvalue ));
return Double.valueOf(String.format("%.4f", totalvalue));
}
// public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) {
......@@ -371,10 +371,10 @@ public class CommonServiceImpl {
coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal)));
socialContributionDtoList.add(coal);
toner.setUnit(CommonConstans.TAN_FEN_CHEN_ZHUBIANDIYACE);
toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner )));
toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner)));
socialContributionDtoList.add(toner);
so2.setUnit(CommonConstans.ER_YANG_HUA_LIU_ZHUBIANDIYACE);
so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide )));
so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide)));
socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100);
......@@ -390,11 +390,12 @@ public class CommonServiceImpl {
List<StationCacheInfoDto> stationCacheInfoDtos = new ArrayList<>();
List<Region> regionList = regionMapper.selectList(new QueryWrapper<Region>().eq("LEVEL", 1));
List<MapRegion> mapRegionList = mapRegionMapper.selectList(new QueryWrapper<MapRegion>().isNotNull("name"));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
List<SjglZsjZsbtz> sjglZsjZsbtzList = sjglZsjZsbtzMapper.selectList(new QueryWrapper<SjglZsjZsbtz>().isNotNull("CAPACITYL").eq("is_del","0").isNotNull("WERKS"));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area"));
//.isNotNull("fan_gateway_id"));
List<SjglZsjZsbtz> sjglZsjZsbtzList = sjglZsjZsbtzMapper.selectList(new QueryWrapper<SjglZsjZsbtz>().isNotNull("CAPACITYL").eq("is_del", "0").isNotNull("WERKS"));
for (int i = 0; i < stationBasicList.size(); i++) {
StationBasic stationBasic = stationBasicList.get(i);
Double StationCapactity = sjglZsjZsbtzList.stream().filter(sjglZsjZsbtz -> sjglZsjZsbtz.getWerks().equals(stationBasic.getStationNumber())&& !StringUtils.isEmpty(sjglZsjZsbtz.getCapacityl())).collect(Collectors.toList()).stream().mapToDouble(l->Double.valueOf(l.getCapacityl())).sum();
Double StationCapactity = sjglZsjZsbtzList.stream().filter(sjglZsjZsbtz -> sjglZsjZsbtz.getWerks().equals(stationBasic.getStationNumber()) && !StringUtils.isEmpty(sjglZsjZsbtz.getCapacityl())).collect(Collectors.toList()).stream().mapToDouble(l -> Double.valueOf(l.getCapacityl())).sum();
StationCacheInfoDto stationCacheInfoDto = new StationCacheInfoDto();
stationCacheInfoDto.setStationId(stationBasic.getSequenceNbr().toString());
stationCacheInfoDto.setStationName(stationBasic.getStationName());
......@@ -560,13 +561,17 @@ public class CommonServiceImpl {
public Double getAvagerByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).average().getAsDouble();
if (!ObjectUtils.isEmpty(equipments)) {
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).average().getAsDouble();
}
return result;
}
public Double getSumByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).sum();
if (equipments != null) {
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).filter(esEquipments -> esEquipments.getValueF() != null).mapToDouble(ESEquipments::getValueF).sum();
}
return result;
}
......
......@@ -149,7 +149,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private UserEmpowerMapper userEmpowerMapper;
public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) {
String table = gateway;
Map<String, List<String>> queryCodntion = new HashMap<>();
......@@ -301,14 +301,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public TreeDto getTreeInfo(String sequenceNbr, ReginParams reginParams) {
String userId = reginParams.getUserModel().getUserId();
String companyLevel ="";
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String companyLevel = "";
StdUserEmpower stdUserEmpower = userEmpowerMapper
.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
if (ObjectUtils.isEmpty(stdUserEmpower)) {
// throw new BadRequest("您当前未配置数据权限!");
}else{
} else {
String permissionOrgCode = stdUserEmpower.getAmosOrgCode().get(0);
Map<String,String> companyInfo= userEmpowerMapper.getCompanyInfoByOrgCode(permissionOrgCode);
companyLevel = companyInfo.get("level").toString();
Map<String, String> companyInfo = userEmpowerMapper.getCompanyInfoByOrgCode(permissionOrgCode);
companyLevel = companyInfo.get("level").toString();
}
StationBasic stationBasic = stationBasicMapper.selectById(sequenceNbr);
List<Integer> integers = JSON.parseArray(stationBasic.getBelongArea(), Integer.class);
......@@ -350,11 +351,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
gfzTreeDto.setChildren(gfz);
List<TreeDto> treeDtos = Arrays.asList(fdzTreeDto, gfzTreeDto);
treeDto.setChildren(treeDtos);
if(companyLevel.equals("station")){
List<TreeDto> children = stationListByRegionCode.stream().filter(t->t.getCode().equals(sequenceNbr)).collect(Collectors.toList());
if(stationBasic.getStationType().equals("FDZ")){
treeDto = fdzTreeDto;
}else {
if (companyLevel.equals("station")) {
List<TreeDto> children = stationListByRegionCode.stream().filter(t -> t.getCode().equals(sequenceNbr))
.collect(Collectors.toList());
if (stationBasic.getStationType().equals("FDZ")) {
treeDto = fdzTreeDto;
} else {
treeDto = gfzTreeDto;
}
treeDto.setChildren(children);
......@@ -372,8 +374,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return new ArrayList<ESEquipmentsDTO>();
}
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName,
Arrays.asList("风机状态", "有功功率", "发电状态", "报警状态", "停机状态", "故障状态", "待机状态", "维护状态", "发电机转速", "正常发电状态","30秒平均风速"));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("风机状态", "有功功率", "发电状态", "报警状态",
"停机状态", "故障状态", "待机状态", "维护状态", "发电机转速", "正常发电状态", "30秒平均风速"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
Map<String, List<String>> queryCondtion1 = new HashMap<>();
......@@ -2398,6 +2400,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Override
public Map<String, Object> partofWaring3D(String stationId, String equipNum) {
Map<String, Object> resultMap = new HashMap<>();
if (stationId == null || equipNum == null || "null".equals(stationId) || "equipNum".equals(equipNum)) {
return resultMap;
}
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment