Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
bd252594da
  1. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  2. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
  3. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/SysLogConfig.java
  4. 6
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  5. 9
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java
  6. 50
      hzims-service/hzims-middle/src/main/resources/db/1.0.1.sql
  7. 1
      hzims-service/hzims-middle/src/main/resources/db/1.0.2.sql
  8. 44
      hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql
  9. 15
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java
  10. 7
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectServiceImpl.java
  11. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/PointDataVo.java
  12. 5
      hzims-service/operational/src/main/resources/db/1.0.2.sql
  13. 28
      hzims-service/ticket/src/main/resources/db/2.0.0.sql
  14. 3
      hzims-service/ticket/src/main/resources/db/2.0.1.sql
  15. 1
      hzims-service/ticket/src/main/resources/db/2.0.2.sql
  16. 18
      hzims-service/ticket/src/main/resources/db/2.0.3.sql
  17. 2
      hzims-service/ticket/src/main/resources/db/2.0.4.sql

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

@ -599,6 +599,17 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
.flatMap(path -> Arrays.stream(path.split("/"))).distinct().collect(Collectors.toList()); .flatMap(path -> Arrays.stream(path.split("/"))).distinct().collect(Collectors.toList());
emCodes.addAll(childrenEmCode); emCodes.addAll(childrenEmCode);
} }
return this.getEmInfoTree(deptId,parentCode,emCodes);
}
/**
* 获取设备树巡检对象选择专用
* @param deptId 机构ID
* @param parentCode 父设备编号
* @param emCodes 巡检项目设备编号集合
* @return 获取设备树
*/
private List<JSONObject> getEmInfoTree(Long deptId, String parentCode,List<String> emCodes) {
EmInfoEntity emInfo = this.getOne(Wrappers.<EmInfoEntity>lambdaQuery().eq(EmInfoEntity::getNumber, parentCode)); EmInfoEntity emInfo = this.getOne(Wrappers.<EmInfoEntity>lambdaQuery().eq(EmInfoEntity::getNumber, parentCode));
// 获取parentCode下的子设备集合 // 获取parentCode下的子设备集合
LambdaQueryWrapper<EmInfoEntity> queryWrapper = Wrappers.<EmInfoEntity>lambdaQuery() LambdaQueryWrapper<EmInfoEntity> queryWrapper = Wrappers.<EmInfoEntity>lambdaQuery()
@ -608,13 +619,12 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
List<JSONObject> result = emInfoList.stream().map(emInfoEntity -> { List<JSONObject> result = emInfoList.stream().map(emInfoEntity -> {
JSONObject object = JSONObject.parseObject(JSON.toJSONString(emInfoEntity)); JSONObject object = JSONObject.parseObject(JSON.toJSONString(emInfoEntity));
object.put("disabled", emCodes.contains(emInfoEntity.getNumber()) ? false : true); object.put("disabled", emCodes.contains(emInfoEntity.getNumber()) ? false : true);
object.put("children",this.getEmInfoTree(deptId,emInfoEntity.getNumber(),emCodes));
return object; return object;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return result; return result;
} }
/** /**
* 设备信息缓存(ctptinstalledCapacity监测点位) * 设备信息缓存(ctptinstalledCapacity监测点位)
*/ */

2
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java

@ -445,7 +445,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
diagnoseStatusVo.setMessage("诊断成功"); diagnoseStatusVo.setMessage("诊断成功");
diagnoseStatusVo.setData(nextstep.getData()); diagnoseStatusVo.setData(nextstep.getData());
r2.setData(diagnoseStatusVo); r2.setData(diagnoseStatusVo);
key = taskDTO.getId().toString(); // key = taskDTO.getId().toString();
redisTemplate.opsForValue().set(fdpReturnValuePath + "_" + key, JSONObject.toJSONString(r2)); redisTemplate.opsForValue().set(fdpReturnValuePath + "_" + key, JSONObject.toJSONString(r2));
redisTemplate.expire(fdpReturnValuePath + "_" + key, 30, TimeUnit.MINUTES); redisTemplate.expire(fdpReturnValuePath + "_" + key, 30, TimeUnit.MINUTES);
return nextstep; return nextstep;

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

@ -29,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, (60L * 1000L)); timer.schedule(myTimeTask, 2000L, 3600000L);
} }
} }

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

@ -21,6 +21,7 @@ import org.apache.xmlbeans.StringEnumAbstractBase;
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 java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@ -64,16 +65,21 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
Statistics statistics = this.getStatisticsBydateCalculated(sysLogStatisticsVo); Statistics statistics = this.getStatisticsBydateCalculated(sysLogStatisticsVo);
//如果为空保存数据,如果不为空更新数据 //如果为空保存数据,如果不为空更新数据
if (statistics == null) { if (statistics == null) {
log.info("执行功能应用统计保存操作....");
statistics = new Statistics(); statistics = new Statistics();
statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName())); statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName()));
statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime()); statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setModuleName(sysLogStatisticsVo.getModuleName()); statistics.setModuleName(sysLogStatisticsVo.getModuleName());
statistics.setCreateTime(LocalDateTime.now());
statistics.setUpdateTime(LocalDateTime.now());
this.save(statistics); this.save(statistics);
} else { } else {
log.info("执行功能应用统计更新操作....");
statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName())); statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName()));
statistics.setModuleName(sysLogStatisticsVo.getModuleName()); statistics.setModuleName(sysLogStatisticsVo.getModuleName());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setUpdateTime(LocalDateTime.now());
this.updateById(statistics); this.updateById(statistics);
} }
} }

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

@ -40,13 +40,4 @@ public class SysLogStatisticsVo {
private Integer moduleNameCount; private Integer moduleNameCount;
/**
* 根据路径统计
*/
private String path;
/**
* 根据路径统计
*/
private Integer pathCount;
} }

50
hzims-service/hzims-middle/src/main/resources/db/1.0.1.sql

@ -1 +1,49 @@
alter table hzims_workflow_operation_log add is_operation_log tinyint(1) comment '1 正常日志 0 错误日志'; alter table hzims_workflow_operation_log add is_operation_log tinyint(1) comment '1 正常日志 0 错误日志';
alter table hzims_statistics add sort int comment '排序';
create table log_options_module_name
(
id bigint primary key auto_increment,
module_name varchar(50) null comment '功能模块',
sort int comment '排序',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
is_deleted tinyint default 0 null comment '逻辑删除 (0 可用 1 删除)'
);
insert into log_options_module_name(module_name, sort)
values ('集中监控', 1),
('综合调度', 2),
('视频集中监控', 3),
('实时监控', 4),
('视频监控', 5),
('演示大屏', 6),
('生态监控', 7),
('数据分析', 9),
('数据查询', 10),
('通讯告警统计', 11),
('气象监测', 12),
('我的事务', 13),
('值班管理', 14),
('缺陷管理', 15),
('两票管理', 16),
('巡检管理', 17),
('日常维护', 18),
('检修管理', 19),
('数据填报', 20),
('安全管理', 21),
('设备管理', 22),
('资产管理', 23),
('智能诊断', 24),
('生产月报', 25),
('告警配置', 26),
('电站安全标准', 27),
('站点管理', 28),
('实时画面', 29),
('资源配置', 30),
('消息管理', 31),
('移动端配置', 32),
('水电站设置', 33),
('告警配置', 34);

1
hzims-service/hzims-middle/src/main/resources/db/1.0.2.sql

@ -1 +0,0 @@
alter table hzims_statistics add sort int comment '排序';

44
hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql

@ -1,44 +0,0 @@
create table log_options_module_name
(
id bigint primary key auto_increment,
module_name varchar(50) null comment '功能模块',
sort int comment '排序',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
is_deleted tinyint default 0 null comment '逻辑删除 (0 可用 1 删除)'
);
insert into log_options_module_name(module_name, sort)
values ('集中监控', 1),
('综合调度', 2),
('视频集中监控', 3),
('实时监控', 4),
('视频监控', 5),
('演示大屏', 6),
('生态监控', 7),
('数据分析', 9),
('数据查询', 10),
('通讯告警统计', 11),
('气象监测', 12),
('我的事务', 13),
('值班管理', 14),
('缺陷管理', 15),
('两票管理', 16),
('巡检管理', 17),
('日常维护', 18),
('检修管理', 19),
('数据填报', 20),
('安全管理', 21),
('设备管理', 22),
('资产管理', 23),
('智能诊断', 24),
('生产月报', 25),
('告警配置', 26),
('电站安全标准', 27),
('站点管理', 28),
('实时画面', 29),
('资源配置', 30),
('消息管理', 31),
('移动端配置', 32),
('水电站设置', 33),
('告警配置', 34);

15
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java

@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity;
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity;
import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest; import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest;
import com.hnac.hzinfo.inspect.obj.services.ProjectContentService;
import com.hnac.hzinfo.inspect.obj.services.ProjectService; import com.hnac.hzinfo.inspect.obj.services.ProjectService;
import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -16,11 +18,14 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @ClassName ProjectClient * @ClassName ProjectClient
@ -35,6 +40,7 @@ import java.util.List;
public class ProjectClient extends BladeController implements IProjectClient { public class ProjectClient extends BladeController implements IProjectClient {
private final ProjectService projectService; private final ProjectService projectService;
private final ProjectContentService projectContentService;
@Override @Override
@PostMapping(ADD_PROJECT_AND_CONTENT) @PostMapping(ADD_PROJECT_AND_CONTENT)
@ -55,8 +61,13 @@ public class ProjectClient extends BladeController implements IProjectClient {
@GetMapping(GET_EM_CODES_BY_DEPT_ID) @GetMapping(GET_EM_CODES_BY_DEPT_ID)
public R<List<String>> getEmCodesByDeptId(@RequestParam Long deptId) { public R<List<String>> getEmCodesByDeptId(@RequestParam Long deptId) {
QueryWrapper<ProjectEntity> queryWrapper = Wrappers.<ProjectEntity>query().eq("create_dept", deptId); QueryWrapper<ProjectEntity> queryWrapper = Wrappers.<ProjectEntity>query().eq("create_dept", deptId);
queryWrapper.select("distinct em_code emCode");
queryWrapper.ne("em_code","").isNotNull("em_code"); queryWrapper.ne("em_code","").isNotNull("em_code");
return R.data(projectService.listObjs(queryWrapper, String::valueOf)); List<ProjectEntity> projects = projectService.list(queryWrapper);
if(CollectionUtil.isNotEmpty(projects)) {
QueryWrapper<ProjectContentEntity> in = Wrappers.<ProjectContentEntity>query().select("distinct project_id").in("project_id", projects.stream().map(ProjectEntity::getId).collect(Collectors.toList()));
List<Long> projectIds = projectContentService.listObjs(in, Func::toLong);
return R.data(projects.stream().filter(project -> projectIds.contains(project.getId())).map(ProjectEntity::getEmCode).collect(Collectors.toList()));
}
return R.data(projects.stream().map(ProjectEntity::getEmCode).collect(Collectors.toList()));
} }
} }

7
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectServiceImpl.java

@ -276,10 +276,15 @@ public class ObjectServiceImpl extends BaseServiceImpl<InspectObjectMapper, Obje
project.setEmCode(emCode); project.setEmCode(emCode);
project.setStatus(ObjectConstants.ProjectEnableEnum.YES.getEnableType()); project.setStatus(ObjectConstants.ProjectEnableEnum.YES.getEnableType());
ProjectEntity one = projectService.getOne(project); ProjectEntity one = projectService.getOne(project);
// 剔除掉未绑定巡检内容的巡检项目
LambdaQueryWrapper<ProjectContentEntity> projectContentWrapper = Wrappers.<ProjectContentEntity>lambdaQuery().eq(ProjectContentEntity::getProjectId, one.getId());
if(CollectionUtil.isEmpty(projectContentService.list(projectContentWrapper))) {
return null;
}
return TemplateProjectEntity.builder().templateId(template.getId()).projectId(one.getId()).build(); return TemplateProjectEntity.builder().templateId(template.getId()).projectId(one.getId()).build();
}; };
List<TemplateProjectEntity> templateProjectList = Stream.iterate(0,n -> n + 1).limit(emCodeList.size()) List<TemplateProjectEntity> templateProjectList = Stream.iterate(0,n -> n + 1).limit(emCodeList.size())
.flatMap(index -> emInfoClient.getChildrenByEmCode(emCodeList.get(index)).getData().stream()).map(getTemplateProjectByEmCode).collect(Collectors.toList()); .flatMap(index -> emInfoClient.getChildrenByEmCode(emCodeList.get(index)).getData().stream()).map(getTemplateProjectByEmCode).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
templateProjectService.saveBatch(templateProjectList); templateProjectService.saveBatch(templateProjectList);
} }
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/PointDataVo.java

@ -42,4 +42,6 @@ public class PointDataVo {
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
private String signage; private String signage;
private String name;
} }

5
hzims-service/operational/src/main/resources/db/1.0.2.sql

@ -0,0 +1,5 @@
update hzims_oper_maintenance_task set flow_task_name = '待领用' where STATUS =1;
update hzims_oper_maintenance_task set flow_task_name = '待执行' where STATUS =2;
update hzims_oper_maintenance_task set flow_task_name = '待确认' where STATUS =3;
update hzims_oper_maintenance_task set flow_task_name = '待归档' where STATUS =4;
update hzims_oper_maintenance_task set flow_task_name = '结束' where STATUS =5;

28
hzims-service/ticket/src/main/resources/db/2.0.0.sql

@ -22,3 +22,31 @@ create table hzims_ticket_count
) )
comment '两票统计分析' row_format = DYNAMIC; comment '两票统计分析' row_format = DYNAMIC;
insert into hzims_work_ticket_finish(ticket_id, ground_num, brake_number)
select ticket_id, ground_switch_count,ground_wire_code
from hzims_work_ticket_flow;
alter table hzims_ticket_count add invalidated_ticket_num int null comment '废票数量';
# 工作票更新
update hzims_work_ticket_info set flow_task_name = '签发' where status = 1;
update hzims_work_ticket_info set flow_task_name = '收到工作票' where status = 2;
update hzims_work_ticket_info set flow_task_name = '许可人许可' where status = 3;
update hzims_work_ticket_info set flow_task_name = '确认条件具备' where status = 4;
update hzims_work_ticket_info set flow_task_name = '工作负责人确认工作' where status = 5;
update hzims_work_ticket_info set flow_task_name = '许可人确认工作结束' where status = 6;
update hzims_work_ticket_info set flow_task_name = '工作票终结' where status = 7;
update hzims_work_ticket_info set flow_task_name = '许可人延期确认' where status = 9;
update hzims_work_ticket_info set flow_task_name = '负责人延期确认' where status = 10;
update hzims_work_ticket_info set flow_task_name = '作废' where status = 11;
update hzims_work_ticket_info set flow_task_name = '逾期' where status = 12;
# 操作票更新
update hzims_standard_ticket_info set flow_task_name = '待监护人确认' where status = 1;
update hzims_standard_ticket_info set flow_task_name = '待值班负责人确认' where status = 2;
update hzims_standard_ticket_info set flow_task_name = '结束' where status = 3;
update hzims_standard_ticket_info set flow_task_name = '终止' where status = 4;
alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量';
alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率';

3
hzims-service/ticket/src/main/resources/db/2.0.1.sql

@ -1,3 +0,0 @@
insert into hzims_work_ticket_finish(ticket_id, ground_num, brake_number)
select ticket_id, ground_switch_count,ground_wire_code
from hzims_work_ticket_flow;

1
hzims-service/ticket/src/main/resources/db/2.0.2.sql

@ -1 +0,0 @@
alter table hzims_ticket_count add invalidated_ticket_num int null comment '废票数量';

18
hzims-service/ticket/src/main/resources/db/2.0.3.sql

@ -1,18 +0,0 @@
# 工作票更新
update hzims_work_ticket_info set flow_task_name = '签发' where status = 1;
update hzims_work_ticket_info set flow_task_name = '收到工作票' where status = 2;
update hzims_work_ticket_info set flow_task_name = '许可人许可' where status = 3;
update hzims_work_ticket_info set flow_task_name = '确认条件具备' where status = 4;
update hzims_work_ticket_info set flow_task_name = '工作负责人确认工作' where status = 5;
update hzims_work_ticket_info set flow_task_name = '许可人确认工作结束' where status = 6;
update hzims_work_ticket_info set flow_task_name = '工作票终结' where status = 7;
update hzims_work_ticket_info set flow_task_name = '许可人延期确认' where status = 9;
update hzims_work_ticket_info set flow_task_name = '负责人延期确认' where status = 10;
update hzims_work_ticket_info set flow_task_name = '作废' where status = 11;
update hzims_work_ticket_info set flow_task_name = '逾期' where status = 12;
# 操作票更新
update hzims_standard_ticket_info set flow_task_name = '待监护人确认' where status = 1;
update hzims_standard_ticket_info set flow_task_name = '待值班负责人确认' where status = 2;
update hzims_standard_ticket_info set flow_task_name = '结束' where status = 3;
update hzims_standard_ticket_info set flow_task_name = '终止' where status = 4;

2
hzims-service/ticket/src/main/resources/db/2.0.4.sql

@ -1,2 +0,0 @@
alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量';
alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率';
Loading…
Cancel
Save