Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
880501eff8
  1. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java
  2. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/GenerationPowerVo.java
  3. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/GenerationVo.java
  4. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceStateVo.java
  5. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceVo.java
  6. 31
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicLoadGenerateVo.java
  7. 31
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicLoadVo.java
  8. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicPowerVo.java
  9. 75
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationAppVo.java
  10. 91
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateAppVo.java
  11. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateVo.java
  12. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/mybatisplus/CodeGenerator.java
  13. 29
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/SysLogConfig.java
  14. 21
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java
  15. 70
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java
  16. 1
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java
  17. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/StatisticsMapper.java
  18. 5
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/xml/StatisticsMapper.xml
  19. 20
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/StatisticsService.java
  20. 34
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  21. 31
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/task/SyslogTimerTask.java
  22. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  23. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  24. 30
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java
  25. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java
  26. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IAnalyseDataService.java
  27. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java
  28. 99
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java
  29. 71
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java
  30. 772
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java
  31. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java
  32. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WebHomeServiceImpl.java
  33. 41
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  34. 16
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java
  35. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketInfoMapper.java
  36. 14
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/WorkTicketInfoService.java
  37. 21
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  38. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketInfoServiceImpl.java

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java

@ -61,7 +61,8 @@ public interface HomePageConstant {
List<String> SIGNAGES = Arrays.asList(HomePageConstant.JOINT_RELAY,HomePageConstant.SWITCH_ON_OFF,HomePageConstant.ELECTRICITY_CONSUMPTION, List<String> SIGNAGES = Arrays.asList(HomePageConstant.JOINT_RELAY,HomePageConstant.SWITCH_ON_OFF,HomePageConstant.ELECTRICITY_CONSUMPTION,
HomePageConstant.ACTIVE_POWER,HomePageConstant.REACTIVE_POWER,HomePageConstant.POWER_FACTOR,HomePageConstant.VOLTAGE,HomePageConstant.CURRENT, HomePageConstant.ACTIVE_POWER,HomePageConstant.REACTIVE_POWER,HomePageConstant.POWER_FACTOR,HomePageConstant.VOLTAGE,HomePageConstant.CURRENT,
HomePageConstant.HYDROPOWER_GENERATE_POWER,HomePageConstant.HYDROPOWER_POWERFACTOR,HomePageConstant.HYDROPOWER_FREQUENCY,HomePageConstant.HYDROPOWER_GUIDEOPEN, HomePageConstant.HYDROPOWER_GENERATE_POWER,HomePageConstant.HYDROPOWER_POWERFACTOR,HomePageConstant.HYDROPOWER_FREQUENCY,HomePageConstant.HYDROPOWER_GUIDEOPEN,
HomePageConstant.HYDROPOWER_VOLTAGE,HomePageConstant.HYDROPOWER_CURRENT,HomePageConstant.UNIT_SPEED,HomePageConstant.ACTIVE_POWER_GIVEN,HomePageConstant.REACTIVE_POWER_GIVEN); HomePageConstant.HYDROPOWER_VOLTAGE,HomePageConstant.HYDROPOWER_CURRENT,HomePageConstant.UNIT_SPEED,HomePageConstant.ACTIVE_POWER_GIVEN,HomePageConstant.REACTIVE_POWER_GIVEN,
HomePageConstant.PV_GENERATION_DAY);
/** /**
* 站点类型 运维服务 * 站点类型 运维服务
@ -168,16 +169,26 @@ public interface HomePageConstant {
String P_ATTRIBUTES = "P"; String P_ATTRIBUTES = "P";
/*==========================================================================================*/ /*==========================================================================================*/
// 光伏电站-电表-物模型监测点标识 // 光伏电站-电表-物模型监测点标识
/**开关机状态**/
String PV_JOINT_RELAY = "joint_relay";
/**总有功电度**/ /**总有功电度**/
String PV_GENERATION_CAPACITY = "generation_capacity"; String PV_GENERATION_CAPACITY = "generation_capacity";
/**日发电量**/
String PV_GENERATION_DAY = "generate_day";
/**有功功率**/
String PV_LOAD = "active_power";
/**正向无功**/ /**正向无功**/
String PV_REACTIVE_POWER = "reactive_power"; String PV_REACTIVE_POWER = "reactive_power";
/**遥信1**/ /**电压**/
String PV_JOINT_RELAY = "joint_relay"; String PV_VOLTAGE = "voltage";
/**电流**/
String PV_CURRENT = "current";
/*==========================================================================================*/ /*==========================================================================================*/
// 光伏指标属性 // 光伏指标属性
String PHOTOVOLTAIC_GENERATE = "generation_capacity"; // 发电量 String PHOTOVOLTAIC_OFF = "1.0"; // 开机
String PHOTOVOLTAIC_LOAD = "active_power"; // 功率
String PHOTOVOLTAIC_LOAD_TARGET = "0";
/*==========================================================================================*/ /*==========================================================================================*/
// 水电集团、区域指标关联 // 水电集团、区域指标关联
/**功率**/ /**功率**/

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/GenerationPowerVo.java

@ -12,5 +12,8 @@ public class GenerationPowerVo {
private String date; private String date;
@ApiModelProperty(value = "发电量") @ApiModelProperty(value = "发电量")
private Float generationPower; private Float generate;
@ApiModelProperty(value = "功率·")
private Float load;
} }

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/GenerationVo.java

@ -17,6 +17,6 @@ public class GenerationVo {
@ApiModelProperty(value = "周期") @ApiModelProperty(value = "周期")
private String period; private String period;
@ApiModelProperty(value = "发电量") @ApiModelProperty(value = "发电量")
private Float power; private Float power;
} }

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceStateVo.java

@ -0,0 +1,21 @@
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/04/03 16:57:22
* @version 4.0.0
*/
@Data
@ApiModel(value = "光伏站点设备状态对象")
public class PhotovoltaicDeviceStateVo {
@ApiModelProperty(value = "设备装态 : 0 - 离线 1 - 在线 2 - 故障")
private Integer state;
@ApiModelProperty(value = "数量")
private Integer count;
}

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceVo.java

@ -75,6 +75,11 @@ public class PhotovoltaicDeviceVo {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Double tec; private Double tec;
@ApiModelProperty(value = "减少森林砍伐:1kwh = 0.000553")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double deforest;
@ApiModelProperty(value = "收益: 元") @ApiModelProperty(value = "收益: 元")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Double income; private Double income;

31
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicLoadGenerateVo.java

@ -0,0 +1,31 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ysj
* @date 2023/03/29 15:14:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "水利站点首页对象")
public class PhotovoltaicLoadGenerateVo {
@ApiModelProperty(value = "周期")
private String period;
@ApiModelProperty(value = "数据值")
private Float value;
}

31
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicLoadVo.java

@ -0,0 +1,31 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/04/04 09:28:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "发电量数据")
public class PhotovoltaicLoadVo {
@ApiModelProperty(value = "机构ID")
private Long deptId;
@ApiModelProperty(value = "站点编码")
private String code;
@ApiModelProperty(value = "站点名称")
private String name;
@ApiModelProperty(value = "实时功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
}

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicPowerVo.java

@ -10,7 +10,7 @@ import lombok.Data;
public class PhotovoltaicPowerVo { public class PhotovoltaicPowerVo {
@ApiModelProperty(value = "小时") @ApiModelProperty(value = "小时")
private String hour; private Integer hour;
@ApiModelProperty(value = "有功功率") @ApiModelProperty(value = "有功功率")
private String activePower; private String activePower;

75
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationAppVo.java

@ -0,0 +1,75 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import com.hnac.hzims.hzimsweather.response.weather.Now;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ysj
* @date 2023/03/29 15:14:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "光伏站点首页对象")
public class PhotovoltaicStationAppVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "站点编码")
private String stationCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "总发电负荷")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "日发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "月发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateMon;
@ApiModelProperty(value = "总发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "天气")
private Now now;
@ApiModelProperty(value = "站点收益")
private Double income;
@ApiModelProperty(value = "co2减排: kg")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double co2;
@ApiModelProperty(value = "节约标准煤减排: kt")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double tec;
@ApiModelProperty(value = "减少森林砍伐:1kwh = 0.000553")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double deforest;
@ApiModelProperty(value = "减少森林砍伐:1kwh = 0.000553")
@JsonSerialize(nullsUsing = NullSerializer.class)
private List<PhotovoltaicDeviceStateVo> deviceState;
}

91
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateAppVo.java

@ -0,0 +1,91 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Now;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
* @date 2023/03/24 09:58:57
* @version 4.0.0
*/
@Data
@ApiModel(value = "发电量数据")
public class PhotovoltaicSubordinateAppVo {
@ApiModelProperty(value = "机构ID")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "天气")
private Now now;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "容量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "今日发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "实时功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "站点实时功率列表")
private List<PhotovoltaicLoadVo> stationLoads;
@ApiModelProperty(value = "日常任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer maintenanceCount;
@ApiModelProperty(value = "日常任务完成数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer maintenanceFinishCount;
@ApiModelProperty(value = "缺陷任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer defectCount;
@ApiModelProperty(value = "缺陷任务完成数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer defectFinishCount;
@ApiModelProperty(value = "检修任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer overhaulCount;
@ApiModelProperty(value = "检修任务完成数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer overhaulFinishCount;
@ApiModelProperty(value = "操作票任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer operateCount;
@ApiModelProperty(value = "操作票任务完成数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer operateFinishCount;
@ApiModelProperty(value = "操作票任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer workCount;
@ApiModelProperty(value = "操作票任务完成数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer workFinishCount;
@ApiModelProperty(value = "排序")
private Integer sort;
}

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/SubordinateVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateVo.java

@ -17,7 +17,7 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel(value = "发电量数据") @ApiModel(value = "发电量数据")
public class SubordinateVo { public class PhotovoltaicSubordinateVo {
@ApiModelProperty(value = "机构ID") @ApiModelProperty(value = "机构ID")
private Long deptId; private Long deptId;

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/mybatisplus/CodeGenerator.java

@ -92,7 +92,7 @@ public class CodeGenerator {
// strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!"); // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// 写于父类中的公共字段 // 写于父类中的公共字段
// strategy.setSuperEntityColumns("id"); // strategy.setSuperEntityColumns("id");
strategy.setInclude("hzims_sys_log"); strategy.setInclude("hzims_statistics");
strategy.setControllerMappingHyphenStyle(true); strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix("hzims_"); strategy.setTablePrefix("hzims_");
mpg.setStrategy(strategy); mpg.setStrategy(strategy);

29
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/SysLogConfig.java

@ -0,0 +1,29 @@
package com.hnac.hzims.middle.systemlog.config;
import com.hnac.hzims.middle.systemlog.task.SyslogTimerTask;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Timer;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/8 14:15
*/
@Configuration
public class SysLogConfig {
@Bean
public void syslogTimer() {
//1.创建一个timer实例
Timer timer = new Timer();
//2.创建一个SyslogTimerTask实例
SyslogTimerTask myTimeTask = new SyslogTimerTask();
//3.通过timer定时定频率调用SyslogTimerTask的业务逻辑
// 即 第一次执行是在当前时间的两秒之后,之后每隔30秒钟执行一次
timer.schedule(myTimeTask,2000L,30000L);
}
}

21
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java

@ -0,0 +1,21 @@
package com.hnac.hzims.middle.systemlog.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 操作日志统计数据 前端控制器
* </p>
*
* @author dfy
* @since 2023-04-08
*/
@RestController
@RequestMapping("/systemlog/statistics")
public class StatisticsController {
}

70
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java

@ -0,0 +1,70 @@
package com.hnac.hzims.middle.systemlog.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 操作日志统计数据
* </p>
*
* @author dfy
* @since 2023-04-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("hzims_statistics")
public class Statistics implements Serializable {
private static final long serialVersionUID=1L;
/**
* 编号
*/
@TableField("id")
private Long id;
/**
* 统计日期
*/
@TableField("date_calculated")
private String dateCalculated;
/**
* 操作模块统计
*/
@TableField("title_num")
private Integer titleNum;
/**
* 功能模块统计
*/
@TableField("module_name_num")
private Integer moduleNameNum;
/**
* 请求路径统计
*/
@TableField("path_num")
private Integer pathNum;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 更新时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
}

1
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java

@ -195,4 +195,5 @@ public class SysLog implements Serializable {
private Integer isDeleted; private Integer isDeleted;
} }

16
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/StatisticsMapper.java

@ -0,0 +1,16 @@
package com.hnac.hzims.middle.systemlog.mapper;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 操作日志统计数据 Mapper 接口
* </p>
*
* @author dfy
* @since 2023-04-08
*/
public interface StatisticsMapper extends BaseMapper<Statistics> {
}

5
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/xml/StatisticsMapper.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.middle.systemlog.mapper.StatisticsMapper">
</mapper>

20
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/StatisticsService.java

@ -0,0 +1,20 @@
package com.hnac.hzims.middle.systemlog.service;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 操作日志统计数据 服务类
* </p>
*
* @author dfy
* @since 2023-04-08
*/
public interface StatisticsService extends IService<Statistics> {
/**
* 保存统计的数据
*/
void saveCountStatistics();
}

34
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java

@ -0,0 +1,34 @@
package com.hnac.hzims.middle.systemlog.service.impl;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.hnac.hzims.middle.systemlog.mapper.StatisticsMapper;
import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 操作日志统计数据 服务实现类
* </p>
*
* @author dfy
* @since 2023-04-08
*/
@Service
public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statistics> implements StatisticsService {
@Autowired
private SysLogService sysLogService;
/**
* 保存统计的数据
*/
@Override
public void saveCountStatistics() {
//1. 保存操作模块的数据
}
}

31
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/task/SyslogTimerTask.java

@ -0,0 +1,31 @@
package com.hnac.hzims.middle.systemlog.task;
import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.TimerTask;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/8 14:13
*/
@Component
public class SyslogTimerTask extends TimerTask {
@Autowired
private StatisticsService statisticsService;
/**
* The action to be performed by this timer task.
*/
@Override
public void run() {
//保存统计的数据
statisticsService.saveCountStatistics();
}
}

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -270,6 +270,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
return record; return record;
}).sorted(Comparator.comparing(AlarmDataVo::getIsHandle) }).sorted(Comparator.comparing(AlarmDataVo::getIsHandle)
.thenComparing(AlarmDataVo::getTs, Comparator.reverseOrder())).collect(Collectors.toList()); .thenComparing(AlarmDataVo::getTs, Comparator.reverseOrder())).collect(Collectors.toList());
response.setCount(datas.size()); response.setCount(datas.size());
response.setSoeList(datas); response.setSoeList(datas);
response.setTotal(result.getData().getTotal()); response.setTotal(result.getData().getTotal());

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -412,11 +412,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
imsDutyMainPersonEntity.setDutyPerson(personId); imsDutyMainPersonEntity.setDutyPerson(personId);
long id1 = IdWorker.getId(imsDutyMainPersonEntity); long id1 = IdWorker.getId(imsDutyMainPersonEntity);
imsDutyMainPersonEntity.setId(id1); imsDutyMainPersonEntity.setId(id1);
if (2 == imsSchedulingVo.getPersonType()) {
imsDutyMainPersonEntity.setDutyChargePerson(imsSchedulingVo.getManagerId());
} else {
imsDutyMainPersonEntity.setDutyChargePerson(managerId); imsDutyMainPersonEntity.setDutyChargePerson(managerId);
}
imsDutyMainPersonEntityList.add(imsDutyMainPersonEntity); imsDutyMainPersonEntityList.add(imsDutyMainPersonEntity);
} }
} }

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

@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
public class PhotovoltaicController extends BladeController { public class PhotovoltaicController extends BladeController {
private final PhotovoltaicService service; private final PhotovoltaicService service;
@ApiLog @ApiLog
@ApiOperation("集团/区域关键指标") @ApiOperation("集团/区域关键指标")
@GetMapping("/KPIs") @GetMapping("/KPIs")
@ -32,6 +33,7 @@ public class PhotovoltaicController extends BladeController {
public R KPIs(@ApiParam(value = "集团/区域机构编号") Long deptId) { public R KPIs(@ApiParam(value = "集团/区域机构编号") Long deptId) {
return R.data(service.KPIs(deptId)); return R.data(service.KPIs(deptId));
} }
@ApiLog @ApiLog
@ApiOperation("集团/区域发电量") @ApiOperation("集团/区域发电量")
@GetMapping("/generation") @GetMapping("/generation")
@ -40,6 +42,7 @@ public class PhotovoltaicController extends BladeController {
@ApiParam(value = "查询类型:0-周 1-月 -2年") String type) { @ApiParam(value = "查询类型:0-周 1-月 -2年") String type) {
return R.data(service.generation(deptId, type)); return R.data(service.generation(deptId, type));
} }
@ApiLog @ApiLog
@ApiOperation("集团/区域下属数据占比") @ApiOperation("集团/区域下属数据占比")
@GetMapping("/subordinate") @GetMapping("/subordinate")
@ -54,4 +57,31 @@ public class PhotovoltaicController extends BladeController {
public R station(@ApiParam(value = "站点机构ID") Long deptId) { public R station(@ApiParam(value = "站点机构ID") Long deptId) {
return R.data(service.station(deptId)); return R.data(service.station(deptId));
} }
@ApiLog
@ApiOperation("App区域下属数据")
@GetMapping("/app_subordinate")
@ApiOperationSupport(order = 3)
public R app_subordinate(@ApiParam(value = "区域/站点机构编号") Long deptId) {
return R.data(service.app_subordinate(deptId));
}
@ApiLog
@ApiOperation("App光伏站点数据")
@GetMapping("/app_station")
@ApiOperationSupport(order = 3)
public R app_station(@ApiParam(value = "区域/站点机构编号") Long deptId) {
return R.data(service.app_station(deptId));
}
@ApiLog
@ApiOperation("App功率/发电量查询")
@GetMapping("/app_load_generate")
@ApiOperationSupport(order = 3)
public R app_load_generate(@ApiParam(value = "区域/站点机构编号") Long deptId,
@ApiParam(value = "数据类型: 0 - 功率 1 - 发电量") String type,
@ApiParam(value = "查询类型: 0 - 日 1 - 周 2 - 月 3 - 年") String queryType) {
return R.data(service.app_load_generate(deptId,type,queryType));
}
} }

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java

@ -175,7 +175,7 @@ public class ScheduledCreateTask {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
homePageService.loadPowerData(param, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),SERVE_TYPE,2); homePageService.loadPowerData(param, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),SERVE_TYPE,3);
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
@ -292,30 +292,30 @@ public class ScheduledCreateTask {
} }
/** /**
* 光伏站-逆变器指标加载 * 光伏站-逆变器实时加载
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(LOAD_PHOTOVOLTAIC_TARGET) @XxlJob(LOAD_PHOTOVOLTAIC_REAL)
//@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/50 * * * * ? ")
public ReturnT<String> loadPhotovoltaicTarget(String param) throws Exception { public ReturnT<String> loadPhotovoltaicReal(String param) throws Exception {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
photovoltaicService.loadPhotovoltaicTarget(param); photovoltaicService.loadPhotovoltaicReal(param);
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
/** /**
* 光伏站-逆变器实时加载 * 光伏站-逆变器指标加载
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(LOAD_PHOTOVOLTAIC_REAL) @XxlJob(LOAD_PHOTOVOLTAIC_TARGET)
//@Scheduled(cron = "0/50 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadPhotovoltaicReal(String param) throws Exception { public ReturnT<String> loadPhotovoltaicTarget(String param) throws Exception {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
photovoltaicService.loadPhotovoltaicReal(param); photovoltaicService.loadPhotovoltaicTarget(param);
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
} }

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IAnalyseDataService.java

@ -1,8 +1,9 @@
package com.hnac.hzims.operational.main.service; package com.hnac.hzims.operational.main.service;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import org.apache.poi.ss.formula.functions.T;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.Function;
@ -11,6 +12,11 @@ import java.util.function.Function;
* @author hx * @author hx
*/ */
public interface IAnalyseDataService { public interface IAnalyseDataService {
<T> List<AnalyzeCodeBySignagesVO> getAnalyzeCodeBySignages(Function<T, MultiAnalyzeCodePO> convert, T resource); <T> List<AnalyzeCodeBySignagesVO> getAnalyzeCodeBySignages(Function<T, MultiAnalyzeCodePO> convert, T resource);
List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages);
} }

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

@ -1,9 +1,6 @@
package com.hnac.hzims.operational.main.service; package com.hnac.hzims.operational.main.service;
import com.hnac.hzims.operational.main.vo.GenerationVo; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.main.vo.PhotovoltaicKPIsVo;
import com.hnac.hzims.operational.main.vo.PhotovoltaicStationVo;
import com.hnac.hzims.operational.main.vo.SubordinateVo;
import java.util.List; import java.util.List;
@ -27,8 +24,17 @@ public interface PhotovoltaicService {
List<GenerationVo> generation(Long deptId,String type); List<GenerationVo> generation(Long deptId,String type);
// 集团/区域下属数据占比 // 集团/区域下属数据占比
List<SubordinateVo> subordinate(Long deptId); List<PhotovoltaicSubordinateVo> subordinate(Long deptId);
// 站点数据 // 站点数据
PhotovoltaicStationVo station(Long deptId); PhotovoltaicStationVo station(Long deptId);
// app区域数据
List<PhotovoltaicSubordinateAppVo> app_subordinate(Long deptId);
// app站点数据
PhotovoltaicStationAppVo app_station(Long deptId);
// App功率/发电量查询
List<PhotovoltaicLoadGenerateVo> app_load_generate(Long deptId, String type,String queryType);
} }

99
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java

@ -1,16 +1,30 @@
package com.hnac.hzims.operational.main.service.impl; package com.hnac.hzims.operational.main.service.impl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.hnac.hzims.EquipmentConstants;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.operational.main.service.IAnalyseDataService; import com.hnac.hzims.operational.main.service.IAnalyseDataService;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -33,4 +47,89 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService {
} }
return result; return result;
} }
/***
* 指标数据列表查询
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号
* @param signages 指标
* @return
*/
@Override
public List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setAccessRules(accessRules);
analyzeDataConditionPO.setSaveTimeType(cycleType);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
po.setSignboardConditions(signboardConditions);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
return result.getData().get(0).getList();
}
/***
* 指标数据列表查询
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param cycleType 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param deviceCode 设备编号
* @param ride 配电比
* @param signages 指标
* @return
*/
@Override
public Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode,Integer ride,String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setAccessRules(accessRules);
analyzeDataConditionPO.setSaveTimeType(cycleType);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
po.setSignboardConditions(signboardConditions);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return 0f;
}
List<AnalyzeDataConditionVO> records = result.getData();
if(CollectionUtil.isEmpty(records)){
return 0f;
}
AnalyzeDataConditionVO analyzeDataConditionVO = records.get(0);
if (ObjectUtil.isEmpty(analyzeDataConditionVO)) {
return 0f;
}
List<AnalyseDataTaosVO> analyseDataTaosVOList = analyzeDataConditionVO.getList();
if (CollectionUtil.isEmpty(analyseDataTaosVOList)) {
return 0f;
}
AnalyseDataTaosVO analyseDataTaosVO = analyzeDataConditionVO.getList().get(0);
if (ObjectUtil.isEmpty(analyseDataTaosVO) || StringUtil.isBlank(analyseDataTaosVO.getVal())) {
return 0f;
}
return Float.parseFloat(analyseDataTaosVO.getVal()) * ride;
}
} }

71
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java

@ -11,6 +11,7 @@ import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.monitor.utils.DateUtils; import com.hnac.hzims.monitor.utils.DateUtils;
import com.hnac.hzims.operational.fill.entity.*; import com.hnac.hzims.operational.fill.entity.*;
import com.hnac.hzims.operational.fill.service.*; import com.hnac.hzims.operational.fill.service.*;
import com.hnac.hzims.operational.main.service.IAnalyseDataService;
import com.hnac.hzims.operational.main.service.IHomePageService; import com.hnac.hzims.operational.main.service.IHomePageService;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.service.IMainTaskStatisticService; import com.hnac.hzims.operational.main.service.IMainTaskStatisticService;
@ -69,7 +70,8 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class HomePageServiceImpl implements IHomePageService { public class HomePageServiceImpl implements IHomePageService {
private final IAnalyseDataSearchClient analyseDataSearchClient;
private final IAnalyseDataService analyseDataService;
private final IPlanGenertionClient planGenertionClient; private final IPlanGenertionClient planGenertionClient;
private final IMainSystemMonitoringService maintenanceTaskService; private final IMainSystemMonitoringService maintenanceTaskService;
private final IMainTaskStatisticService mainTaskStatisticService; private final IMainTaskStatisticService mainTaskStatisticService;
@ -219,41 +221,70 @@ public class HomePageServiceImpl implements IHomePageService {
* *
* @param param 时间 * @param param 时间
* @param serveType 站点类型 * @param serveType 站点类型
* @param yearCount 近几年 * @param year 近几年
*/ */
@Override @Override
public void loadPowerData(String param,List<Integer> types, Integer serveType, int yearCount) { public void loadPowerData(String param,List<Integer> types, Integer serveType, int year) {
// 站点查询 // 站点查询
List<StationEntity> stationList = stationService.getStationType(serveType, types, null); List<StationEntity> stationList = stationService.getStationType(serveType, types, null);
// 设备信息 // 设备信息
List<EminfoAndEmParamVo> equipmentInfoList = maintenanceTaskService.getEmInfoList(); List<EminfoAndEmParamVo> devices = maintenanceTaskService.getEmInfoList();
// 开始事件
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 结束日期
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - year);
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 存储数据map :<站点id,<月份,发电量>> // 存储数据map :<站点id,<月份,发电量>>
Map<Long, Map<String, Float>> powerMap = new HashMap<>(); Map<Long, Map<String, Float>> powerMap = new HashMap<>();
// 获取需要遍历月份
List<String> monList = this.getMonthList(yearCount, 12,true);
Random random = new Random();
stationList.forEach(station -> { stationList.forEach(station -> {
Long departId = station.getRefDept(); // 站点设备集合
// 获取对应站点设备 List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
List<EminfoAndEmParamVo> effEmInfoList = equipmentInfoList.stream().filter(o -> departId.equals(o.getCreateDept())).collect(Collectors.toList()); if(CollectionUtil.isEmpty(stationDevices)){
if (CollectionUtil.isEmpty(effEmInfoList)) {
return; return;
} }
Map<String, Float> floatMap = new HashMap<>(); Map<String, Float> generateMap = this.getGenerateYear(stationDevices,start,end);
for (int i = 0; i < monList.size() - 1; i++) { if(MapUtils.isEmpty(generateMap)){
if (this.compareDate(monList.get(i))) { return;
floatMap.put(monList.get(i), 0f);
continue;
}
float power = getPowerGeneration(effEmInfoList, monList.get(i) + " 00:00:00", monList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType());
floatMap.put(monList.get(i), power);
} }
powerMap.put(station.getId(), floatMap); powerMap.put(station.getId(),generateMap);
}); });
redisTemplate.opsForValue().set(RECENT_YEAR_POWER_DATA, powerMap); redisTemplate.opsForValue().set(RECENT_YEAR_POWER_DATA, powerMap);
} }
/** /**
* 获取年发电量
* @param devices
* @param start
* @param end
* @return
*/
private Map<String, Float> getGenerateYear(List<EminfoAndEmParamVo> devices, String start, String end) {
List<PowerMonthVo> datas = new ArrayList<>();
devices.forEach(device->{
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,5,5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return;
}
datas.addAll(records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE));
generate.setPower(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")) * device.getRideCount());
return generate;
}).collect(Collectors.toList()));
});
if(CollectionUtil.isEmpty(datas)){
return null;
}
return datas.stream().collect(Collectors.groupingBy(PowerMonthVo::getStrMonth, Collectors.collectingAndThen(
Collectors.mapping(PowerMonthVo::getPower, Collectors.reducing(Float::sum)),Optional::get)));
}
/**
* @param stationList * @param stationList
* @return * @return
*/ */

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

File diff suppressed because it is too large Load Diff

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

@ -1634,7 +1634,7 @@ public class SideHustleServiceImpl implements ISideHustleService {
if(CollectionUtil.isEmpty(list)){ if(CollectionUtil.isEmpty(list)){
return 0; return 0;
} }
return (float) list.stream().filter(v->o.equals(v.getDate())).mapToDouble(GenerationPowerVo::getGenerationPower).sum(); return (float) list.stream().filter(v->o.equals(v.getDate())).mapToDouble(GenerationPowerVo::getGenerate).sum();
} }
/** /**

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

@ -322,7 +322,7 @@ public class WebHomeServiceImpl implements IWebHomeService {
generationPowerVo.setDate(dayList.get(i)); generationPowerVo.setDate(dayList.get(i));
// 某天发电量 // 某天发电量
float power = homePageService.getAnalyzeCodeAndSignages(device, dayList.get(i) + " 00:00:00", dayList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),HomePageConstant.HYDROPOWER_GENERATE_POWER); float power = homePageService.getAnalyzeCodeAndSignages(device, dayList.get(i) + " 00:00:00", dayList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
generationPowerVo.setGenerationPower(power); generationPowerVo.setGenerate(power);
generationPowerVoList.add(generationPowerVo); generationPowerVoList.add(generationPowerVo);
} }
return generationPowerVoList; return generationPowerVoList;

41
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -16,11 +16,11 @@ import com.hnac.hzims.operational.config.service.StAlamRecordService;
import com.hnac.hzims.operational.config.service.StFocusPropertiesService; import com.hnac.hzims.operational.config.service.StFocusPropertiesService;
import com.hnac.hzims.operational.config.vo.MessageParamVo; import com.hnac.hzims.operational.config.vo.MessageParamVo;
import com.hnac.hzims.operational.config.vo.StationRealVo; import com.hnac.hzims.operational.config.vo.StationRealVo;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.service.IWeatherService; import com.hnac.hzims.operational.main.service.IWeatherService;
import com.hnac.hzims.operational.main.vo.JointRelayVo; import com.hnac.hzims.operational.main.vo.JointRelayVo;
import com.hnac.hzims.operational.main.vo.WaterLevelVo; import com.hnac.hzims.operational.main.vo.WaterLevelVo;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity; import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IRealMonitorService; import com.hnac.hzims.operational.station.service.IRealMonitorService;
@ -31,6 +31,7 @@ import com.hnac.hzims.operational.station.vo.RealAttributeVo;
import com.hnac.hzims.operational.station.vo.RealDeviceVo; import com.hnac.hzims.operational.station.vo.RealDeviceVo;
import com.hnac.hzims.operational.station.vo.RealStationVo; import com.hnac.hzims.operational.station.vo.RealStationVo;
import com.hnac.hzims.operational.station.vo.WeatherVo; import com.hnac.hzims.operational.station.vo.WeatherVo;
import com.hnac.hzinfo.sdk.v5.redis.RedisClient;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -88,6 +89,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
@NotNull @NotNull
private final AbnormalAlarmService abnormalAlarmService; private final AbnormalAlarmService abnormalAlarmService;
private final RedisClient redisClient;
@NotNull @NotNull
private final ISysClient sysClient; private final ISysClient sysClient;
@ -131,8 +134,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key"; private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
private final static String redis_real_prefix_key = "iot:real:data:";
@Override @Override
public void realTimeData(String param) { public void realTimeData(String param) {
@ -146,10 +147,14 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
return ""; return "";
} }
String jointRelay = points.get(HomePageConstant.JOINT_RELAY); String jointRelay = points.get(HomePageConstant.JOINT_RELAY);
if(StringUtil.isBlank(jointRelay)){ if(!StringUtil.isEmpty(jointRelay)){
return "";
}
return jointRelay; return jointRelay;
}
String onOff = points.get(HomePageConstant.SWITCH_ON_OFF);
if(!StringUtil.isEmpty(onOff)){
return onOff;
}
return "";
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 获取站点缓存数据 // 获取站点缓存数据
List<StationRealVo> stationRealVos = (List<StationRealVo>) redisTemplate.opsForValue().get(moniter_realId_key); List<StationRealVo> stationRealVos = (List<StationRealVo>) redisTemplate.opsForValue().get(moniter_realId_key);
@ -169,11 +174,11 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
list.forEach(stations -> { list.forEach(stations -> {
stations.forEach(stationReal -> { stations.forEach(stationReal -> {
String[] realIdArr = stationReal.getRealId(); String[] realIdArr = stationReal.getRealId();
List<String> realIds = Stream.of(realIdArr).map(o-> redis_real_prefix_key + stationReal.getStation() + ":" + o).collect(Collectors.toList()); List<String> realIds = Stream.of(realIdArr).collect(Collectors.toList());
if(CollectionUtil.isEmpty(realIds)){ if(CollectionUtil.isEmpty(realIds)){
return; return;
} }
List<Object> objects = redisTemplate.opsForValue().multiGet(realIds); List<String> objects = redisClient.getBatchRealDataByRealId(stationReal.getStation(),realIds);
if(CollectionUtil.isEmpty(objects)){ if(CollectionUtil.isEmpty(objects)){
return; return;
} }
@ -182,11 +187,12 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
log.error(realIds.get(i) + "is null"); log.error(realIds.get(i) + "is null");
continue; continue;
} }
Map<String,String> attribute = (Map<String, String>) objects.get(i); Map<String,String> attribute = (Map<String, String>) JSONObject.parse(objects.get(i));
attribute.put("realId",realIdArr[i]); attribute.put("realId",attribute.get("k"));
attribute.put("value",attribute.get("v")); attribute.put("value",attribute.get("v"));
attribute.put("time",attribute.get("t")); attribute.put("time",attribute.get("t"));
attribute.remove("v"); attribute.remove("v");
attribute.remove("k");
attribute.remove("t"); attribute.remove("t");
this.getCheckMap(attribute,switchOnOff); this.getCheckMap(attribute,switchOnOff);
valueMap.put(realIdArr[i],attribute.get("value")); valueMap.put(realIdArr[i],attribute.get("value"));
@ -217,15 +223,15 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
* @param value * @param value
* @return * @return
*/ */
private Map<String, String> getCheckMap(Map<String, String> value,List<String> switchOnOff){ private void getCheckMap(Map<String, String> value,List<String> switchOnOff){
try{ try{
String time = value.get("time");
if(StringUtil.isEmpty(time)){
return value;
}
// 不处理开机状态监测点 // 不处理开机状态监测点
if(switchOnOff.contains(value.get("realId"))){ if(switchOnOff.contains(value.get("realId"))){
return value; return;
}
String time = value.get("time");
if(StringUtil.isEmpty(time)){
return;
} }
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.PATTERN_DATETIME); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.PATTERN_DATETIME);
Date date = simpleDateFormat.parse(time); Date date = simpleDateFormat.parse(time);
@ -234,9 +240,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
value.put("value","0"); value.put("value","0");
} }
}catch (ParseException e){ }catch (ParseException e){
return value; return;
} }
return value;
} }
/** /**

16
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java

@ -43,11 +43,9 @@ public class ProcessTypeController {
private final TicketProperties ticketProperties; private final TicketProperties ticketProperties;
private final ProcessTypeService processTypeService; private final ProcessTypeService processTypeService;
private final List<ProcessService> ticketServiceList; private final List<ProcessService> ticketServiceList;
@ -59,8 +57,6 @@ public class ProcessTypeController {
private final QueueProduceService queueProduceService; private final QueueProduceService queueProduceService;
@GetMapping("/add") @GetMapping("/add")
public void add() { public void add() {
List<WorkTicketProperties> workTickets = ticketProperties.getWorkTickets(); List<WorkTicketProperties> workTickets = ticketProperties.getWorkTickets();
@ -81,9 +77,7 @@ public class ProcessTypeController {
//判断执行具体的实现类 //判断执行具体的实现类
WorkflowQueue workflowQueue = new WorkflowQueue(); WorkflowQueue workflowQueue = new WorkflowQueue();
workflowQueue.setProcessDefinitionKey(key); workflowQueue.setProcessDefinitionKey(key);
ProcessService ticketService = ProcessService ticketService = ticketServiceList.stream().filter(item -> item.isWorkflowProcess(workflowQueue)).findFirst().orElse(null);
ticketServiceList.stream().filter(item -> item.isWorkflowProcess(workflowQueue))
.findFirst().orElse(null);
ticketService.calculate(null); ticketService.calculate(null);
return "key"; return "key";
} }
@ -97,8 +91,7 @@ public class ProcessTypeController {
} }
@OperationAnnotation(title = "工作流审批类型", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, @OperationAnnotation(title = "工作流审批类型", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, action = "查询")
action ="查询")
@GetMapping("/list") @GetMapping("/list")
public R list() { public R list() {
List<ProcessType> list = processTypeService.list(); List<ProcessType> list = processTypeService.list();
@ -107,8 +100,7 @@ public class ProcessTypeController {
} }
@OperationAnnotation(title = "工作流审批类型", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, @OperationAnnotation(title = "工作流审批类型", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, action = "审批流处理")
action ="审批流处理")
@GetMapping("/build") @GetMapping("/build")
public void addList() { public void addList() {
ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse(); ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse();
@ -119,5 +111,7 @@ public class ProcessTypeController {
String qqqq = JsonUtil.toJson(workTicketMessageResponse); String qqqq = JsonUtil.toJson(workTicketMessageResponse);
queueProduceService.sendMessage("blade:queue:flow", qqqq); queueProduceService.sendMessage("blade:queue:flow", qqqq);
} }
} }

17
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketInfoMapper.java

@ -1,17 +0,0 @@
package com.hnac.hzims.ticket.twoTicket.mapper;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/8 11:29
*/
@Repository
public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper<WorkTicketInfoEntity> {
}

14
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/WorkTicketInfoService.java

@ -1,14 +0,0 @@
package com.hnac.hzims.ticket.twoTicket.service;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/8 11:31
*/
public interface WorkTicketInfoService extends BaseService<WorkTicketInfoEntity> {
}

21
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -2,12 +2,15 @@ package com.hnac.hzims.ticket.twoTicket.service.impl;
import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import com.hnac.hzims.ticket.twoTicket.service.WorkTicketInfoService; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/** /**
* 开票处理流程实现类 * 开票处理流程实现类
* @Author WL * @Author WL
@ -24,7 +27,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final IFlowClient flowClient; private final IFlowClient flowClient;
private final WorkTicketInfoService workTicketInfoService; private final IWorkTicketInfoService workTicketInfoService;
/** /**
* 启动开票流程 * 启动开票流程
@ -33,6 +36,20 @@ public class TicketProcessServiceImpl implements TicketProcessService {
*/ */
@Override @Override
public void startUp(ProcessWorkFlowResponse response) { public void startUp(ProcessWorkFlowResponse response) {
//当前环节Id
String processDefinitionKey = response.getProcessDefinitionKey();
//当前任务Id
String taskId = response.getTaskId();
//表单数据
String formData = response.getFormData();
log.info("当前任务ID:{},当前流程定义ID:{},启动开票流程", taskId, processDefinitionKey);
System.out.println(formData);
// Map<String, Object> variables = new HashMap<>();
// variables.put("task_id", taskId);
// variables.put("signUserIds", formData);
// flowClient.startProcessInstanceContainNameByKey(processDefinitionKey,"workTicket:task:"+1,)
} }
} }

17
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -1,17 +0,0 @@
package com.hnac.hzims.ticket.twoTicket.service.impl;
import com.hnac.hzims.ticket.twoTicket.mapper.WorkTicketInfoMapper;
import com.hnac.hzims.ticket.twoTicket.service.WorkTicketInfoService;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/8 11:32
*/
@Service
public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMapper,WorkTicketInfoEntity> implements WorkTicketInfoService {
}
Loading…
Cancel
Save