Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
169bfa1c02
  1. 14
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java
  2. 21
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/LogOptionsModuleNameController.java
  3. 63
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/LogOptionsModuleName.java
  4. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.java
  5. 5
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.xml
  6. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/ILogOptionsModuleNameService.java
  7. 20
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/LogOptionsModuleNameServiceImpl.java
  8. 32
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  9. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java
  10. 44
      hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql
  11. 11
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

14
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java

@ -1,4 +1,4 @@
package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.processflow; // package com.hnac.hzims.middle.processflow;
// //
// import com.baomidou.mybatisplus.generator.AutoGenerator; // import com.baomidou.mybatisplus.generator.AutoGenerator;
// import com.baomidou.mybatisplus.generator.InjectionConfig; // import com.baomidou.mybatisplus.generator.InjectionConfig;
@ -24,7 +24,7 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce
// //
// // 全局配置 // // 全局配置
// GlobalConfig gc = new GlobalConfig(); // GlobalConfig gc = new GlobalConfig();
// String projectPath = System.getProperty("user.dir") + "/hzims-service/ticket"; // String projectPath = System.getProperty("user.dir") + "/hzims-service/hzims-middle";
// gc.setOutputDir(projectPath + "/src/main/java"); // gc.setOutputDir(projectPath + "/src/main/java");
// gc.setAuthor("dfy"); // gc.setAuthor("dfy");
// gc.setOpen(false); // gc.setOpen(false);
@ -33,7 +33,7 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce
// //
// // 数据源配置 // // 数据源配置
// DataSourceConfig dsc = new DataSourceConfig(); // DataSourceConfig dsc = new DataSourceConfig();
// dsc.setUrl("jdbc:mysql://192.168.1.20:3576/dev_hzims_ticket?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"); // dsc.setUrl("jdbc:mysql://192.168.1.20:3576/dev_hzims_middle?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true");
// // dsc.setSchemaName("public"); // // dsc.setSchemaName("public");
// dsc.setDriverName("com.mysql.cj.jdbc.Driver"); // dsc.setDriverName("com.mysql.cj.jdbc.Driver");
// dsc.setUsername("root"); // dsc.setUsername("root");
@ -42,8 +42,8 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce
// //
// // 包配置 // // 包配置
// PackageConfig pc = new PackageConfig(); // PackageConfig pc = new PackageConfig();
// pc.setModuleName("p"); // pc.setModuleName("systemlog");
// pc.setParent("com.hnac.hzims.ticket"); // pc.setParent("com.hnac.hzims.middle");
// mpg.setPackageInfo(pc); // mpg.setPackageInfo(pc);
// //
// // 自定义配置 // // 自定义配置
@ -93,9 +93,9 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce
// // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!"); // // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// // 写于父类中的公共字段 // // 写于父类中的公共字段
// // strategy.setSuperEntityColumns("id"); // // strategy.setSuperEntityColumns("id");
// strategy.setInclude("hzims_work_ticket_finish"); // strategy.setInclude("log_options_module_name");
// strategy.setControllerMappingHyphenStyle(true); // strategy.setControllerMappingHyphenStyle(true);
// strategy.setTablePrefix("hzims_"); // // strategy.setTablePrefix("hzims_");
// mpg.setStrategy(strategy); // mpg.setStrategy(strategy);
// // mpg.setTemplateEngine(new FreemarkerTemplateEngine()); // // mpg.setTemplateEngine(new FreemarkerTemplateEngine());
// mpg.execute(); // mpg.execute();

21
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/LogOptionsModuleNameController.java

@ -0,0 +1,21 @@
package com.hnac.hzims.middle.systemlog.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author dfy
* @since 2023-07-27
*/
@RestController
@RequestMapping("/systemlog/log-options-module-name")
public class LogOptionsModuleNameController {
}

63
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/LogOptionsModuleName.java

@ -0,0 +1,63 @@
package com.hnac.hzims.middle.systemlog.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author dfy
* @since 2023-07-27
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("log_options_module_name")
public class LogOptionsModuleName implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 功能模块
*/
@TableField("module_name")
private String moduleName;
/**
* 排序
*/
@TableField("sort")
private Integer sort;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 更新时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
/**
* 逻辑删除 0 可用 1 删除
*/
@TableField("is_deleted")
private Integer isDeleted;
}

16
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.java

@ -0,0 +1,16 @@
package com.hnac.hzims.middle.systemlog.mapper;
import com.hnac.hzims.middle.systemlog.entity.LogOptionsModuleName;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dfy
* @since 2023-07-27
*/
public interface LogOptionsModuleNameMapper extends BaseMapper<LogOptionsModuleName> {
}

5
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.xml

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

16
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/ILogOptionsModuleNameService.java

@ -0,0 +1,16 @@
package com.hnac.hzims.middle.systemlog.service;
import com.hnac.hzims.middle.systemlog.entity.LogOptionsModuleName;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author dfy
* @since 2023-07-27
*/
public interface ILogOptionsModuleNameService extends IService<LogOptionsModuleName> {
}

20
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/LogOptionsModuleNameServiceImpl.java

@ -0,0 +1,20 @@
package com.hnac.hzims.middle.systemlog.service.impl;
import com.hnac.hzims.middle.systemlog.entity.LogOptionsModuleName;
import com.hnac.hzims.middle.systemlog.mapper.LogOptionsModuleNameMapper;
import com.hnac.hzims.middle.systemlog.service.ILogOptionsModuleNameService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author dfy
* @since 2023-07-27
*/
@Service
public class LogOptionsModuleNameServiceImpl extends ServiceImpl<LogOptionsModuleNameMapper, LogOptionsModuleName> implements ILogOptionsModuleNameService {
}

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

@ -1,11 +1,14 @@
package com.hnac.hzims.middle.systemlog.service.impl; package com.hnac.hzims.middle.systemlog.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.hnac.hzims.middle.systemlog.entity.LogOptionsModuleName;
import com.hnac.hzims.middle.systemlog.entity.Statistics; import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.hnac.hzims.middle.systemlog.mapper.StatisticsMapper; import com.hnac.hzims.middle.systemlog.mapper.StatisticsMapper;
import com.hnac.hzims.middle.systemlog.service.ILogOptionsModuleNameService;
import com.hnac.hzims.middle.systemlog.service.StatisticsService; import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.middle.systemlog.service.SysLogService; import com.hnac.hzims.middle.systemlog.service.SysLogService;
@ -37,6 +40,8 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
@Autowired @Autowired
private SysLogService sysLogService; private SysLogService sysLogService;
@Autowired
private ILogOptionsModuleNameService logOptionsModuleNameService;
/** /**
* 保存统计的数据 * 保存统计的数据
@ -60,13 +65,13 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
//如果为空保存数据,如果不为空更新数据 //如果为空保存数据,如果不为空更新数据
if (statistics == null) { if (statistics == null) {
statistics = new Statistics(); statistics = new Statistics();
statistics.setSort(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());
this.save(statistics); this.save(statistics);
} else { } else {
statistics.setSort(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());
this.updateById(statistics); this.updateById(statistics);
@ -111,18 +116,21 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
/** /**
* 排序 * 排序
*/ */
private static int getModuleName(String moduleName) { private int getModuleName(String moduleName) {
List<String> moduleNames = Lists.newArrayList("集中监控", // List<String> moduleNames = Lists.newArrayList("集中监控",
"综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控", // "综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控",
"数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理", // "数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理",
"缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理", // "缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理",
"资产管理", "智能诊断", "生产月报", "告警配置","电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理", // "资产管理", "智能诊断", "生产月报", "告警配置", "电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理",
"移动端配置", "水电站管理", "告警配置"); // "移动端配置", "水电站管理", "告警配置");
LambdaQueryWrapper<LogOptionsModuleName> queryWrapper = new LambdaQueryWrapper<LogOptionsModuleName>();
queryWrapper.orderByAsc(LogOptionsModuleName::getSort);
List<LogOptionsModuleName> moduleNames = logOptionsModuleNameService.list(queryWrapper);
int result = 0; int result = 0;
for (int i = 0; i < moduleNames.size(); i++) { for (int i = 0; i < moduleNames.size(); i++) {
String name = moduleNames.get(i); LogOptionsModuleName logOptionsModuleName = moduleNames.get(i);
if (name.equals(moduleName)) { if (logOptionsModuleName.getModuleName().equals(moduleName)) {
result = i + 1; result = logOptionsModuleName.getSort();
break; break;
} }
} }

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

@ -31,7 +31,7 @@ public class SysLogStatisticsVo {
private Integer titleCount; private Integer titleCount;
/** /**
* 操作类型统计 * 操作类型
*/ */
private String moduleName; private String moduleName;
/** /**

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

@ -0,0 +1,44 @@
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);

11
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -59,6 +59,7 @@ import org.springblade.system.feign.ISysClient;
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.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -497,6 +498,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
* @param response * @param response
*/ */
private void saveWorkTicket(WorkTicketInfoEntity workTicket, ProcessWorkFlowResponse response) { private void saveWorkTicket(WorkTicketInfoEntity workTicket, ProcessWorkFlowResponse response) {
String flowTaskName = workTicket.getFlowTaskName();
String flowDescription = ""; String flowDescription = "";
//如果response.getHandleType() 是0使用户 //如果response.getHandleType() 是0使用户
if ("0".equals(response.getHandleType())) { if ("0".equals(response.getHandleType())) {
@ -534,11 +536,12 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicket.setFlowDescription(flowDescription); workTicket.setFlowDescription(flowDescription);
} }
//如果签发人为false //如果签发人为false
if (workTicket.getSignFlag() != null) { if (workTicket.getSignFlag() != null) {
if (!workTicket.getSignFlag()) { if (!workTicket.getSignFlag()) {
workTicket.setFlowDescription("errancy"); workTicket.setFlowDescription(flowTaskName);
workTicket.setFlowTaskName("errancy"); workTicket.setFlowTaskName(flowTaskName);
workTicket.setNextStepOperator(" "); workTicket.setNextStepOperator(" ");
workTicket.setStepOperator(" "); workTicket.setStepOperator(" ");
} }
@ -548,8 +551,8 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//运行人员false //运行人员false
if (workTicket.getRecieveFlag() != null) { if (workTicket.getRecieveFlag() != null) {
if (!workTicket.getRecieveFlag()) { if (!workTicket.getRecieveFlag()) {
workTicket.setFlowDescription("errancy"); workTicket.setFlowDescription(flowTaskName);
workTicket.setFlowTaskName("errancy"); workTicket.setFlowTaskName(flowTaskName);
workTicket.setNextStepOperator(" "); workTicket.setNextStepOperator(" ");
workTicket.setStepOperator(" "); workTicket.setStepOperator(" ");
} }

Loading…
Cancel
Save