From bad4a2681a255d7038ff9a273c305fbfc5aaccea Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 24 Jan 2024 14:45:48 +0800 Subject: [PATCH] =?UTF-8?q?#=E8=BF=90=E8=A1=8C=E6=9C=88=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/common/utils/HiKUtil.java | 6 +- .../com/hnac/hzims/equipment/vo/RideDeviceVo.java | 23 + .../main/constant/HomePageConstant.java | 23 + .../operational/main/constant/MainConstants.java | 2 + .../operational/report/entity/RunMonthEntity.java | 40 ++ .../hzims/operational/report/vo/AttributeVo.java | 22 + .../operational/report/vo/CurveAttributeVo.java | 25 ++ .../hzims/operational/report/vo/CurveDataVo.java | 30 ++ .../hnac/hzims/operational/report/vo/CurveVo.java | 20 + .../hzims/operational/report/vo/RunAlarmVo.java | 35 ++ .../hzims/operational/report/vo/RunDataShowVo.java | 32 ++ .../hzims/operational/report/vo/RunDataVo.java | 34 ++ .../controller/AlarmTabulateController.java | 2 +- .../tabulate/service/AlarmTabulateService.java | 2 +- .../service/impl/AlarmTabulateServiceImpl.java | 17 +- .../mapper/equipment/DeviceParamMapper.java | 3 + .../scheduled/mapper/operation/RunMonMapper.java | 13 + .../scheduled/scheduled/AlarmScheduledTask.java | 10 +- .../scheduled/scheduled/MonitorScheduledTask.java | 7 +- .../scheduled/RealTargetScheduledTask.java | 7 +- .../scheduled/scheduled/ReportScheduledTask.java | 17 + .../service/equipment/DeviceParamService.java | 2 + .../scheduled/service/equipment/DeviceService.java | 3 + .../equipment/impl/DeviceParamServiceImpl.java | 14 + .../service/equipment/impl/DeviceServiceImpl.java | 62 +++ .../service/operation/report/ReportService.java | 3 + .../service/operation/report/RunMonService.java | 11 + .../operation/report/impl/ReportServiceImpl.java | 490 ++++++++++++++++++++- .../operation/report/impl/RunMonServiceImpl.java | 19 + .../mapper/equipment/DeviceParamMapper.xml | 11 +- .../resources/mapper/operation/RunMonMapper.xml | 5 + .../controller/OperAccessLibraryController.java | 4 +- .../access/service/IOperAccessLibraryService.java | 2 +- .../service/impl/OperAccessLibraryServiceImpl.java | 8 +- .../report/controller/RunMonthController.java | 41 ++ .../report/mapper/MonthReportMapper.java | 3 + .../operational/report/mapper/RunMonthMapper.java | 10 + .../report/service/RunMonthService.java | 14 + .../report/service/impl/RunMonthServiceImpl.java | 79 ++++ .../service/impl/StationVideoTypeServiceImpl.java | 6 +- .../template/excel/access_import_template.xlsx | Bin 22528 -> 22528 bytes 41 files changed, 1124 insertions(+), 33 deletions(-) create mode 100644 hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/RideDeviceVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/entity/RunMonthEntity.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/AttributeVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveAttributeVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveDataVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunAlarmVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataShowVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataVo.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/RunMonMapper.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/RunMonService.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/RunMonServiceImpl.java create mode 100644 hzims-service/hzims-scheduled/src/main/resources/mapper/operation/RunMonMapper.xml create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/RunMonthController.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/RunMonthMapper.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/RunMonthService.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java index 7481619..89bad9c 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java @@ -1,3 +1,4 @@ +/* package com.hnac.hzims.common.utils; import com.alibaba.druid.support.json.JSONUtils; @@ -27,10 +28,12 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; +*/ /** * @Author: huangxing * @Date: 2024/1/10 14:40 - */ + *//* + public class HiKUtil { public static String APP_KEY = "26486442"; @@ -70,3 +73,4 @@ public class HiKUtil { } } +*/ diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/RideDeviceVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/RideDeviceVo.java new file mode 100644 index 0000000..1ed1c6c --- /dev/null +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/RideDeviceVo.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.equipment.vo; + +import com.hnac.hzims.equipment.entity.EmInfoEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ysj + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class RideDeviceVo extends EmInfoEntity { + + @ApiModelProperty(value = "ct") + private Integer ct; + + @ApiModelProperty(value = "pt") + private Integer pt; + + @ApiModelProperty(value = "配电比") + private Integer ride; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java index e02e30a..ce42a8f 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java @@ -331,4 +331,27 @@ public interface HomePageConstant { * 功率 **/ Integer LOADING = 0; + + /*=============================================运行月报曲线=============================================*/ + + + String A_PHASE_IRON_CORE_TEMP = "ax_txwd"; + + String B_PHASE_IRON_CORE_TEMP = "bx_txwd"; + + String C_PHASE_IRON_CORE_TEMP = "cx_txwd"; + + String UPPER_GUIDE_BEARING_TEMP = "sd_zwwd_1"; + + String UPPER_GUIDE_BEARING_OIL_GROOVE_TEMP = "sd_zcycwd"; + + String THRUST_BEARING_TEMP = "tl_zwwd_1"; + + String LOWER_GUIDE_BEARING_TEMP = "xd_zwwd_1"; + + String LOWER_GUIDE_OIL_TANK_TEMP = "xd_ycwd"; + + String WATER_GUIDE_TILE_TEMP = "wd_zwwd_1"; + + String WATER_GUIDE_OIL_TANK_TEMP = "sd_ycwd"; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java index 5e1572d..ac7dd89 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java @@ -61,6 +61,8 @@ public interface MainConstants { String AREA_MONTH_REPORT = "areaMonthReport"; String WIND_AREA_MONTH_REPORT = "windAreaMonthReport"; String ENERGY_AREA_MONTH_REPORT = "energyAreaMonthReport"; + // 运行月报告 + String RUM_MONTH_REPORT = "runMonthReport"; // 站点数据统计 String STATION_DATA_COUNT = "stationDataCount"; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/entity/RunMonthEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/entity/RunMonthEntity.java new file mode 100644 index 0000000..f4d2eae --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/entity/RunMonthEntity.java @@ -0,0 +1,40 @@ +package com.hnac.hzims.operational.report.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.mp.base.BaseEntity; + +/** + * @author ysj + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_run_month_report") +@ApiModel(value = "运行月报告表", description = "运行月报告实体类") +public class RunMonthEntity extends BaseEntity { + + @ApiModelProperty("站点编码") + private String stationCode; + + @ApiModelProperty("月份") + private String month; + + @ApiModelProperty("运行数据") + private String runData; + + @ApiModelProperty("告警数据") + private String alarmData; + + @ApiModelProperty("曲线数据") + private String curveData; + + @ApiModelProperty("分析数据") + private String analysisData; + + @ApiModelProperty("运行建议") + private String runPropose; + +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/AttributeVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/AttributeVo.java new file mode 100644 index 0000000..e1f653d --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/AttributeVo.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.report.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +@ApiModel("曲线对象") +public class AttributeVo { + + @ApiModelProperty("设备编码") + private String deviceCode; + + @ApiModelProperty("属性") + private String signage; + + @ApiModelProperty("属性名称") + private String signageName; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveAttributeVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveAttributeVo.java new file mode 100644 index 0000000..1d060e3 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveAttributeVo.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.operational.report.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + */ +@Data +@ApiModel("曲线对象") +public class CurveAttributeVo { + + + @ApiModelProperty("属性标识") + private String attribute; + + @ApiModelProperty("属性名称") + private String attributeName; + + @ApiModelProperty("曲线") + private List Curves; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveDataVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveDataVo.java new file mode 100644 index 0000000..17d80d6 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveDataVo.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.operational.report.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + */ +@Data +@ApiModel("运行数据对象") +public class CurveDataVo { + + @ApiModelProperty("设备编码") + private String deviceCode; + + @ApiModelProperty("设备名称") + private String deviceName; + + @ApiModelProperty("负荷曲线") + private List loadCurve; + + @ApiModelProperty("轴承温度曲线") + private List bearingTempCurve; + + @ApiModelProperty("定子温度曲线") + private List statorTempCurve; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveVo.java new file mode 100644 index 0000000..18299e7 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CurveVo.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.operational.report.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +@ApiModel("曲线对象") +public class CurveVo { + + + @ApiModelProperty("时间:day") + private String time; + + @ApiModelProperty("值") + private Double value; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunAlarmVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunAlarmVo.java new file mode 100644 index 0000000..5490c01 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunAlarmVo.java @@ -0,0 +1,35 @@ +package com.hnac.hzims.operational.report.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +@ApiModel("运行告警对象") +public class RunAlarmVo { + + + @ApiModelProperty("设备名称") + private String deviceName; + + @ApiModelProperty("告警时间") + private String alarmTime; + + @ApiModelProperty("告警内容") + private String content; + + @ApiModelProperty("告警类型 : 3-故障 21-一级告警 30-智能预警") + private String type; + + @ApiModelProperty("告警次数") + private Integer count; + + @ApiModelProperty("初步原因分析") + private String reason; + + @ApiModelProperty("处置") + private String dispose; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataShowVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataShowVo.java new file mode 100644 index 0000000..557ed07 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataShowVo.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.operational.report.vo; + +import com.hnac.hzims.operational.report.entity.RunMonthEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +@ApiModel("运行数据对象") +public class RunDataShowVo extends RunMonthEntity { + + @ApiModelProperty("月实际发电量") + private Double monSumGenerate; + + @ApiModelProperty("月实际计划发电量") + private Double monSumPlan; + + @ApiModelProperty("月计划完成率") + private Double monRate; + + @ApiModelProperty("年实际发电量") + private Double yearSumGenerate; + + @ApiModelProperty("月实际计划发电量") + private Double yearSumPlan; + + @ApiModelProperty("年计划完成率") + private Double yearRate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataVo.java new file mode 100644 index 0000000..ad7bc5e --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/RunDataVo.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.operational.report.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +@ApiModel("运行数据对象") +public class RunDataVo { + + @ApiModelProperty("设备编码") + private String deviceCode; + + @ApiModelProperty("设备名称") + private String deviceName; + + @ApiModelProperty("运行时长") + private Double runHours; + + @ApiModelProperty("发电量") + private Double generate; + + @ApiModelProperty("计划发电量") + private Double plan; + + @ApiModelProperty("年发电量") + private Double generateYear; + + @ApiModelProperty("年计划发电量") + private Double planYear; +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java index cbd4d56..b21f37d 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java @@ -39,7 +39,7 @@ public class AlarmTabulateController extends BladeController { @GetMapping("/level") @ApiOperationSupport(order = 2) @ApiOperation(value = "等级告警(设备实例)", notes = "等级告警(设备实例)") - public R> level(TabulateLevelVo param, Query query) { + public R> level(TabulateLevelVo param, Query query) { return R.data(tabulateService.level(Condition.getPage(query), param)); } } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java index 72ba4bd..6d1b7d6 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java @@ -14,5 +14,5 @@ public interface AlarmTabulateService { IPage early(IPage page, TabulateEarlyVo param); - IPage level(IPage page, TabulateLevelVo param); + IPage level(IPage page, TabulateLevelVo param); } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java index 3ae0d59..e21984f 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java @@ -7,12 +7,12 @@ import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; import com.hnac.hzinfo.sdk.core.response.HzPage; import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; -import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; import com.hnac.hzinfo.sdk.v5.soe.SoeDataClient; import com.hnac.hzinfo.sdk.v5.soe.dto.StbAnalysisDTO; import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.StringUtil; @@ -20,6 +20,8 @@ import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * @author ysj @@ -69,8 +71,15 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { * @return */ @Override - public IPage level(IPage page, TabulateLevelVo param) { - deviceDataClient.getDeviceSoeData(param.getProjectId(),param.getDimension(),param.getId(),param.getSoeType(),param.getStartTime(),param.getEndTime()); - return null; + public IPage level(IPage page, TabulateLevelVo param) { + Result> result = deviceDataClient.getDeviceSoeData(param.getProjectId(),param.getDimension(),param.getId(),param.getSoeType(),param.getStartTime(),param.getEndTime(), + true,(int) page.getCurrent(),(int)page.getSize()); + if(!result.isSuccess() || MapUtils.isEmpty(result.getData())){ + return page; + } + Map data = result.getData(); + page.setTotal((Long) data.get("total")); + page.setRecords((List) data.get("data")); + return page; } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/DeviceParamMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/DeviceParamMapper.java index f5bb375..219bcd6 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/DeviceParamMapper.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/DeviceParamMapper.java @@ -1,6 +1,7 @@ package com.hnac.hzims.scheduled.mapper.equipment; import com.hnac.hzims.equipment.entity.EmParamEntity; +import org.apache.ibatis.annotations.Param; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; @@ -13,4 +14,6 @@ import java.util.List; public interface DeviceParamMapper extends UserDataScopeBaseMapper { List params(); + + List rides(@Param("deviceIds") List deviceIds); } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/RunMonMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/RunMonMapper.java new file mode 100644 index 0000000..ffd47b2 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/RunMonMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.scheduled.mapper.operation; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.operational.report.entity.RunMonthEntity; + +/** + * @author ysj + * @date 2023/04/10 11:22:14 + * @version 4.0.0 + */ +public interface RunMonMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java index 6172620..6f4721d 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java @@ -2,6 +2,7 @@ package com.hnac.hzims.scheduled.scheduled; import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService; import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; @@ -11,6 +12,8 @@ import org.springframework.stereotype.Component; import java.util.Date; +import static com.hnac.hzims.operational.main.constant.MainConstants.START_STOP_ALARM; + /** * 告警定时任务 @@ -27,10 +30,9 @@ public class AlarmScheduledTask { * 开停机告警 * @return ReturnT */ - //@XxlJob(START_STOP_ALARM) - @Scheduled(cron = "0/40 * * * * ? ") - public ReturnT startStopAlarm() { - String param = ""; + @XxlJob(START_STOP_ALARM) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT startStopAlarm(String param) { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java index 0dbad04..ba64a08 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java @@ -42,10 +42,9 @@ public class MonitorScheduledTask { * 实时数据刷新 * @return ReturnT */ - //@XxlJob(REAL_TIME_DATA) - @Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadRealData() { - String param = ""; + @XxlJob(REAL_TIME_DATA) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadRealData( String param) { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java index 921d24d..342847e 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java @@ -46,10 +46,9 @@ public class RealTargetScheduledTask { /** * 水电站-机组实时加载 */ - //@XxlJob(LOAD_HYDROPOWER_UNIT_REAL) - @Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadHydropowerReal() { - String param = ""; + @XxlJob(LOAD_HYDROPOWER_UNIT_REAL) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadHydropowerReal(String param) { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java index 438bfc7..bd15fb8 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java @@ -9,6 +9,7 @@ import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; @@ -45,6 +46,7 @@ public class ReportScheduledTask { service.loadMonthReport(param,1); return new ReturnT<>("SUCCESS"); } + /** * 首页-生产月报表 * @return ReturnT @@ -57,6 +59,7 @@ public class ReportScheduledTask { service.loadMonthReportByType(param,1, HomePageConstant.WIND_POWER,wind_recent_year_cache,wind_report_month_cache_final); return new ReturnT<>("SUCCESS"); } + /** * 首页-生产月报表 * @return ReturnT @@ -70,5 +73,19 @@ public class ReportScheduledTask { return new ReturnT<>("SUCCESS"); } + /** + * 站点运行月报 + * @return ReturnT + */ + //@XxlJob(RUM_MONTH_REPORT) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT runMonthReport() { + String param = ""; + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); + } + service.runMonthReport(param); + return new ReturnT<>("SUCCESS"); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceParamService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceParamService.java index bfd7201..90ab7db 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceParamService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceParamService.java @@ -11,4 +11,6 @@ import java.util.List; public interface DeviceParamService extends BaseService { List params(); + + List rides(List deviceIds); } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceService.java index 5b08d88..443eaec 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/DeviceService.java @@ -2,6 +2,7 @@ package com.hnac.hzims.scheduled.service.equipment; import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.equipment.vo.RideDeviceVo; import org.springblade.core.mp.base.BaseService; import java.util.List; @@ -12,4 +13,6 @@ import java.util.List; public interface DeviceService extends BaseService { List device(); + + List rideDevices(List collect); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceParamServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceParamServiceImpl.java index dbc8332..de5500c 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceParamServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceParamServiceImpl.java @@ -21,8 +21,22 @@ import java.util.List; public class DeviceParamServiceImpl extends BaseServiceImpl implements DeviceParamService { + /** + * 查询设备参数 + * @return + */ @Override public List params() { return this.baseMapper.params(); } + + /** + * 查询配电比 + * @param deviceIds + * @return + */ + @Override + public List rides(List deviceIds) { + return this.baseMapper.rides(deviceIds); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceServiceImpl.java index 9f154eb..46f8fd3 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/DeviceServiceImpl.java @@ -1,16 +1,24 @@ package com.hnac.hzims.scheduled.service.equipment.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.equipment.entity.EmInfoEntity; +import com.hnac.hzims.equipment.entity.EmParamEntity; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.equipment.vo.RideDeviceVo; import com.hnac.hzims.scheduled.mapper.equipment.DeviceMapper; +import com.hnac.hzims.scheduled.service.equipment.DeviceParamService; import com.hnac.hzims.scheduled.service.equipment.DeviceService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * @author ysj @@ -20,8 +28,62 @@ import java.util.List; @Slf4j @DS("equipment") public class DeviceServiceImpl extends BaseServiceImpl implements DeviceService { + + private final DeviceParamService deviceParamService; + + /** + * 查询设备信息 + * @return + */ @Override public List device() { return this.baseMapper.device(); } + + /** + * 设备信息(包含配电比) + * @param refDetps + * @return + */ + @Override + public List rideDevices(List refDetps) { + // 查询设备 + List devices = this.list(Wrappers.lambdaQuery() + .in(EmInfoEntity::getDepartment,refDetps) + .eq(EmInfoEntity::getHomePageDisplay,"1") + ); + if(CollectionUtil.isEmpty(devices)){ + return new ArrayList<>(); + } + List paramList = deviceParamService.rides(devices.stream().map(EmInfoEntity::getId).collect(Collectors.toList())); + return devices.stream().map(device->{ + RideDeviceVo rideDevice = new RideDeviceVo(); + BeanUtil.copyProperties(device,rideDevice); + // 寻找设备配置参数 + List itemParamList = paramList.stream().filter(o->device.getId().equals(o.getInfoId())).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(itemParamList)) { + // 遍历设备配置参数 + for (EmParamEntity paramEntity : itemParamList) { + String param_name = paramEntity.getParamName(); + switch (param_name) { + case "ct": + rideDevice.setCt(Integer.parseInt(paramEntity.getParamValue())); + break; + case "pt": + rideDevice.setPt(Integer.parseInt(paramEntity.getParamValue())); + break; + default: + break; + } + } + // 设置ct * pt + if (null != rideDevice.getCt() && null != rideDevice.getPt()) { + rideDevice.setRide(rideDevice.getCt() * rideDevice.getPt()); + } + }else{ + rideDevice.setRide(1); + } + return rideDevice; + }).collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/ReportService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/ReportService.java index 24b3bd0..40f9bfa 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/ReportService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/ReportService.java @@ -6,5 +6,8 @@ package com.hnac.hzims.scheduled.service.operation.report; public interface ReportService { void loadMonthReport(String param, int i); + void loadMonthReportByType(String param, int year,Integer type,String key,String saveKey); + + void runMonthReport(String param); } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/RunMonService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/RunMonService.java new file mode 100644 index 0000000..546cbad --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/RunMonService.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.scheduled.service.operation.report; + +import com.hnac.hzims.operational.report.entity.RunMonthEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + */ +public interface RunMonService extends BaseService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java index 38ba1a2..f0cb559 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java @@ -1,29 +1,53 @@ package com.hnac.hzims.scheduled.service.operation.report.impl; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.hnac.hzims.alarm.config.constants.AlarmConstants; +import com.hnac.hzims.alarm.config.constants.AlarmHandleConstant; +import com.hnac.hzims.common.logs.utils.StringUtils; +import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.PlanGenerationEntity; +import com.hnac.hzims.equipment.vo.RideDeviceVo; import com.hnac.hzims.message.dto.MailPushDto; import com.hnac.hzims.message.fegin.IPushMsgClient; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.vo.AreaMonthReportVo; import com.hnac.hzims.operational.main.vo.MaintainVo; import com.hnac.hzims.operational.main.vo.OverhaulVo; -import com.hnac.hzims.operational.report.vo.DutyDefectVO; +import com.hnac.hzims.operational.report.entity.RunMonthEntity; +import com.hnac.hzims.operational.report.vo.*; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO; +import com.hnac.hzims.scheduled.service.equipment.DeviceService; import com.hnac.hzims.scheduled.service.equipment.PlanService; import com.hnac.hzims.scheduled.service.inspect.TaskService; import com.hnac.hzims.scheduled.service.operation.business.AccessService; import com.hnac.hzims.scheduled.service.operation.business.MaintenanceService; import com.hnac.hzims.scheduled.service.operation.business.PhenomenonService; +import com.hnac.hzims.scheduled.service.operation.plate.DataService; import com.hnac.hzims.scheduled.service.operation.report.ReportService; +import com.hnac.hzims.scheduled.service.operation.report.RunMonService; import com.hnac.hzims.scheduled.service.operation.station.StationService; import com.hnac.hzims.scheduled.service.safeproduct.MonthService; import com.hnac.hzims.scheduled.service.safeproduct.TrialService; import com.hnac.hzims.scheduled.service.ticket.TicketService; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; +import com.hnac.hzinfo.datasearch.PointData; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; +import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient; +import com.hnac.hzinfo.datasearch.history.OriginalDataQuery; +import com.hnac.hzinfo.datasearch.soe.ISoeClient; +import com.hnac.hzinfo.datasearch.soe.domian.SoeData; +import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation; import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; +import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; +import com.hnac.hzinfo.sdk.core.response.HzPage; +import com.hnac.hzinfo.sdk.core.response.Result; +import com.hnac.hzinfo.sdk.v5.soe.SoeDataClient; +import com.hnac.hzinfo.sdk.v5.soe.dto.StbAnalysisDTO; +import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; @@ -58,19 +82,44 @@ import java.util.stream.Collectors; public class ReportServiceImpl implements ReportService { private final PlanService planService; + private final TaskService taskService; + + private final DataService dataService; + private final TrialService trialService; + + private final MonthService monthService; + + private final RunMonService runMonService; + private final AccessService accessService; + private final TicketService ticketService; + + private final DeviceService deviceService; + private final StationService stationService; - private final MonthService monthService; + + private final PhenomenonService phenomenonService; + private final MaintenanceService maintenanceService; - private final RedisTemplate redisTemplate; + private final ISysClient sysClient; + private final IUserClient userClient; + + private final ISoeClient soeClient; + + private final SoeDataClient soeDataClient; + private final IPushMsgClient pushMsgClient; + private final IHistoryDataSearchClient historyDataSearchClient; + + private final RedisTemplate redisTemplate; + private final static String recent_year_cache_final = "hzims:operation:key:power:data"; public final static String wind_recent_year_cache = "hzims:operation:wind:power:data"; @@ -568,4 +617,439 @@ public class ReportServiceImpl implements ReportService { pushDto.setCreateDept(dept.getId()); pushMsgClient.sendMail(pushDto); } + + /** + * 运行月报告 + * @param param + */ + @Override + public void runMonthReport(String param) { + // 查询接入站点 + List stations = stationService.list(Wrappers.lambdaQuery() + .eq(StationEntity::getDataOrigin,HomePageConstant.DATA_ORIGIN) + .eq(StationEntity::getType,HomePageConstant.HYDROPOWER) + ); + if(CollectionUtil.isEmpty(stations)){ + return; + } + // 计划发电量 + List plans = planService.planGeneration(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null ,DateUtil.format(new Date(),"yyyy")); + // 查询站点设备 + List devices = deviceService.rideDevices(stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())); + List runs = new ArrayList<>(); + stations.forEach(station->{ + RunMonthEntity run = new RunMonthEntity(); + run.setStationCode(station.getCode()); + Calendar calendar = Calendar.getInstance(); + //calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); + calendar.add(Calendar.DAY_OF_MONTH,-1); + run.setMonth(DateUtil.format(calendar.getTime(),"yyyy-MM")); + List stationDevices = devices.stream().filter(device->device.getDepartment().equals(station.getRefDept())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(stationDevices)){ + return; + } + // 运行数据 + run.setRunData(this.runData(station.getCode(),stationDevices,plans)); + // 告警数据 + run.setAlarmData(this.alarmData(station.getCode())); + // 月度运行曲线 + run.setCurveData(this.curveData(stationDevices)); + // TODO 运行数据分析 + // TODO 运行建议及其他 + runs.add(run); + }); + runMonService.saveBatch(runs); + } + + /** + * 运行数据 + * @param devices + * @return + */ + private String runData(String stationCode,List devices,List plans) { + List runs = new ArrayList<>(); + devices.forEach(device->{ + RunDataVo run = new RunDataVo(); + run.setDeviceCode(device.getNumber()); + run.setDeviceName(device.getName()); + // 运行时长 + run.setRunHours(this.runHours(device)); + // 月发电量 + run.setGenerate(this.generate(0,device.getNumber(),device.getRide())); + // 年发电量 + run.setGenerateYear(this.generate(1,device.getNumber(),device.getRide())); + // 计划发电量 + run.setPlan(this.planGenerate(0,stationCode,plans)); + // 年计划发电量 + run.setPlanYear(this.planGenerate(1,stationCode,plans)); + runs.add(run); + }); + return JSONObject.toJSONString(runs); + } + + + /** + * 实际发电量 + * @param type + * @param deviceCode + * @param ride + * @return + */ + private Double generate(int type,String deviceCode,int ride) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); + String end = null,start = null; + int cycleType = 5; + switch (type){ + case 0 : + calendar.add(Calendar.DAY_OF_MONTH,-1); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE)); + calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); + end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1); + start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + break; + case 1 : + cycleType = 6; + end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.MONTH,-calendar.get(Calendar.MONTH)); + calendar.add(Calendar.DAY_OF_MONTH,-calendar.get(Calendar.DAY_OF_MONTH)); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE)); + calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); + start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + break; + } + return Double.valueOf(dataService.periodTargetFloat(start,end,5,cycleType,deviceCode,ride,HomePageConstant.HYDROPOWER_GENERATE_POWER)); + } + + /** + * 计划发电量 + * @param type + * @param stationCode + * @param plans + * @return + */ + private Double planGenerate(int type, String stationCode,List plans) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); + if(type == 0){ + calendar.add(Calendar.DAY_OF_MONTH,-1); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY) + 1); + calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE)); + calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); + String time = DateUtil.format(calendar.getTime(),"yyyy-MM"); + return plans.stream().filter(plan -> plan.getStationId().equals(stationCode) && plan.getDateTime().contains(time)) + .mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); + } + String time = DateUtil.format(calendar.getTime(),"yyyy"); + return plans.stream().filter(plan -> plan.getStationId().equals(stationCode) && plan.getDateTime().contains(time)) + .mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); + } + + + /** + * 获取运行数据 + * @param device + * @return + */ + private Double runHours(EmInfoEntity device) { + MultiAnalyzeCodePO analyze = new MultiAnalyzeCodePO(); + analyze.setDeviceCode(device.getNumber()); + analyze.setSignages(Collections.singletonList(HomePageConstant.ACTIVE_POWER)); + List signages = dataService.analyzeCodeBySignages(Collections.singletonList(analyze)); + if(CollectionUtil.isEmpty(signages)){ + return 0.0; + } + // 监测点 + String realId = signages.get(0).getRealId(); + if(StringUtils.isEmpty(realId)){ + return 0.0; + } + // 确定查询时间范围: 年、月 + Date startDate,endDate; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); + endDate = calendar.getTime(); + calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH)); + calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1); + startDate = calendar.getTime(); + return this.getRunConvertData(realId,startDate,endDate); + } + + /** + * 获取时间范围内运行时长 + * @param realId + * @param startDate + * @param endDate + * @return + */ + private Double getRunConvertData(String realId, Date startDate, Date endDate) { + OriginalDataQuery originalDataQuery = new OriginalDataQuery(); + originalDataQuery.setRealId(realId); + originalDataQuery.setBeginTime(startDate); + originalDataQuery.setEndTime(endDate); + originalDataQuery.setLimit(100000); + originalDataQuery.setPage(1); + // 查询时间范围开关机监测点历史数据 + Result> result = historyDataSearchClient.getOriginalDataByRealIds(originalDataQuery); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData())){ + return 0.0; + } + // 开机运行时长 + long time = this.getRunTime(result.getData().getRecords(),startDate,endDate); + return BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + + + /** + * 获取运行时长 + * @param result + * @return + */ + private long getRunTime(List result,Date startDate,Date endDate) { + if(result.size() == 1){ + // 一直开机 + if(Double.parseDouble(result.get(0).getValue()) > 0){ + return endDate.getTime() - startDate.getTime(); + } + // 一直关机 + return 0; + } + long time=0; + // 遍历累计开机时长 + for(int i = 0; i< result.size() ; i++){ + // 记录为开机状态 就计算到下次关机的时间差 + if(Double.parseDouble(result.get(i).getValue()) <= 0){ + continue; + } + Date endTime,startTime = DateUtil.parse(result.get(i).getTime(), DateUtil.PATTERN_DATETIME); + // 遍历至最后一条数据,累计至当前时间 + if(i == result.size() - 1){ + endTime = endDate; + }else { + endTime = DateUtil.parse(result.get(i+1).getTime(), DateUtil.PATTERN_DATETIME); + } + time += endTime.getTime() - startTime.getTime(); + } + return time; + } + + /** + * 告警数据 + * @param code + * @return + */ + private String alarmData(String code) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); + calendar.add(Calendar.DAY_OF_MONTH,-1); + String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.MONTH,-1); + calendar.add(Calendar.DAY_OF_MONTH,1); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE)); + calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + // HZ3000:故障告警 + List alarms = this.hz3000Alarm(code,start,end); + // FIXME 设备实例:一级告警 + // FDP智能预警 + // alarms.addAll(this.intelligentEarly(code,start,end)); + return JSONObject.toJSONString(alarms); + } + + /** + * 查询hz3000告警 + * @param code + */ + private List hz3000Alarm(String code,String start,String end) { + SoeQueryConditionByStation query = new SoeQueryConditionByStation(); + query.setStationIds(Collections.singletonList(code)); + query.setTypes(Collections.singletonList(AlarmHandleConstant.FAULT)); + query.setBeginTime(LocalDateTime.parse(start,DateUtil.DATETIME_FORMATTER)); + query.setEndTime(LocalDateTime.parse(end,DateUtil.DATETIME_FORMATTER)); + query.setNeedPage(false); + Result> result = soeClient.getByStationsAndTime(query); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){ + return new ArrayList<>(); + } + return result.getData().getRecords().stream().collect(Collectors.groupingBy(SoeData::getSoeExplain)).entrySet().stream().map(entry->{ + RunAlarmVo alarm = new RunAlarmVo(); + alarm.setAlarmTime(DateUtil.format(entry.getValue().stream().sorted(Comparator.comparing(SoeData::getTs)).collect(Collectors.toList()).get(0).getTs(),DateUtil.PATTERN_DATETIME)); + alarm.setDeviceName(entry.getValue().get(0).getDeviceName()); + alarm.setContent(entry.getKey()); + alarm.setType(String.valueOf(AlarmConstants.FAULT)); + alarm.setCount(Math.max(entry.getValue().stream().filter(o->StringUtil.isNotBlank(o.getTraceCount())).mapToInt(soe->Integer.parseInt(soe.getTraceCount())).sum(), 1)); + return alarm; + }).collect(Collectors.toList()); + } + + /** + * 智能预警 + * @param code + * @param start + * @param end + * @return + */ + private List intelligentEarly(String code, String start, String end) { + StbAnalysisDTO param = new StbAnalysisDTO(); + param.setStartTime(LocalDateTime.parse(start,DateUtil.DATETIME_FORMATTER)); + param.setEndTime(LocalDateTime.parse(end, DateUtil.DATETIME_FORMATTER)); + param.setStation(code); + param.setPage(0); + param.setPageSize(100000); + Result> result = soeDataClient.pageStbAnalysis(param); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){ + return new ArrayList<>(); + } + return result.getData().getRecords().stream().collect(Collectors.groupingBy(StbAnalysisVO::getContent)).entrySet().stream().map(entry->{ + RunAlarmVo alarm = new RunAlarmVo(); + alarm.setAlarmTime(entry.getValue().stream().sorted(Comparator.comparing(StbAnalysisVO::getTs)).collect(Collectors.toList()).get(0).getTs()); + alarm.setDeviceName(entry.getValue().get(0).getDevicename()); + alarm.setContent(entry.getKey()); + alarm.setType(String.valueOf(AlarmConstants.EARLY)); + alarm.setCount(entry.getValue().size()); + return alarm; + }).collect(Collectors.toList()); + } + + /** + * 运行曲线 + * @param devices + * @return + */ + private String curveData(List devices) { + List curveDatas = devices.stream().map(device->{ + CurveDataVo curveData = new CurveDataVo(); + curveData.setDeviceCode(device.getNumber()); + curveData.setDeviceName(device.getName()); + // 负荷曲线 + curveData.setLoadCurve(this.curve(this.attribute(0),device.getNumber())); + // 轴承温度曲线 + curveData.setBearingTempCurve(this.curve(this.attribute(1),device.getNumber())); + // 定子温度曲线 + curveData.setStatorTempCurve(this.curve(this.attribute(2),device.getNumber())); + return curveData; + }).collect(Collectors.toList()); + return JSONObject.toJSONString(curveDatas); + } + + /** + * 获取曲线数据 + * @param attributes + * @param deviceCode + * @return + */ + private List curve(List attributes, String deviceCode) { + Calendar calendar = Calendar.getInstance(); + //calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-01-01 00:00:00",DateUtil.PATTERN_DATETIME)); + calendar.add(Calendar.DAY_OF_MONTH,-1); + String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.MONTH,-1); + calendar.add(Calendar.DAY_OF_MONTH,1); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE)); + calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + List curveAttributes = new ArrayList<>(); + attributes.forEach(attribute -> { + CurveAttributeVo signage = new CurveAttributeVo(); + signage.setAttribute(attribute.getSignage()); + signage.setAttributeName(attribute.getSignageName()); + List records = dataService.periodTargetData(start,end,3,3,deviceCode,attribute.getSignage()); + if(CollectionUtil.isEmpty(records)){ + return; + } + signage.setCurves(records.stream().map(record -> { + CurveVo curve = new CurveVo(); + Date date = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); + if(date.getDate() > 9){ + curve.setTime("0" + date.getDay()); + }else{ + curve.setTime(date.getDay() + ""); + } + if(StringUtil.isEmpty(record.getVal())){ + curve.setValue(0.0); + }else{ + curve.setValue(Double.valueOf(record.getVal())); + } + return curve; + }).collect(Collectors.toList())); + curveAttributes.add(signage); + }); + return curveAttributes; + } + + /** + * 曲线属性获取 + * @param attributeType + * @return + */ + private List attribute(int attributeType) { + List attributes = new ArrayList<>(); + switch (attributeType){ + case 0: + AttributeVo attribute = new AttributeVo(); + attribute.setSignage(HomePageConstant.ACTIVE_POWER); + attribute.setSignageName("负荷"); + attributes.add(attribute); + break; + case 1: + + AttributeVo upper_temp = new AttributeVo(); + upper_temp.setSignage(HomePageConstant.UPPER_GUIDE_BEARING_TEMP); + upper_temp.setSignageName("上导轴承瓦温1"); + attributes.add(upper_temp); + AttributeVo oil_tem = new AttributeVo(); + oil_tem.setSignage(HomePageConstant.UPPER_GUIDE_BEARING_OIL_GROOVE_TEMP); + oil_tem.setSignageName("上导轴承油槽温度"); + attributes.add(oil_tem); + AttributeVo thrust_tem = new AttributeVo(); + thrust_tem.setSignage(HomePageConstant.THRUST_BEARING_TEMP); + thrust_tem.setSignageName("推力轴瓦温度1"); + attributes.add(thrust_tem); + AttributeVo lower_tem = new AttributeVo(); + lower_tem.setSignage(HomePageConstant.LOWER_GUIDE_BEARING_TEMP); + lower_tem.setSignageName("下导轴承瓦温1"); + attributes.add(lower_tem); + AttributeVo tank_tem = new AttributeVo(); + tank_tem.setSignage(HomePageConstant.LOWER_GUIDE_OIL_TANK_TEMP); + tank_tem.setSignageName("下导油槽温度"); + attributes.add(tank_tem); + AttributeVo tile_tem = new AttributeVo(); + tile_tem.setSignage(HomePageConstant.WATER_GUIDE_TILE_TEMP); + tile_tem.setSignageName("水导瓦温"); + attributes.add(tile_tem); + AttributeVo water_tem = new AttributeVo(); + water_tem.setSignage(HomePageConstant.WATER_GUIDE_OIL_TANK_TEMP); + water_tem.setSignageName("水导油槽温度"); + attributes.add(water_tem); + break; + case 2: + AttributeVo A_tem = new AttributeVo(); + A_tem.setSignage(HomePageConstant.A_PHASE_IRON_CORE_TEMP); + A_tem.setSignageName("A相铁芯温度1"); + attributes.add(A_tem); + + AttributeVo B_tem = new AttributeVo(); + B_tem.setSignage(HomePageConstant.A_PHASE_IRON_CORE_TEMP); + B_tem.setSignageName("B相铁芯温度1"); + attributes.add(B_tem); + + AttributeVo C_tem = new AttributeVo(); + C_tem.setSignage(HomePageConstant.A_PHASE_IRON_CORE_TEMP); + C_tem.setSignageName("C相铁芯温度1"); + attributes.add(C_tem); + break; + } + return attributes; + } + } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/RunMonServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/RunMonServiceImpl.java new file mode 100644 index 0000000..561be44 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/RunMonServiceImpl.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.scheduled.service.operation.report.impl; + +import com.hnac.hzims.operational.report.entity.RunMonthEntity; +import com.hnac.hzims.scheduled.mapper.operation.RunMonMapper; +import com.hnac.hzims.scheduled.service.operation.report.RunMonService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class RunMonServiceImpl extends BaseServiceImpl implements RunMonService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/DeviceParamMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/DeviceParamMapper.xml index 92ab12c..644212b 100644 --- a/hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/DeviceParamMapper.xml +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/DeviceParamMapper.xml @@ -4,7 +4,7 @@ + diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/RunMonMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/RunMonMapper.xml new file mode 100644 index 0000000..083443e --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/RunMonMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java index d83c0c7..ff76a0b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java @@ -102,7 +102,7 @@ public class OperAccessLibraryController extends BladeController { @ApiOperation(value = "检修库导入") @ApiOperationSupport(order = 7) @PostMapping(value = "/import") - public void libraryImport(@RequestParam MultipartFile multipartFile) { - service.libraryImport(multipartFile); + public void libraryImport(@RequestParam MultipartFile file) { + service.libraryImport(file); } } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessLibraryService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessLibraryService.java index 0abc6f7..9d83439 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessLibraryService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessLibraryService.java @@ -30,5 +30,5 @@ public interface IOperAccessLibraryService extends BaseService data(@RequestParam("mon") String mon, + @RequestParam("stationCode") String stationCode){ + return R.data(runMonthService.data(mon,stationCode)); + } + + @GetMapping("/export") + @ApiOperation(value = "导出站点运行月报",notes = "导出站点运行月报") + @ApiOperationSupport(order = 3) + public void export(@RequestParam("mon") String mon, + @RequestParam("stationCode") String stationCode){ + runMonthService.export(mon,stationCode); + } +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/MonthReportMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/MonthReportMapper.java index e9e1806..6f653ff 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/MonthReportMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/MonthReportMapper.java @@ -3,5 +3,8 @@ package com.hnac.hzims.operational.report.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.operational.report.entity.OperMonthReportEntity; +/** + * @author ysj + */ public interface MonthReportMapper extends BaseMapper { } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/RunMonthMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/RunMonthMapper.java new file mode 100644 index 0000000..6985ed5 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/mapper/RunMonthMapper.java @@ -0,0 +1,10 @@ +package com.hnac.hzims.operational.report.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.operational.report.entity.RunMonthEntity; + +/** + * @author ysj + */ +public interface RunMonthMapper extends BaseMapper { +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/RunMonthService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/RunMonthService.java new file mode 100644 index 0000000..aa172f4 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/RunMonthService.java @@ -0,0 +1,14 @@ +package com.hnac.hzims.operational.report.service; + +import com.hnac.hzims.operational.report.entity.RunMonthEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + */ +public interface RunMonthService extends BaseService { + + RunMonthEntity data(String mon, String stationCode); + + void export(String mon, String stationCode); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java new file mode 100644 index 0000000..96c01e4 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java @@ -0,0 +1,79 @@ +package com.hnac.hzims.operational.report.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.operational.report.entity.RunMonthEntity; +import com.hnac.hzims.operational.report.mapper.RunMonthMapper; +import com.hnac.hzims.operational.report.service.RunMonthService; +import com.hnac.hzims.operational.report.vo.RunDataShowVo; +import com.hnac.hzims.operational.report.vo.RunDataVo; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * @author ysj + */ +@Service +@AllArgsConstructor +@Slf4j +public class RunMonthServiceImpl extends BaseServiceImpl implements RunMonthService { + + /** + * 查询站点月报运行数据 + * @param mon + * @param stationCode + * @return + */ + @Override + public RunMonthEntity data(String mon, String stationCode) { + RunMonthEntity entity = this.getOne(Wrappers.lambdaQuery() + .eq(RunMonthEntity::getStationCode,stationCode) + .eq(RunMonthEntity::getMonth,mon) + ); + if(ObjectUtil.isEmpty(entity)){ + throw new ServiceException("站点" + mon + "月份未生成运行月报,请联系管理员进行处理!"); + } + RunDataShowVo data = new RunDataShowVo(); + BeanUtil.copyProperties(entity,data); + List run = JSONObject.parseObject(entity.getRunData(),new TypeReference>(){}); + if(CollectionUtil.isEmpty(run)){ + return data; + } + double monSumGenerate = run.stream().mapToDouble(RunDataVo::getGenerate).sum(); + double monSumPlan = run.stream().mapToDouble(RunDataVo::getPlan).sum(); + data.setMonSumGenerate(monSumGenerate); + data.setMonSumPlan(monSumPlan); + if(Math.abs(monSumGenerate) > 0 && Math.abs(monSumPlan) > 0){ + data.setMonRate(BigDecimal.valueOf(monSumGenerate / monSumPlan * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue()); + } + double yearSumGenerate = run.stream().mapToDouble(RunDataVo::getGenerateYear).sum(); + double yearSumPlan = run.stream().mapToDouble(RunDataVo::getPlanYear).sum(); + data.setYearSumGenerate(yearSumGenerate); + data.setYearSumPlan(yearSumPlan); + if(Math.abs(yearSumGenerate) > 0 && Math.abs(yearSumPlan) > 0){ + data.setYearRate(BigDecimal.valueOf(yearSumGenerate / yearSumPlan * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue()); + } + return data; + } + + /** + * 导出站点月报文件 + * @param mon + * @param stationCode + */ + @Override + public void export(String mon, String stationCode) { + + } +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java index f3500bb..ceeeb0d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hnac.hzims.common.utils.HiKUtil; +//import com.hnac.hzims.common.utils.HiKUtil; import com.hnac.hzims.operational.config.HikPathConfiguration; import com.hnac.hzims.operational.station.StationConstants; import com.hnac.hzims.operational.station.dto.StationVideoTypeDTO; @@ -213,7 +213,7 @@ public class StationVideoTypeServiceImpl extends BaseServiceImpl { param.put("cameraIndexCode",pointCode); - try{ + /*try{ String data = HiKUtil.send("/api/video/v2/cameras/previewURLs", param, finalHost, finalAppKey, finalAppSecret); if(StringUtil.isNotBlank(data)) { Map url = new HashMap() {{ @@ -224,7 +224,7 @@ public class StationVideoTypeServiceImpl extends BaseServiceImplXaYGIZtAcs?r)851S=yOW+&BMXIma~Fj-73@5{C#UBgbTaL2*V-5Gl;X zz`*eJzW@Wn96>=bZZU2K7OBaef@+h)1^Fk}2`Wy0F38WwKl#3(_~c`P{9IxT3$|iOJ`IW^EG^nw%iQ#wa!UKalrKNQhB-@n1GI$2*X?(peGpE7=sxy z7*c_-gu#$uvWe4LMuo|boQxTlZWeQPV&~>yUtRvw6f;DbGa^B~^=r11ZLMxcH) zlMZCO^RJxot_;6PaS(GKoEJ)Vgc!vJbPg7yS_5}R<2MS!Bz6Y&$=iJPZ1R&}V$q(! X7qnR>;13fkgYf5%%QnjfKV|^{5Hz+1 delta 1060 zcmZ{jxl02<7{$MdW7e2}na#0DRI-hVIZz0mh{S**UI=2Zg*Gb0zhG0TAXsFCH1<}) z;#w&lm4$_kM=hvjz```5=s1&&$~wh1zy0QY@4eYAn5bYPa~0RW^c)s_bRBQH?#HY* zeC?teN`gHp>q?1u0*wGr`Sb(40%Y~94sb!+NPFWRAz^RW3phsSNxSj$R)2sXG&xUk z&UA#@EikQYgsE{(BwYQ=!}ffQSNGO^+xj4y(Z%J0_OV?;&g18Cz#h&+zj(=8V(tZJ zy294(^0Juk