From ba0e8b52d07858dd86c989631d20ea88471486ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Thu, 27 Jul 2023 09:09:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8E=92=E5=BA=8F=E8=A7=84=E5=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/middle/processflow/CodeGenerator.java | 14 +++---- .../service/impl/StatisticsServiceImpl.java | 32 ++++++++++------ .../middle/systemlog/vo/SysLogStatisticsVo.java | 2 +- .../hzims-middle/src/main/resources/db/1.0.3.sql | 44 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java index e7e9f35..f4efe10 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java +++ b/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.InjectionConfig; @@ -24,7 +24,7 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // // 全局配置 // 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.setAuthor("dfy"); // gc.setOpen(false); @@ -33,7 +33,7 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // // 数据源配置 // 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.setDriverName("com.mysql.cj.jdbc.Driver"); // dsc.setUsername("root"); @@ -42,8 +42,8 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // // 包配置 // PackageConfig pc = new PackageConfig(); -// pc.setModuleName("p"); -// pc.setParent("com.hnac.hzims.ticket"); +// pc.setModuleName("systemlog"); +// pc.setParent("com.hnac.hzims.middle"); // mpg.setPackageInfo(pc); // // // 自定义配置 @@ -93,9 +93,9 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!"); // // 写于父类中的公共字段 // // strategy.setSuperEntityColumns("id"); -// strategy.setInclude("hzims_work_ticket_finish"); +// strategy.setInclude("log_options_module_name"); // strategy.setControllerMappingHyphenStyle(true); -// strategy.setTablePrefix("hzims_"); +// // strategy.setTablePrefix("hzims_"); // mpg.setStrategy(strategy); // // mpg.setTemplateEngine(new FreemarkerTemplateEngine()); // mpg.execute(); diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java index 4e1fb0c..94c7d4e 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java +++ b/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; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.mapper.StatisticsMapper; +import com.hnac.hzims.middle.systemlog.service.ILogOptionsModuleNameService; import com.hnac.hzims.middle.systemlog.service.StatisticsService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.middle.systemlog.service.SysLogService; @@ -37,6 +40,8 @@ public class StatisticsServiceImpl extends ServiceImpl moduleNames = Lists.newArrayList("集中监控", - "综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控", - "数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理", - "缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理", - "资产管理", "智能诊断", "生产月报", "告警配置","电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理", - "移动端配置", "水电站管理", "告警配置"); + private int getModuleName(String moduleName) { + // List moduleNames = Lists.newArrayList("集中监控", + // "综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控", + // "数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理", + // "缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理", + // "资产管理", "智能诊断", "生产月报", "告警配置", "电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理", + // "移动端配置", "水电站管理", "告警配置"); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.orderByAsc(LogOptionsModuleName::getSort); + List moduleNames = logOptionsModuleNameService.list(queryWrapper); int result = 0; for (int i = 0; i < moduleNames.size(); i++) { - String name = moduleNames.get(i); - if (name.equals(moduleName)) { - result = i + 1; + LogOptionsModuleName logOptionsModuleName = moduleNames.get(i); + if (logOptionsModuleName.getModuleName().equals(moduleName)) { + result = logOptionsModuleName.getSort(); break; } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java index 943c6e5..cecb7a6 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java +++ b/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 String moduleName; /** diff --git a/hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql b/hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql new file mode 100644 index 0000000..2e351c5 --- /dev/null +++ b/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); From 59dd3f6036a95636b8fd36a2350943bd19c36297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Thu, 27 Jul 2023 09:11:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8E=92=E5=BA=8F=E8=A7=84=E5=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LogOptionsModuleNameController.java | 21 ++++++++ .../systemlog/entity/LogOptionsModuleName.java | 63 ++++++++++++++++++++++ .../mapper/LogOptionsModuleNameMapper.java | 16 ++++++ .../mapper/LogOptionsModuleNameMapper.xml | 5 ++ .../service/ILogOptionsModuleNameService.java | 16 ++++++ .../impl/LogOptionsModuleNameServiceImpl.java | 20 +++++++ 6 files changed, 141 insertions(+) create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/LogOptionsModuleNameController.java create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/LogOptionsModuleName.java create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.java create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.xml create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/ILogOptionsModuleNameService.java create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/LogOptionsModuleNameServiceImpl.java diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/LogOptionsModuleNameController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/LogOptionsModuleNameController.java new file mode 100644 index 0000000..e4f3e25 --- /dev/null +++ b/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; + +/** + *

+ * 前端控制器 + *

+ * + * @author dfy + * @since 2023-07-27 + */ +@RestController +@RequestMapping("/systemlog/log-options-module-name") +public class LogOptionsModuleNameController { + +} + diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/LogOptionsModuleName.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/LogOptionsModuleName.java new file mode 100644 index 0000000..4954141 --- /dev/null +++ b/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; + +/** + *

+ * + *

+ * + * @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; + + +} diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.java new file mode 100644 index 0000000..30611fa --- /dev/null +++ b/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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author dfy + * @since 2023-07-27 + */ +public interface LogOptionsModuleNameMapper extends BaseMapper { + +} diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.xml b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.xml new file mode 100644 index 0000000..a17596b --- /dev/null +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/LogOptionsModuleNameMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/ILogOptionsModuleNameService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/ILogOptionsModuleNameService.java new file mode 100644 index 0000000..1a5b79e2 --- /dev/null +++ b/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; + +/** + *

+ * 服务类 + *

+ * + * @author dfy + * @since 2023-07-27 + */ +public interface ILogOptionsModuleNameService extends IService { + +} diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/LogOptionsModuleNameServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/LogOptionsModuleNameServiceImpl.java new file mode 100644 index 0000000..19dd9df --- /dev/null +++ b/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; + +/** + *

+ * 服务实现类 + *

+ * + * @author dfy + * @since 2023-07-27 + */ +@Service +public class LogOptionsModuleNameServiceImpl extends ServiceImpl implements ILogOptionsModuleNameService { + +} From 53705a9f1c53b31c8eb3c3bd5875487b41fd9f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Thu, 27 Jul 2023 16:29:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=A5=A8=E9=94=99=E7=A5=A8=E5=8F=8A=E5=BA=9F=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../twoTicket/service/impl/TicketProcessServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 4ca47ff..1d8c7fa 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/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.entity.User; import org.springblade.system.user.feign.IUserClient; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -497,6 +498,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param response */ private void saveWorkTicket(WorkTicketInfoEntity workTicket, ProcessWorkFlowResponse response) { + String flowTaskName = workTicket.getFlowTaskName(); String flowDescription = ""; //如果response.getHandleType() 是0使用户 if ("0".equals(response.getHandleType())) { @@ -534,11 +536,12 @@ public class TicketProcessServiceImpl implements TicketProcessService { workTicket.setFlowDescription(flowDescription); } + //如果签发人为false if (workTicket.getSignFlag() != null) { if (!workTicket.getSignFlag()) { - workTicket.setFlowDescription("errancy"); - workTicket.setFlowTaskName("errancy"); + workTicket.setFlowDescription(flowTaskName); + workTicket.setFlowTaskName(flowTaskName); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); } @@ -548,8 +551,8 @@ public class TicketProcessServiceImpl implements TicketProcessService { //运行人员false if (workTicket.getRecieveFlag() != null) { if (!workTicket.getRecieveFlag()) { - workTicket.setFlowDescription("errancy"); - workTicket.setFlowTaskName("errancy"); + workTicket.setFlowDescription(flowTaskName); + workTicket.setFlowTaskName(flowTaskName); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); }