Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
ty 1 year ago
parent
commit
061a057104
  1. 4
      hzims-biz-common/pom.xml
  2. 72
      hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java
  3. 4
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmHandleConstant.java
  4. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmHandleDetailEntity.java
  5. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmHandleEntity.java
  6. 4
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/vo/AlarmHandleVo.java
  7. 6
      hzims-service-api/hzims-operational-api/pom.xml
  8. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java
  9. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java
  10. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java
  11. 20
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/ConstructionVo.java
  12. 25
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java
  13. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyMemberVO.java
  14. 6
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/RedisConstants.java
  15. 46
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarCheckRecordDTO.java
  16. 13
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java
  17. 6
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java
  18. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java
  19. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java
  20. 14
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java
  21. 16
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java
  22. 21
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java
  23. 16
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java
  24. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  25. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java
  26. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java
  27. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SafetyToolEntity.java
  28. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java
  29. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java
  30. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java
  31. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java
  32. 37
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordPageVO.java
  33. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java
  34. 9
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java
  35. 4
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java
  36. 4
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/fegin/IRepairClient.java
  37. 8
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskVO.java
  38. 5
      hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java
  39. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  40. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java
  41. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  42. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java
  43. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java
  44. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java
  45. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java
  46. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java
  47. 10
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/AlarmHandleController.java
  48. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java
  49. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleDetailMapper.java
  50. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleDetailMapper.xml
  51. 10
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java
  52. 51
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml
  53. 5
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleDetailService.java
  54. 8
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java
  55. 8
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleDetailServiceImpl.java
  56. 42
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java
  57. 31
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  58. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/wrapper/HandleWrapper.java
  59. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/mapper/AlarmHistoryMapper.java
  60. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/mapper/AlarmHistoryMapper.xml
  61. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/AlarmHistoryService.java
  62. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/DroolsAlarmService.java
  63. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/FdpAlarmService.java
  64. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/LevelAlarmService.java
  65. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/MessageService.java
  66. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/SystemAlarmService.java
  67. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/VideoAlarmService.java
  68. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/AlarmHistoryServiceImpl.java
  69. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/DroolsAlarmServiceImpl.java
  70. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java
  71. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/LevelAlarmServiceImpl.java
  72. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
  73. 10
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java
  74. 8
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/VideoAlarmServiceImpl.java
  75. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java
  76. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java
  77. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java
  78. 23
      hzims-service/operational/pom.xml
  79. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java
  80. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
  81. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml
  82. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java
  83. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml
  84. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  85. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  86. 155
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java
  87. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java
  88. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java
  89. 182
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/AlertWebSocketClient.java
  90. 44
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/WebSocketClientManager.java
  91. 157
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java
  92. 67
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/LevelAlarmController.java
  93. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AbnormalAlarmMapper.java
  94. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AbnormalAlarmMapper.xml
  95. 57
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml
  96. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlertDefectConfigMapper.java
  97. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlertDefectConfigMapper.xml
  98. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java
  99. 49
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml
  100. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryLevelAlarmMapper.java
  101. Some files were not shown because too many files have changed in this diff Show More

4
hzims-biz-common/pom.xml

@ -44,6 +44,10 @@
<groupId>org.springblade</groupId>
<artifactId>blade-starter-datascope</artifactId>
</dependency>
<dependency>
<groupId>com.hikvision.ga</groupId>
<artifactId>artemis-http-client</artifactId>
</dependency>
</dependencies>
<build>

72
hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java

@ -0,0 +1,72 @@
package com.hnac.hzims.common.utils;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JsonNode;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.server.domain.Sys;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.Assert;
import java.text.DateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* @Author: huangxing
* @Date: 2024/1/10 14:40
*/
public class HiKUtil {
public static String APP_KEY = "26486442";
public static String APP_SECRET = "tXBM9jsMqeM9yvEMS8qg";
public static String HOST = "140.210.208.111:443";
public static String send(String api, Map<String, Object> map) {
ArtemisConfig.host = HOST;
ArtemisConfig.appKey = APP_KEY;
ArtemisConfig.appSecret = APP_SECRET;
final String url = "/artemis" + api;
Map<String, String> path = new HashMap<String,String>(2){{
put("https://", url);
}};
String contentType = "application/json";
String body = JSON.toJSONString(map);
String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null);
JSONObject object = JsonUtil.parse(result, JSONObject.class);
return object.getString("data");
}
public static String send(String api, Map<String, Object> map, String host,String appKey,String appSecret) {
ArtemisConfig.host = host;
ArtemisConfig.appKey = appKey;
ArtemisConfig.appSecret = appSecret;
final String url = "/artemis" + api;
Map<String, String> path = new HashMap<String,String>(2){{
put("https://", url);
}};
String contentType = "application/json";
String body = JSON.toJSONString(map);
String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null);
JSONObject object = JsonUtil.parse(result, JSONObject.class);
return object.getString("data");
}
}

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java → hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmHandleConstant.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.alert.constants;
package com.hnac.hzims.alarm.constants;
import java.util.Arrays;
import java.util.List;
@ -6,7 +6,7 @@ import java.util.List;
/**
* @author YSJ
*/
public interface AbnormalAlarmConstant {
public interface AlarmHandleConstant {
List<String> INTERRUPT_LIST = Arrays.asList("13","14");

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleDetailEntity.java → hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmHandleDetailEntity.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.alert.entity;
package com.hnac.hzims.alarm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java → hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmHandleEntity.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.alert.entity;
package com.hnac.hzims.alarm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmHandleVo.java → hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/vo/AlarmHandleVo.java

@ -1,8 +1,8 @@
package com.hnac.hzims.operational.alert.vo;
package com.hnac.hzims.alarm.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.alarm.entity.AlarmHandleEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

6
hzims-service-api/hzims-operational-api/pom.xml

@ -67,6 +67,12 @@
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>4.4.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java

@ -35,6 +35,20 @@ public class OperAccessStatisticsEntity extends TenantEntity {
/**
* 任务ID
*/
@ApiModelProperty(value = "设备编号")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String emCode;
/**
* 任务ID
*/
@ApiModelProperty(value = "设备名称")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String emName;
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long taskId;
@ -59,6 +73,13 @@ public class OperAccessStatisticsEntity extends TenantEntity {
private Date planEndTime;
/**
* 实际工时
*/
@ApiModelProperty(value = "计划工时")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer planHours;
/**
* 实际开始时间
*/
@ApiModelProperty(value = "实际开始时间")

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java

@ -79,6 +79,12 @@ public class OperAccessTaskEntity extends TenantEntity {
private Date planEndTime;
/**
* 计划结束时间
*/
@ApiModelProperty(value = "计划工时")
private Integer planHours;
/**
* 实际开始时间
*/
@ApiModelProperty(value = "实际开始时间")

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java

@ -28,14 +28,14 @@ public class OperConstructionEntity extends TenantEntity {
private String code;
@ApiModelProperty(value = "检修名称")
private String constructionTime;
@ApiModelProperty(value = "检修名称")
private String overhaulName;
@ApiModelProperty(value = "施工地点")
private String constructionLocation;
@ApiModelProperty(value = "施工时间")
private Date constructionTime;
@ApiModelProperty(value = "检修负责人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long overhaulHead;

20
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/ConstructionVo.java

@ -1,10 +1,14 @@
package com.hnac.hzims.operational.access.vo;
import cn.afterturn.easypoi.entity.ImageEntity;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.awt.image.BufferedImage;
import java.io.File;
/**
* @author ysj
*/
@ -17,4 +21,20 @@ public class ConstructionVo extends OperConstructionEntity {
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "年")
private String year;
@ApiModelProperty(value = "月")
private String mon;
@ApiModelProperty(value = "日")
private String day;
@ApiModelProperty(value = "图片1")
private ImageEntity constructionImg1;
@ApiModelProperty(value = "图片2")
private ImageEntity constructionImg2;
}

25
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java

@ -0,0 +1,25 @@
package com.hnac.hzims.operational.duty.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
public class DutyGroupMemberVo {
@ApiModelProperty(value = "班组Id")
private String groupId;
@ApiModelProperty(value = "班组名称")
private String groupName;
@ApiModelProperty(value = "机构Id")
private Long createDept;
@ApiModelProperty(value = "班组成员对象")
private List<DutyMemberVO> member;
}

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

@ -0,0 +1,21 @@
package com.hnac.hzims.operational.duty.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
public class DutyMemberVO {
@ApiModelProperty(value = "班组人员Id")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long personId;
@ApiModelProperty(value = "班组人员名称")
private String personName;
}

6
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/RedisConstants.java

@ -0,0 +1,6 @@
package com.hnac.hzims.safeproduct.constants;
public interface RedisConstants {
/**安全工器具提醒记录**/
String TOOLS_REMIND_MSG = "200000:hzims:safeproduct:tools:remind";
}

46
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarCheckRecordDTO.java

@ -0,0 +1,46 @@
package com.hnac.hzims.safeproduct.dto;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
/**
* @author liwen
* @date 2024-01-09
*/
@Data
@ApiModel(value = "车检记录DTO类")
public class CarCheckRecordDTO {
@ApiModelProperty("车检记录id")
private Long id;
@ApiModelProperty("车辆id")
private Long carId;
@NotNull
@Size(max = 50, message = "检查人长度不能超过50")
@ApiModelProperty("检查人")
private String checker;
@NotNull
@ApiModelProperty("检查时间")
private Date checkTime;
@NotNull
@ApiModelProperty("检查结论")
private String conclusion;
@Size(max = 500, message = "填报备注长度不能超过50")
@ApiModelProperty("填报备注")
private String remark;
@ApiModelProperty("检查项列表")
List<CarCheckItemEntity> itemList;
}

13
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -14,12 +16,19 @@ import java.util.Date;
@ApiModel(value = "车辆维保记录确认DTO类")
public class CarMaintenanceConfirmationDTO {
@NotNull
@ApiModelProperty("车辆维保记录id")
private Long carMaintenanceId;
@NotNull
@ApiModelProperty("车辆管理人意见")
private String managerAdvice;
@ApiModelProperty("确认时间")
private Date confirmationTime;
@NotNull
@ApiModelProperty("下次维保时间")
private Date maintenanceNextTime;
@NotNull
@ApiModelProperty("维保里程")
private BigDecimal maintenanceMileage;
}

6
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import javax.validation.constraints.NotNull;
/**
* @author liwen
@ -14,9 +14,7 @@ import java.util.Date;
@ApiModel(value = "用车记录确认DTO类")
public class CarUsedRecordConfirmationDTO {
@NotNull
@ApiModelProperty("用车记录id")
private Long carUsedRecordId;
@ApiModelProperty("确认时间")
private Date confirmationTime;
}

7
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java

@ -21,8 +21,11 @@ import java.util.List;
@ApiModel(value = "卫生自查计划DTO类")
public class HygienePlanDTO extends BaseEntity {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("卫生自查计划id")
private Long id;
@ApiModelProperty("计划名称")
private String name;
@ApiModelProperty("标准总分值")
private Integer standardScore;

11
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -7,6 +8,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @author liwen
* @date 2024-01-05
@ -20,9 +24,16 @@ public class CarCheckItemEntity extends BaseEntity {
@ApiModelProperty("车检记录id")
private Long carCheckRecordId;
@NotNull
@Size(max = 500, message = "检查项目长度不能超过50")
@ApiModelProperty("检查项目")
private String checkItem;
@NotNull
@ApiModelProperty("检查内容")
private String checkContent;
@NotNull
@ApiModelProperty("检查结果")
private String checkResult;
}

14
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@ -22,24 +24,24 @@ public class CarCheckRecordEntity extends BaseEntity {
@ApiModelProperty("车辆id")
private Long carId;
@Size(max = 50, message = "编码长度不能超过50")
@ApiModelProperty("编码")
private String code;
@NotNull
@Size(max = 50, message = "检查人长度不能超过50")
@ApiModelProperty("检查人")
private String checker;
@NotNull
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("检查项id")
private String checkItemIds;
@ApiModelProperty("检查项结果")
private String checkItemResults;
@NotNull
@ApiModelProperty("检查结论")
private String conclusion;
@Size(max = 500, message = "填报备注长度不能超过50")
@ApiModelProperty("填报备注")
private String remark;
}

16
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java

@ -1,6 +1,7 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -43,51 +44,60 @@ public class CarEntity extends BaseEntity {
private String plateNumber;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上牌时间")
private Date registrationTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上期缴车保时间")
private Date insurancePayLastTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("下期缴车保时间")
private Date insurancePayNextTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("年检时间")
private Date annualInspectionTime;
@NotNull
@Size(max = 50, message = "年检状态长度不能超过50")
@ApiModelProperty("年检状态")
private String annualInspectionStatus;
@NotNull
@Size(max = 50, message = "保险状态长度不能超过50")
@ApiModelProperty("保险状态")
private String insuranceStatus;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上期保养时间")
private Date maintenanceLastTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("下期保养时间")
private Date maintenanceNextTime;
@ApiModelProperty("保养里程")
private BigDecimal maintenanceMileage;
@NotNull
@Size(max = 50, message = "保养状态长度不能超过50")
@ApiModelProperty("保养状态")
private String maintenanceStatus;
@NotNull
@Size(max = 50, message = "车辆管理人长度不能超过50")
@ApiModelProperty("车辆管理人")
private String manager;
@Size(max = 1000, message = "车辆照片长度不能超过1000")
@ApiModelProperty("车辆照片")
private String imgPath;
@Size(max = 1000, message = "车辆附件长度不能超过1000")
@ApiModelProperty("车辆附件")
private String filePath;
}

21
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java

@ -1,12 +1,15 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@ -22,42 +25,60 @@ public class CarMaintenanceEntity extends BaseEntity {
@ApiModelProperty("车辆id")
private Long carId;
@Size(max = 50, message = "编码长度不能超过50")
@ApiModelProperty("编码")
private String code;
@NotNull
@Size(max = 50, message = "维保类型长度不能超过50")
@ApiModelProperty("维保类型")
private String maintenanceType;
@NotNull
@ApiModelProperty("维保内容")
private String content;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("维保开始时间")
private Date startTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("维保结束时间")
private Date endTime;
@NotNull
@Size(max = 255, message = "维保地点长度不能超过255")
@ApiModelProperty("维保地点")
private String location;
@NotNull
@ApiModelProperty("维保费用")
private Long cost;
@NotNull
@Size(max = 20, message = "维保人长度不能超过20")
@ApiModelProperty("维保人")
private String maintainer;
@Size(max = 1000, message = "维保照片长度不能超过1000")
@ApiModelProperty("维保照片")
private String imgPath;
@Size(max = 1000, message = "维保附件长度不能超过1000")
@ApiModelProperty("维保附件")
private String filePath;
@Size(max = 500, message = "车辆管理人意见长度不能超过500")
@ApiModelProperty("车辆管理人意见")
private String managerAdvice;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("确认时间")
private Date confirmationTime;
@Size(max = 50, message = "维保状态长度不能超过50")
@ApiModelProperty("维保状态")
private String maintenanceStatus;
}

16
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
@ -23,33 +25,44 @@ public class CarUsedRecordEntity extends BaseEntity {
@ApiModelProperty("车辆id")
private Long carId;
@Size(max = 50, message = "编码长度不能超过50")
@ApiModelProperty("编码")
private String code;
@NotNull
@Size(max = 50, message = "用车单位长度不能超过50")
@ApiModelProperty("用车单位")
private String unit;
@NotNull
@ApiModelProperty("使用时间")
private Date startTime;
@NotNull
@Size(max = 255, message = "使用地点长度不能超过255")
@ApiModelProperty("使用地点")
private String usedLocation;
@NotNull
@Size(max = 20, message = "使用人长度不能超过20")
@ApiModelProperty("使用人")
private String user;
@ApiModelProperty("用途详情")
private String remark;
@NotNull
@ApiModelProperty("出车公里数")
private BigDecimal startMiles;
@ApiModelProperty("收车公里数")
private BigDecimal endMiles;
@NotNull
@ApiModelProperty("行驶公里数")
private BigDecimal miles;
@NotNull
@ApiModelProperty("收车时间")
private Date endTime;
@ -59,6 +72,7 @@ public class CarUsedRecordEntity extends BaseEntity {
@ApiModelProperty("用车状态")
private String usedStatus;
@ApiModelProperty("图片路径")
@Size(max = 1000, message = "用车图片长度不能超过1000")
@ApiModelProperty("用车图片")
private String imgPath;
}

11
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java

@ -9,7 +9,6 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@ -22,8 +21,8 @@ import java.util.Date;
@ApiModel(value = "卫生自查计划实体类")
public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("计划名称")
private String name;
@ApiModelProperty("标准总分值")
private Integer standardScore;
@ -38,8 +37,6 @@ public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("计划结束时间")
private Date scheduledEndTime;
@NotNull
@Size(max = 20, message = "卫生自查状态字段长度不能超过20")
@ApiModelProperty("卫生自查状态")
private String hygieneStatus;
@ApiModelProperty("自查计划状态")
private String hygienePlanStatus;
}

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java

@ -45,6 +45,7 @@ public class HygieneRecordEntity extends BaseEntity {
@ApiModelProperty("责任区id")
private String hygieneZoneIds;
@NotNull
@ApiModelProperty("检查结果")
private String checkResult;
@ -58,4 +59,7 @@ public class HygieneRecordEntity extends BaseEntity {
@Size(max = 1000, message = "检查图片字段长度不能超过1000")
@ApiModelProperty("检查图片")
private String imgPath;
@ApiModelProperty("自查记录状态")
private String hygieneRecordStatus;
}

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java

@ -9,6 +9,7 @@ import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
@ -38,12 +39,15 @@ public class RehearsalRecordEntity extends BaseEntity {
@ApiModelProperty("参演人员")
private String peopleName;
@NotNull
@ApiModelProperty("演练实际开始时间")
private Date actualStartTime;
@NotNull
@ApiModelProperty("演练实际结束时间")
private Date actualEndTime;
@NotNull
@Size(max = 250, message = "演练记录字段长度不能超过250")
@ApiModelProperty("演练记录")
private String record;

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SafetyToolEntity.java

@ -9,6 +9,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serializable;
import java.util.Date;
@ -21,7 +22,7 @@ import java.util.Date;
@TableName("hzims_safe_safety_tool")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SafetyTool对象", description = "")
public class SafetyToolEntity extends TenantEntity {
public class SafetyToolEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 车辆保险记录状态枚举类
*
* @author liwen
* @date 2024-01-11
*/
public enum CarInsuranceStatusEnum {
INSURED("INSURED", "已参保"),
UNINSURED("UNINSURED", "未参保");
private final String value;
private final String desc;
CarInsuranceStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 车辆维保记录状态枚举类
*
* @author liwen
* @date 2024-01-10
*/
public enum CarMaintenanceStatusEnum {
MAINTAINED("MAINTAINED", "已维保"),
UNMAINTAINED("UNMAINTAINED", "未维保");
private final String value;
private final String desc;
CarMaintenanceStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 用车记录枚举类
*
* @author liwen
* @date 2024-01-10
*/
public enum CarUsedRecordEnum {
USING("USING", "使用中"),
USED("USED", "已使用");
private final String value;
private final String desc;
CarUsedRecordEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.vo;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -37,5 +38,5 @@ public class CarCheckRecordDetailVO {
private String remark;
@ApiModelProperty("检查列表")
private List<CarCheckItemVO> checkItemList;
private List<CarCheckItemEntity> checkItemList;
}

37
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordPageVO.java

@ -0,0 +1,37 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-09
*/
@Data
@ApiModel(value = "车检记录页面VO类")
public class CarCheckRecordPageVO {
@ApiModelProperty("车检记录id")
private Long id;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("检查人")
private String checker;
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("检查结论")
private String conclusion;
}

10
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-04
@ -24,8 +26,11 @@ public class CarMaintenancePageVO {
@ApiModelProperty("型号")
private String carType;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("维保类型")
private String type;
private String maintenanceType;
@ApiModelProperty("维保内容")
private String content;
@ -38,4 +43,7 @@ public class CarMaintenancePageVO {
@ApiModelProperty("维保人")
private String maintainer;
@ApiModelProperty("确认时间")
private Date confirmationTime;
}

9
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java

@ -15,6 +15,9 @@ import java.util.Date;
@ApiModel(value = "用车记录页面VO类")
public class CarUsedRecordPageVO {
@ApiModelProperty("用车记录id")
private Long id;
@ApiModelProperty("用车单位")
private String unit;
@ -24,6 +27,9 @@ public class CarUsedRecordPageVO {
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("使用地点")
private String usedLocation;
@ApiModelProperty("使用时间")
private Date startTime;
@ -41,4 +47,7 @@ public class CarUsedRecordPageVO {
@ApiModelProperty("行驶公里数")
private BigDecimal miles;
@ApiModelProperty("确认时间")
private Date confirmationTime;
}

4
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java

@ -31,7 +31,7 @@ public class WorkTaskEntity extends TenantEntity {
private String headName;
@ApiModelProperty(value = "工作负责人名称")
private Date headHandlTime;
private Date headHandleTime;
@ApiModelProperty(value = "班组ID")
private Long groupId;
@ -52,7 +52,7 @@ public class WorkTaskEntity extends TenantEntity {
private Date planStartTime;
@ApiModelProperty(value = "工作计划结束时间")
private Date endStartTime;
private Date planEndTime;
@ApiModelProperty(value = "工作任务")
private String workTask;

4
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/fegin/IRepairClient.java

@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author ysj
*/
@FeignClient(
value = TicketConstants.APP_NAME,
fallback = RepairClientFallback.class
value = TicketConstants.APP_NAME
// fallback = RepairClientFallback.class
)
public interface IRepairClient {

8
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskVO.java

@ -1,6 +1,7 @@
package com.hnac.hzims.ticket.repair.vo;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -11,5 +12,12 @@ import lombok.EqualsAndHashCode;
@Data
public class WorkTaskVO extends WorkTaskEntity {
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "机构ID")
private Long deptId;
}

5
hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java

@ -97,7 +97,10 @@ public class ParamServiceImpl implements IParamService {
String realData = JSON.toJSONString(realDataR.getData().getDataMap().get(p.getSignage()));
if("0".equals(JSONObject.parseObject(realData).getString("q"))) {
String value = JSONObject.parseObject(realData).getString("v");
if(StringUtil.isNotBlank(p.getDbType()) && "double".equals(p.getDbType())
if(StringUtil.isNotBlank(p.getDbType()) && "int".equals(p.getDbType()) && StringUtil.isNotBlank(value)) {
value = String.valueOf(new BigDecimal(value).setScale(0, RoundingMode.HALF_UP).doubleValue());
}
else if(StringUtil.isNotBlank(p.getDbType()) && "double".equals(p.getDbType())
&& StringUtil.isNotBlank(value) && ObjectUtil.isNotEmpty(p.getKeepFigures())) {
value = String.valueOf(new BigDecimal(value).setScale(p.getKeepFigures(), RoundingMode.HALF_UP).doubleValue());
}

7
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java

@ -420,4 +420,11 @@ public class EmInfoController extends BladeController {
public R<List<EmInfoEntity>> hkVideoDevices() {
return R.data(em_infoService.hkVideoDevices());
}
@GetMapping("/select")
@ApiOperationSupport(order = 13)
@ApiOperation(value = "下拉框设备查询")
public R<List<EmInfoEntity>> select(@RequestParam(value = "deptId",required = false) Long deptId) {
return R.data(em_infoService.select(deptId));
}
}

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java

@ -94,4 +94,6 @@ public interface IEmInfoService extends BaseService<EmInfoEntity> {
List<EmInfoEntity> hkVideoDevices();
List<EmInfoEntity> deviceByPath(String emCode);
List<EmInfoEntity> select(Long deptId);
}

14
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -990,4 +990,18 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
return this.list(Wrappers.<EmInfoEntity>lambdaQuery().in(EmInfoEntity::getNumber, Arrays.asList(deviceCodes)));
}
/**
* 根据机构查询设备
* @param deptId
* @return
*/
@Override
public List<EmInfoEntity> select(Long deptId) {
if(ObjectUtil.isEmpty(deptId)){
return this.list();
}
return this.list(Wrappers.<EmInfoEntity>lambdaQuery()
.eq(EmInfoEntity::getDepartment,deptId));
}
}

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java

@ -2,7 +2,7 @@ package com.hnac.hzims.alarm.monitor.listener;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.source.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.queue.annotation.RedisQueue;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java

@ -2,7 +2,7 @@ package com.hnac.hzims.alarm.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.DroolsAlarmService;
import com.hnac.hzims.alarm.source.service.DroolsAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import lombok.extern.slf4j.Slf4j;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java

@ -2,7 +2,7 @@ package com.hnac.hzims.alarm.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.FdpAlarmService;
import com.hnac.hzims.alarm.source.service.FdpAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import org.springblade.core.log.exception.ServiceException;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java

@ -2,7 +2,7 @@ package com.hnac.hzims.alarm.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import com.hnac.hzims.alarm.source.service.SystemAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import lombok.extern.slf4j.Slf4j;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java

@ -2,7 +2,7 @@ package com.hnac.hzims.alarm.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.VideoAlarmService;
import com.hnac.hzims.alarm.source.service.VideoAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import lombok.extern.slf4j.Slf4j;

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/AlarmHandleController.java

@ -1,13 +1,13 @@
package com.hnac.hzims.operational.alert.controller;
package com.hnac.hzims.alarm.show.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.alarm.show.service.AlarmHandleService;
import com.hnac.hzims.alarm.vo.AlarmHandleVo;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.alert.service.AlarmHandleService;
import com.hnac.hzims.operational.alert.vo.AlarmHandleVo;
import com.hnac.hzims.operational.alert.vo.HandleQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -29,7 +29,7 @@ import java.util.List;
@Api(tags = {"告警处理"})
@RestController
@AllArgsConstructor
@RequestMapping("/alarm/handle")
@RequestMapping("/handle")
public class AlarmHandleController extends BladeController {
private final AlarmHandleService service;
@ -52,7 +52,7 @@ public class AlarmHandleController extends BladeController {
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入AlarmHandleEntity")
@OperationAnnotation(moduleName = "告警配置", title = "告警配置记录", operatorType = OperatorType.MOBILE, businessType =
@OperationAnnotation(moduleName = "分页查询告警处理记录", title = "查询告警处理记录", operatorType = OperatorType.MOBILE, businessType =
BusinessType.GENCODE,
action = "分页")
public R<IPage<AlarmHandleVo>> list(HandleQueryVo param, Query query) {

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java

@ -3,7 +3,7 @@ package com.hnac.hzims.alarm.show.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import com.hnac.hzims.alarm.source.service.SystemAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.AlarmCountVo;
import io.swagger.annotations.Api;

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleDetailMapper.java

@ -1,6 +1,6 @@
package com.hnac.hzims.operational.alert.mapper;
package com.hnac.hzims.alarm.show.mapper;
import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity;
import com.hnac.hzims.alarm.entity.AlarmHandleDetailEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.xml → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleDetailMapper.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.AlarmHandleDetailMapper">
<mapper namespace="com.hnac.hzims.alarm.show.mapper.AlarmHandleDetailMapper">
</mapper>

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java

@ -1,8 +1,8 @@
package com.hnac.hzims.operational.alert.mapper;
package com.hnac.hzims.alarm.show.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.operational.alert.vo.AlarmHandleVo;
import com.hnac.hzims.alarm.entity.AlarmHandleEntity;
import com.hnac.hzims.alarm.vo.AlarmHandleVo;
import com.hnac.hzims.operational.alert.vo.HandleQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
@ -18,7 +18,7 @@ import java.util.List;
public interface AlarmHandleMapper extends UserDataScopeBaseMapper<AlarmHandleEntity> {
@UserDataAuth
IPage<AlarmHandleVo> selectHandlePage(IPage<Object> page,@Param("param") HandleQueryVo param);
IPage<AlarmHandleVo> selectHandlePage(IPage<Object> page, @Param("param") HandleQueryVo param);
List<AlarmHandleEntity> handles(@Param("types") List<Long> types,@Param("start") String start,@Param("end") String end);
List<String> handles(@Param("start") String start,@Param("end") String end);
}

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

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.alarm.show.mapper.AlarmHandleMapper">
<select id="selectHandlePage" resultType="com.hnac.hzims.alarm.vo.AlarmHandleVo">
SELECT H.*,HANDLE_USER,D.PHENOMENON_ID,D.ACCESS_ID,D.DELAY_TIME,D.DELAY_CAUSE,
D.FALSE_ALARM_DESC,D.FILE_PATH,S.NAME AS STATION_NAME,P.CHECK_PROCESS_INSTANCE_ID,A.PROCESS_INSTANCE_ID
FROM HZIMS_ALARM_HANDLE H
LEFT JOIN HZIMS_ALARM_HANDLE_DETAIL D
ON H.DETAIL_ID = D.ID
LEFT JOIN DEV_HZIMS_OPERATION.HZIMS_STATION S
ON H.STATION_CODE = S.CODE
LEFT JOIN DEV_HZIMS_OPERATION.HZIMS_OPER_PHENOMENON P
ON D.PHENOMENON_ID = P.ID
LEFT JOIN DEV_HZIMS_OPERATION.HZIMS_OPER_ACCESS_PLAN A
ON D.ACCESS_ID = A.ID
<where>
H.IS_DELETED = 0
<if test="param.stationCode != null">
AND H.STATION_CODE = #{param.stationCode}
</if>
<if test="param.handleUser != null">
AND H.CREATE_USER = #{param.handleUser}
</if>
<if test="param.startTime != null">
AND H.CREATE_TIME &gt;= #{param.startTime}
</if>
<if test="param.endTime != null">
AND H.CREATE_TIME &lt;= #{param.endTime}
</if>
<if test="param.handleWay != null">
AND H.HANDLE_WAY = #{param.handleWay}
</if>
</where>
order by create_time desc
</select>
<select id="handles" resultType="java.lang.String">
SELECT HANDLER.ALARM_ID
FROM HZIMS_ALARM_HANDLE HANDLER
LEFT JOIN HZIMS_ALARM_HANDLE_DETAIL DETAIL
ON HANDLER.DETAIL_ID = DETAIL.ID
<where>
HANDLER.IS_DELETED = 0
<if test="start != null and end != null">
AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end}
</if>
AND (DETAIL.DELAY_TIME &gt; #{end} OR DETAIL.DELAY_TIME IS NULL)
</where>
</select>
</mapper>

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleDetailService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleDetailService.java

@ -1,6 +1,7 @@
package com.hnac.hzims.operational.alert.service;
package com.hnac.hzims.alarm.show.service;
import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity;
import com.hnac.hzims.alarm.entity.AlarmHandleDetailEntity;
import org.springblade.core.mp.base.BaseService;
/**

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java

@ -1,8 +1,8 @@
package com.hnac.hzims.operational.alert.service;
package com.hnac.hzims.alarm.show.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.operational.alert.vo.AlarmHandleVo;
import com.hnac.hzims.alarm.entity.AlarmHandleEntity;
import com.hnac.hzims.alarm.vo.AlarmHandleVo;
import com.hnac.hzims.operational.alert.vo.HandleQueryVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
@ -23,5 +23,5 @@ public interface AlarmHandleService extends BaseService<AlarmHandleEntity> {
List<User> handleUser();
List<AlarmHandleEntity> handles(List<Long> types,Integer alarmType);
List<String> handles();
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleDetailServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleDetailServiceImpl.java

@ -1,8 +1,8 @@
package com.hnac.hzims.operational.alert.service.impl;
package com.hnac.hzims.alarm.show.service.impl;
import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity;
import com.hnac.hzims.operational.alert.mapper.AlarmHandleDetailMapper;
import com.hnac.hzims.operational.alert.service.AlarmHandleDetailService;
import com.hnac.hzims.alarm.entity.AlarmHandleDetailEntity;
import com.hnac.hzims.alarm.show.mapper.AlarmHandleDetailMapper;
import com.hnac.hzims.alarm.show.service.AlarmHandleDetailService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;

42
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java

@ -1,17 +1,17 @@
package com.hnac.hzims.operational.alert.service.impl;
package com.hnac.hzims.alarm.show.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.alarm.entity.AlarmHandleDetailEntity;
import com.hnac.hzims.alarm.entity.AlarmHandleEntity;
import com.hnac.hzims.alarm.show.mapper.AlarmHandleMapper;
import com.hnac.hzims.alarm.show.service.AlarmHandleDetailService;
import com.hnac.hzims.alarm.show.service.AlarmHandleService;
import com.hnac.hzims.alarm.show.wrapper.HandleWrapper;
import com.hnac.hzims.alarm.vo.AlarmHandleVo;
import com.hnac.hzims.fdp.feign.IFdpMonitorClient;
import com.hnac.hzims.fdp.vo.UpdateFaultStateVo;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.operational.alert.mapper.AlarmHandleMapper;
import com.hnac.hzims.operational.alert.service.AlarmHandleDetailService;
import com.hnac.hzims.operational.alert.service.AlarmHandleService;
import com.hnac.hzims.operational.alert.vo.AlarmHandleVo;
import com.hnac.hzims.alarm.constants.AlarmHandleConstant;
import com.hnac.hzims.operational.alert.vo.HandleQueryVo;
import com.hnac.hzims.operational.alert.wrapper.HandleWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
@ -60,11 +60,11 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
@Override
public boolean execute(AlarmHandleVo param) {
Long way = param.getHandleWay();
if (!AbnormalAlarmConstant.HANDLE_WAY.contains(way)) {
if (!AlarmHandleConstant.HANDLE_WAY.contains(way)) {
throw new ServiceException("无效处理!");
}
// 预警
if(AbnormalAlarmConstant.EARLY_WARNING.equals(param.getAlarmType())){
if(AlarmHandleConstant.EARLY_WARNING.equals(param.getAlarmType())){
this.updateFalultState(param);
}
// 详情
@ -99,7 +99,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
UpdateFaultStateVo state = new UpdateFaultStateVo();
state.setStationId(param.getStationCode());
state.setFaultId(param.getAlarmId());
if(AbnormalAlarmConstant.HANDLE.contains(param.getHandleWay())){
if(AlarmHandleConstant.HANDLE.contains(param.getHandleWay())){
state.setConfidence(1f);
}else{
state.setConfidence(0f);
@ -134,30 +134,18 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
*/
@Override
public List<User> handleUser() {
R<List<Dept>> result = sysClient.getDeptByCurrentUser();
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException("查询告警处理人失败!");
}
List<User> users = new ArrayList<>();
result.getData().forEach(dept->{
users.addAll(userClient.userListByDeptAndChildrenWithAuth(dept.getId()).getData());
});
List<User> users = userClient.userListByDeptAndChildrenWithAuth(Long.valueOf(AuthUtil.getUser().getDeptId())).getData();
return users.stream().distinct().collect(Collectors.toList());
}
/**
* 查询处理告警记录
* @param types 告警类型
* @return
*/
@Override
public List<AlarmHandleEntity> handles(List<Long> types,Integer isEarly) {
if(AbnormalAlarmConstant.INTELLIGENCE_ALARM.equals(isEarly)){
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.handles(types,null,end);
}
public List<String> handles() {
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.handles(types,start,end);
return this.baseMapper.handles(start,end);
}
}

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

@ -3,13 +3,13 @@ package com.hnac.hzims.alarm.show.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.show.mapper.AlarmMapper;
import com.hnac.hzims.alarm.show.service.AlarmHandleService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.alarm.vo.AlarmCountVo;
import com.hnac.hzims.alarm.vo.ChildAlarmCountVo;
import com.hnac.hzims.message.dto.MailMessageDTO;
@ -42,6 +42,8 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
private final AlarmConfigService configService;
private final AlarmHandleService alarmHandleService;
private final IUserClient userClient;
private final IStationClient stationClient;
@ -77,6 +79,12 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
wrapper.eq("ALARM_TYPE",alarm.getAlarmType());
}
// 处理告警过滤 :当天处理告警
List<String> handles = alarmHandleService.handles();
if(!CollectionUtil.isEmpty(handles)){
wrapper.notIn("ALARM_ID",handles);
}
// 查询数据
return this.page(page,wrapper);
}
@ -184,13 +192,18 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
if(CollectionUtil.isEmpty(effectives)){
return null;
}
List<AlarmEntity> alarms = this.list(Wrappers.<AlarmEntity>lambdaQuery()
.in(AlarmEntity::getStationId,effectives)
.in(AlarmEntity::getAlarmType, Arrays.asList(AlarmConstants.FAULT,AlarmConstants.EARLY))
.eq(AlarmEntity::getIsShowAlert,0)
.eq(AlarmEntity::getStatus,0)
//.ge(AlarmEntity::getAlarmType, DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00")
);
// 条件过滤
QueryWrapper<AlarmEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(AlarmEntity::getStationId,effectives);
queryWrapper.lambda().in(AlarmEntity::getAlarmType, Arrays.asList(AlarmConstants.FAULT,AlarmConstants.EARLY));
queryWrapper.lambda().eq(AlarmEntity::getIsShowAlert,0);
queryWrapper.lambda().eq(AlarmEntity::getStatus,0);
// 处理告警过滤 :当天处理告警
List<String> handles = alarmHandleService.handles();
if(!CollectionUtil.isEmpty(handles)){
queryWrapper.lambda().notIn(AlarmEntity::getAlarmId,handles);
}
List<AlarmEntity> alarms = this.list(queryWrapper);
if(CollectionUtil.isEmpty(alarms)){
return null;
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/wrapper/HandleWrapper.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/wrapper/HandleWrapper.java

@ -1,6 +1,6 @@
package com.hnac.hzims.operational.alert.wrapper;
package com.hnac.hzims.alarm.show.wrapper;
import com.hnac.hzims.operational.alert.vo.AlarmHandleVo;
import com.hnac.hzims.alarm.vo.AlarmHandleVo;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.user.cache.UserCache;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/mapper/AlarmHistoryMapper.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.mapper;
package com.hnac.hzims.alarm.source.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.alarm.entity.AlarmHistoryEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/mapper/AlarmHistoryMapper.xml

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

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/AlarmHistoryService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmHistoryEntity;
import org.springblade.core.mp.base.BaseService;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/DroolsAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/DroolsAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/FdpAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/LevelAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/MessageService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/SystemAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/VideoAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.handle.service;
package com.hnac.hzims.alarm.source.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/AlarmHistoryServiceImpl.java

@ -1,7 +1,7 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.hnac.hzims.alarm.entity.AlarmHistoryEntity;
import com.hnac.hzims.alarm.handle.mapper.AlarmHistoryMapper;
import com.hnac.hzims.alarm.source.mapper.AlarmHistoryMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseService;

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/DroolsAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/DroolsAlarmServiceImpl.java

@ -1,10 +1,10 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.DroolsAlarmService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.source.service.DroolsAlarmService;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.ConditionAlarmVo;
import com.hnac.hzims.equipment.feign.IEmInfoClient;

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java

@ -1,10 +1,10 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.FdpAlarmService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.source.service.FdpAlarmService;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.FdpAlarmVo;
import com.hnac.hzims.message.fegin.IMessageClient;

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/LevelAlarmServiceImpl.java

@ -1,11 +1,11 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.LevelAlarmService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.source.service.LevelAlarmService;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.LevelMessageVo;
import com.hnac.hzims.alarm.vo.LevelVo;

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

@ -1,9 +1,9 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.dto.SmsPushDto;

10
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java

@ -1,15 +1,15 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.alarm.source.service.SystemAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.SystemAlarmVo;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.alarm.constants.AlarmHandleConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
import lombok.RequiredArgsConstructor;
@ -61,7 +61,7 @@ public class SystemAlarmServiceImpl implements SystemAlarmService {
List<StationEntity> stations = listAll.getData();
Map<String, String> map = new ConcurrentHashMap<>();
map.put("stations", stations.stream().map(StationEntity::getCode).collect(Collectors.joining(",")));
map.put("soe_type", AbnormalAlarmConstant.SYSTEM_TYPE_LIST);
map.put("soe_type", AlarmHandleConstant.SYSTEM_TYPE_LIST);
return JSONObject.toJSONString(map);
}

8
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/VideoAlarmServiceImpl.java

@ -1,15 +1,15 @@
package com.hnac.hzims.alarm.handle.service.impl;
package com.hnac.hzims.alarm.source.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.VideoAlarmService;
import com.hnac.hzims.alarm.source.service.VideoAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.alarm.constants.AlarmHandleConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzinfo.datasearch.soe.ISoeClient;
@ -105,7 +105,7 @@ public class VideoAlarmServiceImpl implements VideoAlarmService {
entity.setAlarmId(item.getId());
entity.setAlarmTime(DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s"));
entity.setAlarmContext(item.getSoeExplain());
entity.setAlarmType(AbnormalAlarmConstant.VIDEO_ALARM);
entity.setAlarmType(AlarmHandleConstant.VIDEO_ALARM);
entity.setAlarmStatus(Integer.valueOf(item.getSoeStatus()));
entity.setRealId(item.getRealId());
entity.setStationId(item.getStation());

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java

@ -1,7 +1,7 @@
package com.hnac.hzims.alarm.task;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.VideoAlarmService;
import com.hnac.hzims.alarm.source.service.VideoAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.xxl.job.core.biz.model.ReturnT;
import lombok.extern.slf4j.Slf4j;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java

@ -1,6 +1,6 @@
package com.hnac.hzims.alarm.ws.level;
import com.hnac.hzims.alarm.handle.service.LevelAlarmService;
import com.hnac.hzims.alarm.source.service.LevelAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java

@ -1,7 +1,7 @@
package com.hnac.hzims.alarm.ws.level;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.LevelAlarmService;
import com.hnac.hzims.alarm.source.service.LevelAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;

23
hzims-service/operational/pom.xml

@ -18,6 +18,23 @@
</properties>
<dependencies>
<!--转pdf-->
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-local</artifactId>
<version>${documents4j.version}</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-transformer-msoffice-word</artifactId>
<version>${documents4j.version}</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-UTIL-ALL</artifactId>
<version>${documents4j.version}</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
@ -232,6 +249,12 @@
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.xls.free</artifactId>
<version>3.9.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java

@ -49,7 +49,7 @@ public class ConstructionController extends BladeController {
@ApiOperation(value = "新增")
public R save(@RequestBody OperConstructionEntity entity) {
entity.setCode("SGRZ" + DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI));
entity.setConstructionTime(DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME));
entity.setConstructionTime(entity.getOverhaulTime());
return R.status(service.save(entity));
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java

@ -20,6 +20,9 @@ public class OperAccessStatisticsDTO extends OperAccessStatisticsEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("设备编码")
private String emCode;
@ApiModelProperty(value = "任务名称")
private String taskName;

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml

@ -3,12 +3,15 @@
<mapper namespace="com.hnac.hzims.operational.access.mapper.OperAccessStatisticsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity">
<resultMap id="BaseResultMap" type="com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO">
<result column="ID" property="id"/>
<result column="PID" property="pid"/>
<result column="TASK_ID" property="taskId"/>
<result column="EM_CODE" property="emCode"/>
<result column="MANAGER" property="manager"/>
<result column="PLAN_START_TIME" property="planStartTime"/>
<result column="PLAN_END_TIME" property="planEndTime"/>
<result column="PLAN_HOURS" property="planHours"/>
<result column="ACT_START_TIME" property="actStartTime"/>
<result column="ACT_END_TIME" property="actEndTime"/>
<result column="HOURS" property="hours"/>
@ -22,12 +25,19 @@
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<collection property="details"
select="com.hnac.hzims.operational.access.mapper.OperAccessTaskDetailMapper.selectByTaskId"
column="TASK_ID">
</collection>
</resultMap>
<select id="selectPageList" resultType="com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO">
<select id="selectPageList" resultMap="BaseResultMap">
SELECT OT.`NAME` AS taskName,OS.* FROM hzims_oper_access_statistics OS
JOIN hzims_oper_access_task OT
ON OS.`TASK_ID` = OT.`ID`
WHERE OS.IS_DELETED = 0
<if test="dto.emCode != null and dto.emCode != ''">
and OS.EM_CODE = #{dto.emCode}
</if>
<if test="dto.taskName != null">
and OT.`NAME` like concat('%',#{dto.taskName},'%')
</if>

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java

@ -2,8 +2,11 @@ package com.hnac.hzims.operational.access.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
*
* Mapper 接口
@ -13,4 +16,5 @@ import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
**/
public interface OperAccessTaskDetailMapper extends BaseMapper<OperAccessTaskDetailEntity> {
List<OperAccessTaskDetailEntity> selectByTaskId(@Param("taskId") Long taskId);
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml

@ -17,5 +17,10 @@
<result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
</resultMap>
<select id="selectByTaskId" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity">
SELECT NAME,CONTENT
FROM HZIMS_OPER_ACCESS_TASK_DETAIL
WHERE TASK_ID = #{taskId}
</select>
</mapper>

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

@ -32,6 +32,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.text.DecimalFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -229,7 +232,7 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
if(ObjectUtil.isEmpty(plan)){
throw new ServiceException("未查询到检修计划!");
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
for(OperAccessContentDTO item : entity.getAccessContents()){
//任务参数
AccessTaskV4DTO task = BeanUtil.copy(item, AccessTaskV4DTO.class);
@ -239,6 +242,10 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
task.setProcDefId(plan.getProcDefId());
task.setHandler(item.getManager());
task.setPlanId(plan.getId());
LocalDateTime start = LocalDateTime.parse(DateUtil.format(task.getPlanStartTime(),DateUtil.PATTERN_DATETIME), formatter);
LocalDateTime end = LocalDateTime.parse(DateUtil.format(task.getPlanEndTime(),DateUtil.PATTERN_DATETIME), formatter);
Duration duration = Duration.between(start, end);
task.setPlanHours((int) duration.toHours());
task.setContentId(item.getId());
task.setEmCode(item.getEmCode());
task.setTenantId(plan.getTenantId());

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

@ -251,6 +251,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
OperAccessStatisticsDTO statisticsDTO = BeanUtil.copy(entity, OperAccessStatisticsDTO.class);
statisticsDTO.setId(null);
statisticsDTO.setTaskId(entity.getId());
statisticsDTO.setEmCode(entity.getEmCode());
statisticsDTO.setPlanHours(entity.getPlanHours());
statisticsDTO.setManager(entity.getHandler());
OperAccessContentEntity content = contentService.getById(entity.getId());
if (ObjectUtil.isNotEmpty(content)) {

155
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java

@ -1,19 +1,24 @@
package com.hnac.hzims.operational.access.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.afterturn.easypoi.word.WordExportUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.mapper.ConstructionMapper;
import com.hnac.hzims.operational.access.service.ConstructionService;
import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.operational.util.ExcelUtil;
import com.hnac.hzims.operational.util.PdfUtils;
import com.hnac.hzims.operational.util.WordUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.commons.io.IOUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Value;
@ -21,7 +26,12 @@ import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@ -33,12 +43,8 @@ import java.util.Map;
@RequiredArgsConstructor
public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper, OperConstructionEntity> implements ConstructionService {
@Value("${hzims.operational.construction.save.xlsx}")
private String constructionSaveXlsxPath;
@Value("${hzims.operational.construction.save.pdf}")
private String constructionSavePdfPath;
@Value("${hzims.operation.construction.save.img}")
private String constructionSaveImgPath;
/**
* 施工日志记录分页查询
@ -67,34 +73,36 @@ public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper,
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = servletRequestAttributes.getResponse();
//准备数据
OperConstructionEntity construction = this.record(id);
ConstructionVo construction = this.record(id);
Map<String,Object> params = new HashMap<>();
/*try {
try {
params = PdfUtils.objectToMap(construction);
}catch (Exception e) {
log.error("转换对象失败!");
}*/
TemplateExportParams templateExportParams = new TemplateExportParams("template/constructio_template.xlsx", true);
Workbook workbook = null;
}
String fileName = construction.getCode() + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.DOCX_SUFFIX;
XWPFDocument document;
try {
workbook = ExcelUtil.getWorkbook(templateExportParams,params);
document = WordExportUtil.exportWord07("template/word/constructio_template.docx",params);
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("文件创建失败!");
}
//上传xlsx至服务器
//String fileName = DateUtil.format(construction.getConstructionTime(),DateUtil.PATTERN_DATETIME) + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.XLSX_SUFFIX;
/* try {
ExcelUtil.upload(workbook,constructionSaveXlsxPath,fileName);
} catch (Exception e) {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/vnd.ms-word");
ServletOutputStream outputStream;
try {
//设置docx格式
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
//创建一个输出流
outputStream = response.getOutputStream();
//写入数据
document.write(outputStream);
// 关闭
outputStream.close();
document.close();
} catch (IOException e) {
e.printStackTrace();
}*/
//将docx文件转换为pdf并保存
//String pdfFileName = DateUtil.format(construction.getConstructionTime(),DateUtil.PATTERN_DATETIME) + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.PDF_SUFFIX;
//String xlsxFileName = DateUtil.format(construction.getConstructionTime(),DateUtil.PATTERN_DATETIME) + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.XLSX_SUFFIX;
//PdfUtils.convertPdf(constructionSaveXlsxPath, xlsxFileName, constructionSavePdfPath, pdfFileName);
//String savePath = constructionSavePdfPath + pdfFileName;
// 设置response参数,可以打开下载页面
//PdfUtils.readPdf(response,savePath);
}
}
/**
@ -102,11 +110,96 @@ public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper,
* @param id
* @return
*/
private OperConstructionEntity record(Long id) {
private ConstructionVo record(Long id) {
OperConstructionEntity entity = this.getById(id);
if(ObjectUtil.isEmpty(entity)){
throw new ServiceException("施工日志记录不存在!");
}
return entity;
ConstructionVo construction = BeanUtil.copy(entity,ConstructionVo.class);
if(StringUtil.isNotBlank(construction.getConstructionImg())){
String[] imgArr = construction.getConstructionImg().split(",");
if(imgArr.length > 1){
construction.setConstructionImg1(new ImageEntity(imgToByte(constructionSaveImgPath + downloadFileByUrl(imgArr[0],constructionSaveImgPath)), 225, 163));
construction.setConstructionImg2(new ImageEntity(imgToByte(constructionSaveImgPath + downloadFileByUrl(imgArr[1],constructionSaveImgPath)), 225, 163));
}else{
construction.setConstructionImg1(new ImageEntity(imgToByte(constructionSaveImgPath + downloadFileByUrl(imgArr[0],constructionSaveImgPath)), 225, 163));
}
}
if(StringUtil.isEmpty(construction.getConstructionAttachment())){
construction.setConstructionAttachment(" ");
}
construction.setYear(DateUtil.format(construction.getConstructionTime(),"yyyy"));
construction.setMon(DateUtil.format(construction.getConstructionTime(),"MM"));
construction.setDay(DateUtil.format(construction.getConstructionTime(),"dd"));
return construction;
}
/**
* 将图片转化为字节数组
*
* @return 字节数组
*/
private byte[] imgToByte(String tempImgPath) {
File file = new File(tempImgPath);
byte[] buffer = null;
try {
FileInputStream fis = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
byte[] b = new byte[1000];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
fis.close();
bos.close();
buffer = bos.toByteArray();
} catch (IOException e) {
log.error(e.getMessage());
}
//删除临时文件
file.delete();
return buffer;
}
/**
* 下载文件
* @param fileUrl
* @param downloadFileDir
* @return
*/
private String downloadFileByUrl(String fileUrl, String downloadFileDir){
URL url = null;
String fileName = null;
try {
url = new URL(fileUrl);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);
connection.connect();
int responseCode = connection.getResponseCode();
if (responseCode == 200) {
InputStream inputStream = connection.getInputStream();
int lastSlashIndex = fileUrl.lastIndexOf("/");
if (lastSlashIndex > 0){
fileName = fileUrl.substring(lastSlashIndex+1);
String filePath = downloadFileDir + fileName;
File file = new File(filePath);
if (file.exists()){
file.delete();
}
OutputStream outputStream = new FileOutputStream(file);
// 将文件流拷贝到本地处理
IOUtils.copy(inputStream, outputStream);
}else {
throw new ServiceException("下载文件路径异常:" + downloadFileDir);
}
}
} catch (Exception e) {
throw new ServiceException("文件图片下载失败!");
}
return fileName;
}
}

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

@ -50,8 +50,6 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl<OperAccessS
@Override
public R<IPage<OperAccessStatisticsVO>> list(OperAccessStatisticsDTO req, IPage<OperAccessStatisticsVO> page) {
List<OperAccessStatisticsEntity> operAccessStatisticsVOS = this.baseMapper.selectPageList(page, req);
/* IPage pages = super.page(Condition.getPage(query), getQueryWrapperByList(req));
pages.setRecords(OperAccessStatisticsWrapper.build().listVO(pages.getRecords()));*/
return R.data(page.setRecords(OperAccessStatisticsWrapper.build().listVO(operAccessStatisticsVOS)));
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java

@ -1,10 +1,13 @@
package com.hnac.hzims.operational.access.vo;
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 模型VO
*
@ -28,4 +31,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity {
@ApiModelProperty(value = "任务名称")
private String taskName;
@ApiModelProperty(value = "检修内容")
private List<OperAccessTaskDetailEntity> details;
}

182
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/AlertWebSocketClient.java

@ -1,182 +0,0 @@
package com.hnac.hzims.operational.alert;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.monitor.feign.IMonitorClient;
import com.hnac.hzims.operational.alert.service.AlertDefectService;
import com.hnac.hzims.operational.alert.vo.AlertVo;
import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzinfo.core.push.enums.PushAudienceType;
import com.hnac.hzinfo.core.push.model.PushAudience;
import com.hnac.hzinfo.core.push.model.PushInfo;
import com.hnac.hzinfo.core.push.model.PushPlatform;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.resource.feign.IPushClient;
import org.springblade.resource.vo.PushInfoVO;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Value;
import javax.net.ssl.*;
import java.net.URI;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 该socket服务只能启一个微服务启动多个微服务的话同一个信息会重复发
* 如果operation服务需要部署多个微服务这个alert需要分离出来作为单独的微服务部署且只能部署一个
* @Author: py
*/
@Slf4j
public class AlertWebSocketClient extends WebSocketClient {
@Value("${hzims.operation.task.jgPushCode}")
String jgPushCode;
IStationService stationService;
IPushClient pushClient;
IMonitorClient monitorClient;
AlertDefectService alertDefectService;
public AlertWebSocketClient(URI serverUri) {
super(serverUri);
stationService = SpringUtil.getBean(IStationService.class);
pushClient = SpringUtil.getBean(IPushClient.class);
monitorClient = SpringUtil.getBean(IMonitorClient.class);
alertDefectService = SpringUtil.getBean(AlertDefectService.class);
if(serverUri.toString().contains("wss://")){
trustAllHosts(this);
}
}
@Override
public void onOpen(ServerHandshake handshakedata) {
log.info("[websocket] 连接成功");
}
@Override
public void onMessage(String message) {
log.info("[websocket] 收到消息={}",message);
try{
// 处理信息
handleMsg(message);
// 告警缺陷处理现象
handleAlertDefect(message);
}
catch (Exception e){
log.error(e.getMessage());
}
/**自动诊断**/
this.diagnosisByMsg(message);
}
@Override
public void onClose(int code, String reason, boolean remote) {
log.info("[websocket] 退出连接={}-{}, 是否远程主动中断 = ", code , reason, remote);
}
@Override
public void onError(Exception ex) {
log.error("[websocket] onError = {}",ex.getMessage());
}
void trustAllHosts(AlertWebSocketClient appClient) {
log.info("[websocket] wss 连接 ----- ");
try {
// wss需添加
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[] { new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain,
String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] chain,
String authType) {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
} }, new SecureRandom());
SSLSocketFactory factory = sslContext.getSocketFactory();
appClient.setSocket(factory.createSocket());
} catch (Exception e) {
log.error("[websocket] trustAllHosts 错误 - " + e.toString());
}
}
/**
* 推送信息到移动端
* @param message
*/
private void handleMsg(String message){
JSONObject msg = JSONObject.parseObject(message);
if(Func.isEmpty(msg.getString("soe_explain")) || Func.isEmpty(msg.getString("station"))){
return;
}
List<User> users = stationService.getUsersByStationId(msg.getString("station"));
if(Func.isEmpty(users)){
return;
}
// 移动端消息推送 : 使用 用户id做TAG,前端注册用户id为TAG
PushInfoVO pushInfoVO = new PushInfoVO();
pushInfoVO.setTenantId(users.get(0).getTenantId());
PushPlatform platform = PushPlatform.all();
Map<PushAudienceType, List<String>> audienceMap = new HashMap<>();
audienceMap.put(PushAudienceType.TAG, users.stream().map(user -> user.getId().toString()).collect(Collectors.toList()));
PushAudience audience = new PushAudience(false, audienceMap);
PushInfo pushInfo = new PushInfo(jgPushCode
, "实时告警"
, msg.getString("soe_explain")
, ""
, null
, platform
, audience);
pushInfoVO.setPushInfo(pushInfo);
// FIXME:极光推送暂时关闭 推送消息给移动端
//pushClient.tenantPush(pushInfoVO);
log.info("[websocket] handleMsg finish ----- " + pushInfo.toString());
}
/**
* 告警缺陷处理
* @param message
*/
private void handleAlertDefect(String message) {
List<AlertVo> list = Collections.singletonList(JSONObject.parseObject(message, AlertVo.class));
alertDefectService.saveAlertDefect(list);
}
/***
* 根据返回信息自动诊断
* @param message
*/
private void diagnosisByMsg(String message){
JSONObject msg = JSONObject.parseObject(message);
if(Func.isEmpty(msg.getString("station")) || Func.isEmpty(msg.getString("realid"))){
return;
}
/**根据station/realid进行诊断**/
monitorClient.alertAutoDiagnosis(msg.getString("realid"),msg.getString("station"));
}
}

44
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/WebSocketClientManager.java

@ -1,44 +0,0 @@
package com.hnac.hzims.operational.alert;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.net.URI;
/**
* @Author: py
*/
@Slf4j
@EnableScheduling
@Component
public class WebSocketClientManager {
@Value("${hzims.alert.ws-url}")
String wsUrl;
WebSocketClient webSocketClient;
/**
* 保活每30秒发送一次信息
*/
@Scheduled(cron="0 */1 * * * ? ")
private void keepAlive(){
if(Func.isNotEmpty(webSocketClient) && webSocketClient.isOpen()){
webSocketClient.send("{\"type\":\"soe\"}");
log.info("[WebSocketClient] 发送保活信息");
} else {
try {
webSocketClient = new AlertWebSocketClient(new URI(wsUrl));
if(webSocketClient.connectBlocking()){
webSocketClient.send("{\"type\":\"soe\"}");
}
} catch (Exception e) {
log.error("[WebSocketClient] connectBlocking 错误={}",e.toString());
}
}
}
}

157
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java

@ -1,157 +0,0 @@
package com.hnac.hzims.operational.alert.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.alert.vo.HistoryAlarmVo;
import com.hnac.hzims.operational.config.vo.AlarmDataPageVo;
import com.hnac.hzims.operational.config.vo.AlarmVo;
import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo;
import com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* @author ysj
*/
@Api(tags = {"通讯中断、数据异常"})
@RestController
@AllArgsConstructor
@RequestMapping("/abnormal/alarm")
public class AbnormalAlarmController extends BladeController {
private final HistoryAbnormalAlarmService service;
/**
* 统计通讯中断时间
*/
@ApiLog
@RequestMapping(value = "/statisticsTime", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 1)
@ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity")
@OperationAnnotation(moduleName = "通讯告警统计",title = "通讯告警统计", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "查询通讯告警统计数据")
public R<IPage<HistoryAbnormalAlarmVo>> statisticsTime(HistoryAlarmVo entity, Query query) {
IPage<HistoryAbnormalAlarmVo> pages = service.getAlarmTime(query,entity);
return R.data(pages);
}
/**
* 统计通讯中断二级目录查询
*/
@ApiLog
@RequestMapping(value = "/queryByEntity", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 1)
@ApiOperation(value = "统计通讯中断二级目录查询", notes = "传入imsDutyMainEntity")
public R<IPage<HistoryAbnormalAlarmVo>> queryByEntity(HistoryAlarmVo entity, Query query) {
IPage<HistoryAbnormalAlarmVo> pages = service.queryByEntity(entity,query);
return R.data(pages);
}
@ApiLog
@GetMapping("/queryStationName")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询站点")
public R<List<String>> queryStationName() {
List<String> res = service.queryStationName();
return R.data(res);
}
/**
* 详情
*/
@ApiLog
@RequestMapping(value = "/detail", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity")
public R<HistoryAbnormalAlarmEntity> detail(HistoryAbnormalAlarmEntity entity) {
HistoryAbnormalAlarmEntity detail = service.getOne(Condition.getQueryWrapper(entity));
return R.data(detail);
}
/**
* 分页
*/
@ApiLog
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "传入HistoryAbnormalAlarmEntity")
public R<IPage<HistoryAbnormalAlarmEntity>> list(HistoryAbnormalAlarmEntity entity, Query query) {
IPage<HistoryAbnormalAlarmEntity> pages = service.page(Condition.getPage(query), Condition.getQueryWrapper(entity));
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "新增或修改", notes = "传入HistoryAbnormalAlarmEntity")
public R submit(@Valid @RequestBody HistoryAbnormalAlarmEntity entity) {
return R.status(service.saveOrUpdate(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
*
*/
@ApiLog
@ApiOperation(value = "原始告警接口")
@ApiOperationSupport(order = 7)
@RequestMapping(value = "/alarms", method = {RequestMethod.GET, RequestMethod.POST})
public R<AlarmReustVo> alarms(AlarmParamVo param){
return R.data(service.alarms(param));
}
/**
* 智能告警数量: 时间范围当天
*/
@ApiLog
@ApiOperation(value = "智能告警数量")
@ApiOperationSupport(order = 8)
@RequestMapping(value = "/count", method = {RequestMethod.GET, RequestMethod.POST})
public R<List<IntelligentAlarmCountVo>> count(){
return R.data(service.alarmCount());
}
/**
* 智能告警数据: 时间范围当天
*/
@ApiLog
@ApiOperation(value = "智能告警数据")
@ApiOperationSupport(order = 9)
@RequestMapping(value = "/data", method = RequestMethod.GET)
public R<IPage<AlarmVo>> data(AlarmDataPageVo page,Query query) {
return R.data(service.alarmData(page,query));
}
}

67
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/LevelAlarmController.java

@ -1,67 +0,0 @@
package com.hnac.hzims.operational.alert.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.alert.entity.HistoryLevelAlarmEntity;
import com.hnac.hzims.operational.alert.service.HistoryLevelAlarmService;
import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author ysj
*/
@Api(tags = {"等级告警"})
@RestController
@AllArgsConstructor
@RequestMapping("/level/alarm")
public class LevelAlarmController extends BladeController {
private HistoryLevelAlarmService service;
/**
* 分页
*/
@ApiLog
@GetMapping("/list")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页", notes = "传入HistoryAbnormalAlarmEntity")
public R<IPage<HistoryLevelAlarmEntity>> list(HistoryLevelAlarmEntity entity, Query query) {
IPage<HistoryLevelAlarmEntity> pages = service.pageCondition(query, entity);
return R.data(pages);
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 智能告警数量: 时间范围当天
*/
@ApiLog
@ApiOperation(value = "智能告警数量")
@ApiOperationSupport(order = 3)
@RequestMapping(value = "/count", method = {RequestMethod.GET, RequestMethod.POST})
public R<List<IntelligentAlarmCountVo>> count(){
return R.data(service.alarmCount());
}
}

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AbnormalAlarmMapper.java

@ -1,17 +0,0 @@
package com.hnac.hzims.operational.alert.mapper;
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 YSJ
*/
public interface AbnormalAlarmMapper extends UserDataScopeBaseMapper<AbnormalAlarmEntity> {
AbnormalAlarmEntity getAbnormalAlarm(@Param("stationId") String stationId,@Param("type") String type);
List<String> getAbnormalAlarmList();
}

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AbnormalAlarmMapper.xml

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.AbnormalAlarmMapper">
<select id="getAbnormalAlarm" resultType="com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity">
select * from hzims_abnormal_alarm
where station_id = #{stationId}
and type = #{type}
and is_deleted = 0
</select>
<select id="getAbnormalAlarmList" resultType="java.lang.String">
select distinct station_id from hzims_abnormal_alarm
where is_deleted = 0
and type in (13,14)
and `STATUS` = 0
</select>
</mapper>

57
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.AlarmHandleMapper">
<select id="selectHandlePage" resultType="com.hnac.hzims.operational.alert.vo.AlarmHandleVo">
select h.*,handle_user,d.phenomenon_id,d.access_id,d.delay_time,d.delay_cause,
d.false_alarm_desc,d.file_path,s.name as station_name,p.check_process_instance_id,a.process_instance_id
from hzims_alarm_handle h
left join hzims_alarm_handle_detail d
on h.detail_id = d.id
left join hzims_station s
on h.station_code = s.code
left join hzims_oper_phenomenon p
on d.PHENOMENON_ID = p.id
left join hzims_oper_access_plan a
on d.access_id = a.id
<where>
h.is_deleted = 0
<if test="param.stationCode != null">
and h.station_code = #{param.stationCode}
</if>
<if test="param.handleUser != null">
and h.create_user = #{param.handleUser}
</if>
<if test="param.startTime != null">
and h.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null">
and h.create_time &lt;= #{param.endTime}
</if>
<if test="param.handleWay != null">
and h.handle_way = #{param.handleWay}
</if>
</where>
order by create_time desc
</select>
<select id="handles" resultType="com.hnac.hzims.operational.alert.entity.AlarmHandleEntity">
select handler.*
from hzims_alarm_handle handler
left join hzims_alarm_handle_detail detail
on handler.detail_id = detail.id
<where>
handler.is_deleted = 0
<if test="types != null and types.size > 0">
and alarm_type in
<foreach collection="types" item="type" index="index" open="(" close=")" separator=",">
#{type}
</foreach>
</if>
<if test="start != null and end != null">
and handler.create_time between #{start} and #{end}
</if>
and (detail.DELAY_TIME &gt; #{end} or detail.DELAY_TIME is null)
</where>
</select>
</mapper>

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlertDefectConfigMapper.java

@ -1,13 +0,0 @@
package com.hnac.hzims.operational.alert.mapper;
import com.hnac.hzims.operational.alert.entity.AlertDefectConfigEntity;
import java.util.List;
/**
* @author YSJ
*/
public interface AlertDefectConfigMapper {
List<AlertDefectConfigEntity> getConfigAll();
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlertDefectConfigMapper.xml

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.AlertDefectConfigMapper">
<select id="getConfigAll" resultType="com.hnac.hzims.operational.alert.entity.AlertDefectConfigEntity">
select * from hzims_alert_defect_config
</select>
</mapper>

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java

@ -1,26 +0,0 @@
package com.hnac.hzims.operational.alert.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo;
import com.hnac.hzims.spare.vo.SpReceiveVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Date;
import java.util.List;
/**
* @author YSJ
*/
public interface HistoryAbnormalAlarmMapper extends UserDataScopeBaseMapper<HistoryAbnormalAlarmEntity> {
List<HistoryAbnormalAlarmEntity> getHistoryAbnormalAlarm(@Param("stationId") String stationId,@Param("type") String type);
List<HistoryAbnormalAlarmVo> selectPageList(IPage<HistoryAbnormalAlarmVo> page, String type, List<String> stations);
List<HistoryAbnormalAlarmEntity> getAlarmEntity(@Param("type") String type,@Param("stationName") List<String> stationName,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
List<String> getStationName();
}

49
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.HistoryAbnormalAlarmMapper">
<select id="getHistoryAbnormalAlarm" resultType="com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity">
select * from hzims_history_abnormal_alarm
where station_id = #{stationId}
and type = #{type}
and status = 0
</select>
<select id="selectPageList" resultType="com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo">
select * from hzims_history_abnormal_alarm
where status = 0
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="stations != null">
and station_id in
<foreach collection="stations" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
</if>
</select>
<select id="getStationName" resultType="java.lang.String">
select distinct STATION_NAME from hzims_history_abnormal_alarm
</select>
<select id="getAlarmEntity" resultType="com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity">
select * from hzims_history_abnormal_alarm
where is_deleted = 0
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="stationName != null">
and station_name in
<foreach collection="stationName" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
</if>
<if test="startTime != null">
and start_time &gt; #{startTime}
</if>
<if test="endTime != null">
and end_time &lt;= #{endTime}
</if>
</select>
</mapper>

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryLevelAlarmMapper.java

@ -1,11 +0,0 @@
package com.hnac.hzims.operational.alert.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.alert.entity.HistoryLevelAlarmEntity;
/**
* @author YSJ
*/
public interface HistoryLevelAlarmMapper extends BaseMapper<HistoryLevelAlarmEntity> {
}

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

Loading…
Cancel
Save