Browse Source

Merge branch 'prod-5.1.3' of http://175.6.40.68:8081/Jone/hzims-back into prod-5.1.3

zhongwei
wangyinsheng 2 months ago
parent
commit
d55b5e187e
  1. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java
  2. 8
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHistoryVo.java
  3. 30
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/entity/RunTemplateEntity.java
  4. 17
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunDeviceSignagesVo.java
  5. 20
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunParamSignageVo.java
  6. 21
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunParamVo.java
  7. 20
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunResultValueVo.java
  8. 33
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/StartStopTimeVO.java
  9. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/hydroelectric/constant/HydroelectricConstant.java
  10. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java
  11. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java
  12. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/FrameRecordEntity.java
  13. 39
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/controller/ElectricReportController.java
  14. 50
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/controller/RunTemplateController.java
  15. 11
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/mapper/RunTemplateMapper.java
  16. 5
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/mapper/RunTemplateMapper.xml
  17. 8
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/IElectricReportService.java
  18. 16
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/IRunTemplateService.java
  19. 802
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java
  20. 28
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/RunTemplateServiceImpl.java
  21. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/PlanGenertionClient.java
  22. 1
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml
  23. 20
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml
  24. 16
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  25. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java
  26. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  27. 8
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java
  28. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java
  29. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  30. 47
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/StartStopDurationServiceImpl.java
  31. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java
  32. 9
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java
  33. 24
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  34. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java
  35. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  36. 50
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java
  37. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationVideoTypeMapper.java

2
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java

@ -70,5 +70,5 @@ public interface AlarmConstants {
String FDP_INVALID_ZOME_STATUS = "1";
List<Integer> WHOLE_ALARM_TYPE = Arrays.asList(AlarmConstants.WARNING,AlarmConstants.FAULT,AlarmConstants.OFFSIDE,AlarmConstants.INTERRUPT,AlarmConstants.ABNORMAL,AlarmConstants.EARLY,AlarmConstants.START,AlarmConstants.STOP);
List<Integer> WHOLE_ALARM_TYPE = Arrays.asList(AlarmConstants.WARNING,AlarmConstants.FAULT,AlarmConstants.OFFSIDE,AlarmConstants.INTERRUPT,AlarmConstants.ABNORMAL,AlarmConstants.EARLY,AlarmConstants.ONE_LEVEL,AlarmConstants.TWO_LEVEL,AlarmConstants.THREE_LEVEL);
}

8
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHistoryVo.java

@ -23,17 +23,23 @@ public class AlarmHistoryVo {
@ApiModelProperty(value = "站点名称")
private String stationName;
@ApiModelProperty(value = "告警Id")
private String alarmId;
@ApiModelProperty(value = "告警类型")
private Integer alarmType;
@ApiModelProperty(value = "告警内容")
private String alarmContext;
@ApiModelProperty(value = "处理方式")
private Long handleWay;
@ApiModelProperty("处理人")
private Long handleUser;
@ApiModelProperty("处理人名称")
private Long handleUserName;
private String handleUserName;
@ApiModelProperty("处理附件地址")
private String filePath;

30
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/entity/RunTemplateEntity.java

@ -0,0 +1,30 @@
package com.hnac.hzims.electric.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* @author ysj
*/
@Data
@TableName("hzims_run_template")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "运行报表模板")
public class RunTemplateEntity extends TenantEntity {
@ApiModelProperty(value = "模板名称")
private String templateName;
@ApiModelProperty(value = "站点编码")
private String stationId;
@ApiModelProperty(value = "站点名称")
private String stationName;
@ApiModelProperty(value = "标识数据")
private String signages;
}

17
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunDeviceSignagesVo.java

@ -0,0 +1,17 @@
package com.hnac.hzims.electric.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
public class RunDeviceSignagesVo {
@ApiModelProperty(value = "属性标识")
private List<String> signages;
}

20
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunParamSignageVo.java

@ -0,0 +1,20 @@
package com.hnac.hzims.electric.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
public class RunParamSignageVo {
@ApiModelProperty(value = "属性标识")
private String signage;
@ApiModelProperty(value = "属性名称")
private String signagesName;
}

21
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunParamVo.java

@ -0,0 +1,21 @@
package com.hnac.hzims.electric.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author ysj
*/
@Data
public class RunParamVo {
@ApiModelProperty(value = "时间 :yyyy-MM-dd")
private String time;
@ApiModelProperty(value = "属性标识数组")
private List<RunParamSignageVo> signages;
}

20
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/RunResultValueVo.java

@ -0,0 +1,20 @@
package com.hnac.hzims.electric.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Map;
/**
* @author ysj
*/
@Data
public class RunResultValueVo {
@ApiModelProperty(value = "时间")
private String ts;
@ApiModelProperty(value = "值")
private String val;
}

33
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/StartStopTimeVO.java

@ -0,0 +1,33 @@
package com.hnac.hzims.equipment.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author ysj
*/
@Data
public class StartStopTimeVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备编号")
private String deviceCode;
@ApiModelProperty(value = "设备名称")
private String deviceName;
@ApiModelProperty(value = "属性标识")
private String signage;
@ApiModelProperty(value = "时间")
private String time;
@ApiModelProperty(value = "值")
private String value;
@ApiModelProperty(value = "质量值 : 0-有效 1-无效")
private Integer quality;
}

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/hydroelectric/constant/HydroelectricConstant.java

@ -15,4 +15,9 @@ public interface HydroelectricConstant {
* 代运维
*/
Integer PROXY_OPEARIONAL = 2;
/**
* 站点状态: 有效站点
*/
Integer INVALID_STATION = 2;
}

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java

@ -15,4 +15,6 @@ public interface ScheduledConstant {
String LOAD_THREE_YEAR_POWER_GENERATION = "loadThreeYearPowerGeneration";
String THIS_DAY_START_STOP_RECORD = "thisDayStartStopRecord";
String START_STOP_TIME_RECORD = "startStopTimeRecord";
}

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java

@ -40,12 +40,6 @@ public class HydropowerUnitTargetVo {
@ApiModelProperty(value = "昨日发电量")
private Float powerYesterDay;
@ApiModelProperty(value = "本次开机时间")
private String startDownTime;
@ApiModelProperty(value = "本次开机时长")
private Double startupDownDuration;
@ApiModelProperty(value = "年停机时长")
private Double shutDownDurationYear;

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/FrameRecordEntity.java

@ -31,4 +31,10 @@ public class FrameRecordEntity extends TenantEntity {
@ApiModelProperty("实时画面地址")
private String frameAddress;
@ApiModelProperty("区分站点V3、v4")
private String type;
@ApiModelProperty("画面来源: 0云组态 、1 hz3000v3.0、 2 hz3000v4.0")
private Integer picSource;
}

39
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/controller/ElectricReportController.java

@ -3,18 +3,15 @@ package com.hnac.hzims.electric.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.electric.service.IElectricReportService;
import com.hnac.hzims.electric.vo.ComprehensiveElectricVo;
import com.hnac.hzims.equipment.entity.EmAssociationEntity;
import com.hnac.hzims.electric.vo.RunParamVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@ -38,11 +35,37 @@ public class ElectricReportController extends BladeController {
return R.data(service.basics(deptId,type,time));
}
@GetMapping("/basics/export")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "基础报表导出", notes = "传入 deptId、year")
public void basicsExport(HttpServletResponse response,
@RequestParam(value = "deptId",required = false) Long deptId,
@RequestParam(value = "type") Long type,
@RequestParam(value = "time") String time) {
service.basicsExport(response,deptId,type,time);
}
@GetMapping("/comprehensive")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "综合报表", notes = "传入 deptId")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "综合报表", notes = "传入 deptId、year")
public R<List<ComprehensiveElectricVo>> comprehensive(@RequestParam(value = "deptId") Long deptId,
@RequestParam(value = "year") String year) {
return R.data(service.comprehensive(deptId,year));
}
@GetMapping("/comprehensive/export")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "综合报表导出", notes = "传入 deptId、year")
public void comprehensiveExport(HttpServletResponse response,
@RequestParam(value = "deptId") Long deptId,
@RequestParam(value = "year") String year) {
service.comprehensiveExport(response,deptId,year);
}
@PostMapping("/run")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "运行报表", notes = "传入 deptId、day")
public R<Map<String,Object>> run(@RequestBody RunParamVo param) {
return R.data(service.run(param));
}
}

50
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/controller/RunTemplateController.java

@ -0,0 +1,50 @@
package com.hnac.hzims.electric.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.electric.entity.RunTemplateEntity;
import com.hnac.hzims.electric.service.IRunTemplateService;
import com.hnac.hzims.history.vo.HistoryTemplateParamVo;
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.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
/**
* @author ysj
*/
@RestController
@AllArgsConstructor
@RequestMapping("/run/template")
@Api(tags = "电量报表")
public class RunTemplateController extends BladeController {
private final IRunTemplateService service;
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增历史数据模板", notes = "传入HistoryTemplateEntity")
public R save(@RequestBody RunTemplateEntity entity) {
return R.status(service.save(entity));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 10)
@ApiOperation(value = "删除历史数据模板")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.removeByIds(Func.toLongList(ids)));
}
@GetMapping("/pages")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "分页历史数据模板", notes = "查询条件:params、query")
public R<IPage<RunTemplateEntity>> pageCondition(HistoryTemplateParamVo params, Query query) {
return R.data(service.pageCondition(params, Condition.getPage(query)));
}
}

11
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/mapper/RunTemplateMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.electric.mapper;
import com.hnac.hzims.electric.entity.RunTemplateEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface RunTemplateMapper extends UserDataScopeBaseMapper<RunTemplateEntity> {
}

5
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/mapper/RunTemplateMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.electric.mapper.RunTemplateMapper" >
</mapper>

8
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/IElectricReportService.java

@ -1,7 +1,9 @@
package com.hnac.hzims.electric.service;
import com.hnac.hzims.electric.vo.ComprehensiveElectricVo;
import com.hnac.hzims.electric.vo.RunParamVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@ -13,5 +15,11 @@ public interface IElectricReportService {
Map<String, Object> basics(Long deptId, Long type,String time);
void basicsExport(HttpServletResponse response, Long deptId, Long type, String time);
List<ComprehensiveElectricVo> comprehensive(Long deptId,String year);
void comprehensiveExport(HttpServletResponse response, Long deptId, String year);
Map<String,Object> run(RunParamVo param);
}

16
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/IRunTemplateService.java

@ -0,0 +1,16 @@
package com.hnac.hzims.electric.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.electric.entity.RunTemplateEntity;
import com.hnac.hzims.history.entity.HistoryTemplateEntity;
import com.hnac.hzims.history.vo.HistoryTemplateParamVo;
/**
* @author ysj
*/
public interface IRunTemplateService extends IService<RunTemplateEntity> {
IPage<RunTemplateEntity> pageCondition(HistoryTemplateParamVo params, IPage<RunTemplateEntity> page);
}

802
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java

File diff suppressed because it is too large Load Diff

28
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/RunTemplateServiceImpl.java

@ -0,0 +1,28 @@
package com.hnac.hzims.electric.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.electric.entity.RunTemplateEntity;
import com.hnac.hzims.electric.mapper.RunTemplateMapper;
import com.hnac.hzims.electric.service.IRunTemplateService;
import com.hnac.hzims.history.vo.HistoryTemplateParamVo;
import org.springframework.stereotype.Service;
/**
* @author ysj
*/
@Service
public class RunTemplateServiceImpl extends ServiceImpl<RunTemplateMapper, RunTemplateEntity> implements IRunTemplateService {
/**
* 查询运行报表模板
* @param params
* @param page
* @return
*/
@Override
public IPage<RunTemplateEntity> pageCondition(HistoryTemplateParamVo params, IPage<RunTemplateEntity> page) {
return null;
}
}

7
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/PlanGenertionClient.java

@ -12,10 +12,7 @@ import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@ -112,7 +109,7 @@ public class PlanGenertionClient implements IPlanGenertionClient{
*/
@PostMapping(GET_POWER_YEAR)
@Override
public Double getPlanPowerYear(DevicePlanGenerationVo param) {
public Double getPlanPowerYear(@RequestBody DevicePlanGenerationVo param) {
return service.getPlanPowerYear(param.getStationIds(),param.getDate());
}

1
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml

@ -34,6 +34,7 @@
FROM HZIMS_ALARM_HANDLE HANDLER
<where>
HANDLER.IS_DELETED = 0
AND NOT HANDLER.ALARM_ID IS NULL
<if test="start != null and end != null">
AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end}
</if>

20
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml

@ -3,9 +3,8 @@
<mapper namespace="com.hnac.hzims.alarm.show.mapper.AlarmMapper">
<select id="pageCondition" resultType="com.hnac.hzims.alarm.config.vo.AlarmHistoryVo">
SELECT ALARM.STATION_ID,ALARM.STATION_NAME,ALARM.ALARM_TYPE,ALARM.ALARM_CONTEXT,
HANDLE.HANDLE_WAY,HANDLE.CREATE_USER HANDLE_USER,HANDLE.CREATE_USER_NAME HANDLE_USER_NAME,ALARM.ALARM_TIME,
HANDLE.CREATE_TIME HANDLE_TIME,HANDLE.FILE_PATH
SELECT ALARM.STATION_ID,ALARM.STATION_NAME,ALARM.ALARM_ID,ALARM.ALARM_TYPE,ALARM.ALARM_CONTEXT,
HANDLE.HANDLE_WAY,HANDLE.HANDLE_USER HANDLE_USER,ALARM.ALARM_TIME,HANDLE.CREATE_TIME HANDLE_TIME,HANDLE.FILE_PATH
FROM HZIMS_ALARM ALARM
LEFT JOIN HZIMS_ALARM_HANDLE HANDLE
ON ALARM.ALARM_ID = HANDLE.ALARM_ID
@ -20,12 +19,21 @@
<if test="param.endTime != null and param.endTime != ''">
AND ALARM.ALARM_TIME &lt;= #{param.endTime}
</if>
<if test="param.alarmType != null and param.alarmType != ''">
AND ALARM.ALARM_TYPE = #{param.alarmType}
</if>
<if test="param.handleWay != null and param.handleWay != ''">
AND HANDLE.HANDLE_WAY = #{param.handleWay}
</if>
<choose>
<when test="param.alarmType != null and param.alarmType != '' and param.alarmType == 60">
AND ALARM.ALARM_SIGNAGE in ('plc_remote_power','plc_generation_order')
</when>
<when test="param.alarmType != null and param.alarmType != '' and param.alarmType == 61">
AND ALARM.ALARM_SIGNAGE in ('plc_remote_shutdown','plc_shutdown_order','plc_emergency_stop','plc_urgent_shutdown')
</when>
<when test="param.alarmType != null and param.alarmType != ''">
AND ALARM.ALARM_TYPE = #{param.alarmType}
</when>
</choose>
</where>
ORDER BY ALARM.ALARM_TIME DESC
</select>
</mapper>

16
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java

@ -41,6 +41,9 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.message.fegin.IMessageClient;
import org.springblade.system.cache.DictCache;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -553,6 +556,17 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, AlarmEntity> impl
*/
@Override
public IPage<AlarmHistoryVo> pageCondition(AlarmHistoryParamVo param, IPage<AlarmHistoryVo> page) {
return this.baseMapper.pageCondition(param,page);
IPage<AlarmHistoryVo> iPage = this.baseMapper.pageCondition(param,page);
if(CollectionUtil.isNotEmpty(iPage.getRecords())){
iPage.setRecords(iPage.getRecords().stream().peek(record->{
if(ObjectUtil.isNotEmpty(record.getHandleUser())){
User user = UserCache.getUser(record.getHandleUser());
if(ObjectUtil.isNotEmpty(user)){
record.setHandleUserName(user.getRealName());
}
}
}).collect(Collectors.toList()));
}
return iPage;
}
}

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java

@ -80,7 +80,7 @@ public class GenerationScheduledTask {
* @return
*/
//@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION)
@Scheduled(cron = "0 0 1 * * ? ")
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadThreeYearPowerGeneration() {
String param = "";
if (Func.isBlank(param)) {

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

@ -62,7 +62,7 @@ public class RealTargetScheduledTask {
* 水电站-机组指标加载
*/
//@XxlJob(LOAD_HYDROPOWER_UNIT_TARGET)
@Scheduled(cron = "0 0/2 * * * ? ")
@Scheduled(cron = "0 0/3 * * * ? ")
public ReturnT<String> loadHydropowerTarget() {
String param = "";
if (Func.isBlank(param)) {
@ -114,7 +114,7 @@ public class RealTargetScheduledTask {
* 水利-站点水位数据
*/
//@XxlJob(LOAD_WATER_LEVEL)
@Scheduled(cron = "0/40 * * * * ? ")
@Scheduled(cron = "0 0/5 * * * ? ")
public ReturnT<String> loadWaterLevel() {
String param = "";
if (Func.isBlank(param)) {

8
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.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;
@ -41,9 +42,10 @@ public class ShowScheduledTask {
/**
* 首页-区域班组数据
*/
@XxlJob(REGIONAL_DUTY_INFO)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRegionalDuty(String param) {
// @XxlJob(REGIONAL_DUTY_INFO)
@Scheduled(cron = "0 0/5 * * * ? ")
public ReturnT<String> loadRegionalDuty() {
String param = "";
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java

@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
import java.util.Date;
//import static com.hnac.hzims.operational.main.constant.ScheduledConstant.START_STOP_TIME_RECORD;
import static com.hnac.hzims.operational.main.constant.ScheduledConstant.START_STOP_TIME_RECORD;
import static com.hnac.hzims.operational.main.constant.ScheduledConstant.THIS_DAY_START_STOP_RECORD;
@ -45,7 +45,7 @@ public class StartStopScheduledTask {
* 设备开停机时间记录
*/
//@XxlJob(START_STOP_TIME_RECORD)
//@Scheduled(cron = "0/40 * * * * ? ")
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> startStopTimeRecord() {
String param = "";
if (Func.isBlank(param)) {

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -200,6 +200,7 @@ public class AlarmServiceImpl implements AlarmService {
public void interruption(String param) {
// 查询接入站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getType,0)
.eq(StationEntity::getDataOrigin,"0")
);
if(CollectionUtil.isEmpty(stations)){

47
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/StartStopDurationServiceImpl.java

@ -6,17 +6,22 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.equipment.entity.StartStopDurationEntity;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.equipment.vo.StartStopTimeVO;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.vo.StartStopDurationRecordVo;
import com.hnac.hzims.scheduled.mapper.equipment.StartStopDurationMapper;
import com.hnac.hzims.scheduled.service.equipment.StartStopDurationService;
import com.hnac.hzims.scheduled.service.operation.plate.DataService;
import com.hnac.hzims.scheduled.service.operation.station.StationService;
import com.hnac.hzinfo.datasearch.PointData;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient;
import com.hnac.hzinfo.datasearch.history.OriginalDataQuery;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
@ -55,6 +60,8 @@ import java.util.stream.Collectors;
@DS("equipment")
public class StartStopDurationServiceImpl extends ServiceImpl<StartStopDurationMapper, StartStopDurationEntity> implements StartStopDurationService {
private final DataService dataService;
private final StationService stationService;
private final DeviceDataClient deviceDataClient;
@ -64,6 +71,8 @@ public class StartStopDurationServiceImpl extends ServiceImpl<StartStopDurationM
@Value("${hzims.equipment.emInfo.emInfoList}")
public String device_cache_cofig_final;
private final static String START_STOP_TIME_KEY = "hzims:operation:start:stop:key";
private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("device-start-stop-duration-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy());
/**
@ -154,7 +163,45 @@ public class StartStopDurationServiceImpl extends ServiceImpl<StartStopDurationM
*/
@Override
public void startStopTimeRecord(String param) {
// 获取所有设备
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {});
if(CollectionUtil.isEmpty(devices)){
return;
}
// 获取历史开关机状态记录
List<StartStopTimeVO> startStopTimes = (List<StartStopTimeVO>) redisTemplate.opsForValue().get(START_STOP_TIME_KEY);
// 遍历设备
redisTemplate.opsForValue().set(START_STOP_TIME_KEY,devices.stream().map(device->{
StartStopTimeVO startStopTime = new StartStopTimeVO();
startStopTime.setDeviceCode(device.getEmCode());
startStopTime.setDeviceName(device.getName());
startStopTime.setSignage(HomePageConstant.START_STOP_STATUS);
if(MapUtils.isEmpty(device.getPoint()) || !device.getPoint().containsKey(HomePageConstant.START_STOP_STATUS)){
startStopTime.setQuality(-1);
}
// 调用fegin接口查询实时数据
List<FieldsData> fields = dataService.getRealDataByAnalyzeCode(device.getEmCode(),Collections.singletonList(HomePageConstant.START_STOP_STATUS));
if(CollectionUtil.isEmpty(fields) || fields.get(0).getQ() != 0){
startStopTime.setQuality(-1);
return startStopTime;
}
// 有效开关机点位比较value差异
if(CollectionUtil.isNotEmpty(startStopTimes)){
// 寻找设备上次记录值
Optional<StartStopTimeVO> optional = startStopTimes.stream().filter(o->o.getDeviceCode().equals(device.getEmCode())).findFirst();
if(optional.isPresent() && StringUtils.isNotEmpty(optional.get().getValue()) && optional.get().getValue().equals(fields.get(0).getValue())){
startStopTime.setValue(optional.get().getValue());
startStopTime.setTime(optional.get().getTime());
startStopTime.setQuality(optional.get().getQuality());
return startStopTime;
}
}
startStopTime.setTime(fields.get(0).getTime());
startStopTime.setValue(fields.get(0).getValue());
startStopTime.setQuality(fields.get(0).getQ());
return startStopTime;
}).collect(Collectors.toList()));
}
/**

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java

@ -118,7 +118,7 @@ public class PhenomenonServiceImpl extends ServiceImpl<PhenomenonMapper, OperPhe
}
// 消缺数
shortagesVo.setShortagesSum(defects.size());
List<Long> shortagesList = defects.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())).map(OperPhenomenonEntity::getId).collect(Collectors.toList());
List<Long> shortagesList = defects.stream().filter(defect-> "流程结束".equals(defect.getCurrentOperator())).map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(shortagesList)){
shortagesVo.setShortages(0);
}

9
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java

@ -105,7 +105,9 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
public void thisDayPowerGeneration(String param) {
String month = DateUtil.format(new Date(),DateUtil.PATTERN_DATE);
// 步骤1.水电、光伏站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery().in(StationEntity::getType, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC)));
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery().
in(StationEntity::getType, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC))
);
// 步骤2.缓存设备信息
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {});
@ -273,6 +275,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
generate.setStrMonth(strMonth);
generate.setMonth(date.getMonth() + 1);
generate.setGenerate(BigDecimal.valueOf(thirtyGenerationEntities.stream().mapToDouble(o -> o.getGenerate().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
generate.setReactiveGenerate(BigDecimal.valueOf(thirtyGenerationEntities.stream().mapToDouble(o -> o.getReactiveGenerate().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
return generate;
}).collect(Collectors.toList()));
}
@ -500,9 +503,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
}else{
generation.setGenerate(BigDecimal.valueOf(Double.parseDouble(power.getPower().toString())).setScale(2, RoundingMode.HALF_UP));
}
generation.setReactiveGenerate(BigDecimal.ZERO
);
generation.setReactiveGenerate(BigDecimal.ZERO);
return generation;
}).collect(Collectors.toList());
}

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

@ -297,7 +297,6 @@ public class RealTargetServiceImpl implements RealTargetService {
// 今年已经过去多少个小时了
double hoursPassed = this.hoursPassed();
Random random = new Random();
if(CollectionUtil.isNotEmpty(devices)){
CountDownLatch countDownLatch = new CountDownLatch(devices.size());
for(EminfoAndEmParamVo device : devices) {
@ -330,22 +329,16 @@ public class RealTargetServiceImpl implements RealTargetService {
.eq(StartStopDurationEntity::getDeviceCode,device.getEmCode())
);
if(CollectionUtil.isEmpty(durations)){
target.setStartupDurationYear(0.0);
target.setShutDownDurationYear(hoursPassed);
target.setStartupDurationYear(-1.0);
target.setShutDownDurationYear(-1.0);
}else{
target.setStartupDurationYear(durations.stream().mapToDouble(StartStopDurationEntity::getStartDuration).sum());
target.setShutDownDurationYear(durations.stream().mapToDouble(StartStopDurationEntity::getStopDuration).sum());
}
}else{
target.setStartupDurationYear(0.0);
target.setShutDownDurationYear(hoursPassed);
target.setStartupDurationYear(-1.0);
target.setShutDownDurationYear(-1.0);
}
// FIXME 本次开机/停机时间
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MINUTE,random.nextInt(1440));
target.setStartDownTime(DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME));
// FIXME 本次开/停机时长
target.setStartupDownDuration(random.nextDouble() * 24);
targets.add(target);
countDownLatch.countDown();
}catch (Exception exception){
@ -1256,10 +1249,7 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return
*/
private double getWaterLevel(String instanceCode, String signage) {
RealDataSearchPO realData = new RealDataSearchPO();
realData.setAnalyzeCode(instanceCode);
List<String> signages = Collections.singletonList(signage);
realData.setSignages(signages);
// 调用fegin接口查询实时数据
List<FieldsData> fields = dataService.getRealDataByAnalyzeCode(instanceCode,signages);
if(CollectionUtil.isEmpty(fields)){
@ -1559,7 +1549,7 @@ public class RealTargetServiceImpl implements RealTargetService {
calendar.add(Calendar.HOUR_OF_DAY,-23);
// 开始日期
Date start = calendar.getTime();
List<AnalyseDataTaosVO> records = dataService.periodTargetData(DateUtil.format(start,"yyyy-MM-dd HH") + ":00:00", DateUtil.format(start,"yyyy-MM-dd HH") + ":59:59", 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
List<AnalyseDataTaosVO> records = dataService.periodTargetData(DateUtil.format(start,"yyyy-MM-dd HH") + ":00:00", DateUtil.format(end,"yyyy-MM-dd HH") + ":59:59", 3, 2, device.getEmCode(), HomePageConstant.HYDROPOWER_ACTIVE_POWER);
List<ActivePowerVo> activePowers = new ArrayList<>();
while (start.compareTo(end) <= 0){
String time = DateUtil.format(start,"yyyy-MM-dd HH");
@ -1667,6 +1657,10 @@ public class RealTargetServiceImpl implements RealTargetService {
target.setPowerDay(generateService.generate(day,station.getCode()));
// 昨日发电量
target.setPowerYesterDay(0f);
// 开机时长
target.setStartupDurationYear(-1.0);
// 关机时长
target.setShutDownDurationYear(-1.0);
// 30天发电量
target.setGenerationPowerVoList(generateService.generate30Day(day,station.getCode()));
return target;

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java

@ -137,7 +137,7 @@ public class TargetController {
public R<IPage<DeviceClassifyVo>> deviceClassify(Query query,
@RequestParam(value = "stationName",required = false) String stationName,
@RequestParam(value = "deptId",required = false) Long deptId,
@RequestParam(value="status")Integer status) {
@RequestParam(value="status",required = false)Integer status) {
return R.data(service.deviceClassify(Condition.getPage(query),stationName,deptId,status));
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -1186,7 +1186,7 @@ public class TargetServiceImpl implements TargetService {
le(OperPhenomenonEntity::getCreateTime,business.getEndTime());
}
if(!StringUtil.isBlank(business.getType()) && "1".equals(business.getType())){
isNotNull(OperPhenomenonEntity::getHandleTaskId);
eq(OperPhenomenonEntity::getCurrentOperator,"流程结束");
}
if(!StringUtil.isBlank(business.getDeptIds())){
in(OperPhenomenonEntity::getCreateDept, Func.toLongList(",",business.getDeptIds()));

50
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

@ -9,6 +9,7 @@ import com.hnac.hzims.equipment.feign.IPlanGenertionClient;
import com.hnac.hzims.equipment.vo.DevicePlanGenerationVo;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.equipment.vo.PlanPowerYearVo;
import com.hnac.hzims.equipment.vo.StartStopTimeVO;
import com.hnac.hzims.hzimsweather.feign.IRainfallClient;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse;
@ -66,6 +67,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
private final static String LOADWATER_LEVEL_KEY = "hzims:operation:loadwater:level:key";
private final static String RECENT_YEAR_POWER_DATA = "hzims:operation:key:power:data";
private final static String START_STOP_TIME_KEY = "hzims:operation:start:stop:key";
private final static String LOAD_HYDROPOWER_REAL_KEY = "hzims:operation:loadhydropowerunit:real:key";
private final static String LOAD_HYDROPOWER_TARGET_KEY = "hzims:operation:loadhydropowerunit:target:key";
private final static String DEVICE_CACHE_COFIG_FINAL = "hzims:equipment:emInfo:deviceCode.emInfoList";
@ -99,6 +101,8 @@ public class HydroelectricServiceImpl implements HydroelectricService {
List<PlanPowerYearVo> plans = planClient.getPlanPowerByYear(station.getCode(), Integer.parseInt(DateUtil.format(new Date(),"yyyy")));
// 水位数据
List<WaterLevelVo> waterLevels = (List<WaterLevelVo>) redisTemplate.opsForValue().get(LOADWATER_LEVEL_KEY);
// 设备开停机
List<StartStopTimeVO> startStopTimes = (List<StartStopTimeVO>) redisTemplate.opsForValue().get(START_STOP_TIME_KEY);
// 步骤3.数据处理、赋值
HydroelectricStationVo result = new HydroelectricStationVo();
@ -147,8 +151,6 @@ public class HydroelectricServiceImpl implements HydroelectricService {
device.setPowerYear(target.get().getPowerYear());
device.setPowerYesterYear(target.get().getPowerYesterYear());
device.setPowerMon(target.get().getPowerMon());
device.setStartDownTime(target.get().getStartDownTime());
device.setStartupDownDuration(target.get().getStartupDownDuration());
device.setStartupDurationYear(target.get().getStartupDurationYear());
device.setShutDownDurationYear(target.get().getShutDownDurationYear());
if(CollectionUtil.isNotEmpty(target.get().getActivePowerVoList())){
@ -157,6 +159,34 @@ public class HydroelectricServiceImpl implements HydroelectricService {
if(CollectionUtil.isNotEmpty(target.get().getActivePowerVoList())){
device.setGenerates(target.get().getGenerationPowerVoList().stream().map(o-> BeanUtil.copy(o, HydroelectricDeviceGenerateVo.class)).collect(Collectors.toList()));
}
}else{
device.setPowerDay(0f);
device.setPowerYesterDay(0f);
device.setPowerYear(0f);
device.setPowerYesterYear(0f);
device.setPowerMon(0f);
device.setStartupDurationYear(-1.0);
device.setShutDownDurationYear(-1.0);
}
// 开停机数据
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst();
if(startStop.isPresent()){
if(startStop.get().getQuality() == 0){
Date time;
if(startStop.get().getTime().contains(".000")){
time = DateUtil.parse(startStop.get().getTime(), "yyyy-MM-dd HH:mm:ss.sss");
}else{
time = DateUtil.parse(startStop.get().getTime(), DateUtil.PATTERN_DATETIME);
}
device.setStartDownTime(DateUtil.format(time,DateUtil.PATTERN_DATETIME));
device.setStartupDownDuration(BigDecimal.valueOf((System.currentTimeMillis() - time.getTime()) / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue());
}else{
device.setStartDownTime("-1");
device.setStartupDownDuration(-1.0);
}
}else{
device.setStartDownTime("-1");
device.setStartupDownDuration(-1.0);
}
return device;
}).collect(Collectors.toList()));
@ -177,7 +207,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
}else{
result.setPowerMonPlan(0.0);
}
result.setPowerMon(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerMon).sum());
result.setPowerMon(targets.stream().filter(o->o.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum());
if(result.getPowerMonPlan() <= 0 || result.getPowerMon() <= 0){
result.setPowerRateMon(0.0);
}else{
@ -190,7 +220,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
}else{
result.setPowerYearPlan(0.0);
}
result.setPowerYear(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerYear).sum());
result.setPowerYear(targets.stream().filter(o->ObjectUtil.isNotEmpty(o.getPowerYear()) && o.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum());
if(result.getPowerYearPlan() <= 0 || result.getPowerYear() <= 0){
result.setPowerRateYear(0.0);
}else{
@ -198,11 +228,12 @@ public class HydroelectricServiceImpl implements HydroelectricService {
}
// 今日发电量、昨日发电量
result.setPowerDay(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerDay).sum());
result.setPowerYesterDay(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerYesterDay).sum());
result.setPowerDay(result.getDevices().stream().filter(o->ObjectUtil.isNotEmpty(o.getPowerDay())).mapToDouble(HydroelectricDeviceVo::getPowerDay).sum());
result.setPowerYesterDay(result.getDevices().stream().filter(o->ObjectUtil.isNotEmpty(o.getPowerYesterDay())).mapToDouble(HydroelectricDeviceVo::getPowerYesterDay).sum());
}
// 站点水位
result.setWater(this.water(waterLevels,station.getCode()));
// 近30日降雨量/发电量
//result.setPowerRains(this.stationPowerRains(result.getDevices(),rains));
// 近24小时总有功率/水位
@ -304,6 +335,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
// 查询用户当前权限站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.ne(StationEntity::getStatus,HydroelectricConstant.INVALID_STATION)
.eq(StationEntity::getServeType,HydroelectricConstant.PROXY_OPEARIONAL)
.eq(StationEntity::getType,HydroelectricConstant.HYDROPOWER)
);
@ -338,6 +370,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
List<Long> refDepts = stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList());
// 站点数量
group.setCount(stations.size());
group.setGeneratePlanYear(plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum());
// 实时数据
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_REAL_KEY);
if (CollectionUtil.isNotEmpty(reals)) {
@ -372,10 +405,6 @@ public class HydroelectricServiceImpl implements HydroelectricService {
// 日发电量
group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量
DevicePlanGenerationVo planParam = new DevicePlanGenerationVo();
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
param.setDate(DateUtil.format(new Date(),"yyyy"));
group.setGeneratePlanYear(planClient.getPlanPowerYear(planParam));
if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){
group.setGenerateRate(0.0);
}else{
@ -703,6 +732,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
return new ArrayList<>();
}
return stationService.list(Wrappers.<StationEntity>lambdaQuery()
.ne(StationEntity::getStatus,HydroelectricConstant.INVALID_STATION)
.eq(StationEntity::getType, HydroelectricConstant.HYDROPOWER)
.eq(StationEntity::getServeType,HydroelectricConstant.PROXY_OPEARIONAL)
.in(StationEntity::getRefDept,deptIds)

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationVideoTypeMapper.java

@ -1,11 +1,8 @@
package com.hnac.hzims.operational.station.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity;
import com.hnac.hzims.operational.station.vo.StationVideoTypeVO;
@ -14,7 +11,6 @@ import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.sql.Wrapper;
import java.util.List;
import java.util.Map;

Loading…
Cancel
Save