Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 4 months ago
parent
commit
9ea4cc62f3
  1. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java
  2. 26
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricDeviceGenerateVo.java
  3. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricDevicePowerVo.java
  4. 72
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricDeviceVo.java
  5. 28
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricGenerateMonVo.java
  6. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricPowerRainVo.java
  7. 68
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricStationVo.java
  8. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/wind/vo/RainMon.java
  9. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java
  10. 26
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/pv/PowerRainVo.java
  11. 13
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ProjectEntity.java
  12. 15
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java
  13. 9
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java
  14. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  15. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
  16. 11
      hzims-service/hzims-alarm/src/main/resources/dict/dict.sql
  17. 34
      hzims-service/hzims-basic/pom.xml
  18. 8
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
  19. 1
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
  20. 7
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java
  21. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java
  22. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java
  23. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  24. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  25. 12
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java
  26. 30
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java
  27. 8
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectListQueryVO.java
  28. 31
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java
  29. 6
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  30. 15
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml
  31. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  32. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/StorageServiceImpl.java
  33. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java
  34. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/controller/HydroelectricController.java
  35. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/HydroelectricService.java
  36. 316
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java
  37. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  38. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java
  39. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  40. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java
  41. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java
  42. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java
  43. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java

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

@ -69,4 +69,6 @@ public interface AlarmConstants {
String FDP_INVALID_STATUS = "1.0"; String FDP_INVALID_STATUS = "1.0";
String FDP_INVALID_ZOME_STATUS = "1"; String FDP_INVALID_ZOME_STATUS = "1";
List<Integer> WHOLE_ALARM_TYPE = Arrays.asList(AlarmConstants.WARNING,AlarmConstants.FAULT,AlarmConstants.OFFSIDE,AlarmConstants.INTERRUPT,AlarmConstants.ABNORMAL,AlarmConstants.EARLY,AlarmConstants.START,AlarmConstants.STOP);
} }

26
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricDeviceGenerateVo.java

@ -0,0 +1,26 @@
package com.hnac.hzims.operational.homePage.Hydroelectric.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
*/
@Data
@ApiModel(value = "站点首页-设备近30天发电量")
public class HydroelectricDeviceGenerateVo {
@ApiModelProperty(value = "日期")
private String date;
@ApiModelProperty(value = "发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float generate;
@ApiModelProperty(value = "功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float load;
}

22
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricDevicePowerVo.java

@ -0,0 +1,22 @@
package com.hnac.hzims.operational.homePage.Hydroelectric.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
@ApiModel(value = "站点首页-设备近24小时功率曲线")
public class HydroelectricDevicePowerVo {
@ApiModelProperty(value = "字符串时间")
private String strHour;
@ApiModelProperty(value = "小时")
private Integer hour;
@ApiModelProperty(value = "有功功率")
private String activePower;
}

72
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricDeviceVo.java

@ -0,0 +1,72 @@
package com.hnac.hzims.operational.homePage.Hydroelectric.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
@ApiModel(value = "站点首页-设备信息")
public class HydroelectricDeviceVo {
@ApiModelProperty(value = "设备编号")
private String deivceCode;
@ApiModelProperty(value = "设备名称")
private String deivceName;
@ApiModelProperty(value = "开关机状态: 0 - 关机 1 - 开机")
private Boolean state;
@ApiModelProperty(value = "总装机容量")
private Double installedCapacity;
@ApiModelProperty(value = "有功功率")
private Double activePower;
@ApiModelProperty(value = "容量利用率")
private Double capacityRate;
@ApiModelProperty(value = "无功功率")
private Double reactivePower;
@ApiModelProperty(value = "导叶开度")
private Double guideOpen;
@ApiModelProperty(value = "今日发电量")
private Float powerDay;
@ApiModelProperty(value = "昨日发电量")
private Float powerYesterDay;
@ApiModelProperty(value = "当年发电量")
private Float powerYear;
@ApiModelProperty(value = "去年发电量")
private Float powerYesterYear;
@ApiModelProperty(value = "当月发电量")
private Float powerMon;
@ApiModelProperty(value = "本次开机时间")
private String startDownTime;
@ApiModelProperty(value = "本次开机时长")
private Double startupDownDuration;
@ApiModelProperty(value = "年停机时长")
private Double shutDownDurationYear;
@ApiModelProperty(value = "年开机时长")
private Double startupDurationYear;
@ApiModelProperty(value = "设备近24小时有功功率")
private List<HydroelectricDevicePowerVo> powers;
@ApiModelProperty(value = "设备近30日发电量")
private List<HydroelectricDeviceGenerateVo> generates;
}

28
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricGenerateMonVo.java

@ -0,0 +1,28 @@
package com.hnac.hzims.operational.homePage.Hydroelectric.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
@ApiModel(value = "月发电对象")
public class HydroelectricGenerateMonVo {
@ApiModelProperty(value = "年份")
private Integer year;
@ApiModelProperty(value = "月份")
private Integer month;
@ApiModelProperty(value = "字符串格式月份")
private String strMonth;
@ApiModelProperty(value = "月发电量")
private Double power;
@ApiModelProperty(value = "计划发电量")
private Double planPower;
}

22
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricPowerRainVo.java

@ -0,0 +1,22 @@
package com.hnac.hzims.operational.homePage.Hydroelectric.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
@ApiModel(value = "站点首页-最近30日发电量/降雨量")
public class HydroelectricPowerRainVo {
@ApiModelProperty(value = "日期")
private String date;
@ApiModelProperty(value = "发电量")
private Double generate;
@ApiModelProperty(value = "降雨")
private Double rain;
}

68
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/Hydroelectric/vo/HydroelectricStationVo.java

@ -0,0 +1,68 @@
package com.hnac.hzims.operational.homePage.Hydroelectric.vo;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
@ApiModel(value = "水电站首页-站点")
public class HydroelectricStationVo {
@ApiModelProperty(value = "站点编号")
private String stationCode;
@ApiModelProperty(value = "站点名称")
private String stationName;
@ApiModelProperty(value = "总装机容量")
private Double installedCapacity;
@ApiModelProperty(value = "总发电负荷")
private Double powerSum;
@ApiModelProperty(value = "容量利用率")
private Double capacityRate;
@ApiModelProperty(value = "月计划发电量")
private Double powerMonPlan;
@ApiModelProperty(value = "月发电量")
private Double powerMon;
@ApiModelProperty(value = "月发电量完成率")
private Double powerRateMon;
@ApiModelProperty(value = "年计划发电量")
private Double powerYearPlan;
@ApiModelProperty(value = "年发电量")
private Double powerYear;
@ApiModelProperty(value = "年发电完成率")
private Double powerRateYear;
@ApiModelProperty(value = "今日发电量")
private Double powerDay;
@ApiModelProperty(value = "昨日发电量")
private Double powerYesterDay;
@ApiModelProperty(value = "七日内天气")
private List<Daily> weather;
@ApiModelProperty(value = "设备集合")
private List<HydroelectricDeviceVo> devices;
@ApiModelProperty(value = "降雨/发电量曲线")
private List<HydroelectricPowerRainVo> powerRains;
@ApiModelProperty(value = "降雨/发电量曲线")
private List<HydroelectricGenerateMonVo> generateMons;
}

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/home/wind/RainMon.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/homePage/wind/vo/RainMon.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.home.wind; package com.hnac.hzims.operational.homePage.wind.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java

@ -1,7 +1,7 @@
package com.hnac.hzims.operational.main.vo; package com.hnac.hzims.operational.main.vo;
import com.hnac.hzims.hzimsweather.response.weather.Daily; import com.hnac.hzims.hzimsweather.response.weather.Daily;
import com.hnac.hzims.operational.main.vo.pv.PowerRainVo; import com.hnac.hzims.operational.homePage.Hydroelectric.vo.HydroelectricPowerRainVo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -80,7 +80,7 @@ public class HydropowerStationVo {
private List<Daily> weather; private List<Daily> weather;
@ApiModelProperty(value = "降雨/发电量曲线") @ApiModelProperty(value = "降雨/发电量曲线")
private List<PowerRainVo> powerRains; private List<HydroelectricPowerRainVo> powerRains;
@ApiModelProperty(value = "前水位曲线数据") @ApiModelProperty(value = "前水位曲线数据")
private Map<Integer,String> frontCurveMap; private Map<Integer,String> frontCurveMap;

26
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/pv/PowerRainVo.java

@ -1,26 +0,0 @@
package com.hnac.hzims.operational.main.vo.pv;
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
*/
@Data
@ApiModel(value = "当日机组有功功率")
public class PowerRainVo {
@ApiModelProperty(value = "日期")
private String date;
@ApiModelProperty(value = "发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "降雨")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double rain;
}

13
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ProjectEntity.java

@ -13,7 +13,6 @@ import org.springblade.core.tenant.mp.TenantEntity;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
/** /**
* 巡检项目实体类 * 巡检项目实体类
* *
@ -28,20 +27,13 @@ public class ProjectEntity extends TenantEntity {
private static final long serialVersionUID = -1105554271550820235L; private static final long serialVersionUID = -1105554271550820235L;
/**
* 项目编码
*/
@ApiModelProperty(value = "项目编码") @ApiModelProperty(value = "项目编码")
private String code; private String code;
/**
* 项目名称
*/
@ApiModelProperty(value = "项目名称长度必须为1到128") @ApiModelProperty(value = "项目名称长度必须为1到128")
@Size(min=1,max = 128,message ="项目名称长度必须为1到128") @Size(min=1,max = 128,message ="项目名称长度必须为1到128")
private String name; private String name;
/**
* 项目描述
*/
@ApiModelProperty(value = "项目描述长度必须为0到512") @ApiModelProperty(value = "项目描述长度必须为0到512")
@Size(min=0,max = 512,message ="项目描述长度必须为0到512") @Size(min=0,max = 512,message ="项目描述长度必须为0到512")
private String description; private String description;
@ -62,5 +54,4 @@ public class ProjectEntity extends TenantEntity {
@ApiModelProperty("设备编号") @ApiModelProperty("设备编号")
private String emCode; private String emCode;
} }

15
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java

@ -1,6 +1,5 @@
package com.hnac.hzims.spare.service.impl; package com.hnac.hzims.spare.service.impl;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
@ -33,7 +32,6 @@ import com.hnac.hzims.spare.utils.SheetWriteStyleHandler;
import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -171,7 +169,6 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
List<WtSpBasicVO> voList = new ArrayList<>(); List<WtSpBasicVO> voList = new ArrayList<>();
IPage<WtSpBasicVO> voPages = new Page<>(); IPage<WtSpBasicVO> voPages = new Page<>();
if (Func.isNotEmpty(spBasicEntity.getName()) && "工具".equals(spBasicEntity.getName())) { if (Func.isNotEmpty(spBasicEntity.getName()) && "工具".equals(spBasicEntity.getName())) {
// if(Func.isNotEmpty(spBasicEntity.getName())){
List<WtSpManagementEntity> list = managementService.list(Wrappers.<WtSpManagementEntity>query().lambda(). List<WtSpManagementEntity> list = managementService.list(Wrappers.<WtSpManagementEntity>query().lambda().
eq(WtSpManagementEntity::getName, spBasicEntity.getName())); eq(WtSpManagementEntity::getName, spBasicEntity.getName()));
if (list.size() == 0) { if (list.size() == 0) {
@ -218,13 +215,6 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
basicVO.setStock(0L); basicVO.setStock(0L);
} }
BeanUtils.copyProperties(basicEntity, basicVO); BeanUtils.copyProperties(basicEntity, basicVO);
List<TicketInfoStatisticVO> ticketVOS = ticketInfoAllClient.getTicketStatistic("2022-02");
// R<Dept> deptR = sysClient.getDept(basicEntity.getWaterPlantId());
// if(Func.isNotEmpty(deptR.getData())){
// basicVO.setWaterPlantName(deptR.getData().getDeptName());
// }
voList.add(basicVO); voList.add(basicVO);
} else { } else {
WtSpBasicVO basicVO = new WtSpBasicVO(); WtSpBasicVO basicVO = new WtSpBasicVO();
@ -240,16 +230,11 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
if (null != totalEntity) { if (null != totalEntity) {
List<WtSpTotalEntity> totalList = totalService.list(Wrappers.<WtSpTotalEntity>query().lambda().eq(WtSpTotalEntity::getSpBasicId, basicEntity.getId())); List<WtSpTotalEntity> totalList = totalService.list(Wrappers.<WtSpTotalEntity>query().lambda().eq(WtSpTotalEntity::getSpBasicId, basicEntity.getId()));
if (totalList.size() > 0) { if (totalList.size() > 0) {
// basicVO.setStock(totalList.get(0).getStock());
basicVO.setStock(totalEntity.getStock()); basicVO.setStock(totalEntity.getStock());
} else { } else {
basicVO.setStock(0L); basicVO.setStock(0L);
} }
BeanUtils.copyProperties(basicEntity, basicVO); BeanUtils.copyProperties(basicEntity, basicVO);
// R<Dept> deptR = sysClient.getDept(basicEntity.getWaterPlantId());
// if(Func.isNotEmpty(deptR.getData())){
// basicVO.setWaterPlantName(deptR.getData().getDeptName());
// }
voList.add(basicVO); voList.add(basicVO);
} }
List<WtSpTotalEntity> totalEntities = totalMapper.selectByWarehouseId(warehouseId); List<WtSpTotalEntity> totalEntities = totalMapper.selectByWarehouseId(warehouseId);

9
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java

@ -37,8 +37,10 @@ public class RealTimeDataServerImpl implements RealTimeDataServer {
@Override @Override
public R<List<FieldsData>> getData(RealDataSearchPO po) { public R<List<FieldsData>> getData(RealDataSearchPO po) {
R<List<FieldsData>> res = analyseDataSearchClient.getRealDataByAnalyzeCode(po);
List<FieldsData> data = null; String msg = res.getMsg();
if ("操作成功".equals(msg)) {
List<FieldsData> data;
try { try {
data = analyseDataSearchClient.getRealDataByAnalyzeCode(po).getData(); data = analyseDataSearchClient.getRealDataByAnalyzeCode(po).getData();
} catch (Exception e) { } catch (Exception e) {
@ -47,7 +49,8 @@ public class RealTimeDataServerImpl implements RealTimeDataServer {
if (CollectionUtil.isNotEmpty(data)) { if (CollectionUtil.isNotEmpty(data)) {
return R.data(data); return R.data(data);
} }
return R.data(null); }
return R.fail(msg);
} }
@Override @Override

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

@ -245,7 +245,7 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, AlarmEntity> impl
// 条件过滤 // 条件过滤
QueryWrapper<AlarmEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<AlarmEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(AlarmEntity::getStationId,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); queryWrapper.lambda().in(AlarmEntity::getStationId,stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
queryWrapper.lambda().in(AlarmEntity::getAlarmType, Arrays.asList(AlarmConstants.WARNING,AlarmConstants.FAULT,AlarmConstants.OFFSIDE,AlarmConstants.INTERRUPT,AlarmConstants.ABNORMAL,AlarmConstants.EARLY,AlarmConstants.START,AlarmConstants.STOP)); queryWrapper.lambda().in(AlarmEntity::getAlarmType, AlarmConstants.WHOLE_ALARM_TYPE);
queryWrapper.lambda().eq(AlarmEntity::getIsRightTabulation,0); queryWrapper.lambda().eq(AlarmEntity::getIsRightTabulation,0);
queryWrapper.lambda().ge(AlarmEntity::getAlarmTime, DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"); queryWrapper.lambda().ge(AlarmEntity::getAlarmTime, DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00");
queryWrapper.lambda().le(AlarmEntity::getAlarmTime,DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); queryWrapper.lambda().le(AlarmEntity::getAlarmTime,DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME));

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.alarm.source.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.config.entity.AlarmEntity; import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.source.service.MessageService; import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.alarm.ws.alart.AlarmSessionManager; import com.hnac.hzims.alarm.ws.alart.AlarmSessionManager;
@ -70,6 +71,9 @@ public class MessageServiceImpl implements MessageService {
*/ */
@Override @Override
public void webRightMessage(AlarmEntity alarm) { public void webRightMessage(AlarmEntity alarm) {
if(!AlarmConstants.WHOLE_ALARM_TYPE.contains(alarm.getAlarmType())){
return;
}
if(CollectionUtil.isEmpty(AlarmSessionManager.SESSION_POOL)){ if(CollectionUtil.isEmpty(AlarmSessionManager.SESSION_POOL)){
return; return;
} }

11
hzims-service/hzims-alarm/src/main/resources/dict/dict.sql

@ -56,3 +56,14 @@ insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_
insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) values (1651150146049789954, 1651149948657455106, 'alarm_handle_type', '4', '检修', 4, '', 0, 0, 0, -1, 'hzims-alarm'); insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) values (1651150146049789954, 1651149948657455106, 'alarm_handle_type', '4', '检修', 4, '', 0, 0, 0, -1, 'hzims-alarm');
insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) values (1651150182032723969, 1651149948657455106, 'alarm_handle_type', '5', '处理', 5, '', 0, 0, 0, -1, 'hzims-alarm'); insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) values (1651150182032723969, 1651149948657455106, 'alarm_handle_type', '5', '处理', 5, '', 0, 0, 0, -1, 'hzims-alarm');
insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) values (1651150182032756242, 1651149948657455106, 'alarm_handle_type', '6', '处理完成', 5, '', 0, 0, 0, -1, 'hzims-alarm'); insert into `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) values (1651150182032756242, 1651149948657455106, 'alarm_handle_type', '6', '处理完成', 5, '', 0, 0, 0, -1, 'hzims-alarm');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106981, 1658763247160922117, 'WHOLE_ALARM_TYPE', '2', '告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106982, 1658763247160922117, 'WHOLE_ALARM_TYPE', '3', '故障', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106983, 1658763247160922117, 'WHOLE_ALARM_TYPE', '5', '遥测越限', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106984, 1658763247160922117, 'WHOLE_ALARM_TYPE', '13', '通讯中断', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106985, 1658763247160922117, 'WHOLE_ALARM_TYPE', '14', '数据异常', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106986, 1658763247160922117, 'WHOLE_ALARM_TYPE', '60', '开机告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106987, 1658763247160922117, 'WHOLE_ALARM_TYPE', '61', '关机告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160106988, 1658763247160922117, 'WHOLE_ALARM_TYPE', '30', '智能预警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM');

34
hzims-service/hzims-basic/pom.xml

@ -49,6 +49,40 @@
<artifactId>hzims-operational-api</artifactId> <artifactId>hzims-operational-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.3.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions> <exclusions>

8
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java

@ -97,7 +97,7 @@ public class PresonManagementController extends BladeController {
@OperationAnnotation(moduleName = "档案管理",title = "档案管理",operatorType = OperatorType.MOBILE,businessType = @OperationAnnotation(moduleName = "档案管理",title = "档案管理",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action BusinessType.GENCODE,action
= "档案管理") = "档案管理")
public void exportPersonManagemetVo(HttpServletResponse response,PersonManagemetVo personManagemetVo) { public void exportPersonManagemetVo(HttpServletResponse response,PersonManagemetVo personManagemetVo) throws IOException {
try { try {
response.setContentType("application/vnd.ms-excel"); response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
@ -111,8 +111,9 @@ public class PresonManagementController extends BladeController {
EasyExcel.write(response.getOutputStream(), PersonManagemetExportVo.class).autoCloseStream(Boolean.FALSE).sheet("档案管理报表") EasyExcel.write(response.getOutputStream(), PersonManagemetExportVo.class).autoCloseStream(Boolean.FALSE).sheet("档案管理报表")
.doWrite(list); .doWrite(list);
} }
response.getOutputStream().close();
} catch (Exception e) { } catch (Exception e) {
System.out.println("exportExcel = " + e); e.printStackTrace();
// 重置response // 重置response
response.reset(); response.reset();
response.setContentType("application/json"); response.setContentType("application/json");
@ -122,9 +123,12 @@ public class PresonManagementController extends BladeController {
map.put("msg", "档案管理报表导出失败" + e.getMessage()); map.put("msg", "档案管理报表导出失败" + e.getMessage());
try { try {
response.getWriter().println(JSONUtil.toJsonStr(map)); response.getWriter().println(JSONUtil.toJsonStr(map));
response.getOutputStream().close();
} catch (IOException e3) { } catch (IOException e3) {
response.getOutputStream().close();
throw new ServiceException( "发生异常 :" + e); throw new ServiceException( "发生异常 :" + e);
} }
} }
} }

1
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java

@ -38,6 +38,7 @@ public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonMan
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "depetIds")List<Long> depetIds, @Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "depetIds")List<Long> depetIds,
@Param(value = "current")Integer current, @Param(value = "size")Integer size) ; @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
@UserDataAuth
List<PersonManagemetExportVo> exportPersonManagemet( List<PersonManagemetExportVo> exportPersonManagemet(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime, @Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job, @Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,

7
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java

@ -45,8 +45,9 @@ public abstract class ProcessAbstractService implements ProcessService {
@Override @Override
public R startFlow(String userId, String dictValue, String taskId, String processName, Map<String, Object> variables) { public R startFlow(String userId, String dictValue, String taskId, String processName, Map<String, Object> variables) {
log.info("开启流程....."); log.info("开启流程.....");
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
R r = new R(); R r = new R();
try {
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
r.setCode(result.getCode()); r.setCode(result.getCode());
r.setMsg(result.getMsg()); r.setMsg(result.getMsg());
// 更新任务流程Id // 更新任务流程Id
@ -61,6 +62,10 @@ public abstract class ProcessAbstractService implements ProcessService {
pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg()); pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg());
} }
return r; return r;
}catch (Exception e){
log.error(e.toString()) ;
}
return R.fail("开启流程失败");
} }
// public R compensateFlow(String userId,String dictValue,String taskId,String processName,Map<String, Object> variables) { // public R compensateFlow(String userId,String dictValue,String taskId,String processName,Map<String, Object> variables) {
// R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); // R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);

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

@ -24,8 +24,4 @@ public class ScheduledApplication {
BladeApplication.run("hzims-scheduled", ScheduledApplication.class, args); BladeApplication.run("hzims-scheduled", ScheduledApplication.class, args);
} }
// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// return BladeApplication.createSpringApplicationBuilder(builder, "hzims-scheduled", ScheduledApplication.class);
// }
} }

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

@ -75,10 +75,9 @@ public class GenerationScheduledTask {
* @param param * @param param
* @return * @return
*/ */
//@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION) @XxlJob(LOAD_THREE_YEAR_POWER_GENERATION)
@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadThreeYearPowerGeneration() { public ReturnT<String> loadThreeYearPowerGeneration(String param) {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }

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

@ -59,10 +59,9 @@ public class RealTargetScheduledTask {
/** /**
* 水电站-机组指标加载 * 水电站-机组指标加载
*/ */
//@XxlJob(LOAD_HYDROPOWER_UNIT_TARGET) @XxlJob(LOAD_HYDROPOWER_UNIT_TARGET)
@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadHydropowerTarget() { public ReturnT<String> loadHydropowerTarget(String param) {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }

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

@ -13,7 +13,7 @@ import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.hzimsweather.feign.IHeWeatherWeatherClient; import com.hnac.hzims.hzimsweather.feign.IHeWeatherWeatherClient;
import com.hnac.hzims.hzimsweather.vo.RainFallCountByMonthVo; import com.hnac.hzims.hzimsweather.vo.RainFallCountByMonthVo;
import com.hnac.hzims.operational.fill.entity.RainfallEntity; import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.home.wind.RainMon; import com.hnac.hzims.operational.homePage.wind.vo.RainMon;
import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.station.StationConstants; import com.hnac.hzims.operational.station.StationConstants;
@ -1488,7 +1488,7 @@ public class RealTargetServiceImpl implements RealTargetService {
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.add(Calendar.DAY_OF_MONTH,-1); calendar.add(Calendar.DAY_OF_MONTH,-1);
// 开始日期 // 开始日期
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; String start = DateUtil.format(calendar.getTime(),"yyyy-MM-dd HH") + ":00:00";
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) { if (CollectionUtil.isEmpty(records)) {
return new ArrayList<>(); return new ArrayList<>();

12
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java

@ -1,16 +1,16 @@
package com.hnac.hzinfo.inspect.obj.services; package com.hnac.hzinfo.inspect.obj.services;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
import com.hnac.hzinfo.inspect.obj.vo.ProjectListQueryVO;
import com.hnac.hzinfo.inspect.obj.vo.ProjectOfflineVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectOfflineVO;
import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -59,4 +59,12 @@ public interface ProjectService extends IService<ProjectEntity> {
List<Map<String,Object>> deptProjectTree(ProjectDTO project); List<Map<String,Object>> deptProjectTree(ProjectDTO project);
List<ProjectVO> projects(String emCode, ContentDTO content); List<ProjectVO> projects(String emCode, ContentDTO content);
/**
* 查询列表
* @param project 参数
* @param query 分页类
* @return 巡检项目管理列表
*/
IPage<ProjectEntity> getList(ProjectListQueryVO project, Query query);
} }

30
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java

@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzinfo.inspect.Constants; import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.ObjectConstants; import com.hnac.hzinfo.inspect.obj.ObjectConstants;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
@ -14,11 +13,13 @@ import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ContentEntity;
import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity;
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity;
import com.hnac.hzinfo.inspect.obj.mapper.ProjectContentMapper;
import com.hnac.hzinfo.inspect.obj.mapper.ProjectMapper; import com.hnac.hzinfo.inspect.obj.mapper.ProjectMapper;
import com.hnac.hzinfo.inspect.obj.services.ContentService; import com.hnac.hzinfo.inspect.obj.services.ContentService;
import com.hnac.hzinfo.inspect.obj.services.ProjectContentService; import com.hnac.hzinfo.inspect.obj.services.ProjectContentService;
import com.hnac.hzinfo.inspect.obj.services.ProjectService; import com.hnac.hzinfo.inspect.obj.services.ProjectService;
import com.hnac.hzinfo.inspect.obj.utils.CodeUtils; import com.hnac.hzinfo.inspect.obj.utils.CodeUtils;
import com.hnac.hzinfo.inspect.obj.vo.ProjectListQueryVO;
import com.hnac.hzinfo.inspect.obj.vo.ProjectOfflineVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectOfflineVO;
import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import com.hnac.hzinfo.inspect.obj.wrapper.ContentWrapper; import com.hnac.hzinfo.inspect.obj.wrapper.ContentWrapper;
@ -29,7 +30,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.*; import org.springblade.core.tool.utils.*;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -49,8 +51,10 @@ import java.util.stream.Stream;
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity> implements ProjectService { public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity> implements ProjectService {
private final ContentService contentService; private final ContentService contentService;
private final ISysClient sysClient; private final ISysClient sysClient;
//private final ProjectContentService projectContentService;
private final ProjectContentMapper projectContentMapper;
@Override @Override
public boolean save(ProjectEntity entity) { public boolean save(ProjectEntity entity) {
@ -202,6 +206,26 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
} }
/** /**
* 查询列表
*/
@Override
public IPage<ProjectEntity> getList(ProjectListQueryVO project, Query query) {
LambdaQueryWrapper<ProjectEntity> queryWrapper = Condition.getQueryWrapper(new ProjectEntity(), project);
queryWrapper.orderByDesc(ProjectEntity::getUpdateTime);
if (!AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) {
queryWrapper.eq(ProjectEntity::getTenantId, AuthUtil.getTenantId());
}
IPage<ProjectEntity> pages = this.page(Condition.getPage(query), queryWrapper);
pages.getRecords().forEach(entity->{
QueryWrapper<ProjectContentEntity> qw = new QueryWrapper<>();
qw.lambda().eq(ProjectContentEntity::getProjectId, entity.getId());
Long contentNum = projectContentMapper.selectCount(qw);
entity.setContentNum(contentNum.intValue());
});
return pages;
}
/**
* 获取项目树中 机构下巡检项目的子集 * 获取项目树中 机构下巡检项目的子集
* @param project 筛选条件 * @param project 筛选条件
* @param deptId 机构ID * @param deptId 机构ID

8
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectListQueryVO.java

@ -20,18 +20,13 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
public class ProjectListQueryVO implements Serializable { public class ProjectListQueryVO implements Serializable {
private static final long serialVersionUID = -953928646703619934L; private static final long serialVersionUID = -953928646703619934L;
/**
* 项目编码
*/
@ApiModelProperty(value = "项目编码") @ApiModelProperty(value = "项目编码")
@QueryField(condition = SqlCondition.LIKE) @QueryField(condition = SqlCondition.LIKE)
private String code; private String code;
/**
* 项目名称
*/
@ApiModelProperty(value = "项目名称") @ApiModelProperty(value = "项目名称")
@QueryField(condition = SqlCondition.LIKE) @QueryField(condition = SqlCondition.LIKE)
private String name; private String name;
@ -54,5 +49,4 @@ public class ProjectListQueryVO implements Serializable {
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "创建机构") @ApiModelProperty(value = "创建机构")
private Long createDept; private Long createDept;
} }

31
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java

@ -23,11 +23,8 @@ import com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
@ -61,24 +58,13 @@ public class ProjectController {
@Autowired @Autowired
private ISysClient sysClient; private ISysClient sysClient;
/**
* 巡检项目列表
*/
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "巡检项目列表", notes = "巡检项目列表") @ApiOperation(value = "巡检项目列表", notes = "巡检项目列表")
@OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE, businessType = @OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE, businessType =
BusinessType.GENCODE, BusinessType.GENCODE,
action = "查询巡检项目管理列表") action = "查询巡检项目管理列表")
public R<IPage<ProjectEntity>> list(ProjectListQueryVO project, Query query) { public R<IPage<ProjectEntity>> list(ProjectListQueryVO project, Query query) {
LambdaQueryWrapper<ProjectEntity> queryWrapper = Condition.getQueryWrapper(new ProjectEntity(),project); IPage<ProjectEntity> pages = projectService.getList(project, query);
queryWrapper.orderByDesc(ProjectEntity::getUpdateTime);
IPage<ProjectEntity> pages = projectService.page(Condition.getPage(query), (!AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(ProjectEntity::getTenantId, AuthUtil.getTenantId()) : queryWrapper);
pages.getRecords().forEach(entity->{
QueryWrapper<ProjectContentEntity> qw = new QueryWrapper<>();
qw.lambda().eq(ProjectContentEntity::getProjectId, entity.getId());
Long contentNum = projectContentService.count(qw);
entity.setContentNum(contentNum.intValue());
});
return R.data(pages); return R.data(pages);
} }
@ -89,9 +75,6 @@ public class ProjectController {
return R.data(projectService.deptProjectTree(project)); return R.data(projectService.deptProjectTree(project));
} }
/**
* 查询单条
*/
@ApiOperation(value = "查看详情", notes = "传入id") @ApiOperation(value = "查看详情", notes = "传入id")
@GetMapping("/detail") @GetMapping("/detail")
public R<ProjectEntity> detail(Long id) { public R<ProjectEntity> detail(Long id) {
@ -99,9 +82,6 @@ public class ProjectController {
return R.data(project); return R.data(project);
} }
/**
* 新增或修改
*/
@PostMapping("/submit") @PostMapping("/submit")
@ApiOperation(value = "新增或修改", notes = "传入巡检项目") @ApiOperation(value = "新增或修改", notes = "传入巡检项目")
public R<Boolean> submit(@Valid @RequestBody ProjectEntity project) { public R<Boolean> submit(@Valid @RequestBody ProjectEntity project) {
@ -111,9 +91,6 @@ public class ProjectController {
return R.status(projectService.saveOrUpdate(project)); return R.status(projectService.saveOrUpdate(project));
} }
/**
* 删除
*/
@PostMapping("/remove") @PostMapping("/remove")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ApiOperation(value = "删除", notes = "传入id集合") @ApiOperation(value = "删除", notes = "传入id集合")
@ -137,9 +114,6 @@ public class ProjectController {
return R.success("删除成功!"); return R.success("删除成功!");
} }
/**
* 启用/停用
*/
@GetMapping("/disableOrEnable") @GetMapping("/disableOrEnable")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ApiOperation(value = "启用/停用", notes = "传入id,以及状态") @ApiOperation(value = "启用/停用", notes = "传入id,以及状态")
@ -155,9 +129,6 @@ public class ProjectController {
return R.status(projectService.update(ew)); return R.status(projectService.update(ew));
} }
/**
* 根据ids 批量复制
*/
@PostMapping("/insertCopyBatch") @PostMapping("/insertCopyBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合") @ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids, public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids,

6
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java

@ -143,12 +143,8 @@ public class TaskController extends BladeController {
*/ */
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "分页显示任务列表", notes = "传入task") @ApiOperation(value = "分页显示任务列表", notes = "传入task")
@Operate(label = "查询巡检任务分页列表-2",type = BusinessType.QUERY,ignore = false) @Operate(label = "查询巡检任务分页列表-2",type = BusinessType.QUERY)
public R<BladePage<TaskVo>> list(TaskListQuery task, Query query) { public R<BladePage<TaskVo>> list(TaskListQuery task, Query query) {
//CacheUtil.put("test#2","inspect","test","12");
// LambdaQueryWrapper<TaskEntity> queryWrapper = Condition.getQueryWrapper(new TaskEntity(),task);
// queryWrapper.orderByDesc(TaskEntity::getUpdateTime);
// IPage<TaskEntity> pages = taskService.page(Condition.getPage(query), queryWrapper);
IPage<TaskVo> pages = Condition.getPage(query); IPage<TaskVo> pages = Condition.getPage(query);
if (!AuthUtil.isAdministrator()) { if (!AuthUtil.isAdministrator()) {
task.setCurUserId(AuthUtil.getUserId()); task.setCurUserId(AuthUtil.getUserId());

15
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

@ -132,9 +132,13 @@
</select> </select>
<select id="getListPage" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo"> <select id="getListPage" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">
SELECT t.*,u.USER_ID from HZ_ST_EX_TASK t SELECT
LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID t.*, u.USER_ID
where t.IS_DELETED=0 and u.IS_DELETED=0 from
HZ_ST_EX_TASK t
left join HZ_ST_EX_TASK_USER u on t.ID = u.TASK_ID
where
t.IS_DELETED = 0 and u.IS_DELETED = 0
<if test="task.dutyId != null "> <if test="task.dutyId != null ">
and t.DUTY_ID = #{task.dutyId} and t.DUTY_ID = #{task.dutyId}
</if> </if>
@ -174,14 +178,15 @@
<if test="task.taskIds != null and task.taskIds != ''"> <if test="task.taskIds != null and task.taskIds != ''">
and FIND_IN_SET(t.ID, #{task.taskIds}) and FIND_IN_SET(t.ID, #{task.taskIds})
</if> </if>
<if test="task.areaId != null"> <if test="task.createDept != null">
and t.CREATE_DEPT = #{task.areaId} and t.CREATE_DEPT = #{task.createDept}
</if> </if>
<if test="task.yearMonth != null"> <if test="task.yearMonth != null">
and date_format(t.PLAN_START_TIME,'%Y-%m') = #{task.yearMonth} and date_format(t.PLAN_START_TIME,'%Y-%m') = #{task.yearMonth}
</if> </if>
order by t.UPDATE_TIME desc order by t.UPDATE_TIME desc
</select> </select>
<select id="getAllPageList" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo"> <select id="getAllPageList" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">
SELECT SELECT
t.*, b.USER_ID as userIds, t.*, b.USER_ID as userIds,

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -112,6 +112,11 @@ public class DefectCheckServiceImpl extends ServiceImpl<OperPhenomenonMapper, Op
if (StringUtils.isNotBlank(AuthUtil.getNickName())){ if (StringUtils.isNotBlank(AuthUtil.getNickName())){
entity.setCreateUserName(AuthUtil.getNickName()); entity.setCreateUserName(AuthUtil.getNickName());
} }
if (StringUtils.isNotBlank(entity.getInitResult())){
entity.setInitResult( entity.getInitResult().replaceAll("\n",""));
entity.setInitResult( entity.getInitResult().replaceAll("</p>",""));
entity.setInitResult( entity.getInitResult().replaceAll("<p>",""));
}
R r=new R(); R r=new R();
//加锁 //加锁
Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + entity.getCreateDept(), entity.getCreateDept(), 30, TimeUnit.SECONDS); Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + entity.getCreateDept(), entity.getCreateDept(), 30, TimeUnit.SECONDS);

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/StorageServiceImpl.java

@ -69,11 +69,12 @@ public class StorageServiceImpl extends ServiceImpl<StorageMapper, StorageEntity
StorageEntity history = this.getOne(new LambdaQueryWrapper<StorageEntity>(){{ StorageEntity history = this.getOne(new LambdaQueryWrapper<StorageEntity>(){{
eq(StorageEntity::getStationCode, entity.getStationCode()); eq(StorageEntity::getStationCode, entity.getStationCode());
eq(StorageEntity::getFillDate,entity.getFillDate()); eq(StorageEntity::getFillDate,entity.getFillDate());
ne(ObjectUtil.isNotEmpty(entity.getId()),StorageEntity::getId,entity.getId());
}}); }});
if(ObjectUtil.isNotEmpty(history) && (ObjectUtil.isEmpty(entity.getId()) || !entity.getId().equals(history.getId()))){ if(ObjectUtil.isNotEmpty(history)){
throw new ServiceException("日期已经存在填报数据!"); throw new ServiceException("日期已经存在填报数据!");
} }
if(ObjectUtil.isEmpty(history)){ if(ObjectUtil.isEmpty(history) && ObjectUtil.isEmpty(entity.getId())){
return this.save(entity); return this.save(entity);
} }
return this.updateById(entity); return this.updateById(entity);

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.fill.entity.StorageEntity;
import com.hnac.hzims.operational.fill.entity.UseEntity; import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.mapper.UseMapper; import com.hnac.hzims.operational.fill.mapper.UseMapper;
import com.hnac.hzims.operational.fill.service.UseService; import com.hnac.hzims.operational.fill.service.UseService;
@ -97,11 +98,12 @@ public class UseServiceImpl extends ServiceImpl<UseMapper, UseEntity> implements
UseEntity history = this.getOne(new LambdaQueryWrapper<UseEntity>(){{ UseEntity history = this.getOne(new LambdaQueryWrapper<UseEntity>(){{
eq(UseEntity::getStationCode, entity.getStationCode()); eq(UseEntity::getStationCode, entity.getStationCode());
eq(UseEntity::getFillDate,entity.getFillDate()); eq(UseEntity::getFillDate,entity.getFillDate());
ne(ObjectUtil.isNotEmpty(entity.getId()), UseEntity::getId,entity.getId());
}}); }});
if(ObjectUtil.isNotEmpty(history) && (ObjectUtil.isEmpty(entity.getId()) || !entity.getId().equals(history.getId()))){ if(ObjectUtil.isNotEmpty(history)){
throw new ServiceException("日期已经存在填报数据!"); throw new ServiceException("日期已经存在填报数据!");
} }
if(ObjectUtil.isEmpty(history)){ if(ObjectUtil.isEmpty(history) && ObjectUtil.isEmpty(entity.getId())){
return this.save(entity); return this.save(entity);
} }
return this.updateById(entity); return this.updateById(entity);

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

@ -0,0 +1,35 @@
package com.hnac.hzims.operational.homePage.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.homePage.Hydroelectric.vo.HydroelectricStationVo;
import com.hnac.hzims.operational.homePage.service.HydroelectricService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ysj
*/
@RestController
@RequestMapping("/hydroelectric")
@Api(value = "水电站-首页", tags = "水电站-首页")
@AllArgsConstructor
public class HydroelectricController extends BladeController {
private final HydroelectricService hydroelectricService;
@ApiOperation("水电站站点指标")
@GetMapping("/station")
@ApiOperationSupport(order = 1)
public R<HydroelectricStationVo> station(@RequestParam("deptId") Long deptId) {
return R.data(hydroelectricService.station(deptId));
}
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/HydroelectricService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.operational.homePage.service;
import com.hnac.hzims.operational.homePage.Hydroelectric.vo.HydroelectricStationVo;
/**
* 水电站-首页接口
* @author ysj
*/
public interface HydroelectricService {
HydroelectricStationVo station(Long deptId);
}

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

@ -0,0 +1,316 @@
package com.hnac.hzims.operational.homePage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.feign.IPlanGenertionClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.equipment.vo.PlanPowerYearVo;
import com.hnac.hzims.hzimsweather.feign.IRainfallClient;
import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse;
import com.hnac.hzims.operational.homePage.Hydroelectric.vo.*;
import com.hnac.hzims.operational.homePage.service.HydroelectricService;
import com.hnac.hzims.operational.main.service.IWeatherService;
import com.hnac.hzims.operational.main.vo.HydropowerUnitRealVo;
import com.hnac.hzims.operational.main.vo.HydropowerUnitTargetVo;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* 水电站-首页接口实现类
* @author ysj
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class HydroelectricServiceImpl implements HydroelectricService {
private final IStationService stationService;
private final IWeatherService weatherService;
private final IRainfallClient rainClient;
private final IPlanGenertionClient planClient;
private final RedisTemplate redisTemplate;
private final static String RECENT_YEAR_POWER_DATA = "hzims:operation:key:power:data";
private final static String LOAD_HYDROPOWER_REAL_KEY = "hzims:operation:loadhydropowerunit:real:key";
private final static String LOAD_HYDROPOWER_TARGET_KEY = "hzims:operation:loadhydropowerunit:target:key";
private final static String DEVICE_CACHE_COFIG_FINAL = "hzims:equipment:emInfo:deviceCode.emInfoList";
/**
* 水电站首页-站点首页
* @param deptId
* @return
*/
@Override
public HydroelectricStationVo station(Long deptId) {
// 步骤1.查询站点
StationEntity station = stationService.getOne(Wrappers.<StationEntity>lambdaQuery().eq(StationEntity::getRefDept,deptId));
if(ObjectUtil.isEmpty(station)){
return new HydroelectricStationVo();
}
// 步骤2.数据准备
// 设备
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(DEVICE_CACHE_COFIG_FINAL).toString(),new TypeReference<List<EminfoAndEmParamVo>>() {});
// 实时数据
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_REAL_KEY);
// 指标数据
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY);
// 降雨数据
List<Map<String, Object>> rains = this.nearThirtyRains(station.getCode());
// 七日天气
Map<String, HeWeatherWeatherDailyResponse> weathers = this.weekWeather(Collections.singletonList(station.getCode()));
// 近3年发电量
Map<String, Map<String, Float>> map = (Map<String, Map<String, Float>>) redisTemplate.opsForValue().get(RECENT_YEAR_POWER_DATA);
// 计划发电量
List<PlanPowerYearVo> plans = planClient.getPlanPowerByYear(station.getCode(), Integer.parseInt(DateUtil.format(new Date(),"yyyy")));
// 步骤3.数据处理、赋值
HydroelectricStationVo result = new HydroelectricStationVo();
result.setStationCode(station.getCode());
result.setStationName(station.getName());
// 天气
if(MapUtils.isNotEmpty(weathers) && weathers.containsKey(station.getCode())){
HeWeatherWeatherDailyResponse week = weathers.get(station.getCode());
if(ObjectUtil.isNotEmpty(week) && CollectionUtil.isNotEmpty(week.getDaily())){
result.setWeather(week.getDaily());
}
}
// 设备
if(CollectionUtil.isNotEmpty(devices)){
result.setDevices(devices.stream().map(iter->{
HydroelectricDeviceVo device = new HydroelectricDeviceVo();
Optional<HydropowerUnitRealVo> real = reals.stream().filter(o-> iter.getEmCode().equals(o.getDeviceCode())).findFirst();
// 实时数据
if(real.isPresent()){
device.setState(real.get().getState());
device.setInstalledCapacity(real.get().getInstalledCapacity());
device.setActivePower(real.get().getActivePower());
device.setReactivePower(real.get().getReactivePower());
device.setGuideOpen(real.get().getGuideOpen());
if(device.getActivePower() > 0 && device.getReactivePower() > 0){
device.setCapacityRate(BigDecimal.valueOf(device.getActivePower() / device.getInstalledCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}else{
device.setCapacityRate(0.0);
}
}
// 指标数据
Optional<HydropowerUnitTargetVo> target = targets.stream().filter(o-> iter.getEmCode().equals(o.getDeviceCode())).findFirst();
if(target.isPresent()){
device.setPowerDay(target.get().getPowerDay());
device.setPowerYesterDay(target.get().getPowerYesterDay());
device.setPowerYear(target.get().getPowerYear());
device.setPowerYesterYear(target.get().getPowerYesterYear());
device.setPowerMon(target.get().getPowerMon());
device.setStartDownTime(target.get().getStartDownTime());
device.setStartupDownDuration(target.get().getStartupDownDuration());
device.setStartupDurationYear(target.get().getStartupDurationYear());
device.setShutDownDurationYear(target.get().getShutDownDurationYear());
if(CollectionUtil.isNotEmpty(target.get().getActivePowerVoList())){
device.setPowers(target.get().getActivePowerVoList().stream().map(o-> BeanUtil.copy(o, HydroelectricDevicePowerVo.class)).collect(Collectors.toList()));
}
if(CollectionUtil.isNotEmpty(target.get().getActivePowerVoList())){
device.setGenerates(target.get().getGenerationPowerVoList().stream().map(o-> BeanUtil.copy(o, HydroelectricDeviceGenerateVo.class)).collect(Collectors.toList()));
}
}
return device;
}).collect(Collectors.toList()));
}
// 站点指标数据
if(CollectionUtil.isNotEmpty(result.getDevices())){
// 装机容量、发电负荷
result.setInstalledCapacity(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getInstalledCapacity).sum());
result.setPowerSum(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getActivePower).sum());
if(result.getInstalledCapacity() > 0 && result.getPowerSum() > 0 ){
result.setCapacityRate(BigDecimal.valueOf(result.getPowerSum() / result.getInstalledCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}else{
result.setCapacityRate(0.0);
}
// 月计划发电量、月已发电量
if(CollectionUtil.isNotEmpty(plans)){
result.setPowerMonPlan(plans.stream().filter(plan -> plan.getMon().contains(DateUtil.format(new Date(),"yyyy-NM"))).mapToDouble(PlanPowerYearVo::getPlanPower).sum());
}else{
result.setPowerMonPlan(0.0);
}
result.setPowerMon(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerMon).sum());
// 年计划发电量、年已发电量
if(CollectionUtil.isNotEmpty(plans)){
result.setPowerYearPlan(plans.stream().mapToDouble(PlanPowerYearVo::getPlanPower).sum());
}else{
result.setPowerYearPlan(0.0);
}
result.setPowerYear(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerYear).sum());
// 今日发电量、昨日发电量
result.setPowerDay(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerDay).sum());
result.setPowerYesterDay(result.getDevices().stream().mapToDouble(HydroelectricDeviceVo::getPowerYesterDay).sum());
// 近30日降雨量/发电量
result.setPowerRains(this.stationPowerRains(result.getDevices(),rains));
// 电站月发电/计划发电
result.setGenerateMons(this.stationGenerateMons(plans,map.get(station.getCode())));
}
return result;
}
/**
* 站点近30天降雨数据
* @param station
* @return
*/
private List<Map<String, Object>> nearThirtyRains(String station) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
calendar.add(Calendar.DAY_OF_MONTH,-29);
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
R<List<Map<String, Object>>> rains = rainClient.getDurationRainFall(station,start,end);
if(!rains.isSuccess() || CollectionUtil.isEmpty(rains.getData())){
return new ArrayList<>();
}
return rains.getData();
}
/**
* 站点七天天气
* @param stations
*/
private Map<String, HeWeatherWeatherDailyResponse> weekWeather(List stations) {
if(CollectionUtil.isEmpty(stations)){
return new HashMap<>();
}
// 实时天气
return weatherService.getWeekWeather(stations);
}
/**
* 站点近30天降雨量/发电量
* @param devices
* @return
*/
private List<HydroelectricPowerRainVo> stationPowerRains(List<HydroelectricDeviceVo> devices,List<Map<String, Object>> rains) {
List<HydroelectricDeviceGenerateVo> generates = new ArrayList<>();
devices.forEach(device->{
generates.addAll(device.getGenerates());
});
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-1);
Date end = calendar.getTime();
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));
calendar.add(Calendar.DAY_OF_MONTH,-29);
Date start = calendar.getTime();
List<HydroelectricPowerRainVo> powerRains = new ArrayList<>();
while (start.compareTo(end) < 0) {
HydroelectricPowerRainVo powerRain = new HydroelectricPowerRainVo();
// 日期
powerRain.setDate(DateUtil.format(calendar.getTime(),"yyyy-MM-dd"));
// 发电量
powerRain.setGenerate(generates.stream().filter(o-> powerRain.getDate().equals(o.getDate())).mapToDouble(HydroelectricDeviceGenerateVo::getGenerate).sum());
// 降雨量
if(CollectionUtil.isNotEmpty(rains)){
powerRain.setRain(rains.stream().mapToDouble(map->{
if (map.get("fx_date").equals(powerRain.getDate())) {
Object object = map.get("precip");
if(ObjectUtil.isEmpty(object)){
return 0.0;
}else{
return Double.parseDouble(object.toString());
}
}
return 0.0;
}).sum());
}else{
powerRain.setRain(0.0);
}
powerRains.add(powerRain);
calendar.add(Calendar.DAY_OF_MONTH,1);
start = calendar.getTime();
}
return powerRains;
}
/**
* 站点电站月发电/计划发电
* @param plans
* @param map
* @return
*/
private List<HydroelectricGenerateMonVo> stationGenerateMons(List<PlanPowerYearVo> plans, Map<String, Float> map) {
// 获取月份集合
List<String> mons = this.mons(0,12,false);
return mons.stream().map(mon->{
Date date = DateUtil.parse(mon,DateUtil.PATTERN_DATE);
HydroelectricGenerateMonVo generateMon = new HydroelectricGenerateMonVo();
generateMon.setStrMonth(mon);
generateMon.setYear(date.getYear());
generateMon.setMonth(date.getMonth() + 1);
// 计划发电量
if(CollectionUtil.isNotEmpty(plans)){
generateMon.setPlanPower(plans.stream().filter(plan -> plan.getMon().contains(DateUtil.format(date,"yyyy-MM"))).mapToDouble(PlanPowerYearVo::getPlanPower).sum());
}else{
generateMon.setPlanPower(0.0);
}
// 实际发电
if(MapUtils.isNotEmpty(map)){
generateMon.setPower(map.entrySet().stream().filter(entry->entry.getKey().equals(mon)).mapToDouble(Map.Entry::getValue).sum());
}else{
generateMon.setPlanPower(0.0);
}
return generateMon;
}).collect(Collectors.toList());
}
/**
* 获取近年月份集合
* @param year
* @return
*/
public List<String> mons(int year, int endMoth, boolean nextMon) {
List<String> list = new ArrayList<>();
// 开始日期
Calendar endCal = Calendar.getInstance();
endCal.setTime(new Date());
endCal.add(Calendar.MONTH, -endCal.get(Calendar.MONTH) + endMoth);
endCal.add(Calendar.DATE, -endCal.get(Calendar.DATE) + 1);
// 结束日期
Calendar startCal = Calendar.getInstance();
startCal.setTime(new Date());
startCal.set(Calendar.YEAR, startCal.get(Calendar.YEAR) - year);
startCal.add(Calendar.MONTH, -startCal.get(Calendar.MONTH));
startCal.add(Calendar.DATE, -startCal.get(Calendar.DATE) + 1);
// 获取日期之间的月份
while (endCal.after(startCal)) {
list.add(DateUtil.format(startCal.getTime(),DateUtil.PATTERN_DATE));
startCal.add(Calendar.MONTH, 1);
}
if(nextMon){
list.add(DateUtil.format(endCal.getTime(),DateUtil.PATTERN_DATE));
}
return list;
}
}

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -18,11 +18,11 @@ import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService; import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo; import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo;
import com.hnac.hzims.operational.homePage.Hydroelectric.vo.HydroelectricPowerRainVo;
import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.entity.UserDeptEntity; import com.hnac.hzims.operational.main.entity.UserDeptEntity;
import com.hnac.hzims.operational.main.service.*; import com.hnac.hzims.operational.main.service.*;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.main.vo.pv.PowerRainVo;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
@ -193,7 +193,7 @@ public class HydropowerServiceImpl implements HydropowerService {
* @param rains * @param rains
* @return * @return
*/ */
private List<PowerRainVo> getPowerRains(StationEntity station,List<HydropowerUnitVo> devices, List<Map<String, Object>> rains) { private List<HydroelectricPowerRainVo> getPowerRains(StationEntity station,List<HydropowerUnitVo> devices, List<Map<String, Object>> rains) {
List<GenerationPowerVo> powers = new ArrayList<>(); List<GenerationPowerVo> powers = new ArrayList<>();
if(CollectionUtil.isNotEmpty(devices)){ if(CollectionUtil.isNotEmpty(devices)){
devices.forEach(device->{ devices.forEach(device->{
@ -205,7 +205,7 @@ public class HydropowerServiceImpl implements HydropowerService {
// 根据日期遍历 // 根据日期遍历
List<String> days = this.get30Day(); List<String> days = this.get30Day();
return days.stream().map(day->{ return days.stream().map(day->{
PowerRainVo powerRain = new PowerRainVo(); HydroelectricPowerRainVo powerRain = new HydroelectricPowerRainVo();
powerRain.setDate(day); powerRain.setDate(day);
if(CollectionUtil.isEmpty(powers)){ if(CollectionUtil.isEmpty(powers)){
powerRain.setGenerate(0.0); powerRain.setGenerate(0.0);
@ -383,6 +383,7 @@ public class HydropowerServiceImpl implements HydropowerService {
private List<String> get30Day() { private List<String> get30Day() {
List<String> times = new ArrayList<>(); List<String> times = new ArrayList<>();
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-1);
Date end = calendar.getTime(); Date end = calendar.getTime();
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE)); calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE));

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

@ -4,7 +4,7 @@ import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.hzimsweather.response.weather.Daily; import com.hnac.hzims.hzimsweather.response.weather.Daily;
import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse;
import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherNowResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherNowResponse;
import com.hnac.hzims.operational.home.wind.RainMon; import com.hnac.hzims.operational.homePage.wind.vo.RainMon;
import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.service.AreaService; import com.hnac.hzims.operational.main.service.AreaService;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -819,6 +819,9 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, StationEntity
if (StringUtil.isNotBlank(entity.getName())) { if (StringUtil.isNotBlank(entity.getName())) {
like(StationEntity::getName, "%".concat(entity.getName()).concat("%")); like(StationEntity::getName, "%".concat(entity.getName()).concat("%"));
} }
if (ObjectUtil.isNotEmpty(entity.getServeType())) {
eq(StationEntity::getServeType, entity.getServeType());
}
if (ObjectUtil.isNotEmpty(entity.getType())) { if (ObjectUtil.isNotEmpty(entity.getType())) {
eq(StationEntity::getType, entity.getType()); eq(StationEntity::getType, entity.getType());
} }

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.controller; package com.hnac.hzims.safeproduct.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
@ -26,6 +27,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SpringUtil; import org.springblade.core.tool.utils.SpringUtil;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -84,18 +86,13 @@ public class SafetyToolController extends BladeController {
return safetyToolService.doUpdate(safetyTool); return safetyToolService.doUpdate(safetyTool);
} }
/**
* 详情
*/
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情", notes = "传入safetyTool") @ApiOperation(value = "详情", notes = "传入safetyTool")
@Operate(label = "详情", type = com.hnac.hzinfo.log.contants.BusinessType.QUERY, ignore = false) @Operate(label = "详情", type = com.hnac.hzinfo.log.contants.BusinessType.QUERY, ignore = false)
public R<SafetyToolVO> detail(@RequestParam("id") Long id) { public R<SafetyToolVO> detail(@RequestParam("id") Long id) {
SafetyToolEntity detail = safetyToolService.getOne(Condition.getQueryWrapper(new SafetyToolEntity() {{ SafetyToolVO safetyToolVO = safetyToolService.detail(id);
setId(id); return R.data(safetyToolVO);
}}));
return R.data(SafetyToolWrapper.build().entityVO(detail));
} }
/** /**

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java

@ -31,7 +31,7 @@ public class DangerSourceClient implements IDangerSourceClient {
@Override @Override
@GetMapping(DETAILS) @GetMapping(DETAILS)
public List<DangerSourceEntity> details(@RequestParam String[] ids) { public List<DangerSourceEntity> details(@RequestParam("ids") String[] ids) {
List<DangerSourceEntity> resp = service.listByIds(Arrays.asList(ids)); List<DangerSourceEntity> resp = service.listByIds(Arrays.asList(ids));
//未查到数据返回空集合 //未查到数据返回空集合
if (CollectionUtils.isEmpty(resp)) { if (CollectionUtils.isEmpty(resp)) {

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java

@ -45,4 +45,11 @@ public interface ISafetyToolService extends IService<SafetyToolEntity> {
* @return * @return
*/ */
R remove(List<Long> idList); R remove(List<Long> idList);
/**
* 详情
* @param id 安全工器具id
* @return 安全工器具VO类
*/
SafetyToolVO detail(Long id);
} }

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java

@ -38,6 +38,7 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.*; import org.springblade.core.tool.utils.*;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
@ -275,6 +276,20 @@ public class SafetyToolServiceImpl extends ServiceImpl<SafetyToolMapper, SafetyT
return R.status(removeByIds(idList)); return R.status(removeByIds(idList));
} }
/**
* 详情
*/
@Override
public SafetyToolVO detail(Long id) {
SafetyToolEntity detail = this.getOne(Condition.getQueryWrapper(new SafetyToolEntity() {{
setId(id);
}}));
if (cn.hutool.core.util.ObjectUtil.isEmpty(detail)) {
throw new ServiceException(ResultCode.REQ_REJECT, "没有访问该安全工器具的权限");
}
return SafetyToolWrapper.build().entityVO(detail);
}
/** /**
* 工器具Code唯一性校验 * 工器具Code唯一性校验

Loading…
Cancel
Save