Commit 42a432aa authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents dc72176e de9c6a7a
package com.yeejoin.amos.api.householdapi.constant;
import java.util.HashMap;
/**
* 北向-华为常量
*/
public class ImasterConstant {
public static final HashMap<String, String> stationStaus = new HashMap<String, String>() {
{
put("1", "离线");
put("2", "告警");
put("3", "在线");
}
};
public static final HashMap<String, String> alarmstatus = new HashMap<String, String>() {
{
put("1", "未处理");
}
};
public static final HashMap<String, String> alarmLevel = new HashMap<String, String>() {
{
put("1", "严重");
put("2", "重要");
put("3", "次要");
put("4", "提示");
}
};
public static String baseurl ="https://cn.fusionsolar.huawei.com";
public static String account ="ahsjmg-API";
public static String password ="huawei123";
public static String tokenUrl ="/thirdData/login";
public static String requestPOST="POST";
public static String requestGET="GET";
public static String stationListUrl="/thirdData/stations";
public static String stationDetailUrl = "/thirdData/getStationRealKpi";
public static String collectorListUrl = "/thirdData/getDevList";
public static String collectorDetailUrl = "/thirdData/getDevRealKpi";
public static String alarmListUrl = "/thirdData/getAlarmList";
public static String resovleRule_data_page_records = "data";
public static String resovle_rows="rows";
public static int devTypeC=62;
public static int devTypeI=1;
}
...@@ -2,7 +2,10 @@ package com.yeejoin.amos.api.householdapi.controller; ...@@ -2,7 +2,10 @@ package com.yeejoin.amos.api.householdapi.controller;
import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils; import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils;
import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService;
import com.yeejoin.amos.api.householdapi.face.service.ImasterDataService;
import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService;
import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl;
import fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -31,6 +34,8 @@ public class HouseholdTestController { ...@@ -31,6 +34,8 @@ public class HouseholdTestController {
private GoLangDataAcquisitionService goLangDataAcquisitionService; private GoLangDataAcquisitionService goLangDataAcquisitionService;
@Autowired @Autowired
private KSolarDataAcquisitionService kSolarDataAcquisitionService; private KSolarDataAcquisitionService kSolarDataAcquisitionService;
@Autowired
private ImasterDataService imasterDataService;
/** /**
...@@ -119,4 +124,27 @@ public class HouseholdTestController { ...@@ -119,4 +124,27 @@ public class HouseholdTestController {
// goLangDataAcquisitionService.inverAlramInfo(); // goLangDataAcquisitionService.inverAlramInfo();
} }
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/imasterNew")
@ApiOperation(httpMethod = "POST", value = "北向", notes = "北向")
public void imasterNew() throws IOException {
// imasterDataService.stationList();
// imasterDataService.stationDetail();
// imasterDataService.collectorList();
// imasterDataService.inverterList();
imasterDataService.inverterDetail();
// goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
// goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
}
} }
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class ImasterAlarmDto {
private Integer alarmId;
private Integer alarmType;
private Long raiseTime;
private String stationName;
private Integer lev;
private Integer devTypeId;
private String stationCode;
private String alarmName;
private String alarmCause;
private String devName;
private String repairSuggestion;
private String esnCode;
private Integer status;
}
...@@ -16,7 +16,7 @@ import java.util.Date; ...@@ -16,7 +16,7 @@ import java.util.Date;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_jp_inverter") @TableName("hygf_jp_inverter")
public class JpInverter implements Serializable { public class JpInverter implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_collector_list", autoResultMap = true)
public class ImasterCollectorList {
private Long createdTime;
private Long id;
private String stationCode;
private String stationName;
private String devName;
private String esnCode;
private Integer devTypeId;
private String softwareVersion;
private String invType;
private Double longitude;
private Double latitude;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_inverter_list", autoResultMap = true)
public class ImasterInverterList {
private Long createdTime;
private Long id;
private String stationCode;
private String stationName;
private String collectorSnCode;
private String devName;
private String esnCode;
private Integer devTypeId;
private String softwareVersion;
private String invType;
private Double longitude;
private Double latitude;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_inverter_list_details", autoResultMap = true)
public class ImasterInverterListDetails {
private Long createdTime;
private String inverterId;
Double pv26_i ;
Double pv2_u ;
Double pv28_i ;
Double pv4_u ;
Double pv22_i ;
Double power_factor ;
Double pv6_u ;
Double mppt_total_cap ;
Double pv24_i ;
Double pv8_u ;
Double open_time ;
Double pv22_u ;
Double a_i ;
Double pv24_u ;
Double mppt_9_cap ;
Double c_i ;
Double pv20_u ;
Double pv19_u ;
Double pv15_u ;
Double reactive_power ;
Double a_u ;
Double pv17_u ;
Double c_u ;
Double mppt_8_cap ;
Double pv20_i ;
Double pv15_i ;
Double efficiency ;
Double pv17_i ;
Double pv11_i ;
Double pv13_i ;
Double pv11_u ;
Double mppt_power ;
Double pv13_u ;
Double run_state ;
Double close_time ;
Double pv19_i ;
Double mppt_7_cap ;
Double mppt_5_cap ;
Double pv27_u ;
Double pv2_i ;
Double active_power ;
Double pv4_i ;
Double pv6_i ;
Double pv8_i ;
Double mppt_6_cap ;
Double pv27_i ;
Double pv1_u ;
Double pv3_u ;
Double pv23_i ;
Double pv5_u ;
Double pv25_i ;
Double pv7_u ;
Double pv23_u ;
Double inverter_state ;
Double pv9_u ;
Double pv25_u ;
Double total_cap ;
Double mppt_3_cap ;
Double b_i ;
Double pv21_u ;
Double mppt_10_cap ;
Double pv16_u ;
Double pv18_u ;
Double temperature ;
Double bc_u ;
Double b_u ;
Double pv21_i ;
Double elec_freq ;
Double mppt_4_cap ;
Double pv16_i ;
Double pv18_i ;
Double day_cap ;
Double pv12_i ;
Double pv14_i ;
Double pv12_u ;
Double mppt_1_cap ;
Double pv14_u ;
Double pv10_u ;
Double pv26_u ;
Double pv1_i ;
Double pv28_u ;
Double pv3_i ;
Double mppt_2_cap ;
Double pv5_i ;
Double ab_u ;
Double ca_u ;
Double pv7_i ;
Double pv10_i ;
Double pv9_i ;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details" ,autoResultMap = true)
public class ImasterStationDetail {
private Long createdTime;
private String stationCode ;
private Double day_power ;
private Double month_power;
private Double total_power;
private Double day_income ;
private Double total_income ;
private Integer real_health_state;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details_day" ,autoResultMap = true)
public class ImasterStationDetailsDay {
private Long createdTime;
private String stationCode ;
private Double installedCapacity ;
private Double radiationIntensity;
private Double theoryPower ;
private Double performanceRatio ;
private Double inverterPower ;
private Double ongridPower ;
private Double usePower ;
private Double powerProfit ;
private Double perpowerRatio;
private Double reductionTotalCo2 ;
private Double reductionTotalCoal ;
private Double reductionTotalTree;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details_month" ,autoResultMap = true)
public class ImasterStationDetailsMonth {
private Long createdTime;
private String stationCode ;
private Double installedCapacity ;
private Double radiationIntensity;
private Double theoryPower ;
private Double performanceRatio ;
private Double inverterPower ;
private Double ongridPower ;
private Double usePower ;
private Double powerProfit ;
private Double perpowerRatio;
private Double reductionTotalCo2 ;
private Double reductionTotalCoal ;
private Double reductionTotalTree;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details_year" ,autoResultMap = true)
public class ImasterStationDetailsYear {
private Long createdTime;
private String stationCode ;
private Double installedCapacity ;
private Double radiationIntensity;
private Double theoryPower ;
private Double performanceRatio ;
private Double inverterPower ;
private Double ongridPower ;
private Double usePower ;
private Double powerProfit ;
private Double perpowerRatio;
private Double reductionTotalCo2 ;
private Double reductionTotalCoal ;
private Double reductionTotalTree;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "imaster_station_list" ,autoResultMap = true)
public class ImasterStationList implements Serializable {
private Long createdTime;
private String latitude;
private String longitude;
private String plantAddress;
private String plantName;
private String plantCode;
private String contactPerson;
private String contactMethod;
private String gridConnectionDate;
private Double capacity;
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterCollectorList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface ImasterCollectorListMapper extends BaseMapper<ImasterCollectorList> {
@Select("select id from imaster_collector_list where esn_code is not null group by id")
List<Long> getCollectIds();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterListDetails;
public interface ImasterInverterListDetailsMapper extends BaseMapper<ImasterInverterListDetails> {
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface ImasterInverterListMapper extends BaseMapper<ImasterInverterList> {
@Select("select esn_code from imaster_inverter_list where esn_code is not null group by esn_code")
List<String> getCollectIds();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterListDetails;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterStationDetail;
public interface ImasterStationDetailsMapper extends BaseMapper<ImasterStationDetail> {
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterStationList;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import java.util.List;
public interface ImasterStationMapper extends BaseMapper<ImasterStationList> {
@Select("select * from imaster_station_list")
List<ImasterStationList> getStationInfo();
@Select("select plant_code as plantCode from imaster_station_list group by plant_code")
List<String> getStationIds();
}
package com.yeejoin.amos.api.householdapi.face.service;
public interface ImasterDataService {
/**
* @descrption 场站列表数据入库
*/
void stationList();
/**
* @descrption 场站详情数据入库
*/
void stationDetail();
/**
* @descrption 采集器列表数据入库
*/
void collectorList();
/**
* @descrption 采集器详情数据入库
*/
void collectorDetail();
/**
* @descrption 逆变器列表数据入库
*/
void inverterList();
/**
* @descrption 逆变器详情数据入库
*/
void inverterDetail();
/**
* @descrption 采集器告警列表数据入库
*/
void inverAlramInfo();
}
...@@ -69,6 +69,11 @@ ...@@ -69,6 +69,11 @@
<artifactId>tablesaw-json</artifactId> <artifactId>tablesaw-json</artifactId>
<version>0.43.1</version> <version>0.43.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -20,6 +20,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -20,6 +20,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode); BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
BigDecimal getHealthScoreInfoByStation(@Param("stationCode") String stationCode, @Param("tableName") String tableName);
List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode); List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName); List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName);
......
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
<where> <where>
a.project_org_code = c.project_org_code a.project_org_code = c.project_org_code
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND project_org_code like concat(#{parentCode},'%') AND a.project_org_code like concat(#{parentCode},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
......
...@@ -316,7 +316,7 @@ public class PersonQrCodeController extends BaseController { ...@@ -316,7 +316,7 @@ public class PersonQrCodeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getDetailInfoByObjectId") @GetMapping(value = "/getDetailInfoByObjectId")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 三级弹窗左侧信息API", notes = "评估大屏 - 三级弹窗左侧信息API") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 三级弹窗左侧信息API", notes = "评估大屏 - 三级弹窗左侧信息API")
public ResponseModel<Map<String, Object>> getDetailInfoByObjectId(@RequestParam(value = "objectId") String objectId, public ResponseModel<Map<String, Object>> getDetailInfoByObjectId(@RequestParam(value = "objectId", required = false) String objectId,
@RequestParam(value = "column") String column, @RequestParam(value = "column") String column,
@RequestParam(required = false, value = "jobId") String jobId) { @RequestParam(required = false, value = "jobId") String jobId) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
......
...@@ -215,17 +215,18 @@ ...@@ -215,17 +215,18 @@
<select id="getJobDetailInfoByObjectId" resultType="java.util.Map"> <select id="getJobDetailInfoByObjectId" resultType="java.util.Map">
SELECT SELECT
IFNULL(`JOB_DESCRIPTION`, '') as `name`, IFNULL(a.`JOB_DESCRIPTION`, '') as `name`,
case case
when QRCODE_COLOR = 'red' then '重大' when a.QRCODE_COLOR = 'red' then '重大'
when QRCODE_COLOR = 'yellow' then '超时' when a.QRCODE_COLOR = 'yellow' then '超时'
else '正常' end as `status`, else '正常' end as `status`,
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor, IFNULL(a.QRCODE_COLOR, 'green') as qrCodeColor,
IFNULL(ZFZR, '') as person, b.REAL_NAME as person,
'' as phone, b.MOBILE as phone,
IFNULL(CREATE_TIME, '') as `recDate` IFNULL(a.CREATE_TIME, '') as `recDate`
FROM FROM
fdgl_job_main fdgl_job_main a
where DBID = #{objectId} left join privilege_agency_user b on a.ZFZR = b.SEQUENCE_NBR
where a.DBID = #{objectId}
</select> </select>
</mapper> </mapper>
...@@ -94,6 +94,8 @@ public class CommonConstans { ...@@ -94,6 +94,8 @@ public class CommonConstans {
public static final String QueryStringEquipmentIndexName = "equipmentIndexName.keyword"; public static final String QueryStringEquipmentIndexName = "equipmentIndexName.keyword";
//es EquipIndexName 查绚关键字 //es EquipIndexName 查绚关键字
public static final String QueryStringEquipmentIndexNameNotKeyword = "equipmentIndexName"; public static final String QueryStringEquipmentIndexNameNotKeyword = "equipmentIndexName";
public static final String QueryStringEquipmentSpecificNameNotKeyword = "equipmentSpecificName.keyword";
//es gatewayId 查绚关键字 //es gatewayId 查绚关键字
public static final String QueryStringGateWayId = "gatewayId.keyword"; public static final String QueryStringGateWayId = "gatewayId.keyword";
public static final String QueryStringFrontMoudle = "frontModule.keyword"; public static final String QueryStringFrontMoudle = "frontModule.keyword";
......
...@@ -764,12 +764,16 @@ public class MonitorFanIdxController extends BaseController { ...@@ -764,12 +764,16 @@ public class MonitorFanIdxController extends BaseController {
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId, current, size)); return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId, current, size));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "汇流箱支路电流偏差率") @ApiOperation(value = "汇流箱支路电流偏差率")
@GetMapping("/getDeaviAtionRate") @GetMapping("/getDeaviAtionRate")
public ResponseModel<Page<DeaviationRateDto>> getDeaviAtionRate(@RequestParam(value = "stationId") String stationId, String equipNumber) { public ResponseModel<ResultsData> getDeaviAtionRate(@RequestParam(value = "stationId") String stationId,
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.getDeaviAtionRate(stationId, equipNumber)); @RequestParam(value = "zz") String zz, @RequestParam(value = "nbq") String nbq,
} @RequestParam(value = "hlx") String hlx) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.getDeaviAtionRate(gatewayId, zz, nbq, hlx));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
...@@ -855,29 +855,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -855,29 +855,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
data = listDatum.getDisplayName(); data = listDatum.getDisplayName();
} }
} }
statusMap.put("addres",listDatum.getAddress());
statusMap.put("data", data); statusMap.put("data", data);
statusMap.put("state", listDatum.getValue().equals("false") ? 0 : 1); statusMap.put("state", listDatum.getValue().equals("false") ? 0 : 1);
statusMap.put("status", listDatum.getValue().equals("false") ? 0 : 1); statusMap.put("status", listDatum.getValue().equals("false") ? 0 : 1);
if(listDatum.getEquipmentIndexName().equals("直流屏装置1网络状态1")||listDatum.getEquipmentIndexName().equals("直流屏装置2网络状态1")){ statusMap.put("title", listDatum.getValue().equals("false") ? "断" : "通");
statusMap.put("title", listDatum.getValue().equals("false") ? "断" : "通");
}else{
statusMap.put("title", listDatum.getValue().equals("false") ? "通" : "断");
}
statusMaps.add(statusMap); statusMaps.add(statusMap);
} }
statusMaps.sort(Comparator.comparingLong(o -> Long.parseLong(o.get("addres").toString())));
Collator instance = Collator.getInstance(Locale.CHINA);
Collections.sort(statusMaps, (e1, e2) -> {
return instance.compare(e1.get("data"), e2.get("data"));
});
return statusMaps; return statusMaps;
} }
...@@ -1325,10 +1310,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1325,10 +1310,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("1svg", "1SVG"); resultMap.put("1svg", "1SVG");
resultMap.put("2svg", "2SVG"); resultMap.put("2svg", "2SVG");
resultMap.put("xzsvg", "夏造 SVG"); resultMap.put("xzsvg", "夏造SVG");
resultMap.put("xzaggavc", "夏造 AGGAVC"); resultMap.put("xzaggavc", "夏造AGCAVC");
resultMap.put("xzgyxh", "夏造 公用信号"); resultMap.put("xzgyxh", "夏造公用信号");
resultMap.put("xzjzlp", "夏造 交直流屏"); resultMap.put("xzjzlp", "夏造交直流屏");
//下方重复列表数据 //下方重复列表数据
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10); List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10);
...@@ -2157,28 +2142,59 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2157,28 +2142,59 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public Page<DeaviationRateDto> getDeaviAtionRate(String stationId, String equipNumber) { public ResultsData getDeaviAtionRate(String gatewayId, String zz, String nbq, String hlx) {
StationCacheInfoDto stationCacheInfoDto = commonServiceImpl.getStationCacheInfoDtoByStationId(stationId); ArrayList<Map<String, Object>> resultList = new ArrayList<>();
Page<DeaviationRateDto> deaviationRateDtoPage = new Page<>(1, 100); Map<String, List<String>> queryConditon = new HashMap<>();
List<DeaviationRateDto> deaviationRateDtoList = new ArrayList<>(); queryConditon.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, List<String>> queryCondition = new HashMap<>(); Map<String, String> likeMap = new HashMap<>();
queryCondition.put(CommonConstans.QueryStringEquipmentNumber, Arrays.asList(equipNumber)); likeMap.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "路电流");
queryCondition.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId())); //hlx=hlx.replace("#0", "#");
Map<String, String> shouldCodtion = new HashMap<>(); //likeMap.put(CommonConstans.QueryStringEquipmentSpecificNameNotKeyword, hlx);
shouldCodtion.put(CommonConstans.QueryStringEquipmentIndexName, "路电流"); String nhlx =zz+"/"+nbq+"/"+ hlx.replace("#0", "#");
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondition, shouldCodtion, ESEquipments.class); List<ESEquipments> list = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null,
Random random = new Random(); ESEquipments.class, likeMap);
indicatorsDtoList.forEach(esEquipments -> {
DeaviationRateDto deaviationRateDto = new DeaviationRateDto(); // Map<String, List<String>> queryConditon1 = new HashMap<>();
deaviationRateDto.setName(esEquipments.getEquipmentIndexName()); // queryConditon1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
deaviationRateDto.setCurrentValue(esEquipments.getValue()); // Map<String, String> likeMap1 = new HashMap<>();
deaviationRateDto.setOffset(String.valueOf(random.nextDouble())); // likeMap1.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "平均电流");
deaviationRateDto.setAttValue(String.valueOf(random.nextDouble())); // List<ESEquipments> list1 = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null,
deaviationRateDtoList.add(deaviationRateDto); // ESEquipments.class, likeMap1);
});
deaviationRateDtoPage.setRecords(deaviationRateDtoList); if (!ValidationUtil.isEmpty(list)) {
return deaviationRateDtoPage; list=list.stream().filter(i->i.getEquipmentSpecificName().contains(nhlx)).collect(Collectors.toList());
}
Double avageValue = 0.0;
avageValue = list.stream().filter(e -> !ObjectUtils.isEmpty(e.getValueF()))
.mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).average().getAsDouble();
avageValue = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, avageValue));
for (ESEquipments s : list) {
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("hlx", s.getEquipmentIndexName());
double now = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, s.getValueF()));
resultMap.put("now", now);
resultMap.put("avg", avageValue);
double c = now - avageValue;
if (c < 0) {
c = -c;
}
double lsv = c / avageValue;
lsv = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, lsv));
resultMap.put("lsv", lsv);
resultList.add(resultMap);
}
}
// 构建平台数据
DataGridMock DataGridMock = new DataGridMock(0, resultList.size(), false, 0, resultList);
ColModel colModelEventMovement = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx");
ColModel colModelStationName = new ColModel("now", "now", "当前值", "当前值", "dataGrid", "now");
ColModel colModelEventDesc = new ColModel("avg", "avg", "平均值", "平均值", "dataGrid", "avg");
ColModel colModelAlarmGroupName = new ColModel("pcv", "pcv", "偏差率", "偏差率", "dataGrid", "pcv");
List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc,
colModelAlarmGroupName);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
// //@Scheduled(cron = "0/1 * * * * ?") // //@Scheduled(cron = "0/1 * * * * ?")
......
...@@ -293,14 +293,14 @@ public class MonitoringServiceImpl { ...@@ -293,14 +293,14 @@ public class MonitoringServiceImpl {
SocialContributionDto completionRatioDto = new SocialContributionDto(); SocialContributionDto completionRatioDto = new SocialContributionDto();
completionRatioDto.setTitle(completionRatio); completionRatioDto.setTitle(completionRatio);
completionRatioDto.setUnit("%"); completionRatioDto.setUnit("%");
SocialContributionDto useHoursDto = new SocialContributionDto(); // SocialContributionDto useHoursDto = new SocialContributionDto();
useHoursDto.setTitle(String.format(CommonConstans.Twodecimalplaces, (fdzannualPower.get() * CommonConstans.wkwhToMv / fdzInstallCapacity.get() + gfzannualPower.get() * CommonConstans.wkwhToMv / gfzinstallCapacity.get()))); // useHoursDto.setTitle(String.format(CommonConstans.Twodecimalplaces, (fdzannualPower.get() * CommonConstans.wkwhToMv / fdzInstallCapacity.get() + gfzannualPower.get() * CommonConstans.wkwhToMv / gfzinstallCapacity.get())));
useHoursDto.setUnit("h"); // useHoursDto.setUnit("h");
socialContributionDtoList.add(dailyPowerdto); socialContributionDtoList.add(dailyPowerdto);
socialContributionDtoList.add(monthlyPowerdto); socialContributionDtoList.add(monthlyPowerdto);
socialContributionDtoList.add(annualPowerdto); socialContributionDtoList.add(annualPowerdto);
socialContributionDtoList.add(completionRatioDto); socialContributionDtoList.add(completionRatioDto);
socialContributionDtoList.add(useHoursDto); // socialContributionDtoList.add(useHoursDto);
socialContributionDtoPage.setRecords(socialContributionDtoList); socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1); socialContributionDtoPage.setCurrent(1);
......
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