Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
tyty 1 year ago
parent
commit
48943d60c0
  1. 3
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/request/StationInfoReq.java
  2. 0
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/vo/StationRealVo.java
  3. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java
  4. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealAttributeVo.java
  5. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java
  6. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java
  7. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WeatherVo.java
  8. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/DutyDefectVO.java
  9. 2
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
  10. 132
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java
  11. 58
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java
  12. 11
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
  13. 12
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java
  14. 65
      hzims-service/hzims-scheduled/pom.xml
  15. 59
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
  16. 17
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/PlanMapper.java
  17. 10
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/WorkshopInfoMapper.java
  18. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskMapper.java
  19. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.java
  20. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AccessMapper.java
  21. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DefectMapper.java
  22. 17
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/GenerateMapper.java
  23. 21
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.java
  24. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/MaintenanceMapper.java
  25. 9
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/ModelStationMapper.java
  26. 5
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/OtherMapper.java
  27. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/OverDetailsMapper.java
  28. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/OverMapper.java
  29. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/PhenomenonMapper.java
  30. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/PowerMapper.java
  31. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/RecordMapper.java
  32. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/SolveMapper.java
  33. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StFocusPropertiesMapper.java
  34. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttrConfigMapper.java
  35. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttributeMapper.java
  36. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.java
  37. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/UseMapper.java
  38. 10
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/CompanyMapper.java
  39. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/InstanceMapper.java
  40. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/MonthMapper.java
  41. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/TrialMapper.java
  42. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/TicketEvaluateMapper.java
  43. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/TicketMapper.java
  44. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkTicketMapper.java
  45. 65
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  46. 126
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  47. 40
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java
  48. 54
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
  49. 38
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java
  50. 101
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StAlamRecordTask.java
  51. 16
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/HistoryAbnormalAlarmService.java
  52. 17
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IHzimsAnalyzeModelStationService.java
  53. 16
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IMainSystemMonitoringService.java
  54. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IRealMonitorService.java
  55. 16
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttrConfigService.java
  56. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttributeService.java
  57. 27
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationService.java
  58. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IWaterService.java
  59. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StAlamRecordService.java
  60. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StFocusPropertiesService.java
  61. 16
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/PlanService.java
  62. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/WorkshopInfoService.java
  63. 35
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/PlanServiceImpl.java
  64. 21
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/WorkshopInfoServiceImpl.java
  65. 242
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/AbnormalAlarmServiceImpl.java
  66. 41
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HistoryAbnormalAlarmServiceImpl.java
  67. 17
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HzimsAnalyzeModelStationServiceImpl.java
  68. 51
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/MainSystemMonitoringServiceImpl.java
  69. 164
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StFocusPropertiesServiceImpl.java
  70. 22
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationAttributeServiceImpl.java
  71. 60
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationServiceImpl.java
  72. 201
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/WaterServiceImpl.java
  73. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/TaskService.java
  74. 64
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java
  75. 10
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AbnormalAlarmService.java
  76. 17
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AccessService.java
  77. 22
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AnalyseDataService.java
  78. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/DefectService.java
  79. 25
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/GenerateService.java
  80. 18
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java
  81. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ModelStationService.java
  82. 21
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MonitorService.java
  83. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/OtherService.java
  84. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/OverDetailsService.java
  85. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/OverService.java
  86. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java
  87. 17
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PowerService.java
  88. 34
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/RealTargetService.java
  89. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/RecordService.java
  90. 9
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ReportService.java
  91. 9
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java
  92. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/SolveService.java
  93. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/StationAttrConfigService.java
  94. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/StationAttributeService.java
  95. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/StationService.java
  96. 29
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/UseService.java
  97. 33
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AbnormalAlarmServiceImpl.java
  98. 86
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AccessServiceImpl.java
  99. 139
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AnalyseDataServiceImpl.java
  100. 55
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DefectServiceImpl.java
  101. Some files were not shown because too many files have changed in this diff Show More

3
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/request/StationInfoReq.java

@ -36,4 +36,7 @@ public class StationInfoReq implements Serializable {
@ApiModelProperty("站点描述")
private String stationDesc;
@ApiModelProperty("租户ID")
private String tenantId;
}

0
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/StationRealVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/vo/StationRealVo.java

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

@ -146,7 +146,7 @@ public interface HomePageConstant {
// 水利-泵组实时属性名称
String JOINT_RELAY = "joint_relay"; // 开机状态
String SWITCH_ON_OFF = "switch_on_off"; // 开机状态
String OFF = "1"; // 开机
String OFF = "1.0"; // 开机
String ON = "0"; // 关机
String ELECTRICITY_CONSUMPTION = "electricity_consumption"; // 用电量

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/vo/RealAttributeVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealAttributeVo.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.vo;
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/vo/RealDeviceVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.vo;
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/vo/RealStationVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.vo;
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/vo/WeatherVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WeatherVo.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.vo;
package com.hnac.hzims.operational.main.vo;
import lombok.Data;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DutyDefectVO.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/DutyDefectVO.java

@ -3,6 +3,9 @@ package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
public class DutyDefectVO{

2
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java

@ -53,6 +53,8 @@ public class MessageConstants {
DUTY("duty","值班消息"),
SAFE("safe","安全消息"),
ACCESS("access","检修消息"),
TICKETMESSAGE("ticket-message","工作票消息"),
OPERATIONTICKETMESSAGE("operation-ticket-message","操作票消息"),
;
@Getter
private String key;

132
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java

@ -2,77 +2,85 @@ package com.hnac.hzims.ticket.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Optional;
/**
* 工作票中所需常数定义
*
* @author hx
*/
public interface WorkTicketConstants {
@AllArgsConstructor
enum WorkTicketMeasureTypeEnum {
/**第一种安措**/
ONE("1","matterLibraryListOne"),
/**第二种安措**/
TWO("2","matterLibraryListTwo"),
/**第三种安措**/
THREE("3","matterLibraryListThree"),
FOUR("4","matterLibraryListFour"),
Five("5","matterLibraryListFive"),
Flow("6","matterLibraryListFlow"),
;
@Getter
private String type;
@Getter
private String convertAttributes;
}
@AllArgsConstructor
enum WorkTicketMeasureTypeEnum {
/** 第一种安措 **/
ONE("1", "matterLibraryListOne"),
/** 第二种安措 **/
TWO("2", "matterLibraryListTwo"),
/** 第三种安措 **/
THREE("3", "matterLibraryListThree"),
FOUR("4", "matterLibraryListFour"),
Five("5", "matterLibraryListFive"),
Flow("6", "matterLibraryListFlow"),
//第二种工作票
SEVEN("7", "matterLibraryListSeven"),
//水力机器工作票
EIGHT("8", "matterLibraryListEight"),
NINE("9", "matterLibraryListNine"),
TEN("10", "matterLibraryListTen"),
;
@Getter
private String type;
@Getter
private String convertAttributes;
}
@AllArgsConstructor
enum FirstWorkTicketStatusEnum {
/**签发**/
SIGN(1,"签发"),
/**收到工作票**/
RECEIVE(2,"收到工作票"),
/**许可人许可**/
LICENSE(3,"许可人许可"),
/**确认条件具备**/
CONFIRM_MEASURE(4,"确认条件具备"),
/**工作负责人确认工作**/
CONFIRM_WORK(5,"工作负责人确认工作"),
/**许可人确认工作结束**/
WORK_FINISH(6,"许可人确认工作结束"),
/**工作票终结**/
TICKET_FINISH(7,"工作票终结"),
/**结束**/
FINISH(8,"结束"),
/**许可人延期确认**/
LICENSE_DELAY(9,"许可人延期确认"),
/**负责人延期确认**/
CONFIRM_DELAY(10,"负责人延期确认"),
/**作废**/
INVALID(11,"作废"),
/**逾期**/
OVERDUE(12,"逾期"),
/**线下开票**/
OFFLINE(13,"线下开票"),
/**线下执行任务**/
OFFLINE_OPERATE(14,"线下执行任务"),
/**线下许可人许可**/
OFFLINE_LICENSE(15,"线下许可人许可"),
/**线下结束**/
OFFLINE_END(16,"线下结束")
;
@Getter
private Integer status;
@Getter
private String description;
@AllArgsConstructor
enum FirstWorkTicketStatusEnum {
/** 签发 **/
SIGN(1, "签发"),
/** 收到工作票 **/
RECEIVE(2, "收到工作票"),
/** 许可人许可 **/
LICENSE(3, "许可人许可"),
/** 确认条件具备 **/
CONFIRM_MEASURE(4, "确认条件具备"),
/** 工作负责人确认工作 **/
CONFIRM_WORK(5, "工作负责人确认工作"),
/** 许可人确认工作结束 **/
WORK_FINISH(6, "许可人确认工作结束"),
/** 工作票终结 **/
TICKET_FINISH(7, "工作票终结"),
/** 结束 **/
FINISH(8, "结束"),
/** 许可人延期确认 **/
LICENSE_DELAY(9, "许可人延期确认"),
/** 负责人延期确认 **/
CONFIRM_DELAY(10, "负责人延期确认"),
/** 作废 **/
INVALID(11, "作废"),
/** 逾期 **/
OVERDUE(12, "逾期"),
/** 线下开票 **/
OFFLINE(13, "线下开票"),
/** 线下执行任务 **/
OFFLINE_OPERATE(14, "线下执行任务"),
/** 线下许可人许可 **/
OFFLINE_LICENSE(15, "线下许可人许可"),
/** 线下结束 **/
OFFLINE_END(16, "线下结束");
@Getter
private Integer status;
@Getter
private String description;
public static FirstWorkTicketStatusEnum getEnumByStatus(Integer status) {
Optional<FirstWorkTicketStatusEnum> statusOptional = Arrays.stream(FirstWorkTicketStatusEnum.class.getEnumConstants())
.filter(e-> status.equals(e.getStatus())).findAny();
return statusOptional.orElse(null);
}
}
public static FirstWorkTicketStatusEnum getEnumByStatus(Integer status) {
Optional<FirstWorkTicketStatusEnum> statusOptional = Arrays.stream(FirstWorkTicketStatusEnum.class.getEnumConstants())
.filter(e -> status.equals(e.getStatus())).findAny();
return statusOptional.orElse(null);
}
}
}

58
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java

@ -125,4 +125,62 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@ApiModelProperty("是否评价")
private Integer isEvaluate;
/**
* AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性
* 站点标识-两票编码
*/
@ApiModelProperty("站点标识-两票编码")
private String signage;
/**
* 编号原站点ID
*/
@ApiModelProperty("编号(原站点ID)")
private String signageCode;
/**
* 流程状态'
*/
@ApiModelProperty("流程状态")
private Integer flowStatus;
/**
* 流程描述
*/
@ApiModelProperty("流程描述")
private String flowDescription;
/**
* 下一个审批人
*/
@ApiModelProperty("下一个审批人")
private String nextStepOperator;
/**
* 用户Id
*/
@ApiModelProperty("用户Id")
private String flowUserId;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")
private String flowTaskName;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")
private String flowTaskId;
}

11
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java

@ -316,8 +316,8 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
/**
* 工作条件false 停电 true 不停电
*/
@ApiModelProperty("工作条件(false 停电 true 不停电)")
private Boolean isPower;
@ApiModelProperty("工作条件(停电或不停电)")
private String power;
/**
@ -414,6 +414,13 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
/**
* 用户Id
*/
@ApiModelProperty("用户Id")
private String flowUserId;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")

12
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java

@ -20,6 +20,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
@ -51,13 +52,16 @@ public class FdpQuestionServiceImpl implements IFdpQuestionService {
R<StationEntity> stationResult = stationClient.getStationByCode(stationCode);
if(stationResult.isSuccess()) {
StationEntity stationEntity = stationResult.getData();
log.info("请求体为:{}",AuthUtil.getTenantId());
StationInfoReq infoReq = StationInfoReq.builder()
.stationId(stationCode)
.stationName(stationEntity.getName())
.type(this.getStationType(stationEntity.getType()))
.stationDesc(Optional.ofNullable(stationDesc).orElse(""))
.stationId(stationCode)
.stationName(stationEntity.getName())
.type(this.getStationType(stationEntity.getType()))
.stationDesc(Optional.ofNullable(stationDesc).orElse(""))
.tenantId("200000")
.build();
if(Func.isNotEmpty(infoReq.getType())) {
log.info("请求体为:{}",JSON.toJSONString(infoReq));
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getSubmitStationInfo())
.body(JSON.toJSONString(infoReq))
.execute();

65
hzims-service/hzims-scheduled/pom.xml

@ -2,15 +2,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-service</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hzims-scheduled</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
@ -81,42 +81,6 @@
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<!-- 月报统计图表导出-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jcommon</artifactId>
<version>1.0.24</version>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>com.hikvision.ga</groupId>
<artifactId>artemis-http-client</artifactId>
</dependency>
<!-- ApacheHttp请求工具 Start -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<!-- ApacheHttp请求工具 End -->
<!-- freemark,用于导出word Start-->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
<!-- freemark,用于导出word End-->
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>equipment-api</artifactId>
@ -146,47 +110,22 @@
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
</dependency>
<!--${bladex.project.version}-->
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<!-- spring-boot-websocket start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-http -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-core -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<!--WebSocket核心依赖包-->
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
</dependency>
<!-- spring-boot-websocket end -->
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-resource-api</artifactId>

59
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java

@ -1,59 +0,0 @@
// package com.hnac.hzims.scheduled.config;
//
// import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
// import lombok.extern.slf4j.Slf4j;
// import org.springframework.beans.factory.annotation.Value;
// import org.springframework.context.annotation.Bean;
// import org.springframework.context.annotation.ComponentScan;
// import org.springframework.context.annotation.Configuration;
//
// /**
// * @Author WL
// * @Version v1.0
// * @Serial 1.0
// * @Date 2022/1/8 10:23
// */
// @Slf4j
// @Configuration
// //指定任务Handler所在包路径
// public class XxlJobConfig {
//
//
// @Value("${xxl.job.admin.addresses}")
// private String adminAddresses;
//
// @Value("${xxl.job.executor.appname}")
// private String appName;
//
// @Value("${xxl.job.executor.ip}")
// private String ip;
//
// @Value("${xxl.job.executor.port}")
// private int port;
//
// @Value("${xxl.job.accessToken}")
// private String accessToken;
//
// @Value("${xxl.job.executor.logpath}")
// private String logPath;
//
// @Value("${xxl.job.executor.logretentiondays}")
// private int logRetentionDays;
//
//
// @Bean(initMethod = "start", destroyMethod = "destroy")
// public XxlJobSpringExecutor xxlJobExecutor() {
// log.info("====xxl-job config init====");
// XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
// xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
// xxlJobSpringExecutor.setAppName(appName);
// xxlJobSpringExecutor.setIp(ip);
// xxlJobSpringExecutor.setPort(port);
// xxlJobSpringExecutor.setAccessToken(accessToken);
// xxlJobSpringExecutor.setLogPath(logPath);
// xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
// return xxlJobSpringExecutor;
// }
//
// }
//

17
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/PlanMapper.java

@ -0,0 +1,17 @@
package com.hnac.hzims.scheduled.mapper.equipment;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
* @author ysj
*/
public interface PlanMapper extends UserDataScopeBaseMapper<PlanGenerationEntity> {
// 查询计划发电量
List<PlanGenerationEntity> planGeneration(@Param("stationIds") List<String> stationIds, @Param("deptIds") List<String> deptIds, @Param("date") String date);
}

10
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/WorkshopInfoMapper.java

@ -0,0 +1,10 @@
package com.hnac.hzims.scheduled.mapper.equipment;
import com.hnac.hzims.equipment.entity.WorkshopInfoEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface WorkshopInfoMapper extends UserDataScopeBaseMapper<WorkshopInfoEntity> {
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskMapper.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.mapper.inspect;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
@Mapper
public interface TaskMapper extends UserDataScopeBaseMapper<TaskEntity> {
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.java

@ -1,20 +1,14 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:30
* @author ysj
*/
public interface AbnormalAlarmMapper extends UserDataScopeBaseMapper<AbnormalAlarmEntity>{
public interface AbnormalAlarmMapper extends UserDataScopeBaseMapper<AbnormalAlarmEntity> {
AbnormalAlarmEntity getAbnormalAlarm(@Param("stationId") String stationId, @Param("type") String type);
List<String> getAbnormalAlarmList();
List<String> abnormalAlarms();
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AccessMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface AccessMapper extends UserDataScopeBaseMapper<OperAccessTaskEntity> {
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DefectMapper.java

@ -0,0 +1,12 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface DefectMapper extends UserDataScopeBaseMapper<OperDefectEntity> {
}

17
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/GenerateMapper.java

@ -0,0 +1,17 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
* @author ysj
* @date 2023/04/10 11:22:14
* @version 4.0.0
*/
public interface GenerateMapper extends UserDataScopeBaseMapper<GenerateEntity> {
List<GenerateEntity> records(@Param("date") String date,@Param("station") String station);
}

21
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.java

@ -1,21 +0,0 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:12
*/
public interface HistoryAbnormalAlarmMapper extends UserDataScopeBaseMapper<HistoryAbnormalAlarmEntity> {
List<HistoryAbnormalAlarmEntity> getHistoryAbnormalAlarm(@Param("stationId") String stationId, @Param("type") String type);
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/MaintenanceMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface MaintenanceMapper extends UserDataScopeBaseMapper<OperMaintenanceTaskEntity> {
}

9
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HzimsAnalyzeModelStationMapper.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/ModelStationMapper.java

@ -3,11 +3,10 @@ package com.hnac.hzims.scheduled.mapper.operation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/22 11:43
* @author ysj
*/
public interface HzimsAnalyzeModelStationMapper extends BaseMapper<HzimsAnalyzeModelStationEntity> {
public interface ModelStationMapper extends BaseMapper<HzimsAnalyzeModelStationEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/OtherMapper.java

@ -1,8 +1,11 @@
package com.hnac.hzims.operational.fill.mapper;
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.OtherEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface OtherMapper extends UserDataScopeBaseMapper<OtherEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/OverDetailsMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.OverDetailsEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface OverDetailsMapper extends UserDataScopeBaseMapper<OverDetailsEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/OverMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.OverEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface OverMapper extends UserDataScopeBaseMapper<OverEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/PhenomenonMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface PhenomenonMapper extends UserDataScopeBaseMapper<OperPhenomenonEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/PowerMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.PowerEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface PowerMapper extends UserDataScopeBaseMapper<PowerEntity> {
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/RecordMapper.java

@ -1,14 +1,17 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
import com.hnac.hzims.operational.config.vo.StAlarmRecordVo;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 15:47
* @author ysj
*/
public interface StAlarmRecordMapper extends BaseMapper<StAlarmRecordEntity> {
public interface RecordMapper extends BaseMapper<StAlarmRecordEntity> {
Long insertReturnId(StAlarmRecordEntity record);
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/SolveMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.SolveEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface SolveMapper extends UserDataScopeBaseMapper<SolveEntity> {
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StFocusPropertiesMapper.java

@ -1,13 +0,0 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:28
*/
public interface StFocusPropertiesMapper extends BaseMapper<StFocusPropertiesEntity> {
}

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttrConfigMapper.java

@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.station.entity.StationAttrConfigEntity;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 16:09
* @author ysj
*/
public interface StationAttrConfigMapper extends BaseMapper<StationAttrConfigEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttributeMapper.java

@ -1,13 +1,16 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:39
* @author hx
*/
@Mapper
public interface StationAttributeMapper extends UserDataScopeBaseMapper<StationAttributeEntity> {
List<StationAttributeEntity> PointUnit();
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.java

@ -1,21 +1,12 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.station.entity.StationEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:36
* @author ysj
*/
public interface StationMapper extends UserDataScopeBaseMapper<StationEntity> {
List<StationEntity> selectStationByType(Integer stationType, Integer serveType);
List<StationEntity> selectAll();
List<StationEntity> selectStationByInCode(List<String> codes);
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/UseMapper.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/04/10 11:22:14
* @version 4.0.0
*/
public interface UseMapper extends UserDataScopeBaseMapper<UseEntity> {
}

10
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/CompanyMapper.java

@ -0,0 +1,10 @@
package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface CompanyMapper extends UserDataScopeBaseMapper<CheckCompanyEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/InstanceMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
/**
* @author Lch
*/
public interface InstanceMapper extends BaseMapper<CheckItemInstanceEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/MonthMapper.java

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

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/TrialMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* 设备试验mapper接口
*/
public interface TrialMapper extends UserDataScopeBaseMapper<SafeEquipmentTrialEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/TicketEvaluateMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.ticket;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
/**
* @author ysj
*/
public interface TicketEvaluateMapper extends BaseMapper<TicketInfoEvaluateEntity> {
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/TicketMapper.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.mapper.ticket;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
@Mapper
public interface TicketMapper extends UserDataScopeBaseMapper<StandardTicketInfoEntity> {
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkTicketMapper.java

@ -0,0 +1,14 @@
package com.hnac.hzims.scheduled.mapper.ticket;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
@Mapper
public interface WorkTicketMapper extends UserDataScopeBaseMapper<WorkTicketInfoEntity> {
}

65
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -0,0 +1,65 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.operation.MonitorService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
/**
* @author ysj
*/
@Slf4j
@Component
public class MonitorScheduledTask {
@Autowired
private MonitorService service;
/**
* realId刷新
*/
@XxlJob(REAL_ID_DATA)
public ReturnT<String> loadRealId(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadRealId(param);
return new ReturnT<>("SUCCESS");
}
/**
* 实时数据刷新
* @return ReturnT<String>
*/
@XxlJob(REAL_TIME_DATA)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealData(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadRealData(param);
return new ReturnT<>("SUCCESS");
}
/**
* 集中监控数据处理
* @return ReturnT<String>
*/
@XxlJob(CENTRALIZED_MONITORING)
public ReturnT<String> loadMonitoring(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadMonitoring(param);
return new ReturnT<>("SUCCESS");
}
}

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

@ -0,0 +1,126 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.scheduled.service.operation.RealTargetService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
/**
* @author ysj
*/
@Slf4j
@Component
public class RealTargetScheduledTask {
@Autowired
private RealTargetService service;
/**
* 水电站-机组实时加载
*/
@XxlJob(LOAD_HYDROPOWER_UNIT_REAL)
public ReturnT<String> loadHydropowerReal(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadHydropowerReal(param);
return new ReturnT<>("SUCCESS");
}
/**
* 水电站-机组指标加载
*/
@XxlJob(LOAD_HYDROPOWER_UNIT_TARGET)
public ReturnT<String> loadHydropowerTarget(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadHydropowerTarget(param);
return new ReturnT<>("SUCCESS");
}
/**
* 水利-泵组实时加载
*/
@XxlJob(LOAD_WATER_PUMP_REAL)
public ReturnT<String> loadWaterPumpReal(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadWaterPumpReal(param);
return new ReturnT<>("SUCCESS");
}
/**
* 水利-泵组指标加载
*/
@XxlJob(LOAD_WATER_PUMP_TARGET)
public ReturnT<String> loadWaterPumpTarget(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadWaterPumpTarget(param);
return new ReturnT<>("SUCCESS");
}
/**
* 水利-站点水位数据
*/
@XxlJob(LOAD_WATER_LEVEL)
public ReturnT<String> loadWaterLevel(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadWaterLevel(param);
return new ReturnT<>("SUCCESS");
}
/**
* 光伏站-逆变器实时加载
*/
@XxlJob(LOAD_PHOTOVOLTAIC_REAL)
public ReturnT<String> loadPhotovoltaicReal(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadPhotovoltaicReal(param);
return new ReturnT<>("SUCCESS");
}
/**
* 光伏站-逆变器指标加载
*/
@XxlJob(LOAD_PHOTOVOLTAIC_TARGET)
public ReturnT<String> loadPhotovoltaicTarget(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadPhotovoltaicTarget(param);
return new ReturnT<>("SUCCESS");
}
/**
* 获取站点近3年发电量数据
*/
@XxlJob(ELECTRICITY_GENERATION_RECENT_YEAR)
public ReturnT<String> loadPowerData(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadPowerData(param, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),2,3);
return new ReturnT<>("SUCCESS");
}
}

40
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java

@ -0,0 +1,40 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.operation.ReportService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.AREA_MONTH_REPORT;
/**
* @author ysj
*/
@Slf4j
@Component
public class ReportScheduledTask {
@Autowired
private ReportService service;
/**
* 首页-生产月报表
* @return ReturnT<String>
*/
@XxlJob(AREA_MONTH_REPORT)
public ReturnT<String> loadMonthReport(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
}
service.loadMonthReport(param,1);
return new ReturnT<>("SUCCESS");
}
}

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

@ -1,54 +0,0 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.IWaterService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.LOAD_WATER_LEVEL;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/22 11:21
*/
@Slf4j
@Component
public class ScheduledCreateTask {
@Autowired
private IWaterService waterService;
/**
* 水利-站点水位数据
* @return ReturnT<String>
*/
@XxlJob(LOAD_WATER_LEVEL)
public ReturnT<String> loadWaterLevel(String param) throws Exception {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
waterService.loadWaterLevel(param);
return new ReturnT<>("SUCCESS");
}
/**
* 水利-站点水位数据
* @return ReturnT<String>
*/
@XxlJob("cheshi")
public ReturnT<String> cheshi(String param) throws Exception {
System.out.println("执行呢方法");
return new ReturnT<>("SUCCESS");
}
}

38
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java

@ -0,0 +1,38 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.operation.ShowService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.LOAD_HOME_TARGET;
/**
* @author ysj
*/
@Slf4j
@Component
public class ShowScheduledTask {
@Autowired
private ShowService service;
/**
* 首页-指标数据加载
*/
@XxlJob(LOAD_HOME_TARGET)
public ReturnT<String> loadHomeTarget(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadHomeTarget(param);
return new ReturnT<>("SUCCESS");
}
}

101
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StAlamRecordTask.java

@ -1,101 +0,0 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.AbnormalAlarmService;
import com.hnac.hzims.scheduled.service.IRealMonitorService;
import com.hnac.hzims.scheduled.service.StFocusPropertiesService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
/**
* 集中监控
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:17
*/
@Slf4j
@Component
public class StAlamRecordTask {
@Value("${hzims.operation.comprehensiveD}")
public String path;
// @Autowired
private IRealMonitorService monitorService;
@Autowired
private AbnormalAlarmService abnormalAlarmService;
@Autowired
private StFocusPropertiesService stFocusPropertiesService;
/**
* 数据中断告警
* @return ReturnT<String>
*/
@XxlJob(ALARM_DATA_HANDLE)
public ReturnT<String> alarmDataHandle(String param) throws Exception {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
abnormalAlarmService.alarmDataHandle(param);
return new ReturnT<>("SUCCESS");
}
/**
* realId获取
* @return ReturnT<String>
*/
@XxlJob(REAL_ID_DATA)
public ReturnT<String> realIdData(String param) throws Exception {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
stFocusPropertiesService.getStationRealIds(param);
return new ReturnT<>("SUCCESS");
}
/**
* 站点实时数据
* @return ReturnT<String>
*/
@XxlJob(REAL_TIME_DATA)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> realTimeData(String param) throws Exception {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
monitorService.realTimeData(param);
return new ReturnT<>("SUCCESS");
}
/**
* 集中监控数据处理
* @return ReturnT<String>
*/
@XxlJob(CENTRALIZED_MONITORING)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> centralizedMonitoring(String param) throws Exception {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
monitorService.centralizedMonitoring(param);
return new ReturnT<>("SUCCESS");
}
}

16
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/HistoryAbnormalAlarmService.java

@ -1,16 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:09
*/
public interface HistoryAbnormalAlarmService extends BaseService<HistoryAbnormalAlarmEntity> {
HistoryAbnormalAlarmEntity getAbnormalAlarm(String station, String soeType);
}

17
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IHzimsAnalyzeModelStationService.java

@ -1,17 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/22 11:31
*/
public interface IHzimsAnalyzeModelStationService extends BaseService<HzimsAnalyzeModelStationEntity> {
}

16
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IMainSystemMonitoringService.java

@ -1,16 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 14:00
*/
public interface IMainSystemMonitoringService {
List<EminfoAndEmParamVo> getEmInfoList();
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IRealMonitorService.java

@ -1,13 +0,0 @@
package com.hnac.hzims.scheduled.service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:20
*/
public interface IRealMonitorService {
void realTimeData(String param);
void centralizedMonitoring(String param);
}

16
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttrConfigService.java

@ -1,16 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.operational.station.entity.StationAttrConfigEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 16:06
*/
public interface IStationAttrConfigService extends BaseService<StationAttrConfigEntity> {
List<String> getHideList();
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttributeService.java

@ -1,13 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:34
*/
public interface IStationAttributeService extends BaseService<StationAttributeEntity> {
}

27
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationService.java

@ -1,27 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.operational.station.entity.StationEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.ArrayList;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:33
*/
public interface IStationService extends BaseService<StationEntity> {
List<StationEntity> getStationByType(Integer stationType, Integer serveType);
List<StationEntity> getAll();
List<StationEntity> getStationByInCode(List<String> strings);
List<StationEntity> getStationType(Integer serveType,List<Integer> typeList,List<Long> departIdList);
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IWaterService.java

@ -1,11 +0,0 @@
package com.hnac.hzims.scheduled.service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/22 11:22
*/
public interface IWaterService {
void loadWaterLevel(String param);
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StAlamRecordService.java

@ -1,14 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 15:41
*/
public interface StAlamRecordService extends BaseService<StAlarmRecordEntity> {
Long insertAlert(String stationId, String monitorId);
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StFocusPropertiesService.java

@ -1,14 +0,0 @@
package com.hnac.hzims.scheduled.service;
import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:21
*/
public interface StFocusPropertiesService extends BaseService<StFocusPropertiesEntity> {
void getStationRealIds(String param);
}

16
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/PlanService.java

@ -0,0 +1,16 @@
package com.hnac.hzims.scheduled.service.equipment;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface PlanService extends BaseService<PlanGenerationEntity> {
// 查询计划发电量
List<PlanGenerationEntity> planGeneration(List<String> stationIds, List<String> deptIds, String date);
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/WorkshopInfoService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.scheduled.service.equipment;
import com.hnac.hzims.equipment.entity.WorkshopInfoEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author hx
*/
public interface WorkshopInfoService extends BaseService<WorkshopInfoEntity> {
}

35
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/PlanServiceImpl.java

@ -0,0 +1,35 @@
package com.hnac.hzims.scheduled.service.equipment.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.scheduled.mapper.equipment.PlanMapper;
import com.hnac.hzims.scheduled.service.equipment.PlanService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author ysj
*/
@Service
@Slf4j
@AllArgsConstructor
@DS("equipment")
public class PlanServiceImpl extends BaseServiceImpl<PlanMapper, PlanGenerationEntity> implements PlanService {
/**
* 查询计划发电量
* @param stationIds
* @param deptIds
* @param date
* @return
*/
@Override
public List<PlanGenerationEntity> planGeneration(List<String> stationIds, List<String> deptIds, String date) {
return this.baseMapper.planGeneration(stationIds,deptIds,date);
}
}

21
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/WorkshopInfoServiceImpl.java

@ -0,0 +1,21 @@
package com.hnac.hzims.scheduled.service.equipment.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hnac.hzims.equipment.entity.WorkshopInfoEntity;
import com.hnac.hzims.scheduled.mapper.equipment.WorkshopInfoMapper;
import com.hnac.hzims.scheduled.service.equipment.WorkshopInfoService;
import groovy.util.logging.Slf4j;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @author hx
*/
@Service
@AllArgsConstructor
@Slf4j
@DS("equipment")
public class WorkshopInfoServiceImpl extends BaseServiceImpl<WorkshopInfoMapper, WorkshopInfoEntity> implements WorkshopInfoService {
}

242
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/AbnormalAlarmServiceImpl.java

@ -1,242 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.mapper.operation.AbnormalAlarmMapper;
import com.hnac.hzims.scheduled.service.AbnormalAlarmService;
import com.hnac.hzims.scheduled.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.scheduled.service.IStationService;
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.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:29
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMapper, AbnormalAlarmEntity> implements AbnormalAlarmService {
private final IStationService stationService;
private final HistoryAbnormalAlarmService historyAbnormalAlarmService;
private final ISysClient sysClient;
private final ISoeClient soeClient;
private final IUserClient userClient;
private final IMessageClient messageClient;
/**
* 数据中断数据异常告警
* @param param
*/
@Override
public void alarmDataHandle(String param) {
// 查询代运维站点
List<StationEntity> stations = stationService.getStationByType(null, HomePageConstant.HYDROPOWER_SERVETYPE);
if(CollectionUtil.isEmpty(stations)){
return;
}
SoeQueryConditionByStation query = new SoeQueryConditionByStation();
query.setTypes(AbnormalAlarmConstant.SEND_MESSSAGE_TYPE_LIST);
query.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
Calendar calendar = Calendar.getInstance();
query.setEndTime(LocalDateTime.parse(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
calendar.add(Calendar.MINUTE,-2);
query.setBeginTime(LocalDateTime.parse(DateUtil.format(calendar.getTime() , DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
query.setNeedPage(false);
log.error("alarm_data_handle_param : {}",query);
Result<HzPage<SoeData>> result = soeClient.getByStationsAndTime(query);
// 未查询到告警信息
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData().getRecords())){
return;
}
log.error("alarm_data_handle_begin_result : {}",result.getData().getRecords());
// 遍历告警信息
List<SoeData> list = new ArrayList<>(result.getData().getRecords().stream().sorted(Comparator.comparing(SoeData::getTs).reversed())
.collect(Collectors.toMap(o -> o.getStation() + o.getSoeType(), Function.identity(), (o1, o2) -> o1)).values());
log.error("alarm_data_handle_end_result : {}",list);
list.forEach(item -> {
AbnormalAlarmEntity queryEntity = this.baseMapper.getAbnormalAlarm(item.getStation(),item.getSoeType());
boolean flag = AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType());
String stationName = Optional.ofNullable(stations.stream().filter(o-> o.getCode().equals(item.getStation())).collect(Collectors.toList())).map(o->o.get(0).getName()).orElse(null);
if(ObjectUtil.isEmpty(queryEntity)){
AbnormalAlarmEntity entity = new AbnormalAlarmEntity();
entity.setStationId(item.getStation());
entity.setStationName(stationName);
entity.setRealId(item.getRealId());
entity.setSoeExplain(item.getSoeExplain());
entity.setType(item.getSoeType());
entity.setStartTime(item.getTs());
entity.setEndTime(null);
entity.setStatus(0);
if(flag){
entity.setStartTime(null);
entity.setEndTime(item.getTs());
entity.setStatus(1);
}
// 保存告警信息
this.save(entity);
return;
}
queryEntity.setSoeExplain(item.getSoeExplain());
queryEntity.setStationName(stationName);
queryEntity.setType(item.getSoeType());
queryEntity.setStartTime(queryEntity.getStartTime());
queryEntity.setUpdateTime(new Date());
queryEntity.setEndTime(null);
queryEntity.setStatus(0);
if(flag){
queryEntity.setEndTime(item.getTs());
queryEntity.setStatus(1);
}
this.updateById(queryEntity);
});
// 异步保存历史告警
CompletableFuture.supplyAsync(()-> this.saveHistoryAlarm(result.getData().getRecords(),stations));
}
/**
* 保存告警历史信息
* @param list
* @return
*/
private String saveHistoryAlarm(List<SoeData> list,List<StationEntity> stations) {
list.forEach(item -> {
Date ts = DateUtil.parse(DateUtil.format(item.getTs(),DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMAT);
// 历史数据异常查询
HistoryAbnormalAlarmEntity queryEntity = this.historyAbnormalAlarmService.getAbnormalAlarm(item.getStation(),item.getSoeType());
// 数据中断恢复
boolean flag = AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType());
String stationName = Optional.ofNullable(stations.stream().filter(o-> o.getCode().equals(item.getStation())).collect(Collectors.toList())).map(o->o.get(0).getName()).orElse(null);
if(ObjectUtil.isEmpty(queryEntity) || !flag){
HistoryAbnormalAlarmEntity entity = new HistoryAbnormalAlarmEntity();
entity.setAlarmId(item.getId());
entity.setStationId(item.getStation());
entity.setStationName(stationName);
entity.setRealId(item.getRealId());
entity.setSoeExplain(item.getSoeExplain());
entity.setType(item.getSoeType());
entity.setStartTime(ts);
entity.setStatus(0);
this.historyAbnormalAlarmService.save(entity);
// 消息推送
this.sendAlarmMessage(Collections.singletonList(entity),stations);
return;
}
queryEntity.setSoeExplain(item.getSoeExplain());
queryEntity.setUpdateTime(new Date());
queryEntity.setEndTime(ts);
queryEntity.setStatus(1);
this.historyAbnormalAlarmService.updateById(queryEntity);
});
return "success";
}
/**
* 告警消息推送
* @param entitys
*/
private void sendAlarmMessage(List<HistoryAbnormalAlarmEntity> entitys,List<StationEntity> stations) {
if(CollectionUtil.isEmpty(entitys)){
return;
}
// 告警等级 :事故、数据中断
List<HistoryAbnormalAlarmEntity> alarms = entitys.stream().filter(entity -> AbnormalAlarmConstant.SEND_MESSSAGE_TYPE_LIST.contains(entity.getType())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(alarms)){
return;
}
// 查询站点用户
entitys.forEach(entity->{
if(StringUtil.isEmpty(entity.getStationId())){
return;
}
List<Long> depts = stations.stream().filter(station -> station.getCode().equals(entity.getStationId())).map(StationEntity::getRefDept).collect(Collectors.toList());
if(CollectionUtil.isEmpty(depts)){
return;
}
// 获取站点用户
R<List<User>> result = userClient.userListByDeptId(depts.get(0));
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return;
}
MessagePushRecordDto message = new MessagePushRecordDto();
message.setBusinessClassify("warning");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription());
message.setTaskId(entity.getId());
message.setTenantId("200000");
message.setContent(entity.getSoeExplain());
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY);
message.setDeptId(depts.get(0));
R<String> deptName = sysClient.getDeptName(depts.get(0));
if (deptName.isSuccess()) {
message.setDeptName(deptName.getData());
}
User admin = userClient.userByAccount("200000", "admin").getData();
message.setCreateDept(admin.getCreateDept());
message.setCreateUser(admin.getCreateUser());
result.getData().forEach(user->{
message.setPusher(String.valueOf(user.getId()));
message.setPusherName(user.getName());
message.setAccount(String.valueOf(user.getId()));
messageClient.sendMessage(message);
});
});
}
/**
* 查询实时告警数据
* @return
*/
@Override
public List<String> getAbnormalAlarmList() {
List<String> alarmList = this.baseMapper.getAbnormalAlarmList();
if(CollectionUtil.isEmpty(alarmList)){
return new ArrayList<>();
}
return alarmList;
}
}

41
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -1,41 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.scheduled.mapper.operation.HistoryAbnormalAlarmMapper;
import com.hnac.hzims.scheduled.service.HistoryAbnormalAlarmService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:12
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbnormalAlarmMapper, HistoryAbnormalAlarmEntity> implements HistoryAbnormalAlarmService {
/**
* 查询单条历史告警
*
* @param station
* @param soeType
* @return
*/
@Override
public HistoryAbnormalAlarmEntity getAbnormalAlarm(String station, String soeType) {
List<HistoryAbnormalAlarmEntity> alarms = this.baseMapper.getHistoryAbnormalAlarm(station, soeType);
if(CollectionUtil.isEmpty(alarms)){
return null;
}
return alarms.stream().sorted(Comparator.comparing(HistoryAbnormalAlarmEntity::getStartTime)).collect(Collectors.toList()).get(0);
}
}

17
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HzimsAnalyzeModelStationServiceImpl.java

@ -1,17 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
import com.hnac.hzims.scheduled.mapper.operation.HzimsAnalyzeModelStationMapper;
import com.hnac.hzims.scheduled.service.IHzimsAnalyzeModelStationService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/22 11:42
*/
@Service
public class HzimsAnalyzeModelStationServiceImpl extends BaseServiceImpl<HzimsAnalyzeModelStationMapper, HzimsAnalyzeModelStationEntity> implements IHzimsAnalyzeModelStationService {
}

51
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/MainSystemMonitoringServiceImpl.java

@ -1,51 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.scheduled.service.IMainSystemMonitoringService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 14:01
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringService {
private final RedisTemplate redisTemplate;
@Value("${hzims.equipment.emInfo.emInfoList}")
public String emInfoListPath;
/**
* 从Redis获取设备信息
*
* @return
*/
@Override
public List<EminfoAndEmParamVo> getEmInfoList() {
List<EminfoAndEmParamVo> list = new ArrayList<>();
Object json = redisTemplate.opsForValue().get(emInfoListPath);
if (ObjectUtil.isNotEmpty(json)) {
list = JSONObject.parseObject(json.toString(), new TypeReference<List<EminfoAndEmParamVo>>() {
});
}
return list;
}
}

164
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StFocusPropertiesServiceImpl.java

@ -1,164 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists;
import com.hnac.hzims.equipment.entity.WorkshopInfoEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.feign.IWorkshopInfoClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.mapper.operation.StFocusPropertiesMapper;
import com.hnac.hzims.scheduled.service.IStationAttributeService;
import com.hnac.hzims.scheduled.service.IStationService;
import com.hnac.hzims.scheduled.service.StFocusPropertiesService;
import com.hnac.hzims.scheduled.vo.StationRealVo;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import lombok.RequiredArgsConstructor;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:27
*/
@Service
@RequiredArgsConstructor
public class StFocusPropertiesServiceImpl extends BaseServiceImpl<StFocusPropertiesMapper, StFocusPropertiesEntity> implements StFocusPropertiesService {
private final IStationService stationService;
private final IStationAttributeService attbtService;
private final IEmInfoClient emInfoClient;
private final IAnalyseDataSearchClient analyseDataSearchClient;
private final IWorkshopInfoClient workshopInfoClient;
private final RedisTemplate redisTemplate;
private final BladeLogger logger;
@Value("${hzims.operation.monitor.realId}")
public String moniter_realId_key;
@Value("${hzims.equipment.emInfo.emInfoList}")
public String em_info_list_path;
@Override
public void getStationRealIds(String param) {
// 所有站点
List<StationEntity> stationList = stationService.getAll();
if(CollectionUtil.isEmpty(stationList)){
return;
}
// 设备监测点list
Object json = redisTemplate.opsForValue().get(em_info_list_path);
List<EminfoAndEmParamVo> eminfoAndEmParams = JSONObject.parseObject(json.toString(), new TypeReference<List<EminfoAndEmParamVo>>() {});
// 厂房监测点list
List<AnalyzeCodeBySignagesVO> wsMonitorList = this.getRealIdByWsCodeAndSign();
// 实时监控监测点list
List<StationAttributeEntity> timeList = attbtService.list(new LambdaQueryWrapper<StationAttributeEntity>() {{
eq(StationAttributeEntity::getIsDeleted, "0");
isNotNull(StationAttributeEntity::getMonitorId);
orderByAsc(StationAttributeEntity::getSort);
}});
// 监测点存储list
List<StationRealVo> list = new ArrayList<>();
stationList.forEach(station->{
StationRealVo stationRealVo = new StationRealVo();
stationRealVo.setStation(station.getCode());
List<String> realDeviceList = this.getRealDeviceList(station.getRefDept(),eminfoAndEmParams);
// 厂站匹配站点监测点集合
List<String> realWsList = wsMonitorList.stream().filter(
o -> Func.isNotEmpty(o.getStation()) && o.getStation().equals(station.getCode())
).map(AnalyzeCodeBySignagesVO::getRealId).collect(Collectors.toList());
// 实时监控匹配站点监测点集合
List<String> realTimeList = timeList.stream().filter(o -> null != o.getStationId() && o.getStationId().equals(station.getCode())).map(StationAttributeEntity::getMonitorId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(realTimeList)){
realDeviceList.addAll(realTimeList);
}
if(CollectionUtil.isNotEmpty(realWsList)) {
realDeviceList.addAll(realWsList);
}
if(CollectionUtil.isEmpty(realDeviceList)){
return;
}
List<String> realList = realDeviceList.stream().distinct().collect(Collectors.toList());
String[] realArr = StringUtil.join(realList,",").split(",");
stationRealVo.setRealId(realArr);
list.add(stationRealVo);
});
redisTemplate.opsForValue().set(moniter_realId_key,list);
}
private List<AnalyzeCodeBySignagesVO> getRealIdByWsCodeAndSign() {
R<List<WorkshopInfoEntity>> wsInfoListR = workshopInfoClient.getAllWorkshop();
List<WorkshopInfoEntity> wsInfoList = Optional.ofNullable(wsInfoListR).filter(r -> r.isSuccess() && CollectionUtil.isNotEmpty(wsInfoListR.getData()))
.map(R::getData).orElse(null);
if(CollectionUtil.isEmpty(wsInfoList)) {
return Lists.newArrayList();
}
Function<String, MultiAnalyzeCodePO> getAnalyzeCodePO = wsCode -> {
MultiAnalyzeCodePO multiAnalyzeCodePO = new MultiAnalyzeCodePO();
multiAnalyzeCodePO.setDeviceCode(wsCode);
multiAnalyzeCodePO.setSignages(Lists.newArrayList(HomePageConstant.PV_JOINT_RELAY,HomePageConstant.PV_REACTIVE_POWER,HomePageConstant.PV_GENERATION_CAPACITY));
return multiAnalyzeCodePO;
};
List<MultiAnalyzeCodePO> analyzeCodePOList = wsInfoList.stream().map(WorkshopInfoEntity::getNumber).map(getAnalyzeCodePO).collect(Collectors.toList());
R<List<AnalyzeCodeBySignagesVO>> analyzeCodeBySignages = analyseDataSearchClient.getAnalyzeCodeBySignages(analyzeCodePOList);
return Optional.ofNullable(analyzeCodeBySignages).filter(r -> r.isSuccess()).map(R::getData).orElse(Lists.newArrayList());
}
/**
* 获取站点realId
* @param refDept
* @param eminfoAndEmParams
* @return
*/
private List<String> getRealDeviceList(Long refDept, List<EminfoAndEmParamVo> eminfoAndEmParams) {
// 参数检查
if(CollectionUtil.isEmpty(eminfoAndEmParams) || ObjectUtil.isEmpty(refDept)){
return new ArrayList<>();
}
// 有效设备
List<EminfoAndEmParamVo> filters = eminfoAndEmParams.stream().filter(o-> o.getCreateDept().equals(refDept)).collect(Collectors.toList());
if(CollectionUtil.isEmpty(filters)){
return new ArrayList<>();
}
// 遍历设备
List<String> result = new ArrayList<>();
for(EminfoAndEmParamVo device : filters){
result.addAll(device.getPoint().values());
}
return result;
}
}

22
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationAttributeServiceImpl.java

@ -1,22 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import com.hnac.hzims.scheduled.mapper.operation.StationAttributeMapper;
import com.hnac.hzims.scheduled.service.IStationAttributeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 11:39
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class StationAttributeServiceImpl extends BaseServiceImpl<StationAttributeMapper, StationAttributeEntity> implements IStationAttributeService {
}

60
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationServiceImpl.java

@ -1,60 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.mapper.operation.StationMapper;
import com.hnac.hzims.scheduled.service.IStationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:36
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEntity> implements IStationService {
@Override
public List<StationEntity> getStationByType(Integer stationType, Integer serveType) {
return this.baseMapper.selectStationByType(stationType, serveType);
}
@Override
public List<StationEntity> getAll() {
return this.baseMapper.selectAll();
}
@Override
public List<StationEntity> getStationByInCode(List<String> codes) {
return this.baseMapper.selectStationByInCode(codes);
}
@Override
public List<StationEntity> getStationType(Integer serveType, List<Integer> typeList, List<Long> departIdList) {
return this.list(new LambdaQueryWrapper<StationEntity>() {{
eq(StationEntity::getIsDeleted, 0);
if (ObjectUtil.isNotEmpty(serveType)) {
eq(StationEntity::getServeType, serveType);
}
if (CollectionUtil.isNotEmpty(typeList)) {
in(StationEntity::getType, typeList);
}
if (CollectionUtil.isNotEmpty(departIdList)) {
in(StationEntity::getRefDept, departIdList);
}
}});
}
}

201
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/WaterServiceImpl.java

@ -1,201 +0,0 @@
package com.hnac.hzims.scheduled.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.EquipmentConstants;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.vo.WaterLevelVo;
import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.service.IHzimsAnalyzeModelStationService;
import com.hnac.hzims.scheduled.service.IStationService;
import com.hnac.hzims.scheduled.service.IWaterService;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/22 11:23
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class WaterServiceImpl implements IWaterService {
private final IStationService stationService;
private final IHzimsAnalyzeModelStationService modelStationService;
private final IAnalyseDataSearchClient analyseDataSearchClient;
private final RedisTemplate redisTemplate;
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
/**
* 水利-站点水位数据
* @param param
*/
@Override
public void loadWaterLevel(String param) {
// 有效站点模型
List<HzimsAnalyzeModelStationEntity> modelList = getModelStationList();
if(CollectionUtil.isEmpty(modelList)){
return;
}
List<WaterLevelVo> list = new ArrayList<>();
modelList.forEach(item -> {
List<MultiAnalyzeCodePO> multiAnalyzeCodePOList = new ArrayList<>();
MultiAnalyzeCodePO multiAnalyzeCodePO = new MultiAnalyzeCodePO();
multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode());
multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL));
multiAnalyzeCodePOList.add(multiAnalyzeCodePO);
R<List<AnalyzeCodeBySignagesVO>> result = analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return;
}
WaterLevelVo waterLevelVo = new WaterLevelVo();
waterLevelVo.setStationCode(item.getStationId());
// 前水位
double frontWaterLevel = this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL);
waterLevelVo.setFrontWaterLevel(frontWaterLevel);
// 后水位
double rearWaterLevel = this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL);
waterLevelVo.setRearWaterLevel(rearWaterLevel);
// 前水位当日曲线
Map<Integer,String> frontCurveMap = this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL);
waterLevelVo.setFrontCurveMap(frontCurveMap);
// 后水位当日曲线
Map<Integer,String> rearCurveMap = this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL);
waterLevelVo.setRearCurveMap(rearCurveMap);
list.add(waterLevelVo);
});
redisTemplate.opsForValue().set(loadwater_level_key,list);
}
/**
* 获取水位实时数据
* @param instanceCode
* @param signage
* @return
*/
private double getWaterLevel(String instanceCode, String signage) {
RealDataSearchPO realData = new RealDataSearchPO();
realData.setAnalyzeCode(instanceCode);
List<String> signages = Collections.singletonList(signage);
realData.setSignages(signages);
// 调用fegin接口查询实时数据
R<List<FieldsData>> R = analyseDataSearchClient.getRealDataByAnalyzeCode(realData);
if(!R.isSuccess() || CollectionUtil.isEmpty(R.getData())){
return 0.0;
}
// 时间限制
String time = R.getData().get(0).getTime();
if(StringUtil.isEmpty(time) || "-".equals(time)){
return 0.0;
}
Date date = DateUtil.parse(time, "yyyy-MM-dd HH:mm:ss.sss");
if(System.currentTimeMillis() - date.getTime() > 30 * 60 * 1000L){
return 0.0;
}
return Double.parseDouble(R.getData().get(0).getValue());
}
/**
* 获取水位当年数据
* @param instanceCode
* @param signage
* @return
*/
private Map<Integer, String> getWaterLevelMap(String instanceCode, String signage) {
LocalDateTime beginTime = LocalDateTime.parse(DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"), DateUtil.DATETIME_FORMATTER);
LocalDateTime endTime = LocalDateTime.now();
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
analyzeDataConditionPO.setSignages(signage);
// 取数规则: 0=(整点值/最早值)、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值) 6=最新值
analyzeDataConditionPO.setAccessRules(EquipmentConstants.AccessRulesEnum.FINAL_CYCLE.getType());
// 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年)
analyzeDataConditionPO.setSaveTimeType(2);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(beginTime);
analyzeDataConditionPO.setEndTime(endTime);
signboardConditions.add(analyzeDataConditionPO);
po.setDeviceCode(instanceCode);
po.setSignboardConditions(signboardConditions);
R<List<AnalyzeDataConditionVO>> R = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if(!R.isSuccess() || CollectionUtil.isEmpty(R.getData())){
return null;
}
if(CollectionUtil.isEmpty(R.getData().get(0).getList())){
return null;
}
return R.getData().get(0).getList().stream().collect(Collectors.toMap(key-> {
Date dateTime = DateUtil.parse(key.getTs(), "yyyy-MM-dd HH:mm:ss.s");
return dateTime.getHours();
}, value -> {
if(StringUtil.isBlank(value.getVal())){
return "0";
}
return value.getVal();
}));
}
/**
* 获取有效站点模型
* @return
*/
private List<HzimsAnalyzeModelStationEntity> getModelStationList() {
// 水利站点(All)
List<StationEntity> stationList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, null, null);
if(CollectionUtil.isEmpty(stationList)){
return null;
}
// 站点code集合
List<String> codes = stationList.stream().map(StationEntity::getCode).collect(Collectors.toList());
if(CollectionUtil.isEmpty(codes)){
return null;
}
// 查询站点模型列表
List<HzimsAnalyzeModelStationEntity> list = modelStationService.list(new LambdaQueryWrapper<HzimsAnalyzeModelStationEntity>() {{
in(HzimsAnalyzeModelStationEntity::getStationId, codes);
}});
if(CollectionUtil.isEmpty(list)){
return null;
}
return list;
}
}

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/TaskService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.scheduled.service.inspect;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface TaskService extends BaseService<TaskEntity> {
DutyInspectTaskVO task(String start, String end, List<Long> areas);
}

64
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java

@ -0,0 +1,64 @@
package com.hnac.hzims.scheduled.service.inspect.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.scheduled.mapper.inspect.TaskMapper;
import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@Service
@Slf4j
@AllArgsConstructor
public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements TaskService {
/**
* 时间区间机构的巡检任务数据查询
* @param start
* @param end
* @param areas
* @return
*/
@Override
public DutyInspectTaskVO task(String start, String end, List<Long> areas) {
DutyInspectTaskVO task = new DutyInspectTaskVO();
task.setInspectTaskSum(0);
task.setInspectTaskFinish(0);
task.setNotExecuteTaskCount(0);
// 查询所有巡检任务
List<TaskEntity> tasks = this.list(new LambdaQueryWrapper<TaskEntity>() {{
ge(TaskEntity::getPlanStartTime, start)
.le(TaskEntity::getPlanStartTime, end)
.in(TaskEntity::getCreateDept, areas);
}});
if(CollectionUtil.isEmpty(tasks)){
return task;
}
task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
task.setInspectTaskSum(tasks.size());
// 所有处理完成巡检任务
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList());
if(CollectionUtil.isEmpty(finshList)){
return task;
}
task.setInspectTaskFinish(finshList.size());
// 未执行任务数
List<TaskEntity> notExecuteList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(0)).collect(Collectors.toList());
if(CollectionUtil.isEmpty(notExecuteList)){
return task;
}
task.setNotExecuteTaskCount(notExecuteList.size());
return task;
}
}

10
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/AbnormalAlarmService.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AbnormalAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.scheduled.service;
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
import org.springblade.core.mp.base.BaseService;
@ -7,13 +7,9 @@ import java.util.List;
/**
* 告警处理接口
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/5/19 10:20
* @author ysj
*/
public interface AbnormalAlarmService extends BaseService<AbnormalAlarmEntity> {
void alarmDataHandle(String param);
List<String> getAbnormalAlarmList();
List<String> abnormalAlarms();
}

17
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AccessService.java

@ -0,0 +1,17 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.main.vo.OverhaulVo;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface AccessService extends BaseService<OperAccessTaskEntity> {
double accessCount(List<Long> areas);
OverhaulVo overhaul(String start, String end, List<Long> areas);
}

22
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AnalyseDataService.java

@ -0,0 +1,22 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import java.util.List;
import java.util.function.Function;
/**
* @author ysj
*/
public interface AnalyseDataService {
<T> List<AnalyzeCodeBySignagesVO> getAnalyzeCodeBySignages(Function<T, MultiAnalyzeCodePO> convert, T resource);
List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages);
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/DefectService.java

@ -0,0 +1,14 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author Lch
*/
public interface DefectService extends BaseService<OperDefectEntity> {
Double defectCount(List<Long> areas);
}

25
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/GenerateService.java

@ -0,0 +1,25 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import com.hnac.hzims.operational.main.vo.GenerationPowerVo;
import com.hnac.hzims.operational.main.vo.PowerMonthVo;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
public interface GenerateService extends BaseService<GenerateEntity> {
// 查询填报用电量
Float generate(String date,String station);
// 查询30天填报用电量
List<GenerationPowerVo> generate30Day(String day, String station);
// 获取站点填报发电量
List<PowerMonthVo> generateThreeYear(String start, String end, String station);
}

18
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java

@ -0,0 +1,18 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.main.vo.MaintainVo;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface MaintenanceService extends BaseService<OperMaintenanceTaskEntity> {
// 查询当年日常维护数量
Integer maintenanceCount(List<Long> departList);
MaintainVo maintain(String start, String end, List<Long> areas);
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ModelStationService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface ModelStationService extends BaseService<HzimsAnalyzeModelStationEntity> {
}

21
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MonitorService.java

@ -0,0 +1,21 @@
package com.hnac.hzims.scheduled.service.operation;
import org.springblade.core.tool.api.R;
import java.util.Map;
/**
* WEB水电站首页接口
* @author ysj
*/
public interface MonitorService {
// realId刷新
void loadRealId(String param);
// 实时数据刷新
void loadRealData(String param);
// 集中监控数据处理
void loadMonitoring(String param);
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/OtherService.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.fill.entity.OtherEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface OtherService extends BaseService<OtherEntity> {
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/OverDetailsService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.fill.entity.OverDetailsEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface OverDetailsService extends BaseService<OverDetailsEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/OverService.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.fill.entity.OverEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface OverService extends BaseService<OverEntity> {
}

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface PhenomenonService extends BaseService<OperPhenomenonEntity> {
DutyDefectVO defect(String start, String end, List<Long> areas);
}

17
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PowerService.java

@ -0,0 +1,17 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.fill.entity.PowerEntity;
import com.hnac.hzims.operational.main.vo.PowerMonthVo;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface PowerService extends BaseService<PowerEntity> {
Double generate(String date,Long station);
List<PowerMonthVo> generateThreeYear(String start,String end,Long station);
}

34
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/RealTargetService.java

@ -0,0 +1,34 @@
package com.hnac.hzims.scheduled.service.operation;
import java.util.List;
/**
* WEB水电站首页接口
* @author ysj
*/
public interface RealTargetService {
// 水电站实时数据加载
void loadHydropowerReal(String param);
// 水电站指标数据加载
void loadHydropowerTarget(String param);
// 泵站实时数据加载
void loadWaterPumpReal(String param);
// 泵站指标数据加载
void loadWaterPumpTarget(String param);
// 站点水位指标数据
void loadWaterLevel(String param);
// 光伏站实时数据加载
void loadPhotovoltaicReal(String param);
// 光伏站指标数据加载
void loadPhotovoltaicTarget(String param);
// 光伏、水电站近3年发电量
void loadPowerData(String param, List<Integer> types, Integer serveType, int year);
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/RecordService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface RecordService extends BaseService<StAlarmRecordEntity> {
Long insertAlert(String stationId, String monitorId);
}

9
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ReportService.java

@ -0,0 +1,9 @@
package com.hnac.hzims.scheduled.service.operation;
/**
* @author ysj
*/
public interface ReportService {
void loadMonthReport(String param, int i);
}

9
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java

@ -0,0 +1,9 @@
package com.hnac.hzims.scheduled.service.operation;
/**
* @author ysj
*/
public interface ShowService {
void loadHomeTarget(String param);
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/SolveService.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.fill.entity.SolveEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface SolveService extends BaseService<SolveEntity> {
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/StationAttrConfigService.java

@ -0,0 +1,14 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.station.entity.StationAttrConfigEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface StationAttrConfigService extends BaseService<StationAttrConfigEntity> {
List<String> getHideList();
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/StationAttributeService.java

@ -0,0 +1,14 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.Map;
/**
* @author hx
*/
public interface StationAttributeService extends BaseService<StationAttributeEntity> {
Map<String,String> PointUnit();
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/StationService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.station.entity.StationEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface StationService extends BaseService<StationEntity> {
}

29
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/UseService.java

@ -0,0 +1,29 @@
package com.hnac.hzims.scheduled.service.operation;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.UseVo;
import com.hnac.hzims.operational.main.vo.UsrPowerVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
public interface UseService extends BaseService<UseEntity> {
// 查询填报用电量
Float use(String date,String station);
// 查询30天填报用电量
List<UsrPowerVo> use30Day(String day, String station);
Map<String, Float> generateThreeYear(String start, String end, String station);
}

33
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AbnormalAlarmServiceImpl.java

@ -0,0 +1,33 @@
package com.hnac.hzims.scheduled.service.operation.impl;
import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
import com.hnac.hzims.scheduled.mapper.operation.AbnormalAlarmMapper;
import com.hnac.hzims.scheduled.service.operation.AbnormalAlarmService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 告警实现类
* @author ysj
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMapper, AbnormalAlarmEntity> implements AbnormalAlarmService {
@Override
public List<String> abnormalAlarms() {
List<String> alarmList = this.baseMapper.abnormalAlarms();
if(CollectionUtil.isEmpty(alarmList)){
return new ArrayList<>();
}
return alarmList;
}
}

86
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AccessServiceImpl.java

@ -0,0 +1,86 @@
package com.hnac.hzims.scheduled.service.operation.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.main.vo.OverhaulVo;
import com.hnac.hzims.scheduled.mapper.operation.AccessMapper;
import com.hnac.hzims.scheduled.service.operation.AccessService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@Service
@Slf4j
@AllArgsConstructor
public class AccessServiceImpl extends BaseServiceImpl<AccessMapper, OperAccessTaskEntity> implements AccessService {
/**
* 查询当年检修任务数量
* @param areas
* @return
*/
@Override
public double accessCount(List<Long> areas) {
if(CollectionUtil.isEmpty(areas)) {
return 0;
}
LocalDate firstDay = LocalDate.now().withDayOfYear(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
LocalDateTime now = LocalDateTime.now();
//日常维护
List<OperAccessTaskEntity> accesss = this.list(new LambdaQueryWrapper<OperAccessTaskEntity>(){{
ge(OperAccessTaskEntity::getPlanStartTime,firstDateTime);
le(OperAccessTaskEntity::getPlanStartTime,now);
in(OperAccessTaskEntity::getCreateDept,areas);
}});
if(CollectionUtil.isEmpty(accesss)){
return 0;
}
return accesss.size();
}
/**
* 时间区间机构的巡检数据查询
* @param start
* @param end
* @param areas
* @return
*/
@Override
public OverhaulVo overhaul(String start, String end, List<Long> areas) {
OverhaulVo overhaulVo = new OverhaulVo();
// 检修总数
List<OperAccessTaskEntity> overhaulList = this.list(new LambdaQueryWrapper<OperAccessTaskEntity>(){{
ge(OperAccessTaskEntity::getPlanStartTime,start);
le(OperAccessTaskEntity::getPlanStartTime,end);
in(OperAccessTaskEntity::getCreateDept,areas);
}});
if(CollectionUtil.isEmpty(overhaulList)){
overhaulVo.setOverhaul(0);
overhaulVo.setOverhaulFinish(0);
return overhaulVo;
}
overhaulVo.setOverhaul(overhaulList.size());
// 检修完成数量
List<Long> overhaulFinishTask = overhaulList.stream().filter(task-> Func.isNotEmpty(task.getStatus()) && AccessConstants.ACCESS_TASK_STATUS_4 == task.getStatus())
.map(OperAccessTaskEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(overhaulFinishTask)){
overhaulVo.setOverhaulFinish(0);
}
overhaulVo.setOverhaulFinish(overhaulFinishTask.size());
return overhaulVo;
}
}

139
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AnalyseDataServiceImpl.java

@ -0,0 +1,139 @@
package com.hnac.hzims.scheduled.service.operation.impl;
import com.google.common.collect.Lists;
import com.hnac.hzims.scheduled.service.operation.AnalyseDataService;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author hx
*/
@Service
@AllArgsConstructor
@Slf4j
public class AnalyseDataServiceImpl implements AnalyseDataService {
private final IAnalyseDataSearchClient analyseDataSearchClient;
@Override
public <T> List<AnalyzeCodeBySignagesVO> getAnalyzeCodeBySignages(Function<T, MultiAnalyzeCodePO> convert, T resource) {
List<AnalyzeCodeBySignagesVO> result = Lists.newArrayList();
List<MultiAnalyzeCodePO> multiAnalyzeCodePOList = Lists.newArrayList(resource).stream().map(convert).collect(Collectors.toList());
R<List<AnalyzeCodeBySignagesVO>> analyzeCodeBySignResult = analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList);
if(analyzeCodeBySignResult.isSuccess() && CollectionUtil.isNotEmpty(analyzeCodeBySignResult.getData())) {
result = analyzeCodeBySignResult.getData();
}
return result;
}
/***
* 指标数据列表查询
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号
* @param signages 指标
* @return
*/
@Override
public List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setKeepFigures(2);
analyzeDataConditionPO.setAccessRules(accessRules);
analyzeDataConditionPO.setSaveTimeType(cycleType);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
po.setSignboardConditions(signboardConditions);
log.error("period_target_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_target_data_resp {}",result);
return result.getData().get(0).getList();
}
/***
* 指标数据列表查询
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号
* @param ride 配电比
* @param signages 指标
* @return
*/
@Override
public Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode,Integer ride,String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setKeepFigures(2);
analyzeDataConditionPO.setAccessRules(accessRules);
analyzeDataConditionPO.setSaveTimeType(cycleType);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
po.setSignboardConditions(signboardConditions);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return 0f;
}
List<AnalyzeDataConditionVO> records = result.getData();
if(CollectionUtil.isEmpty(records)){
return 0f;
}
AnalyzeDataConditionVO analyzeDataConditionVO = records.get(0);
if (ObjectUtil.isEmpty(analyzeDataConditionVO)) {
return 0f;
}
List<AnalyseDataTaosVO> analyseDataTaosVOList = analyzeDataConditionVO.getList();
if (CollectionUtil.isEmpty(analyseDataTaosVOList)) {
return 0f;
}
AnalyseDataTaosVO analyseDataTaosVO = analyzeDataConditionVO.getList().get(0);
if (ObjectUtil.isEmpty(analyseDataTaosVO) || StringUtil.isBlank(analyseDataTaosVO.getVal())) {
return 0f;
}
return Float.parseFloat(Optional.ofNullable(analyseDataTaosVO.getVal()).orElse("0")) * ride;
}
}

55
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DefectServiceImpl.java

@ -0,0 +1,55 @@
package com.hnac.hzims.scheduled.service.operation.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.scheduled.mapper.operation.DefectMapper;
import com.hnac.hzims.scheduled.service.operation.DefectService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@Service
@AllArgsConstructor
public class DefectServiceImpl extends BaseServiceImpl<DefectMapper, OperDefectEntity> implements DefectService {
/**
* 获取消缺率
* @param areas
* @return
*/
@Override
public Double defectCount(List<Long> areas) {
if(CollectionUtil.isEmpty(areas)) {
return 100.00;
}
LocalDate firstDay = LocalDate.now().withDayOfYear(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
LocalDateTime now = LocalDateTime.now();
List<OperDefectEntity> pTaskList = this.list(new LambdaQueryWrapper<OperDefectEntity>(){{
ge(OperDefectEntity::getCreateTime,firstDateTime);
le(OperDefectEntity::getCreateTime,now);
in(OperDefectEntity::getCreateDept,areas);
}});
if(CollectionUtil.isEmpty(pTaskList)){
return 0.0;
}
// 缺陷处理完成数
List<OperDefectEntity> finishTask = pTaskList.stream().filter(defect -> "1".equals(defect.getHandleStatus())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(finishTask)){
return 0.0;
}
// 消缺率 = (缺陷数 / 总数) * 100
return BigDecimal.valueOf(finishTask.size() / (double) pTaskList.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save