Browse Source

#集中监控铃铛设置

zhongwei
yang_shj 12 months ago
parent
commit
4f0a24e4f1
  1. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  2. 8
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  3. 35
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  4. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java
  5. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/RealTargetService.java
  6. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  7. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -86,4 +86,8 @@ public interface MainConstants {
String DUTY_NOTICE = "dutyNotice";
String PROJECT_MANAGER = "projectManager";
String LOAD_EM_INFO = "loadEmInfo";
String WIND_RECENT_YEAR_POWER_DATA = "hzims:operation:wind:power:data";
}

8
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
@ -42,7 +43,6 @@ public class MonitorScheduledTask {
* @return ReturnT<String>
*/
@XxlJob(REAL_TIME_DATA)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealData(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
@ -55,8 +55,10 @@ public class MonitorScheduledTask {
* 集中监控数据处理
* @return ReturnT<String>
*/
@XxlJob(CENTRALIZED_MONITORING)
public ReturnT<String> loadMonitoring(String param) {
//@XxlJob(CENTRALIZED_MONITORING)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadMonitoring() {
String param = "";
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

35
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java

@ -8,13 +8,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.Date;
import static com.hnac.hzims.fdp.constants.ScheduledConstant.LOAD_EM_INFO;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
@ -36,8 +34,11 @@ public class RealTargetScheduledTask {
*/
@XxlJob(LOAD_EM_INFO)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadEmInfo() {
service.loadEmInfo();
public ReturnT<String> loadEmInfo(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadEmInfo(param);
return new ReturnT<>("SUCCESS");
}
@ -131,24 +132,22 @@ public class RealTargetScheduledTask {
*/
@XxlJob(ELECTRICITY_GENERATION_RECENT_YEAR)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadPowerData() {
// if (Func.isBlank(param)) {
// param = DateUtil.format(new Date(), "yyyy-MM");
// }
service.loadPowerData("", Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),2,3);
public ReturnT<String> loadPowerData(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadPowerData(param, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),2,3);
return new ReturnT<>("SUCCESS");
}
/**
* 获取風電和儲能站点近3年发电量数据
*/
private final static String wind_recent_year_power_data = "hzims:operation:wind:power:data";
@XxlJob(WIND_POWER_GENERATION_RECENT_YEAR)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadWindPowerData() {
// if (Func.isBlank(param)) {
// param = DateUtil.format(new Date(), "yyyy-MM");
// }
service.loadPowerDataByWindEnergy("", Arrays.asList(HomePageConstant.WIND_POWER,HomePageConstant.ENERGY_STORAGE),2,3,wind_recent_year_power_data);
public ReturnT<String> loadWindPowerData(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadPowerDataByWindEnergy(param, Arrays.asList(HomePageConstant.WIND_POWER,HomePageConstant.ENERGY_STORAGE),2,3,WIND_RECENT_YEAR_POWER_DATA);
return new ReturnT<>("SUCCESS");
}
}

7
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java

@ -11,13 +11,11 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -39,6 +37,7 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, Ala
List<AlarmEntity> alarms = this.list(Wrappers.<AlarmEntity>lambdaQuery()
.in(AlarmEntity::getStationId,codes)
.eq(AlarmEntity::getIsSmallBell,0)
.like(AlarmEntity::getAlarmTime, DateUtil.format(new Date(),DateUtil.PATTERN_DATE))
);
if(CollectionUtil.isEmpty(alarms)){
return new ArrayList<>();

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/RealTargetService.java

@ -9,7 +9,7 @@ import java.util.List;
public interface RealTargetService {
void loadEmInfo();
void loadEmInfo(String param);
// 水电站实时数据加载
void loadHydropowerReal(String param);

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -101,7 +101,7 @@ public class RealTargetServiceImpl implements RealTargetService {
@Override
public void loadEmInfo() {
public void loadEmInfo(String param) {
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getDataOrigin,"0"));
// 查询所有首页展示/状态非删除设备
@ -148,17 +148,17 @@ public class RealTargetServiceImpl implements RealTargetService {
List<EmParamEntity> itemParamList = paramList.stream().filter(o->item.getId().equals(o.getInfoId())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(itemParamList)){
// 遍历设备配置参数
for(EmParamEntity param : itemParamList){
String param_name = param.getParamName();
for(EmParamEntity paramEntity : itemParamList){
String param_name = paramEntity.getParamName();
switch (param_name){
case "ct":
item.setCt(Integer.valueOf(param.getParamValue()));
item.setCt(Integer.valueOf(paramEntity.getParamValue()));
break;
case "pt":
item.setPt(Integer.valueOf(param.getParamValue()));
item.setPt(Integer.valueOf(paramEntity.getParamValue()));
break;
case "installedCapacity":
item.setInstalledCapacity(Double.valueOf(param.getParamValue()));
item.setInstalledCapacity(Double.valueOf(paramEntity.getParamValue()));
break;
default:
break;

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java

@ -17,8 +17,8 @@ import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzims.scheduled.service.operation.business.AccessService;
import com.hnac.hzims.scheduled.service.operation.business.MaintenanceService;
import com.hnac.hzims.scheduled.service.operation.business.PhenomenonService;
import com.hnac.hzims.scheduled.service.operation.station.StationService;
import com.hnac.hzims.scheduled.service.operation.report.ReportService;
import com.hnac.hzims.scheduled.service.operation.station.StationService;
import com.hnac.hzims.scheduled.service.safeproduct.MonthService;
import com.hnac.hzims.scheduled.service.safeproduct.TrialService;
import com.hnac.hzims.scheduled.service.ticket.TicketService;
@ -41,6 +41,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
@ -329,7 +330,7 @@ public class ReportServiceImpl implements ReportService {
areaMonthReport.setPowerFinishRate(0.0);
} else {
// 发电完成率
double powerFinishRate = BigDecimal.valueOf(actualPower / planPower * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
double powerFinishRate = BigDecimal.valueOf(actualPower / planPower * 100).setScale(1, RoundingMode.HALF_UP).doubleValue();
areaMonthReport.setPowerFinishRate(powerFinishRate);
}
// 同比
@ -338,7 +339,7 @@ public class ReportServiceImpl implements ReportService {
areaMonthReport.setComparePowerRate(0.0);
return;
}
double comparePowerRate = BigDecimal.valueOf(actualPower / oldActualPower).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
double comparePowerRate = BigDecimal.valueOf(actualPower / oldActualPower).setScale(2, RoundingMode.HALF_UP).doubleValue();
areaMonthReport.setComparePowerRate(comparePowerRate);
}
@ -365,7 +366,7 @@ public class ReportServiceImpl implements ReportService {
if (operateQualify <= 0) {
areaMonthReport.setOperaQualifyRate(0.0);
} else {
double operateQualifyRate = BigDecimal.valueOf(operateQualify / (double) operate * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
double operateQualifyRate = BigDecimal.valueOf(operateQualify / (double) operate * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue();
areaMonthReport.setOperaQualifyRate(operateQualifyRate);
}
//工作票
@ -375,7 +376,7 @@ public class ReportServiceImpl implements ReportService {
if (workQualify <= 0) {
areaMonthReport.setWorkQualifyRate(0.0);
} else {
double workQualifyRate = BigDecimal.valueOf(workQualify / (double) work * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
double workQualifyRate = BigDecimal.valueOf(workQualify / (double) work * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue();
areaMonthReport.setWorkQualifyRate(workQualifyRate);
}
}
@ -421,7 +422,7 @@ public class ReportServiceImpl implements ReportService {
if (defectSum <= 0) {
areaMonthReport.setDefectRate(0.0);
} else {
double deletionRate = BigDecimal.valueOf(defect / defectSum * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
double deletionRate = BigDecimal.valueOf(defect / defectSum * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue();
areaMonthReport.setDefectRate(deletionRate);
}
countDownLatch.countDown();
@ -464,7 +465,7 @@ public class ReportServiceImpl implements ReportService {
if(Math.abs(oldActualPower) <= 0 && Math.abs(oldOldActualPower) <= 0 ){
return;
}
double predictPlanPower = BigDecimal.valueOf((oldActualPower + oldOldActualPower) / 2).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
double predictPlanPower = BigDecimal.valueOf((oldActualPower + oldOldActualPower) / 2).setScale(2, RoundingMode.HALF_UP).doubleValue();
areaMonthReport.setPredictPlanPower(predictPlanPower);
}

Loading…
Cancel
Save