Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
dc51537716
  1. 8
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java
  2. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/HistoryAbnormalAlarmEntity.java
  3. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmDataVo.java
  4. 36
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmMergeVo.java
  5. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
  6. 2
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/areamonthly/vo/TaskListQuery.java
  7. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CheckMonthEntity.java
  8. 7
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/MaintenanceTaskWithAreaVo.java
  9. 20
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardTicketVo.java
  10. 8
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardTicketWithAreaVo.java
  11. 10
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardWorkVo.java
  12. 6
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java
  13. 3
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/SysLogConfig.java
  14. 6
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  15. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java
  16. 2
      hzims-service/hzims-middle/src/main/resources/application.yml
  17. 2
      hzims-service/hzims-middle/src/test/java/com/hnac/hzims/middle/MiddleApplicationTests.java
  18. 13
      hzims-service/operational/pom.xml
  19. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java
  20. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
  21. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmMergeService.java
  22. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/LevelAlarmService.java
  23. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlertDefectServiceImpl.java
  24. 106
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlertMerageServiceImpl.java
  25. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  26. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java
  27. 60
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/Swagger2Config.java
  28. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/config/WebSocketConfig.java
  29. 79
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/AlarmHandler.java
  30. 58
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/AlarmSessionManager.java
  31. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/MessageHandler.java
  32. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/MyInterceptor.java
  33. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/SocketPool.java
  34. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/WebsocketRun.java
  35. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainPersonMapper.xml
  36. 95
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  37. 71
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java
  38. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  39. 13
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java
  40. 6
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml
  41. 35
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  42. 16
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java
  43. 6
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml
  44. 38
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

8
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java

@ -13,6 +13,13 @@ public interface AbnormalAlarmConstant {
/**通讯恢复*/ /**通讯恢复*/
String ABNORMAL_STATUS = "1"; String ABNORMAL_STATUS = "1";
/**事故**/
String FAULT = "2";
String WEBSOCKET_FAULT = "0";
List<String> ALARM_WARN_TYPES = Arrays.asList("0","1","2");
String[] TYPE_NAMES = {"默认", "系统", "告警", "故障", "用户操作", "遥测越限", "遥信变位", "注册信息", "信息提示", "设备巡检", "遥控操作", "遥测越限恢复","未定义","通讯中断","数据异常"}; String[] TYPE_NAMES = {"默认", "系统", "告警", "故障", "用户操作", "遥测越限", "遥信变位", "注册信息", "信息提示", "设备巡检", "遥控操作", "遥测越限恢复","未定义","通讯中断","数据异常"};
/**处理、延后、误报*/ /**处理、延后、误报*/
@ -22,4 +29,5 @@ public interface AbnormalAlarmConstant {
* 2-告警,3-故障,5-遥测越限,13-通讯异常,14-数据异常 * 2-告警,3-故障,5-遥测越限,13-通讯异常,14-数据异常
*/ */
List<Integer> SOE_TYPE_LIST = Arrays.asList(2,3,5,13,14); List<Integer> SOE_TYPE_LIST = Arrays.asList(2,3,5,13,14);
} }

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/HistoryAbnormalAlarmEntity.java

@ -9,6 +9,9 @@ import org.springblade.core.mp.base.BaseEntity;
import java.util.Date; import java.util.Date;
/**
* @author ysj
*/
@Data @Data
@TableName("hzims_history_abnormal_alarm") @TableName("hzims_history_abnormal_alarm")
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ -24,6 +27,9 @@ public class HistoryAbnormalAlarmEntity extends BaseEntity {
@ApiModelProperty("站点名称") @ApiModelProperty("站点名称")
private String stationName; private String stationName;
@ApiModelProperty("告警编码")
private Long alarmId;
@ApiModelProperty("检查点") @ApiModelProperty("检查点")
private String realId; private String realId;

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

@ -3,12 +3,14 @@ package com.hnac.hzims.operational.alert.vo;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData; import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
/** /**
* @author ysj * @author ysj
* @date 2023/03/23 14:06:27 * @date 2023/03/23 14:06:27
* @version 4.0.0 * @version 4.0.0
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
public class AlarmDataVo extends SoeData { public class AlarmDataVo extends SoeData {

36
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmMergeVo.java

@ -0,0 +1,36 @@
package com.hnac.hzims.operational.alert.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author ysj
* @date 2023/03/17 10:02:33
* @version 4.0.0
*/
@Data
public class AlarmMergeVo{
@ApiModelProperty("站点编号")
private String stationCode;
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("检测点位")
private String realId;
@ApiModelProperty("告警编号")
private String alarmCode;
@ApiModelProperty("告警类型: 0 - 事故 、 1 - 一级告警、 2 - 二级告警")
private String type;
@ApiModelProperty("告警内容: 0 - 事故 、 1 - 一级告警、 2 - 二级告警")
private String content;
@ApiModelProperty("告警时间")
private Date date;
}

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java

@ -104,11 +104,13 @@ public class OperDefectEntity extends TenantEntity {
/** /**
* 区域Id * 区域Id
*/ */
@ApiModelProperty(value = "区域Id")
@TableField(exist = false) @TableField(exist = false)
private String areaId; private String areaId;
/** /**
* 年月 * 年月
*/ */
@ApiModelProperty(value = "年月")
@TableField(exist = false) @TableField(exist = false)
private YearMonth yearMonth; private YearMonth yearMonth;
} }

2
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/areamonthly/vo/TaskListQuery.java

@ -126,11 +126,13 @@ public class TaskListQuery implements Serializable {
/** /**
* 月份 * 月份
*/ */
@ApiModelProperty("月份")
private YearMonth yearmonth; private YearMonth yearmonth;
/** /**
* 区域Id * 区域Id
*/ */
@ApiModelProperty("区域Id")
private String areaId; private String areaId;

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

@ -47,6 +47,7 @@ public class CheckMonthEntity extends TenantEntity implements Serializable {
* 年月 * 年月
*/ */
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty("月份")
private YearMonth yearMonth; private YearMonth yearMonth;
@ -55,6 +56,4 @@ public class CheckMonthEntity extends TenantEntity implements Serializable {
private String itemName; private String itemName;
} }

7
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/MaintenanceTaskWithAreaVo.java

@ -1,5 +1,6 @@
package com.hnac.hzims.ticket.areamonthly.vo; package com.hnac.hzims.ticket.areamonthly.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.YearMonth; import java.time.YearMonth;
@ -17,33 +18,39 @@ public class MaintenanceTaskWithAreaVo {
/** /**
* 区域编号 * 区域编号
*/ */
@ApiModelProperty("区域编号")
private String areaId; private String areaId;
/** /**
* 月份 * 月份
*/ */
@ApiModelProperty("月份")
private java.time.YearMonth YearMonth; private java.time.YearMonth YearMonth;
/** /**
* 项目名称 * 项目名称
*/ */
@ApiModelProperty("项目名称")
private String title; private String title;
/** /**
* 维护内容 * 维护内容
*/ */
@ApiModelProperty("维护内容")
private String content; private String content;
/** /**
* 执行状态 * 执行状态
*/ */
@ApiModelProperty("执行状态")
private Integer status; private Integer status;
/** /**
* 任务类型 * 任务类型
*/ */
@ApiModelProperty("执行状态")
private String taskType; private String taskType;
} }

20
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardTicketVo.java

@ -1,5 +1,6 @@
package com.hnac.hzims.ticket.areamonthly.vo; package com.hnac.hzims.ticket.areamonthly.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -18,6 +19,7 @@ import java.util.Date;
*/ */
@EqualsAndHashCode @EqualsAndHashCode
@Data @Data
@ApiModel("操作票对象")
public class StandardTicketVo implements Serializable { public class StandardTicketVo implements Serializable {
private static final long serialVersionUID = -8870464581684939369L; private static final long serialVersionUID = -8870464581684939369L;
@ -26,91 +28,109 @@ public class StandardTicketVo implements Serializable {
/** /**
* 编号 * 编号
*/ */
@ApiModelProperty("编号")
private Long id; private Long id;
/** /**
* 开票种类 * 开票种类
*/ */
@ApiModelProperty("开票种类")
private String ticketType; private String ticketType;
/** /**
* 单位 * 单位
*/ */
@ApiModelProperty("单位")
private String company; private String company;
/** /**
* 编号 * 编号
*/ */
@ApiModelProperty("编号")
private String code; private String code;
/** /**
* 开票来源 * 开票来源
*/ */
@ApiModelProperty("开票来源")
private String taskType; private String taskType;
/** /**
* 开票来源名称 * 开票来源名称
*/ */
@ApiModelProperty("开票来源名称")
private String taskTypeName; private String taskTypeName;
/** /**
* 开票任务来源 * 开票任务来源
*/ */
@ApiModelProperty("开票任务来源")
private String taskName; private String taskName;
/** /**
* 发令人 * 发令人
*/ */
@ApiModelProperty("发令人")
private Long issueOrderPerson; private Long issueOrderPerson;
/** /**
* 发令人名称 * 发令人名称
*/ */
@ApiModelProperty("发令人名称")
private String issueOrderPersonName; private String issueOrderPersonName;
/** /**
* 受令人 * 受令人
*/ */
@ApiModelProperty("受令人")
private Long accessOrderPerson; private Long accessOrderPerson;
/** /**
* 受令人名称 * 受令人名称
*/ */
@ApiModelProperty("受令人名称")
private String accessOrderPersonName; private String accessOrderPersonName;
/** /**
* 监护人 * 监护人
*/ */
@ApiModelProperty("监护人")
private Long guardian; private Long guardian;
/** /**
* 监护人名称 * 监护人名称
*/ */
@ApiModelProperty("监护人名称")
private String guardianName; private String guardianName;
/** /**
* 值班负责人 * 值班负责人
*/ */
@ApiModelProperty("值班负责人")
private Long principal; private Long principal;
/** /**
* 值班负责人 * 值班负责人
*/ */
@ApiModelProperty("值班负责人名称")
private String principalName; private String principalName;
/** /**
* 开票时间 * 开票时间
*/ */
@ApiModelProperty("开票时间")
private Date createTime; private Date createTime;
/** /**
* 状态 * 状态
*/ */
@ApiModelProperty("状态")
private Integer status; private Integer status;
/** /**
* 是否评价 * 是否评价
*/ */
@ApiModelProperty("是否评价")
private Integer isEvaluate; private Integer isEvaluate;
} }

8
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardTicketWithAreaVo.java

@ -21,34 +21,40 @@ public class StandardTicketWithAreaVo {
/** /**
* 区域编号 * 区域编号
*/ */
@ApiModelProperty("区域编号")
private String areaId; private String areaId;
/** /**
* 月份 * 月份
*/ */
private YearMonth YearMonth; @ApiModelProperty("月份")
private YearMonth yearMonth;
/** /**
* 开票种类 * 开票种类
*/ */
@ApiModelProperty("开票种类")
private String ticketType; private String ticketType;
/** /**
* 编号 * 编号
*/ */
@ApiModelProperty("编号")
private String code; private String code;
/** /**
* 开票来源 * 开票来源
*/ */
@ApiModelProperty("开票来源")
private String taskType; private String taskType;
/** /**
* 状态 * 状态
*/ */
@ApiModelProperty("状态")
private Integer status; private Integer status;

10
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardWorkVo.java

@ -1,5 +1,6 @@
package com.hnac.hzims.ticket.areamonthly.vo; package com.hnac.hzims.ticket.areamonthly.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -22,45 +23,54 @@ public class StandardWorkVo implements Serializable {
/** /**
* 编号 * 编号
*/ */
@ApiModelProperty("编号")
private Long id; private Long id;
/** /**
* 开票种类 * 开票种类
*/ */
@ApiModelProperty("开票种类")
private String type; private String type;
/** /**
* 单位 * 单位
*/ */
@ApiModelProperty("单位")
private String company; private String company;
/** /**
* 编号 * 编号
*/ */
@ApiModelProperty("编号")
private String code; private String code;
/** /**
* 开票来源 * 开票来源
*/ */
@ApiModelProperty("开票来源")
private String taskType; private String taskType;
/** /**
* 开票任务来源 * 开票任务来源
*/ */
@ApiModelProperty("开票任务来源")
private String taskName; private String taskName;
/** /**
* 开票时间 * 开票时间
*/ */
@ApiModelProperty("开票时间")
private Date createTime; private Date createTime;
/** /**
* 状态 * 状态
*/ */
@ApiModelProperty("状态")
private Integer status; private Integer status;
/** /**
* 是否评价 * 是否评价
*/ */
@ApiModelProperty("是否评价")
private Integer isEvaluate; private Integer isEvaluate;
} }

6
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java

@ -13,6 +13,12 @@ import org.springframework.context.annotation.ComponentScan;
@MapperScan("com.hnac.hzims.*.**.mapper.**") @MapperScan("com.hnac.hzims.*.**.mapper.**")
@ComponentScan(basePackages = {"com.hnac.*"}) @ComponentScan(basePackages = {"com.hnac.*"})
public class MiddleApplication { public class MiddleApplication {
static {
System.setProperty("spring.cloud.nacos.discovery.server-addr", "http://175.6.40.67:10042");
System.setProperty("spring.cloud.nacos.config.server-addr", "http://175.6.40.67:10042");
System.setProperty("spring.cloud.nacos.username", "nacos");
System.setProperty("spring.cloud.nacos.password", "nacos");
}
public static void main(String[] args) { public static void main(String[] args) {
BladeApplication.run("hzims-middle", MiddleApplication.class, args); BladeApplication.run("hzims-middle", MiddleApplication.class, args);

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

@ -7,6 +7,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask;
/** /**
* @Author WL * @Author WL
@ -28,7 +29,7 @@ public class SysLogConfig {
SyslogTimerTask myTimeTask = new SyslogTimerTask(statisticsService); SyslogTimerTask myTimeTask = new SyslogTimerTask(statisticsService);
//3.通过timer定时定频率调用SyslogTimerTask的业务逻辑 //3.通过timer定时定频率调用SyslogTimerTask的业务逻辑
// 即 第一次执行是在当前时间的两秒之后,之后每隔60分钟执行一次 // 即 第一次执行是在当前时间的两秒之后,之后每隔60分钟执行一次
timer.schedule(myTimeTask,2000L,60000L); timer.schedule(myTimeTask, 2000L, (60L * 1000L));
} }
} }

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

@ -54,10 +54,16 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
statistics = new Statistics(); statistics = new Statistics();
statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime()); statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setTitle(sysLogStatisticsVo.getTitle());
statistics.setModuleName(sysLogStatisticsVo.getModuleName());
statistics.setPath(sysLogStatisticsVo.getPath());
statistics.setTitleNum(sysLogStatisticsVo.getTitleCount()); statistics.setTitleNum(sysLogStatisticsVo.getTitleCount());
statistics.setPathNum(sysLogStatisticsVo.getPathCount()); statistics.setPathNum(sysLogStatisticsVo.getPathCount());
statisticsService.save(statistics); statisticsService.save(statistics);
} else { } else {
statistics.setTitle(sysLogStatisticsVo.getTitle());
statistics.setModuleName(sysLogStatisticsVo.getModuleName());
statistics.setPath(sysLogStatisticsVo.getPath());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setTitleNum(sysLogStatisticsVo.getTitleCount()); statistics.setTitleNum(sysLogStatisticsVo.getTitleCount());
statistics.setPathNum(sysLogStatisticsVo.getPathCount()); statistics.setPathNum(sysLogStatisticsVo.getPathCount());

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java

@ -43,7 +43,7 @@ public class SysLogStatisticsVo {
/** /**
* 根据路径统计 * 根据路径统计
*/ */
private Integer path; private String path;
/** /**
* 根据路径统计 * 根据路径统计

2
hzims-service/hzims-middle/src/main/resources/application.yml

@ -4,6 +4,8 @@ server:
#数据源配置 #数据源配置
spring: spring:
main:
allow-bean-definition-overriding: true
#排除DruidDataSourceAutoConfigure #排除DruidDataSourceAutoConfigure
autoconfigure: autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

2
hzims-service/hzims-middle/src/test/java/com/hnac/hzims/middle/MiddleApplicationTests.java

@ -3,7 +3,7 @@ package com.hnac.hzims.middle;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest @SpringBootTest(classes = MiddleApplication.class)
class MiddleApplicationTests { class MiddleApplicationTests {
@Test @Test

13
hzims-service/operational/pom.xml

@ -14,6 +14,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<documents4j.version>1.0.3</documents4j.version> <documents4j.version>1.0.3</documents4j.version>
<swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version>
</properties> </properties>
<dependencies> <dependencies>
@ -214,6 +215,18 @@
<groupId>com.hnac.hzinfo.data</groupId> <groupId>com.hnac.hzinfo.data</groupId>
<artifactId>hzinfo-data-sdk</artifactId> <artifactId>hzinfo-data-sdk</artifactId>
</dependency> </dependency>
<!--swagger-bootstrap-ui-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java

@ -41,14 +41,12 @@ import javax.annotation.Resource;
public class OperationApplication extends SpringBootServletInitializer { public class OperationApplication extends SpringBootServletInitializer {
static{ static{
System.setProperty("--spring.cloud.nacos.discovery.server-addr", "http://175.6.40.67:10042"); System.setProperty("spring.cloud.nacos.discovery.server-addr", "http://175.6.40.67:10042");
System.setProperty("--spring.cloud.nacos.config.server-addr", "http://175.6.40.67:10042"); System.setProperty("spring.cloud.nacos.config.server-addr", "http://175.6.40.67:10042");
System.setProperty("--spring.cloud.nacos.username", "nacos"); System.setProperty("spring.cloud.nacos.username", "nacos");
System.setProperty("--spring.cloud.nacos.password", "nacos"); System.setProperty("spring.cloud.nacos.password", "nacos");
} }
public static void main(String[] args) { public static void main(String[] args) {
BladeApplication.run(OperationalConstants.APP_NAME, OperationApplication.class, args); BladeApplication.run(OperationalConstants.APP_NAME, OperationApplication.class, args);
} }

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

@ -27,14 +27,15 @@ public class OperAccessStatisticsDTO extends OperAccessStatisticsEntity {
private List<Long> deptIds; private List<Long> deptIds;
/** /**
* *
*/ */
private YearMonth yearMonth; @ApiModelProperty("月份")
private YearMonth yearmonth;
/** /**
* 区域Id * 区域Id
*/ */
@ApiModelProperty("区域Id")
private String areaId; private String areaId;

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmMergeService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.operational.alert.service;
import com.hnac.hzims.operational.config.vo.MessageParamVo;
import org.springframework.web.socket.TextMessage;
/**
* @author ysj
* @date 2023/03/09 09:19:13
* @version 4.0.0
*/
public interface AlarmMergeService {
// 获取发送消息
TextMessage getSendMessage(MessageParamVo param);
}

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/LevelAlarmService.java

@ -0,0 +1,10 @@
package com.hnac.hzims.operational.alert.service;
/**
* 告警处理接口
* @author ysj
*/
public interface LevelAlarmService {
}

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

@ -27,6 +27,7 @@ import java.util.stream.Collectors;
/** /**
* 告警缺陷处理实现类 * 告警缺陷处理实现类
* @author ysj
*/ */
@Slf4j @Slf4j
@Service @Service

106
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlertMerageServiceImpl.java

@ -0,0 +1,106 @@
package com.hnac.hzims.operational.alert.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.service.AlarmHandleService;
import com.hnac.hzims.operational.alert.service.AlarmMergeService;
import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.operational.alert.service.LevelAlarmService;
import com.hnac.hzims.operational.alert.vo.AlarmMergeVo;
import com.hnac.hzims.operational.config.vo.MessageParamVo;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import org.springframework.web.socket.TextMessage;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 告警合并处理实现类
* @author ysj
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class AlertMerageServiceImpl implements AlarmMergeService {
private final IStationService stationService;
private final LevelAlarmService levelAlarmService;
private final AlarmHandleService alarmHandleService;
private final HistoryAbnormalAlarmService faultAlarmService;
/**
* 根据用户获取hz3000事故告警平台一级告警二级告警
* @param param
* @return
*/
@Override
public TextMessage getSendMessage(MessageParamVo param) {
// 查询用户
if(ObjectUtil.isEmpty(param)){
return null;
}
List<Long> depts = param.getDeptIds();
if(CollectionUtil.isEmpty(depts)){
return null;
}
// 查询站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.in(StationEntity::getRefDept,depts)
.eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE)
);
if(CollectionUtil.isEmpty(stations)){
return null;
}
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 23:59:59";
// hz3000事故告警
List<HistoryAbnormalAlarmEntity> faults = faultAlarmService.list(Wrappers.<HistoryAbnormalAlarmEntity>lambdaQuery()
.in(HistoryAbnormalAlarmEntity::getStationId,stations.stream().map(StationEntity::getCode).collect(Collectors.toList()))
.eq(HistoryAbnormalAlarmEntity::getType, AbnormalAlarmConstant.FAULT)
.between(HistoryAbnormalAlarmEntity::getStartTime,start,end)
);
// 处理告警记录
List<AlarmHandleEntity> handles = alarmHandleService.list(Wrappers.<AlarmHandleEntity>lambdaQuery()
.in(AlarmHandleEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList()))
.in(AlarmHandleEntity::getAlarmType, AbnormalAlarmConstant.ALARM_WARN_TYPES)
.between(AlarmHandleEntity::getCreateTime,start,end)
);
List<AlarmMergeVo> alarms = new ArrayList<>();
if(CollectionUtil.isNotEmpty(faults)){
alarms.addAll(faults.stream().filter(o -> CollectionUtil.isEmpty(handles)
|| handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(o.getAlarmId())).
map(fault->{
AlarmMergeVo alarm = new AlarmMergeVo();
alarm.setStationCode(fault.getStationId());
alarm.setStationName(fault.getStationName());
alarm.setContent(fault.getSoeExplain());
alarm.setDate(fault.getStartTime());
alarm.setRealId(fault.getRealId());
alarm.setType(AbnormalAlarmConstant.WEBSOCKET_FAULT);
return alarm;
}).collect(Collectors.toList()));
}
// hz3000事故告警
// faultAlarmService.list();
return new TextMessage(JSONObject.toJSONString(alarms.stream().sorted(Comparator.comparing(AlarmMergeVo::getDate)).collect(Collectors.toList())));
}
}

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

@ -49,6 +49,7 @@ import java.util.stream.Collectors;
/** /**
* 历史告警实现类 * 历史告警实现类
* @author ysj
*/ */
@Slf4j @Slf4j
@Service @Service

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java

@ -0,0 +1,18 @@
package com.hnac.hzims.operational.alert.service.impl;
import com.hnac.hzims.operational.alert.service.LevelAlarmService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 等级告警实现类
* @author ysj
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class LevelAlarmServiceImpl implements LevelAlarmService {
}

60
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/Swagger2Config.java

@ -0,0 +1,60 @@
package com.hnac.hzims.operational.config;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/13 13:40
*/
@Configuration
@EnableSwagger2
public class Swagger2Config implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/");
registry.addResourceHandler("doc.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
@Bean
public Docket webApiConfig(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("operationApplication")
.apiInfo(webApiInfo())
.select()
//只显示api路径下的页面
.paths(Predicates.and(PathSelectors.regex("/areaMonthlyDetails/.*")))
.build();
}
private ApiInfo webApiInfo() {
return new ApiInfoBuilder()
.title("网站-API文档")
.description("本文档描述了网站微服务接口定义")
.version("1.0")
.contact(new Contact("WL", "http://localhost:8501/", "55317332@qq.com"))
.build();
}
}

25
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/config/WebSocketConfig.java

@ -1,10 +1,8 @@
package com.hnac.hzims.operational.config.config; package com.hnac.hzims.operational.config.config;
import com.hnac.hzims.operational.config.ws.AlarmHandler;
import com.hnac.hzims.operational.config.ws.MessageHandler; import com.hnac.hzims.operational.config.ws.MessageHandler;
import com.hnac.hzims.operational.vRView.service.IHzImsRealDataService;
import com.hnac.hzims.operational.vRView.ws.HzWebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketHandler;
@ -13,27 +11,32 @@ import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.server.standard.ServerEndpointExporter; import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* @author ysj
*/
@Configuration @Configuration
@EnableWebSocket @EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer{ public class WebSocketConfig implements WebSocketConfigurer{
@Override @Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(myHandler(), "/comprehensiveD/{uid}") // 集中监控处理器
.setAllowedOrigins("*"); registry.addHandler(monitorHandler(), "/comprehensiveD/{uid}").setAllowedOrigins("*");
// 告警处理器
registry.addHandler(alarmHandler(), "/alarmHandler/{uid}").setAllowedOrigins("*");
} }
@Bean @Bean
public WebSocketHandler myHandler() { public WebSocketHandler monitorHandler() {
return new MessageHandler(); return new MessageHandler();
} }
@Bean @Bean
public ServerEndpointExporter serverEndpointExporter() { public WebSocketHandler alarmHandler() {
return new ServerEndpointExporter(); return new AlarmHandler();
} }
@Autowired @Bean
public void hzImsRealDataService(IHzImsRealDataService realDataService) { public ServerEndpointExporter serverEndpointExporter() {
HzWebSocketServer.hzImsRealDataService = realDataService; return new ServerEndpointExporter();
} }
} }

79
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/AlarmHandler.java

@ -0,0 +1,79 @@
package com.hnac.hzims.operational.config.ws;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.operational.alert.service.AlarmHandleService;
import com.hnac.hzims.operational.alert.service.AlarmMergeService;
import com.hnac.hzims.operational.config.vo.MessageParamVo;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;
import java.io.IOException;
/**
* @author ysj
*/
@Slf4j
public class AlarmHandler extends TextWebSocketHandler {
private final Long defaultRealDataRefreshTime = 20000L;
@Autowired
private AlarmMergeService alarmMergeService;
//WebSocket连接建立成功之后调用
@Override
public void afterConnectionEstablished(WebSocketSession session) {
String[] split = session.getUri().toString().split("/");
String uid = split[split.length - 1];
// session 参数设置用户进行标识
session.getAttributes().put("userId", uid);
AlarmSessionManager.add(uid, session);
SocketPool.alarm_pool.put(session.getId(), this);
}
// 连接关闭时调用
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
// 移除会话
AlarmSessionManager.removeAndClose(session.getId());
// map移除用户
SocketPool.alarm_pool.remove(session.getId());
}
// 消息传输错误触发
@Override
public void handleTransportError(WebSocketSession session, Throwable exception) {
// 移除会话
SessionManager.removeAndClose(session.getId());
// map移除用户
SocketPool.pool.remove(session.getId());
}
// 接收消息触发
@Override
protected void handleTextMessage(WebSocketSession session, TextMessage textMessage) throws IOException {
// 获取会话用户编号
String userId = (String) session.getAttributes().get("userId");
String message = textMessage.getPayload();
if(StringUtil.isBlank(message)){
return;
}
MessageParamVo depts = JSONObject.parseObject(message, MessageParamVo.class);
if(ObjectUtil.isEmpty(depts)){
return;
}
TextMessage sendMessage = alarmMergeService.getSendMessage(depts);
if(ObjectUtil.isEmpty(sendMessage)){
return;
}
session.sendMessage(sendMessage);
}
}

58
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/AlarmSessionManager.java

@ -0,0 +1,58 @@
package com.hnac.hzims.operational.config.ws;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.socket.WebSocketSession;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author Lch
*/
@Slf4j
public class AlarmSessionManager {
public static ConcurrentHashMap<String, WebSocketSession> SESSION_POOL = new ConcurrentHashMap<>();
/**
* 添加会话
* @param uid 用户
* @param session 会话对象
*/
public static void add(String uid, WebSocketSession session) {
if (SESSION_POOL.containsKey(uid)) {
AlarmSessionManager.removeAndClose(uid);
}
SESSION_POOL.put(uid, session);
log.info("添加 WebSocketSession 会话成功,uid=" + uid);
}
/**
* 获取会话
* @param uid 用户
* @return
*/
public static WebSocketSession get(String uid) {
return SESSION_POOL.get(uid);
}
/**
* 移除会话并关闭会话
* @param uid 用户
*/
public static void removeAndClose(String uid) {
WebSocketSession session = SESSION_POOL.get(uid);
if (session != null) {
try {
//关闭连接
session.close();
} catch (IOException ex) {
throw new RuntimeException("关闭ws会话失败!", ex);
}
}
SESSION_POOL.remove(uid);
}
}

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/MessageHandler.java

@ -3,7 +3,6 @@ package com.hnac.hzims.operational.config.ws;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.operational.config.vo.MessageParamVo; import com.hnac.hzims.operational.config.vo.MessageParamVo;
import com.hnac.hzims.operational.station.service.IRealMonitorService; import com.hnac.hzims.operational.station.service.IRealMonitorService;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
@ -14,25 +13,20 @@ import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler; import org.springframework.web.socket.handler.TextWebSocketHandler;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @author ysj
*/
@Slf4j @Slf4j
public class MessageHandler extends TextWebSocketHandler { public class MessageHandler extends TextWebSocketHandler {
private ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); private final Long defaultRealDataRefreshTime = 20000L;
private Long defaultRealDataRefreshTime = 20000L;
@Autowired @Autowired
private IRealMonitorService monitorService; private IRealMonitorService monitorService;
private WebSocketSession session;
@Override @Override
public void afterConnectionEstablished(WebSocketSession session) { public void afterConnectionEstablished(WebSocketSession session) {
this.session = session;
String[] split = session.getUri().toString().split("/"); String[] split = session.getUri().toString().split("/");
String uid = split[split.length - 1]; String uid = split[split.length - 1];
SessionManager.add(uid, session); SessionManager.add(uid, session);
@ -45,21 +39,17 @@ public class MessageHandler extends TextWebSocketHandler {
@Override @Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
SessionManager.removeAndClose(session.getId()); SessionManager.removeAndClose(session.getId());
if (SocketPool.pool.containsKey(session.getId())) {
SocketPool.pool.remove(session.getId()); SocketPool.pool.remove(session.getId());
}
log.info("sessionId: " + session.getId()); log.info("sessionId: " + session.getId());
log.info("uri: " + session.getUri()); log.info("uri: " + session.getUri());
log.info("session closed successful!"); log.info("session closed successful!");
} }
@Override @Override
public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception { public void handleTransportError(WebSocketSession session, Throwable exception) {
SessionManager.removeAndClose(session.getId()); SessionManager.removeAndClose(session.getId());
if (SocketPool.pool.containsKey(session.getId())) {
SocketPool.pool.remove(session.getId()); SocketPool.pool.remove(session.getId());
} }
}
@Override @Override
protected void handleTextMessage(WebSocketSession session, TextMessage textMessage) throws IOException { protected void handleTextMessage(WebSocketSession session, TextMessage textMessage) throws IOException {

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/MyInterceptor.java

@ -8,37 +8,34 @@ import org.springframework.stereotype.Component;
import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.HandshakeInterceptor; import org.springframework.web.socket.server.HandshakeInterceptor;
import java.nio.charset.Charset; import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
/**
* @author ysj
*/
@Component @Component
public class MyInterceptor implements HandshakeInterceptor { public class MyInterceptor implements HandshakeInterceptor {
/** /**
* 握手前 * 握手前
*
* @param request * @param request
* @param response * @param response
* @param wsHandler * @param wsHandler
* @param attributes * @param attributes
* @return * @return
* @throws Exception
*/ */
@Override @Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception { public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) {
System.out.println("握手开始");
// 获得请求参数 // 获得请求参数
HashMap<String, String> paramMap = (HashMap<String, String>) HttpUtil.decodeParamMap(request.getURI().getQuery(), StandardCharsets.UTF_8);
HashMap<String, String> paramMap = (HashMap<String, String>) HttpUtil.decodeParamMap(request.getURI().getQuery(), Charset.forName("utf-8"));
String uid = paramMap.get("token"); String uid = paramMap.get("token");
if (StrUtil.isNotBlank(uid)) { if (StrUtil.isNotBlank(uid)) {
// 放入属性域 // 放入属性域
attributes.put("token", uid); attributes.put("token", uid);
System.out.println("用户 token " + uid + " 握手成功!");
return true; return true;
} }
System.out.println("用户登录已失效");
return false; return false;
} }
@ -52,7 +49,6 @@ public class MyInterceptor implements HandshakeInterceptor {
*/ */
@Override @Override
public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) { public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) {
System.out.println("握手完成");
} }
} }

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/SocketPool.java

@ -3,8 +3,13 @@ package com.hnac.hzims.operational.config.ws;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
/**
* @author ysj
*/
public class SocketPool { public class SocketPool {
public static Map<String, MessageHandler> pool = new ConcurrentHashMap<String, MessageHandler>(); public static Map<String, MessageHandler> pool = new ConcurrentHashMap<>();
public static Map<String, AlarmHandler> alarm_pool = new ConcurrentHashMap<>();
} }

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/WebsocketRun.java

@ -1,13 +0,0 @@
package com.hnac.hzims.operational.config.ws;
public class WebsocketRun extends Thread{
@Override
public void run() {
super.run();
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainPersonMapper.xml

@ -10,7 +10,7 @@
<result column="DUTY_DATE" property="dutyDate" jdbcType="DATE"/> <result column="DUTY_DATE" property="dutyDate" jdbcType="DATE"/>
<result column="CLASS_ID" property="classId" jdbcType="BIGINT"/> <result column="CLASS_ID" property="classId" jdbcType="BIGINT"/>
<result column="DUTY_GROUP_ID" property="dutyGroupId" jdbcType="BIGINT"/> <result column="DUTY_GROUP_ID" property="dutyGroupId" jdbcType="BIGINT"/>
<result column="CLASS_NAME" property="className" jdbcType="VARCHAR"/> <result column="DUTY_GROUP_NAME" property="dutyGroupName" jdbcType="VARCHAR"/>
<result column="STATUS" property="status" jdbcType="TINYINT"/> <result column="STATUS" property="status" jdbcType="TINYINT"/>
<result column="REMARK" property="remark" jdbcType="LONGVARCHAR"/> <result column="REMARK" property="remark" jdbcType="LONGVARCHAR"/>
<result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP"/>

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

@ -31,6 +31,7 @@ import org.springblade.core.tool.utils.*;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -518,6 +519,8 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if (ObjectUtil.isNotEmpty(imsDutyMainEntity1)) { if (ObjectUtil.isNotEmpty(imsDutyMainEntity1)) {
proDutyMainId = imsDutyMainEntity1.getId().toString(); proDutyMainId = imsDutyMainEntity1.getId().toString();
} }
}
if (StringUtil.isNotBlank(proDutyMainId)) {
imsDutyMainEntity.setPreDutyId(Long.valueOf(proDutyMainId)); imsDutyMainEntity.setPreDutyId(Long.valueOf(proDutyMainId));
} }
if (StringUtil.isNotBlank(personIds)) { if (StringUtil.isNotBlank(personIds)) {
@ -531,6 +534,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
imsDutyMainEntity.setTenantId(AuthUtil.getTenantId()); imsDutyMainEntity.setTenantId(AuthUtil.getTenantId());
imsDutyMainEntityList.add(imsDutyMainEntity); imsDutyMainEntityList.add(imsDutyMainEntity);
proDutyMainId = id == null ? "" : imsDutyMainEntity.getId().toString(); proDutyMainId = id == null ? "" : imsDutyMainEntity.getId().toString();
imsDutyMainEntity1=imsDutyMainEntity;
//同步保存到排班计划-人员表 //同步保存到排班计划-人员表
copyPersonByDutyMain(imsSchedulingVo, managerId, groupName, personEntityList, imsDutyMainEntity, collectPerson); copyPersonByDutyMain(imsSchedulingVo, managerId, groupName, personEntityList, imsDutyMainEntity, collectPerson);
} }
@ -1245,12 +1249,13 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if (CollectionUtil.isEmpty(imsDutyMainEntities)) { if (CollectionUtil.isEmpty(imsDutyMainEntities)) {
return R.fail("暂无对应排班计划"); return R.fail("暂无对应排班计划");
} }
List<Long> ids = imsDutyMainEntities.stream().map(ImsDutyMainEntity::getId).collect(Collectors.toList()); List<Long> mainIds = imsDutyMainEntities.stream().map(ImsDutyMainEntity::getId).collect(Collectors.toList());
List<ImsDutyMainPersonEntity> personEntityList = imsDutyMainPersonMapper.selectList(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{ List<ImsDutyMainPersonEntity> personEntityList = imsDutyMainPersonMapper.selectList(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
in(ImsDutyMainPersonEntity::getDutyMainId, ids); in(ImsDutyMainPersonEntity::getDutyMainId, mainIds);
}}); }});
if (CollectionUtil.isEmpty(personEntityList)) { if (CollectionUtil.isEmpty(personEntityList)) {
//如果人员计划表中,无值,需要填充对应信息(只有排班-班组,人员计划表才有可能无值) //如果人员计划表中,无值,需要填充对应信息(只有排班-班组,人员计划表才有可能无值)
//对上一个版本做兼容
for (ImsDutyMainEntity imsDutyMainEntity : imsDutyMainEntities) { for (ImsDutyMainEntity imsDutyMainEntity : imsDutyMainEntities) {
String[] dutyPersonIds = imsDutyMainEntity.getDutyPersonIds().split("\\^"); String[] dutyPersonIds = imsDutyMainEntity.getDutyPersonIds().split("\\^");
List<String> personIdlist = Arrays.asList(dutyPersonIds); List<String> personIdlist = Arrays.asList(dutyPersonIds);
@ -1262,23 +1267,20 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
copyPersonByDutyMain(imsSchedulingVo, imsDutyGroupEntity.getManagerId(), imsDutyGroupEntity.getGroupName(), personEntityList, imsDutyMainEntity, collect); copyPersonByDutyMain(imsSchedulingVo, imsDutyGroupEntity.getManagerId(), imsDutyGroupEntity.getGroupName(), personEntityList, imsDutyMainEntity, collect);
} }
} }
//前期移除,做是否是班组组长的判断 //调出时,做是否是班组组长的判断
List<String> personId = changeDutyMainVo.getPersonId(); List<String> personId = changeDutyMainVo.getPersonId();
HashSet<String> manageIds=new HashSet<>(); HashSet<String> manageIds=new HashSet<>();
HashSet<String> personHashSet=new HashSet<>(); HashSet<String> personHashSet=new HashSet<>();
imsDutyMainEntities.stream().map(s->{ for (ImsDutyMainEntity imsDutyMainEntity : imsDutyMainEntities) {
if (s.getDutyGroupId()!=null){ if (imsDutyMainEntity.getDutyGroupId()!=null){
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(s.getDutyGroupId()); ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsDutyMainEntity.getDutyGroupId());
manageIds.add(imsDutyGroupEntity.getManagerId().toString()); manageIds.add(imsDutyGroupEntity.getManagerId().toString());
} }
return s;
});
for (ImsDutyMainEntity imsDutyMainEntity : imsDutyMainEntities) {
String[] dutyMainPersonIds = imsDutyMainEntity.getDutyPersonIds().split("\\^"); String[] dutyMainPersonIds = imsDutyMainEntity.getDutyPersonIds().split("\\^");
List<String> personIdlist = new ArrayList<>(Arrays.asList(dutyMainPersonIds)); List<String> personIdlist = new ArrayList<>(Arrays.asList(dutyMainPersonIds));
personHashSet.addAll(personIdlist); personHashSet.addAll(personIdlist);
} }
//调入调出,对人员做重复判断
for (String s : personId) { for (String s : personId) {
if (1==changeDutyMainVo.getType()) { if (1==changeDutyMainVo.getType()) {
if (personHashSet.contains(s)) { if (personHashSet.contains(s)) {
@ -1290,7 +1292,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
} }
} }
} }
//值班组长无法调走
List<String> dutyChargePersonIds = personEntityList.stream().filter(s -> s.getDutyChargePerson()!=null) List<String> dutyChargePersonIds = personEntityList.stream().filter(s -> s.getDutyChargePerson()!=null)
.map(s -> s.getDutyChargePerson().toString()).collect(Collectors.toList()); .map(s -> s.getDutyChargePerson().toString()).collect(Collectors.toList());
manageIds.addAll(dutyChargePersonIds); manageIds.addAll(dutyChargePersonIds);
@ -1303,17 +1305,6 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
return s; return s;
}); });
List<ImsDutyMainPersonEntity> addPersonEntityList = new ArrayList<>(); List<ImsDutyMainPersonEntity> addPersonEntityList = new ArrayList<>();
List<ImsDutyMainPersonEntity> updatePersonEntityList= personEntityList.stream().map(sig -> {
if (sig.getDutyGroupId() != null) {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(sig.getDutyGroupId());
sig.setDutyGroupName(imsDutyGroupEntity.getGroupName());
sig.setDutyGroupId(null);
}
long id = IdWorker.getId(sig);
sig.setId(id);
return sig;
}).collect(Collectors.toList());
List<Long> longList=new ArrayList<>();
List<ImsDutyMainEntity> updateDutyMainEntities = imsDutyMainEntities.stream().map(s -> { List<ImsDutyMainEntity> updateDutyMainEntities = imsDutyMainEntities.stream().map(s -> {
String[] dutyMainPersonIds = s.getDutyPersonIds().split("\\^"); String[] dutyMainPersonIds = s.getDutyPersonIds().split("\\^");
List<String> personIdlist = new ArrayList<>(Arrays.asList(dutyMainPersonIds)); List<String> personIdlist = new ArrayList<>(Arrays.asList(dutyMainPersonIds));
@ -1324,54 +1315,51 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
} }
String resIds = StringUtils.join(personIdlist, "^"); String resIds = StringUtils.join(personIdlist, "^");
s.setDutyPersonIds(resIds); s.setDutyPersonIds(resIds);
//如果是班组排班,调班之后,则需要转换为灵活排班,加上排班名字
if (s.getDutyGroupId() != null) { if (s.getDutyGroupId() != null) {
s.setDutyGroupId(null); s.setDutyGroupId(null);
} }
long id = IdWorker.getId(s); return s;
for (ImsDutyMainPersonEntity imsDutyMainPersonEntity : personEntityList) { }).collect(Collectors.toList());
if (imsDutyMainPersonEntity.getDutyMainId().equals(s.getId())) { //之前原有的排版-人员表,需要修改的部分
//更换mainID List<ImsDutyMainPersonEntity> updatePersonEntityList= personEntityList.stream().map(sig -> {
imsDutyMainPersonEntity.setDutyMainId(id); if (sig.getDutyGroupId() != null) {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(sig.getDutyGroupId());
sig.setDutyGroupName(imsDutyGroupEntity.getGroupName());
sig.setDutyGroupId(null);
}
long id = IdWorker.getId(sig);
sig.setId(id);
return sig;
}).collect(Collectors.toList());
//如果是添加,填充对应人员的排版人员表
if(1 == changeDutyMainVo.getType()) { if(1 == changeDutyMainVo.getType()) {
//根据mainID添加新的排版人员表 for (String addId : personId) {
for (String s1 : personId) { for (Long mainId : mainIds) {
ImsDutyMainPersonEntity entity = new ImsDutyMainPersonEntity(); //copy修改后的数据,
BeanUtil.copy(imsDutyMainPersonEntity, entity); List<ImsDutyMainPersonEntity> collect = updatePersonEntityList.stream().filter(s -> mainId.equals(s.getDutyMainId())).collect(Collectors.toList());
entity.setDutyPerson(Long.valueOf(s1)); ImsDutyMainPersonEntity imsDutyMainPersonEntity=collect.get(0);
ImsDutyMainPersonEntity addEntity = new ImsDutyMainPersonEntity();
BeanUtil.copy(imsDutyMainPersonEntity, addEntity);
addEntity.setDutyPerson(Long.valueOf(addId));
long id1 = IdWorker.getId(imsDutyMainPersonEntity); long id1 = IdWorker.getId(imsDutyMainPersonEntity);
entity.setId(id1); addEntity.setId(id1);
if (!longList.contains(imsDutyMainPersonEntity.getDutyMainId())) { addPersonEntityList.add(addEntity);
addPersonEntityList.add(entity);
longList.add(imsDutyMainPersonEntity.getDutyMainId());
}
}
} }
} }
if (imsDutyMainPersonEntity.getDutyGroupId() != null) { updatePersonEntityList.addAll(addPersonEntityList);
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsDutyMainPersonEntity.getDutyGroupId());
imsDutyMainPersonEntity.setDutyGroupName(imsDutyGroupEntity.getGroupName());
imsDutyMainPersonEntity.setDutyGroupId(null);
}
long key = IdWorker.getId(imsDutyMainPersonEntity);
imsDutyMainPersonEntity.setId(key);
} }
s.setId(id);
return s;
}).collect(Collectors.toList());
if (2 == changeDutyMainVo.getType()) { if (2 == changeDutyMainVo.getType()) {
for (String s : personId) { for (String s : personId) {
updatePersonEntityList=updatePersonEntityList.stream().filter( updatePersonEntityList=updatePersonEntityList.stream().filter(
sig -> !sig.getDutyPerson().equals(s)) sig -> !sig.getDutyPerson().equals(s))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} else {
updatePersonEntityList.addAll(addPersonEntityList);
} }
this.deleteLogic(ids); //更新排班-班组表,删除排班人员表,再添加排班班组人员表
this.updateBatchById(updateDutyMainEntities);
List<Long> list = personEntityList.stream().map(s -> Long.valueOf(s.getId())).collect(Collectors.toList()); List<Long> list = personEntityList.stream().map(s -> Long.valueOf(s.getId())).collect(Collectors.toList());
iImsDutyMainPersonService.deleteLogic(list); iImsDutyMainPersonService.deleteLogic(list);
this.saveBatch(updateDutyMainEntities);
iImsDutyMainPersonService.saveBatch(updatePersonEntityList); iImsDutyMainPersonService.saveBatch(updatePersonEntityList);
return R.success("修改成功"); return R.success("修改成功");
} }
@ -1594,6 +1582,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
imsDutyMainEntity.setTenantId(AuthUtil.getTenantId()); imsDutyMainEntity.setTenantId(AuthUtil.getTenantId());
imsDutyMainEntityList.add(imsDutyMainEntity); imsDutyMainEntityList.add(imsDutyMainEntity);
proDutyMainId = id == null ? "" : imsDutyMainEntity.getId().toString(); proDutyMainId = id == null ? "" : imsDutyMainEntity.getId().toString();
BeanUtils.copyProperties(imsDutyMainEntity,imsDutyMainEntity1);
} }
} }
} }

71
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java

@ -28,7 +28,9 @@ import com.hnac.hzims.ticket.areamonthly.vo.*;
import com.hnac.hzinfo.inspect.areamonthly.vo.TaskListQuery; import com.hnac.hzinfo.inspect.areamonthly.vo.TaskListQuery;
import com.hnac.hzinfo.inspect.areamonthly.vo.TaskVo; import com.hnac.hzinfo.inspect.areamonthly.vo.TaskVo;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
@ -49,6 +51,7 @@ import java.util.List;
* @Serial 1.0 * @Serial 1.0
* @Date 2023/4/10 11:21 * @Date 2023/4/10 11:21
*/ */
@Api(tags = "水电生成报告详情数据")
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
@ -70,8 +73,12 @@ public class AreaMonthlyDetailsController {
* *
* @return * @return
*/ */
@ApiOperation("操作票 根据月份,区域 获取操作详情分页列表数据")
@GetMapping("/areaMonthlyWithOperation/{page}/{size}") @GetMapping("/areaMonthlyWithOperation/{page}/{size}")
public R areaMonthlyWithOperation(@PathVariable("page") Long page, @PathVariable("size") Long size, StandardTicketWithAreaVo areaMonthly) { public R areaMonthlyWithOperation(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
StandardTicketWithAreaVo areaMonthly) {
BladePage<StandardTicketVo> standardTicketInfoVoIPage = areaMonthlyDetailsService.areaMonthlyWithOperation(page, size, areaMonthly); BladePage<StandardTicketVo> standardTicketInfoVoIPage = areaMonthlyDetailsService.areaMonthlyWithOperation(page, size, areaMonthly);
return R.data(standardTicketInfoVoIPage); return R.data(standardTicketInfoVoIPage);
} }
@ -82,6 +89,7 @@ public class AreaMonthlyDetailsController {
* *
* @return * @return
*/ */
@ApiOperation("操作票 根据月份,区域 获取操作详情数据")
@GetMapping("/areaMonthlyWithOperation/detail/{id}") @GetMapping("/areaMonthlyWithOperation/detail/{id}")
public R areaMonthlyWithOperationDetail(@PathVariable("id") Long id) { public R areaMonthlyWithOperationDetail(@PathVariable("id") Long id) {
StandardTicketInfoVO standardTicketInfoVoIPage = areaMonthlyDetailsService.areaMonthlyWithOperationDetail(id); StandardTicketInfoVO standardTicketInfoVoIPage = areaMonthlyDetailsService.areaMonthlyWithOperationDetail(id);
@ -92,6 +100,7 @@ public class AreaMonthlyDetailsController {
/** /**
* 查询工作票评论 * 查询工作票评论
*/ */
@ApiOperation("查询工作票评论")
@GetMapping("/areaMonthlyWithOperation/workTicketCommentList") @GetMapping("/areaMonthlyWithOperation/workTicketCommentList")
public R<List<TicketInfoEvaluateVO>> workTicketCommentList(TicketInfoEvaluateEntity req) { public R<List<TicketInfoEvaluateVO>> workTicketCommentList(TicketInfoEvaluateEntity req) {
List<TicketInfoEvaluateVO> ticketInfoEvaluateVOS = areaMonthlyDetailsService.workTicketCommentList(req); List<TicketInfoEvaluateVO> ticketInfoEvaluateVOS = areaMonthlyDetailsService.workTicketCommentList(req);
@ -102,16 +111,21 @@ public class AreaMonthlyDetailsController {
/** /**
* 保存评论信息 * 保存评论信息
*/ */
@ApiOperation("保存评论信息")
@PostMapping("/saveComment") @PostMapping("/saveComment")
public R saveComment(@RequestBody TicketInfoEvaluateDto req) { public R saveComment(@RequestBody TicketInfoEvaluateDto req) {
return R.data(areaMonthlyDetailsService.saveComment(req)); return R.data(areaMonthlyDetailsService.saveComment(req));
} }
/** /**
* 根据月份和区域查询工作票列表详情 * 根据月份和区域查询工作票分页列表数据
*/ */
@ApiOperation("根据月份和区域查询工作票分页列表数据")
@GetMapping("/workTicketListByMonthAndArea/{page}/{size}") @GetMapping("/workTicketListByMonthAndArea/{page}/{size}")
R<BladePage<StandardWorkVo>> workTicketListByMonthAndArea(@PathVariable Long page, @PathVariable Long size, @SpringQueryMap StandardTicketWithAreaVo areaMonthlyVo) { R<BladePage<StandardWorkVo>> workTicketListByMonthAndArea(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
@SpringQueryMap StandardTicketWithAreaVo areaMonthlyVo) {
BladePage<StandardWorkVo> standardWorkVoIPage = areaMonthlyDetailsService.workTicketListByMonthAndArea(page, size, areaMonthlyVo); BladePage<StandardWorkVo> standardWorkVoIPage = areaMonthlyDetailsService.workTicketListByMonthAndArea(page, size, areaMonthlyVo);
return R.data(standardWorkVoIPage); return R.data(standardWorkVoIPage);
} }
@ -121,9 +135,12 @@ public class AreaMonthlyDetailsController {
* 根据区域和月份分页查询日志维护列表 * 根据区域和月份分页查询日志维护列表
*/ */
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "日志维护列表分页查询") @ApiOperation(value = "根据区域和月份分页查询日志维护列表")
@GetMapping("/queryLogMaintenancePageList/{page}/{size}") @GetMapping("/queryLogMaintenancePageList/{page}/{size}")
public R<IPage<MaintenanceTaskVo>> queryLogMaintenancePageList(@PathVariable Long page, @PathVariable Long size, MaintenanceTaskWithAreaVo maintenanceTaskVo) { public R<IPage<MaintenanceTaskVo>> queryLogMaintenancePageList(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
MaintenanceTaskWithAreaVo maintenanceTaskVo) {
Page<OperMaintenanceTaskEntity> pageParam = new Page<>(page, size); Page<OperMaintenanceTaskEntity> pageParam = new Page<>(page, size);
IPage<MaintenanceTaskVo> taskList = taskService.queryLogMaintenancePageList(pageParam, maintenanceTaskVo); IPage<MaintenanceTaskVo> taskList = taskService.queryLogMaintenancePageList(pageParam, maintenanceTaskVo);
return R.data(taskList); return R.data(taskList);
@ -135,7 +152,7 @@ public class AreaMonthlyDetailsController {
*/ */
@GetMapping("/queryLogMaintenancePageList/detail/{id}") @GetMapping("/queryLogMaintenancePageList/detail/{id}")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "根据区域和月份分页查询日志维护 根据id获取详情")
public R<OperMaintenanceTaskEntity> detail(@PathVariable Long id) { public R<OperMaintenanceTaskEntity> detail(@PathVariable Long id) {
return taskService.detail(id); return taskService.detail(id);
} }
@ -145,7 +162,7 @@ public class AreaMonthlyDetailsController {
* 根据区域和月份分页查询巡检任务 * 根据区域和月份分页查询巡检任务
*/ */
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页查询") @ApiOperation(value = "根据区域和月份分页查询巡检任务")
@GetMapping("/queryCheckTaskPageList") @GetMapping("/queryCheckTaskPageList")
public R<BladePage<TaskVo>> queryCheckTaskPageList(TaskListQuery task, Query query) { public R<BladePage<TaskVo>> queryCheckTaskPageList(TaskListQuery task, Query query) {
BladePage<TaskVo> taskVoIPage = areaMonthlyDetailsService.queryCheckTaskPageList(task, query); BladePage<TaskVo> taskVoIPage = areaMonthlyDetailsService.queryCheckTaskPageList(task, query);
@ -156,9 +173,9 @@ public class AreaMonthlyDetailsController {
/** /**
* 根据id查询巡检任务 * 根据id查询巡检任务
*/ */
@ApiOperation(value = "根据id查询巡检任务")
@GetMapping("/queryCheckTaskById/{id}") @GetMapping("/queryCheckTaskById/{id}")
@ApiOperationSupport(order = 60) @ApiOperationSupport(order = 60)
@ApiOperation(value = "详情")
public R<TaskEntity> queryCheckTaskById(@PathVariable Long id) { public R<TaskEntity> queryCheckTaskById(@PathVariable Long id) {
TaskEntity task = areaMonthlyDetailsService.queryCheckTaskById(id); TaskEntity task = areaMonthlyDetailsService.queryCheckTaskById(id);
return R.data(task); return R.data(task);
@ -169,11 +186,11 @@ public class AreaMonthlyDetailsController {
* 根据区域和月份分页查询缺陷库 * 根据区域和月份分页查询缺陷库
*/ */
@ApiOperationSupport(order = 70) @ApiOperationSupport(order = 70)
@ApiOperation(value = "分页查询") @ApiOperation(value = "根据区域和月份分页查询缺陷库")
@GetMapping("/queryDefectPageList/{page}/{size}") @GetMapping("/queryDefectPageList/{page}/{size}")
public R<IPage<OperDefectVO>> queryDefectPageList( public R<IPage<OperDefectVO>> queryDefectPageList(
@PathVariable Long page, @ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@PathVariable Long size, @ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
OperDefectEntity defect) { OperDefectEntity defect) {
Page<OperDefectEntity> operDefectEntityPage = new Page<>(page, size); Page<OperDefectEntity> operDefectEntityPage = new Page<>(page, size);
IPage<OperDefectEntity> pages = defectService.selectPage(operDefectEntityPage, defect); IPage<OperDefectEntity> pages = defectService.selectPage(operDefectEntityPage, defect);
@ -187,7 +204,7 @@ public class AreaMonthlyDetailsController {
*/ */
@GetMapping("queryDefectPageDetail/detail") @GetMapping("queryDefectPageDetail/detail")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入defect") @ApiOperation(value = "根据区域和月份分页查询缺陷库 详情", notes = "传入defect")
public R<OperDefectVO> queryDefectPageDetail(OperDefectEntity defect) { public R<OperDefectVO> queryDefectPageDetail(OperDefectEntity defect) {
return defectService.detail(defect); return defectService.detail(defect);
} }
@ -200,7 +217,8 @@ public class AreaMonthlyDetailsController {
@ApiOperation(value = "根据区域和月份分页查询检修任务") @ApiOperation(value = "根据区域和月份分页查询检修任务")
@GetMapping("/queryReconditionPageList/{page}/{size}") @GetMapping("/queryReconditionPageList/{page}/{size}")
public R<IPage<OperAccessStatisticsVO>> queryReconditionPageList( public R<IPage<OperAccessStatisticsVO>> queryReconditionPageList(
@PathVariable Long page, @PathVariable Long size, @ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
OperAccessStatisticsDTO result) { OperAccessStatisticsDTO result) {
Page<OperAccessStatisticsVO> dbPage = new Page<>(page, size); Page<OperAccessStatisticsVO> dbPage = new Page<>(page, size);
R<IPage<OperAccessStatisticsVO>> r = accessStatisticsService.list(result, dbPage); R<IPage<OperAccessStatisticsVO>> r = accessStatisticsService.list(result, dbPage);
@ -226,7 +244,9 @@ public class AreaMonthlyDetailsController {
@GetMapping("/queryProduceNumByAreaCode/{page}/{size}") @GetMapping("/queryProduceNumByAreaCode/{page}/{size}")
@ApiOperationSupport(order = 90) @ApiOperationSupport(order = 90)
@ApiOperation(value = "根据区域编号查询安全生产会议次数") @ApiOperation(value = "根据区域编号查询安全生产会议次数")
public R<BladePage<CheckMonthVo>> queryProduceNumByAreaCode(@PathVariable Long page, @PathVariable Long size, public R<BladePage<CheckMonthVo>> queryProduceNumByAreaCode(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
CheckMonthEntity req) { CheckMonthEntity req) {
req.setItemName("现场每月1次安全生产会议"); req.setItemName("现场每月1次安全生产会议");
BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size, BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size,
@ -240,7 +260,10 @@ public class AreaMonthlyDetailsController {
@GetMapping("/querySkillByAreaCode/{page}/{size}") @GetMapping("/querySkillByAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询技能培训") @ApiOperation(value = "根据区域编号查询技能培训")
public R<BladePage<CheckMonthVo>> querySkillByAreaCode(@PathVariable Long page, @PathVariable Long size, CheckMonthEntity req) { public R<BladePage<CheckMonthVo>> querySkillByAreaCode(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
CheckMonthEntity req) {
req.setItemName("每月开展1次技能培训"); req.setItemName("每月开展1次技能培训");
BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size, BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size,
req); req);
@ -254,20 +277,22 @@ public class AreaMonthlyDetailsController {
@GetMapping("/queryProduceByAreaCode/{page}/{size}") @GetMapping("/queryProduceByAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询技能培训") @ApiOperation(value = "根据区域编号查询技能培训")
public R<BladePage<CheckMonthVo>> queryProduceByAreaCode(@PathVariable Long page, @PathVariable Long size, CheckMonthEntity req) { public R<BladePage<CheckMonthVo>> queryProduceByAreaCode(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
CheckMonthEntity req) {
BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size, BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size,
req); req);
return R.data(checkMonthVoBladePage); return R.data(checkMonthVoBladePage);
} }
/** /**
* 根据区域编号查询 月度自查 技能培训 安全生产会议次数 * 根据区域编号查询 月度自查 技能培训 安全生产会议次数
*/ */
@GetMapping("/queryProduceByAreaCodeDetail/detail/{id}") @GetMapping("/queryProduceByAreaCodeDetail/detail/{id}")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情", notes = "传入id") @ApiOperation(value = "根据区域编号查询 月度自查 技能培训 安全生产会议次数", notes = "传入id")
public R<CheckMonthVo> queryProduceByAreaCodeDetail(@PathVariable Long id) { public R<CheckMonthVo> queryProduceByAreaCodeDetail(@PathVariable Long id) {
CheckMonthVo checkMonthVo = areaMonthlyDetailsService.queryProduceByAreaCodeDetail(id); CheckMonthVo checkMonthVo = areaMonthlyDetailsService.queryProduceByAreaCodeDetail(id);
return R.data(checkMonthVo); return R.data(checkMonthVo);
@ -280,8 +305,9 @@ public class AreaMonthlyDetailsController {
@GetMapping("/querySecurityAreaCode/{page}/{size}") @GetMapping("/querySecurityAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询安全检查") @ApiOperation(value = "根据区域编号查询安全检查")
public R<BladePage<CheckCompanyVo>> querySecurityAreaCode(@PathVariable Long page, public R<BladePage<CheckCompanyVo>> querySecurityAreaCode(
@PathVariable Long size, @ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
CheckCompanyEntity req) { CheckCompanyEntity req) {
BladePage<CheckCompanyVo> checkMonthVoBladePage = areaMonthlyDetailsService.querySecurityAreaCode(page, size, BladePage<CheckCompanyVo> checkMonthVoBladePage = areaMonthlyDetailsService.querySecurityAreaCode(page, size,
req); req);
@ -301,7 +327,6 @@ public class AreaMonthlyDetailsController {
} }
/** /**
* 根据区域编号查询设备试验 * 根据区域编号查询设备试验
*/ */
@ -309,8 +334,8 @@ public class AreaMonthlyDetailsController {
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询设备试验") @ApiOperation(value = "根据区域编号查询设备试验")
public R<BladePage<SafeEquipmentTrialVO>> queryEquipmentAreaCode( public R<BladePage<SafeEquipmentTrialVO>> queryEquipmentAreaCode(
@PathVariable Long page, @ApiParam(name = "page",value = "当前页",required = true) @PathVariable("page") Long page,
@PathVariable Long size, @ApiParam(name = "size",value = "每页记录数",required = true) @PathVariable("size") Long size,
SafeEquipmentTrialDTO safeEquipmentTrialDTO) { SafeEquipmentTrialDTO safeEquipmentTrialDTO) {
BladePage<SafeEquipmentTrialVO> checkMonthVoBladePage = areaMonthlyDetailsService.queryEquipmentAreaCode(page BladePage<SafeEquipmentTrialVO> checkMonthVoBladePage = areaMonthlyDetailsService.queryEquipmentAreaCode(page
, size, safeEquipmentTrialDTO); , size, safeEquipmentTrialDTO);

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

@ -143,6 +143,8 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
} }
// 删除智能诊断站点 // 删除智能诊断站点
questionClient.deleteStationInfo(stationEntity.getCode()); questionClient.deleteStationInfo(stationEntity.getCode());
//删除所属机构信息
deptClient.deleteDeptById(stationEntity.getRefDept());
} }
return saveFlag; return saveFlag;
} }

13
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java

@ -1,6 +1,9 @@
package com.hnac.hzims.ticket.standardTicket.mapper; package com.hnac.hzims.ticket.standardTicket.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
@ -42,4 +45,14 @@ public interface StandardTicketInfoMapper extends UserDataScopeBaseMapper<Standa
List<OperateTicketStatisticVO> getOperateTicketReportStatistic(@Param("startDate") String startDate, List<OperateTicketStatisticVO> getOperateTicketReportStatistic(@Param("startDate") String startDate,
@Param("endDate") String endDate, @Param("endDate") String endDate,
@Param("deptIdList") List<Long> deptIdList); @Param("deptIdList") List<Long> deptIdList);
/**
* 分页查询
* @param searchPage
* @param queryWrapper
* @return
*/
Page<StandardTicketInfoEntity> selectPages(Page<StandardTicketInfoEntity> searchPage,
@Param(Constants.WRAPPER) QueryWrapper<StandardTicketInfoEntity> queryWrapper);
} }

6
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml

@ -76,4 +76,10 @@
</if> </if>
</where> </where>
</select> </select>
<select id="selectPages" resultType="com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity">
select sti.* from hzims_standard_ticket_info sti left join
hzims_ticket_info_evaluate tie on sti.id = tie.ticket_id
${ew.customSqlSegment}
</select>
</mapper> </mapper>

35
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -331,23 +331,26 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
//1.查询 //1.查询
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
//开票来源 //开票来源
queryWrapper.lambda().eq(Func.isNotEmpty(areaVo.getTaskType()), StandardTicketInfoEntity::getTaskType, queryWrapper.eq(Func.isNotEmpty(areaVo.getTaskType()), "sti.task_type",
areaVo.getTaskType()); areaVo.getTaskType());
//编号 //编号
queryWrapper.lambda().like(Func.isNotEmpty(areaVo.getCode()), StandardTicketInfoEntity::getCode, areaVo.getCode()); queryWrapper.like(Func.isNotEmpty(areaVo.getCode()),"sti.code" , areaVo.getCode());
//状态 //状态
queryWrapper.lambda().eq(Func.isNotEmpty(areaVo.getStatus()), StandardTicketInfoEntity::getStatus, queryWrapper.eq(Func.isNotEmpty(areaVo.getStatus()), "sti.status",
areaVo.getStatus()); areaVo.getStatus());
//开始时间 //开始时间
queryWrapper.lambda().lt(Func.isNotEmpty(areaVo.getStartTime()), StandardTicketInfoEntity::getCreateTime, queryWrapper.lt(Func.isNotEmpty(areaVo.getStartTime()), "sti.create_time",
areaVo.getStartTime()); areaVo.getStartTime());
//结束时间 //结束时间
queryWrapper.lambda().le(Func.isNotEmpty(areaVo.getEndTime()), StandardTicketInfoEntity::getCreateTime, queryWrapper.le(Func.isNotEmpty(areaVo.getEndTime()), "sti.create_time",
areaVo.getEndTime()); areaVo.getEndTime());
queryWrapper.eq("CREATE_DEPT", areaVo.getAreaId());
queryWrapper.eq("sti.CREATE_DEPT", areaVo.getAreaId());
queryWrapper.eq(areaVo.getYearMonth() != null, queryWrapper.eq(areaVo.getYearMonth() != null,
"date_format(create_time,'%Y-%m')", areaVo.getYearMonth()); "date_format(sti.create_time,'%Y-%m')", areaVo.getYearMonth());
Page<StandardTicketInfoEntity> standardTicketInfoEntityPage = baseMapper.selectPage(searchPage, queryWrapper); queryWrapper.eq("tie.status",1);
Page<StandardTicketInfoEntity> standardTicketInfoEntityPage = baseMapper.selectPages(searchPage, queryWrapper);
//数据转换StandardTicketInfoEntity ==> StandardTicketVo //数据转换StandardTicketInfoEntity ==> StandardTicketVo
List<StandardTicketVo> standardTicketInfoVOList = new ArrayList<>(); List<StandardTicketVo> standardTicketInfoVOList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(standardTicketInfoEntityPage.getRecords())) { if (CollectionUtil.isNotEmpty(standardTicketInfoEntityPage.getRecords())) {
@ -368,6 +371,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
return standardTicketVo; return standardTicketVo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
Page<StandardTicketVo> page = new Page<>(); Page<StandardTicketVo> page = new Page<>();
page.setSize(standardTicketInfoEntityPage.getSize()); page.setSize(standardTicketInfoEntityPage.getSize());
page.setCurrent(standardTicketInfoEntityPage.getCurrent()); page.setCurrent(standardTicketInfoEntityPage.getCurrent());
@ -379,6 +383,21 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
return bladePage; return bladePage;
} }
/**
* 判断是否存在合格率 如果存在返回true 否则为false
* @param item
* @return
*/
private boolean isTicketPercentById(StandardTicketInfoEntity item) {
LambdaQueryWrapper<TicketInfoEvaluateEntity> ticketInfoEvaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getTicketId, item.getId());
ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getStatus,
TicketConstants.TicketQualifiedEnum.Qualified.getCode());
int count = ticketInfoEvaluateService.count(ticketInfoEvaluateEntityLambdaQueryWrapper);
return count > 0;
}
/** /**
* 首页-当月操作票获取 * 首页-当月操作票获取
* *

16
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java

@ -1,5 +1,8 @@
package com.hnac.hzims.ticket.workTicket.mapper; package com.hnac.hzims.ticket.workTicket.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketReportStatisticVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketReportStatisticVO;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
@ -28,6 +31,7 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper<WorkTicket
/** /**
* 获取安全检查项工作票项统计 * 获取安全检查项工作票项统计
*
* @param startDate 开始时间 * @param startDate 开始时间
* @param endDate 结束时间 * @param endDate 结束时间
* @param dept 机构 * @param dept 机构
@ -39,6 +43,7 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper<WorkTicket
/** /**
* 获取站点统计报表 - 工作票 * 获取站点统计报表 - 工作票
*
* @param startDate 开始时间 * @param startDate 开始时间
* @param endDate 结束时间 * @param endDate 结束时间
* @param dept 机构ID * @param dept 机构ID
@ -48,4 +53,15 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper<WorkTicket
List<WorkTicketReportStatisticVO> getWorkTicketReportStatistic(@Param("startDate") String startDate, List<WorkTicketReportStatisticVO> getWorkTicketReportStatistic(@Param("startDate") String startDate,
@Param("endDate") String endDate, @Param("endDate") String endDate,
@Param("deptIdList") List<Long> dept); @Param("deptIdList") List<Long> dept);
/**
* 分页查询
*
* @param pageEntity
* @param queryWrapper
* @return
*/
Page<WorkTicketInfoEntity> selectPages(Page<WorkTicketInfoEntity> pageEntity,
@Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper);
} }

6
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml

@ -79,4 +79,10 @@
</where> </where>
</select> </select>
<select id="selectPages" resultType="com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity">
select sti.* from hzims_work_ticket_info sti left join
hzims_ticket_info_evaluate tie on sti.id = tie.ticket_id
${ew.customSqlSegment}
</select>
</mapper> </mapper>

38
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -14,6 +14,8 @@ import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.feign.ITaskClient; import com.hnac.hzims.operational.maintenance.feign.ITaskClient;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo; import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo;
@ -93,6 +95,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
private final WorkDelayNoScopeMapper workDelayNoScopeMapper; private final WorkDelayNoScopeMapper workDelayNoScopeMapper;
private final IOperAccessTaskClient operAccessTaskClient; private final IOperAccessTaskClient operAccessTaskClient;
private final ITaskClient taskClient; private final ITaskClient taskClient;
private final TicketInfoEvaluateService ticketInfoEvaluateService;
/** 生成两票编号锁 **/ /** 生成两票编号锁 **/
private Lock lock = new ReentrantLock(); private Lock lock = new ReentrantLock();
@ -877,28 +880,30 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>();
//开票来源 //开票来源
queryWrapper.lambda().eq(Func.isNotEmpty(areaVo.getTaskType()), WorkTicketInfoEntity::getTaskType, queryWrapper.eq(Func.isNotEmpty(areaVo.getTaskType()), "sti.task_type",
areaVo.getTaskType()); areaVo.getTaskType());
//编号 //编号
queryWrapper.lambda().like(Func.isNotEmpty(areaVo.getCode()), WorkTicketInfoEntity::getCode, areaVo.getCode()); queryWrapper.like(Func.isNotEmpty(areaVo.getCode()), "sti.code", areaVo.getCode());
//状态 //状态
queryWrapper.lambda().eq(Func.isNotEmpty(areaVo.getStatus()), WorkTicketInfoEntity::getStatus, queryWrapper.eq(Func.isNotEmpty(areaVo.getStatus()), "sti.status",
areaVo.getStatus()); areaVo.getStatus());
//开始时间 //开始时间
queryWrapper.lambda().lt(Func.isNotEmpty(areaVo.getStartTime()), WorkTicketInfoEntity::getCreateTime, queryWrapper.lt(Func.isNotEmpty(areaVo.getStartTime()), "sti.create_time",
areaVo.getStartTime()); areaVo.getStartTime());
//结束时间 //结束时间
queryWrapper.lambda().le(Func.isNotEmpty(areaVo.getEndTime()), WorkTicketInfoEntity::getCreateTime, queryWrapper.le(Func.isNotEmpty(areaVo.getEndTime()), "sti.create_time",
areaVo.getEndTime()); areaVo.getEndTime());
queryWrapper.eq("create_dept", areaVo.getAreaId()); queryWrapper.eq("sti.create_dept", areaVo.getAreaId());
queryWrapper.eq(areaVo.getYearMonth() != null, "date_format(create_time,'%Y-%m')", queryWrapper.eq(areaVo.getYearMonth() != null, "date_format(sti.create_time,'%Y-%m')",
areaVo.getYearMonth()); areaVo.getYearMonth());
Page<WorkTicketInfoEntity> workTicketInfoEntityPage = baseMapper.selectPage(pageEntity, queryWrapper); //如果为1为合格
queryWrapper.eq("tie.status",1);
Page<WorkTicketInfoEntity> workTicketInfoEntityPage = baseMapper.selectPages(pageEntity, queryWrapper);
//数据转换 //数据转换
List<StandardWorkVo> standardWorkList = new ArrayList<>(); List<StandardWorkVo> standardWorkList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(workTicketInfoEntityPage.getRecords())) { if (CollectionUtil.isNotEmpty(workTicketInfoEntityPage.getRecords())) {
@ -918,4 +923,21 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
BladePage<StandardWorkVo> bladePage = BladePage.of(page); BladePage<StandardWorkVo> bladePage = BladePage.of(page);
return bladePage; return bladePage;
} }
/**
* 判断是否存在合格率 如果存在返回true 否则为false
*
* @param item
* @return
*/
private boolean isTicketPercentById(WorkTicketInfoEntity item) {
LambdaQueryWrapper<TicketInfoEvaluateEntity> ticketInfoEvaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getTicketId, item.getId());
ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getStatus,
TicketConstants.TicketQualifiedEnum.Qualified.getCode());
// 查询合格评价
int count = ticketInfoEvaluateService.count(ticketInfoEvaluateEntityLambdaQueryWrapper);
return count > 0;
}
} }

Loading…
Cancel
Save