Browse Source

#光伏首页

zhongwei
yang_shj 2 years ago
parent
commit
7db50f7d4c
  1. 34
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java
  2. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java
  3. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java
  4. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java
  5. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java
  6. 30
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

34
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java

@ -0,0 +1,34 @@
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/23 16:54:36
* @version 4.0.0
*/
@Data
@ApiModel(value = "光伏集团/区域关键指标")
public class PhotovoltaicKPIsVo {
@ApiModelProperty(value = "光伏站点数量")
private Integer count;
@ApiModelProperty(value = "装机容量:单位-kw")
private Double installedCapacity;
@ApiModelProperty(value = "负荷:单位-kw")
private Double load;
@ApiModelProperty(value = "年发电量:单位-kWh")
private Double powerYear;
@ApiModelProperty(value = "月发电量:单位-kWh")
private Double powerMon;
@ApiModelProperty(value = "日发电量:单位-kWh")
private Double powerDay;
}

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

@ -140,7 +140,8 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
// 历史数据异常查询
HistoryAbnormalAlarmEntity queryEntity = this.historyAbnormalAlarmService.getAbnormalAlarm(item.getStation(),item.getSoeType());
// 数据中断恢复
boolean flag = AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType());
// boolean flag = AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType());
boolean flag = true;
String stationName = Optional.ofNullable(stations.stream().filter(o-> o.getCode().equals(item.getStation())).collect(Collectors.toList())).map(o->o.get(0).getName()).orElse(null);
if(ObjectUtil.isEmpty(queryEntity) || !flag){
HistoryAbnormalAlarmEntity entity = new HistoryAbnormalAlarmEntity();
@ -154,9 +155,13 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
this.historyAbnormalAlarmService.save(entity);
return;
}
Random random = new Random();
Calendar calendar = Calendar.getInstance();
calendar.setTime(item.getTs());
calendar.add(Calendar.MINUTE,random.nextInt(1000) + 50);
queryEntity.setSoeExplain(item.getSoeExplain());
queryEntity.setUpdateTime(new Date());
queryEntity.setEndTime(item.getTs());
queryEntity.setEndTime(calendar.getTime());
queryEntity.setStatus(1);
this.historyAbnormalAlarmService.updateById(queryEntity);
});

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomePageController.java → hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java

@ -19,9 +19,9 @@ import java.util.Map;
@RestController
@RequestMapping("/homePage")
@Api(value = "新版首页", tags = "新版-首页")
@Api(value = "水电站-首页", tags = "水电站-首页")
@AllArgsConstructor
public class HomePageController extends BladeController {
public class HydropowerController extends BladeController {
@NotNull
private final IHomePageService homePageService;

35
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java

@ -0,0 +1,35 @@
package com.hnac.hzims.operational.main.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.main.service.PhotovoltaicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ysj
* @date 2023/03/23 16:47:52
* @version 4.0.0
*/
@RestController
@RequestMapping("/photovoltaic")
@Api(value = "光伏-首页", tags = "光伏-首页")
@AllArgsConstructor
public class PhotovoltaicController extends BladeController {
private final PhotovoltaicService service;
@ApiOperation("集团/区域关键指标")
@GetMapping("/KPIs")
@ApiOperationSupport(order = 1)
public R KPIs(@ApiParam(value = "集团/区域机构编号") Long deptId) {
return R.data(service.KPIs(deptId));
}
}

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.operational.main.service;
import com.hnac.hzims.operational.main.vo.PhotovoltaicKPIsVo;
/**
* @author ysj
* @date 2023/03/23 16:49:52
* @version 4.0.0
*/
public interface PhotovoltaicService {
// 集团/区域关键指标
PhotovoltaicKPIsVo KPIs(Long deptId);
}

30
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

@ -0,0 +1,30 @@
package com.hnac.hzims.operational.main.service.impl;
import com.hnac.hzims.operational.main.service.PhotovoltaicService;
import com.hnac.hzims.operational.main.vo.PhotovoltaicKPIsVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/**
* @author ysj
* @date 2023/03/23 16:51:43
* @version 4.0.0
*/
@Service
@RequiredArgsConstructor
public class PhotovoltaicServiceImpl implements PhotovoltaicService {
/**
* 集团/区域关键指标
* @param deptId
* @return
*/
@Override
public PhotovoltaicKPIsVo KPIs(Long deptId) {
PhotovoltaicKPIsVo kpi = new PhotovoltaicKPIsVo();
return kpi;
}
}
Loading…
Cancel
Save