Browse Source

水电生产运行数据 操作票分页列表详情

zhongwei
段飞宇 2 years ago
parent
commit
f59a0ee86c
  1. 32
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/TicketFeignClient.java
  2. 30
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/fallback/StandardTicketInfoFeignClient.java
  3. 28
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/AreaMonthlyVo.java
  4. 71
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/StandardTicketVo.java
  5. 208
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/mybatisplus/CodeGenerator.java
  6. 11
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/SysLogConfig.java
  7. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java
  8. 0
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/StatisticsMapper.xml
  9. 10
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java
  10. 13
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml
  11. 9
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/StatisticsService.java
  12. 8
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java
  13. 47
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  14. 12
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java
  15. 5
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/task/SyslogTimerTask.java
  16. 36
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java
  17. 4
      hzims-service/hzims-middle/src/main/resources/application.yml
  18. 5
      hzims-service/hzims-middle/src/main/resources/mapper/SysLogMapper.xml
  19. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java
  20. 33
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/IPageDeserializer.java
  21. 52
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/WebDataConvertConfig.java
  22. 52
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java
  23. 24
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/AreaMonthlyDetailsService.java
  24. 48
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthlyDetailsServiceImpl.java
  25. 2
      hzims-service/operational/src/main/resources/application-dev.yml
  26. 4
      hzims-service/ticket/pom.xml
  27. 208
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java
  28. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
  29. 10
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java
  30. 10
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/WorkflowOperationLog.java
  31. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java
  32. 22
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  33. 16
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java
  34. 51
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  35. 22
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  36. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/TicketInfoClient.java

32
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/TicketFeignClient.java

@ -0,0 +1,32 @@
package com.hnac.hzims.ticket.areamonthly.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.feign.fallback.StandardTicketInfoFeignClient;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 13:39
*/
@FeignClient(value = "hzims-ticket", fallback = StandardTicketInfoFeignClient.class)
public interface TicketFeignClient {
/**
* 根据月份区域 获取操作详情数据
*
* @return
*/
@GetMapping("/standard/ticket/areaMonthlyWithOperation/{page}/{size}")
R<IPage<StandardTicketVo>> areaMonthlyWithOperation(@PathVariable("page") Long page,
@PathVariable("size") Long size,
@SpringQueryMap AreaMonthlyVo areaMonthlyV);
}

30
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/fallback/StandardTicketInfoFeignClient.java

@ -0,0 +1,30 @@
package com.hnac.hzims.ticket.areamonthly.feign.fallback;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.feign.TicketFeignClient;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 17:24
*/
@Service
public class StandardTicketInfoFeignClient implements TicketFeignClient {
/**
* 根据月份区域 获取操作详情数据
*
* @param page
* @param size
* @return
*/
@Override
public R<IPage<StandardTicketVo>> areaMonthlyWithOperation(Long page, Long size, AreaMonthlyVo areaMonthlyV) {
return R.fail("远程调用失败");
}
}

28
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/vo/AreaMonthlyVo.java

@ -0,0 +1,28 @@
package com.hnac.hzims.ticket.areamonthly.vo;
import lombok.Data;
import java.time.YearMonth;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 11:28
*/
@Data
public class AreaMonthlyVo {
/**
* 区域编号
*/
private String areaId;
/**
* 月份
*/
private YearMonth YearMonth;
}

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

@ -0,0 +1,71 @@
package com.hnac.hzims.ticket.areamonthly;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.mp.support.SqlCondition;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 17:06
*/
@EqualsAndHashCode
@Data
public class StandardTicketVo implements Serializable {
private static final long serialVersionUID = -8870464581684939369L;
/**
* 开票种类
*/
private String ticketType;
/**
* 单位
*/
private String company;
/**
* 编号
*/
private String code;
/**
* 开票来源
*/
private String taskType;
/**
* 开票任务来源
*/
private String taskName;
/**
* 发令人
*/
private Long issueOrderPerson;
/**
* 受令人
*/
private Long accessOrderPerson;
/**
* 监护人
*/
private String guardian;
/**
* 值班负责人
*/
private Long principal;
/**
* 开票时间
*/
private Date createTime;
}

208
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/mybatisplus/CodeGenerator.java

@ -1,104 +1,104 @@
package com.hnac.hzims.middle.mybatisplus;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import java.util.ArrayList;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/4 9:07
*/
public class CodeGenerator {
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir") + "/hzims-service/hzims-middle";
gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("dfy");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
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");
dsc.setPassword("123");
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName("systemlog");
pc.setParent("com.hnac.hzims.middle");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
// String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
// 配置自定义输出模板
//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// templateConfig.setEntity("templates/entity2.java");
// templateConfig.setService();
// templateConfig.setController();
// templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setEntityBooleanColumnRemoveIsPrefix(true);
strategy.setEntityLombokModel(true);
strategy.setEntitySerialVersionUID(true);
strategy.setChainModel(true);
strategy.setEntityTableFieldAnnotationEnable(true);
// strategy.setFieldPrefix("hzims_");
// 公共父类
// strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// 写于父类中的公共字段
// strategy.setSuperEntityColumns("id");
strategy.setInclude("hzims_statistics");
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix("hzims_");
mpg.setStrategy(strategy);
// mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}
// package com.hnac.hzims.middle.mybatisplus;
//
// import com.baomidou.mybatisplus.generator.AutoGenerator;
// import com.baomidou.mybatisplus.generator.InjectionConfig;
// import com.baomidou.mybatisplus.generator.config.*;
// import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
//
// import java.util.ArrayList;
// import java.util.List;
//
// /**
// * @Author WL
// * @Version v1.0
// * @Serial 1.0
// * @Date 2023/4/4 9:07
// */
// public class CodeGenerator {
//
//
// public static void main(String[] args) {
// // 代码生成器
// AutoGenerator mpg = new AutoGenerator();
//
// // 全局配置
// GlobalConfig gc = new GlobalConfig();
// String projectPath = System.getProperty("user.dir") + "/hzims-service/hzims-middle";
// gc.setOutputDir(projectPath + "/src/main/java");
// gc.setAuthor("dfy");
// gc.setOpen(false);
// // gc.setSwagger2(true); 实体属性 Swagger2 注解
// mpg.setGlobalConfig(gc);
//
// // 数据源配置
// DataSourceConfig dsc = new DataSourceConfig();
// 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");
// dsc.setPassword("123");
// mpg.setDataSource(dsc);
//
// // 包配置
// PackageConfig pc = new PackageConfig();
// pc.setModuleName("systemlog");
// pc.setParent("com.hnac.hzims.middle");
// mpg.setPackageInfo(pc);
//
// // 自定义配置
// InjectionConfig cfg = new InjectionConfig() {
// @Override
// public void initMap() {
// // to do nothing
// }
// };
//
// // 如果模板引擎是 freemarker
// String templatePath = "/templates/mapper.xml.ftl";
// // 如果模板引擎是 velocity
// // String templatePath = "/templates/mapper.xml.vm";
//
// // 自定义输出配置
// List<FileOutConfig> focList = new ArrayList<>();
// cfg.setFileOutConfigList(focList);
// mpg.setCfg(cfg);
//
// // 配置模板
// TemplateConfig templateConfig = new TemplateConfig();
//
// // 配置自定义输出模板
// //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// // templateConfig.setEntity("templates/entity2.java");
// // templateConfig.setService();
// // templateConfig.setController();
//
// // templateConfig.setXml(null);
// mpg.setTemplate(templateConfig);
//
// // 策略配置
// StrategyConfig strategy = new StrategyConfig();
// strategy.setNaming(NamingStrategy.underline_to_camel);
// strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// // strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
// strategy.setEntityLombokModel(true);
// strategy.setRestControllerStyle(true);
// strategy.setEntityBooleanColumnRemoveIsPrefix(true);
// strategy.setEntityLombokModel(true);
// strategy.setEntitySerialVersionUID(true);
// strategy.setChainModel(true);
// strategy.setEntityTableFieldAnnotationEnable(true);
// // strategy.setFieldPrefix("hzims_");
// // 公共父类
// // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// // 写于父类中的公共字段
// // strategy.setSuperEntityColumns("id");
// strategy.setInclude("hzims_statistics");
// strategy.setControllerMappingHyphenStyle(true);
// strategy.setTablePrefix("hzims_");
// mpg.setStrategy(strategy);
// // mpg.setTemplateEngine(new FreemarkerTemplateEngine());
// mpg.execute();
// }
//
// }
//

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

@ -1,6 +1,8 @@
package com.hnac.hzims.middle.systemlog.config;
import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.hnac.hzims.middle.systemlog.task.SyslogTimerTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -15,15 +17,18 @@ import java.util.Timer;
@Configuration
public class SysLogConfig {
@Autowired
private StatisticsService statisticsService;
@Bean
public void syslogTimer() {
//1.创建一个timer实例
Timer timer = new Timer();
//2.创建一个SyslogTimerTask实例
SyslogTimerTask myTimeTask = new SyslogTimerTask();
SyslogTimerTask myTimeTask = new SyslogTimerTask(statisticsService);
//3.通过timer定时定频率调用SyslogTimerTask的业务逻辑
// 即 第一次执行是在当前时间的两秒之后,之后每隔30秒钟执行一次
timer.schedule(myTimeTask,2000L,30000L);
// 即 第一次执行是在当前时间的两秒之后,之后每隔3秒钟执行一次
timer.schedule(myTimeTask,2000L,10000L);
}
}

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.time.YearMonth;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

0
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/xml/StatisticsMapper.xml → hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/StatisticsMapper.xml

10
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java

@ -2,6 +2,9 @@ package com.hnac.hzims.middle.systemlog.mapper;
import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo;
import java.util.List;
/**
* <p>
@ -13,4 +16,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SysLogMapper extends BaseMapper<SysLog> {
/**
* 查询统计的数据
* @return
*/
List<SysLogStatisticsVo> countStatistics();
}

13
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml

@ -0,0 +1,13 @@
<?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.SysLogMapper">
<select id="countStatistics" resultType="com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo">
select date_format(operation_time, '%Y-%m-%d') operationTime,
count(title) titleCount,
count(module_name) moduleNameCount,
count(path) pathCount
from hzims_sys_log
group by operationTime;
</select>
</mapper>

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

@ -3,6 +3,8 @@ package com.hnac.hzims.middle.systemlog.service;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.baomidou.mybatisplus.extension.service.IService;
import java.time.YearMonth;
/**
* <p>
* 操作日志统计数据 服务类
@ -17,4 +19,11 @@ public interface StatisticsService extends IService<Statistics> {
* 保存统计的数据
*/
void saveCountStatistics();
/**
* 根据时间查询数据
* @param operationTime
* @return
*/
Statistics getStatisticsBydateCalculated(String operationTime);
}

8
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java

@ -2,6 +2,9 @@ package com.hnac.hzims.middle.systemlog.service;
import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo;
import java.util.List;
/**
* <p>
@ -13,4 +16,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface SysLogService extends IService<SysLog> {
/**
* 查询统计的数据
* @return
*/
List<SysLogStatisticsVo> countStatistics();
}

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

@ -1,13 +1,18 @@
package com.hnac.hzims.middle.systemlog.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.hnac.hzims.middle.systemlog.mapper.StatisticsMapper;
import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.YearMonth;
import java.util.List;
/**
* <p>
* 操作日志统计数据 服务实现类
@ -22,13 +27,53 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
@Autowired
private SysLogService sysLogService;
@Autowired
private StatisticsService statisticsService;
/**
* 保存统计的数据
*/
@Override
public void saveCountStatistics() {
//1. 保存操作模块的数据
//1. 查询统计的数据
List<SysLogStatisticsVo> sysLogStatisticsVoList = sysLogService.countStatistics();
System.out.println(sysLogStatisticsVoList);
//2. 保存数据
if (sysLogStatisticsVoList == null) {
return;
}
for (SysLogStatisticsVo sysLogStatisticsVo : sysLogStatisticsVoList) {
//查询数据
Statistics statistics = statisticsService.getStatisticsBydateCalculated(sysLogStatisticsVo.getOperationTime());
//如果为空保存数据,如果不为空更新数据
if (statistics == null) {
statistics = new Statistics();
statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setTitleNum(sysLogStatisticsVo.getTitleCount());
statistics.setPathNum(sysLogStatisticsVo.getPathCount());
statisticsService.save(statistics);
}else {
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setTitleNum(sysLogStatisticsVo.getTitleCount());
statistics.setPathNum(sysLogStatisticsVo.getPathCount());
statisticsService.updateById(statistics);
}
}
}
/**
* 根据时间查询数据
*
* @param operationTime
* @return
*/
@Override
public Statistics getStatisticsBydateCalculated(String operationTime) {
QueryWrapper<Statistics> statisticsQueryWrapper = new QueryWrapper<>();
statisticsQueryWrapper.eq("date_calculated", operationTime);
return baseMapper.selectOne(statisticsQueryWrapper);
}
}

12
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java

@ -4,8 +4,11 @@ import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.hnac.hzims.middle.systemlog.mapper.SysLogMapper;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
@ -17,4 +20,13 @@ import org.springframework.stereotype.Service;
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
/**
* 查询统计的数据
*
* @return
*/
@Override
public List<SysLogStatisticsVo> countStatistics() {
return baseMapper.countStatistics();
}
}

5
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/task/SyslogTimerTask.java

@ -2,6 +2,7 @@ package com.hnac.hzims.middle.systemlog.task;
import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -13,11 +14,10 @@ import java.util.TimerTask;
* @Serial 1.0
* @Date 2023/4/8 14:13
*/
@Component
@AllArgsConstructor
public class SyslogTimerTask extends TimerTask {
@Autowired
private StatisticsService statisticsService;
/**
@ -26,6 +26,7 @@ public class SyslogTimerTask extends TimerTask {
@Override
public void run() {
//保存统计的数据
System.out.println("保存统计的数据");
statisticsService.saveCountStatistics();
}
}

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

@ -0,0 +1,36 @@
package com.hnac.hzims.middle.systemlog.vo;
import lombok.Data;
import java.time.YearMonth;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 9:03
*/
@Data
public class SysLogStatisticsVo {
/**
* 操作时间
*/
private String operationTime;
/**
* 操作模块统计
*/
private Integer titleCount;
/**
* 操作类型统计
*/
private Integer moduleNameCount;
/**
* 根据路径统计
*/
private Integer pathCount;
}

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

@ -15,9 +15,7 @@ spring:
#mybatis-plus配置
mybatis-plus:
mapper-locations:
- classpath:com/hnac/hzims/**/mapper/*Mapper.xml
- classpath:/mapper/*Mapper.xml
mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity

5
hzims-service/hzims-middle/src/main/resources/mapper/SysLogMapper.xml

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

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

@ -22,6 +22,7 @@ import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

33
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/IPageDeserializer.java

@ -0,0 +1,33 @@
package com.hnac.hzims.operational.main.config;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 16:12
*/
public class IPageDeserializer extends StdDeserializer<IPage> {
protected IPageDeserializer(Class<?> vc) {
super(vc);
}
@Override
public IPage deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException {
JsonNode node = jsonParser.getCodec().readTree(jsonParser);
String s = node.toString();
ObjectMapper om = new ObjectMapper();
Page page = om.readValue(s,Page.class);
return page;
}
}

52
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/WebDataConvertConfig.java

@ -0,0 +1,52 @@
package com.hnac.hzims.operational.main.config;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import java.util.Arrays;
import java.util.List;
/**
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 16:11
*/
@Configuration
public class WebDataConvertConfig extends WebMvcConfigurationSupport {
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(mappingJackson2HttpMessageConverter());
super.configureMessageConverters(converters);
}
@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SimpleModule module = new SimpleModule();
module.addDeserializer(IPage.class, new IPageDeserializer(IPage.class));
mapper.registerModule(module);
converter.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON,MediaType.APPLICATION_JSON_UTF8,MediaType.APPLICATION_OCTET_STREAM));
converter.setObjectMapper(mapper);
return converter;
}
}

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

@ -0,0 +1,52 @@
package com.hnac.hzims.operational.main.controller.web;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.main.service.AreaMonthlyDetailsService;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 水电生成报告详情数据
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 11:21
*/
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/areaMonthlyDetails")
public class AreaMonthlyDetailsController {
private final AreaMonthlyDetailsService areaMonthlyDetailsService;
/**
* 操作票 根据月份区域 获取操作详情数据
*
* @return
*/
@GetMapping("/areaMonthlyWithOperation/{page}/{size}")
public R areaMonthlyWithOperation(@PathVariable("page") Long page,
@PathVariable("size") Long size,
AreaMonthlyVo areaMonthly) {
IPage<StandardTicketVo> standardTicketInfoVoIPage =
areaMonthlyDetailsService.areaMonthlyWithOperation(page,size, areaMonthly);
return R.data(standardTicketInfoVoIPage);
}
}

24
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/AreaMonthlyDetailsService.java

@ -0,0 +1,24 @@
package com.hnac.hzims.operational.main.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
/**
*
* 水电生产运行数据
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 13:46
*/
public interface AreaMonthlyDetailsService {
/**
* 根据月份区域 获取操作详情数据
* @param page
* @param size
* @param areaMonthly
* @return
*/
IPage<StandardTicketVo> areaMonthlyWithOperation(Long page, Long size, AreaMonthlyVo areaMonthly);
}

48
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthlyDetailsServiceImpl.java

@ -0,0 +1,48 @@
package com.hnac.hzims.operational.main.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.feign.TicketFeignClient;
import com.hnac.hzims.operational.main.service.AreaMonthlyDetailsService;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
/**
* 水电生产运行数据
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/10 13:46
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService {
private final TicketFeignClient ticketFeignClient;
/**
* 根据月份区域 获取操作详情数据
*
* @param page
* @param size
* @param areaMonthly
* @return
*/
@Override
public IPage<StandardTicketVo> areaMonthlyWithOperation(Long page, Long size, AreaMonthlyVo areaMonthly) {
R<IPage<StandardTicketVo>> pageR =
ticketFeignClient.areaMonthlyWithOperation(page, size,areaMonthly);
if (pageR.isSuccess()) {
log.info("获取操作详情数据成功");
return pageR.getData();
}
System.out.println(pageR.getMsg());
return null;
}
}

2
hzims-service/operational/src/main/resources/application-dev.yml

@ -4,6 +4,8 @@ server:
#数据源配置
spring:
main:
allow-bean-definition-overriding: true
profiles:
active: dev
#排除DruidDataSourceAutoConfigure

4
hzims-service/ticket/pom.xml

@ -168,10 +168,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-dict-api</artifactId>
</dependency>

208
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java

@ -1,104 +1,104 @@
package com.hnac.hzims.ticket.processflow;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import java.util.ArrayList;
import java.util.List;
/**
* 代码生成器
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/29 8:59
*/
public class CodeGenerator {
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir") + "/hzims-service/ticket";
gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("dfy");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
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.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("123");
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName("processflow");
pc.setParent("com.hnac.hzims.ticket");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
// String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
// 配置自定义输出模板
//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// templateConfig.setEntity("templates/entity2.java");
// templateConfig.setService();
// templateConfig.setController();
// templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setEntityBooleanColumnRemoveIsPrefix(true);
strategy.setEntityLombokModel(true);
strategy.setEntitySerialVersionUID(true);
strategy.setChainModel(true);
strategy.setEntityTableFieldAnnotationEnable(true);
// strategy.setFieldPrefix("hzims_");
// 公共父类
// strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// 写于父类中的公共字段
// strategy.setSuperEntityColumns("id");
strategy.setInclude("hzims_process_type");
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix("hzims_");
mpg.setStrategy(strategy);
// mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}
// package com.hnac.hzims.ticket.processflow;
//
// import com.baomidou.mybatisplus.generator.AutoGenerator;
// import com.baomidou.mybatisplus.generator.InjectionConfig;
// import com.baomidou.mybatisplus.generator.config.*;
// import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
//
// import java.util.ArrayList;
// import java.util.List;
//
// /**
// * 代码生成器
// * @Author dfy
// * @Version v1.0
// * @Serial 1.0
// * @Date 2023/3/29 8:59
// */
// public class CodeGenerator {
//
//
// public static void main(String[] args) {
// // 代码生成器
// AutoGenerator mpg = new AutoGenerator();
//
// // 全局配置
// GlobalConfig gc = new GlobalConfig();
// String projectPath = System.getProperty("user.dir") + "/hzims-service/ticket";
// gc.setOutputDir(projectPath + "/src/main/java");
// gc.setAuthor("dfy");
// gc.setOpen(false);
// // gc.setSwagger2(true); 实体属性 Swagger2 注解
// mpg.setGlobalConfig(gc);
//
// // 数据源配置
// 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.setSchemaName("public");
// dsc.setDriverName("com.mysql.cj.jdbc.Driver");
// dsc.setUsername("root");
// dsc.setPassword("123");
// mpg.setDataSource(dsc);
//
// // 包配置
// PackageConfig pc = new PackageConfig();
// pc.setModuleName("processflow");
// pc.setParent("com.hnac.hzims.ticket");
// mpg.setPackageInfo(pc);
//
// // 自定义配置
// InjectionConfig cfg = new InjectionConfig() {
// @Override
// public void initMap() {
// // to do nothing
// }
// };
//
// // 如果模板引擎是 freemarker
// String templatePath = "/templates/mapper.xml.ftl";
// // 如果模板引擎是 velocity
// // String templatePath = "/templates/mapper.xml.vm";
//
// // 自定义输出配置
// List<FileOutConfig> focList = new ArrayList<>();
// cfg.setFileOutConfigList(focList);
// mpg.setCfg(cfg);
//
// // 配置模板
// TemplateConfig templateConfig = new TemplateConfig();
//
// // 配置自定义输出模板
// //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// // templateConfig.setEntity("templates/entity2.java");
// // templateConfig.setService();
// // templateConfig.setController();
//
// // templateConfig.setXml(null);
// mpg.setTemplate(templateConfig);
//
// // 策略配置
// StrategyConfig strategy = new StrategyConfig();
// strategy.setNaming(NamingStrategy.underline_to_camel);
// strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// // strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
// strategy.setEntityLombokModel(true);
// strategy.setRestControllerStyle(true);
// strategy.setEntityBooleanColumnRemoveIsPrefix(true);
// strategy.setEntityLombokModel(true);
// strategy.setEntitySerialVersionUID(true);
// strategy.setChainModel(true);
// strategy.setEntityTableFieldAnnotationEnable(true);
// // strategy.setFieldPrefix("hzims_");
// // 公共父类
// // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// // 写于父类中的公共字段
// // strategy.setSuperEntityColumns("id");
// strategy.setInclude("hzims_process_type");
// strategy.setControllerMappingHyphenStyle(true);
// strategy.setTablePrefix("hzims_");
// mpg.setStrategy(strategy);
// // mpg.setTemplateEngine(new FreemarkerTemplateEngine());
// mpg.execute();
// }
//
// }

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java

@ -10,5 +10,6 @@ package com.hnac.hzims.ticket.processflow.constant;
*/
public class TicketProcessConstant {
public final static String STARTEVENT = "startEvent1";
// public final static String STARTEVENT = "startEvent1";
public final static String STARTEVENT = "newFirstWorkTicket";
}

10
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java

@ -44,19 +44,21 @@ public class StandardWorkTicketConsumer implements IQueueConsume {
WorkflowQueue ticker = new WorkflowQueue();
ticker.setProcessDefinitionKey(taskDefinitionKey);
//判断执行具体的实现类
ProcessService ticketService = ticketServiceList.stream().filter(item -> item.isWorkflowProcess(ticker))
.findFirst().orElse(null);
ProcessService ticketService = ticketServiceList.stream().filter(item -> item.isWorkflowProcess(ticker)).findFirst().orElse(null);
if (ObjectUtils.isNotEmpty(ticketService)) {
//执行业务方法
try {
ticketService.calculate(response);
} catch (Exception e) {
//todo 业务出错误 做补偿
log.error("业务出错,StandardWorkTicketConsumer: ", e);
log.info("正在保存到hzims_workflow_operation_log....");
log.error("业务出错,StandardWorkTicketConsumer: {}", e.getMessage());
log.error("业务出错,StandardWorkTicketConsumer: {} ", response);
WorkflowOperationLog workflowOperationLog = new WorkflowOperationLog();
BeanUtils.copyProperties(response,workflowOperationLog);
if (ObjectUtils.isNotEmpty(workflowOperationLog)) {
log.info("正在保存到hzims_workflow_operation_log.... :{}", workflowOperationLog);
workflowOperationLogService.save(workflowOperationLog);
}
}
}

10
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/WorkflowOperationLog.java

@ -1,10 +1,8 @@
package com.hnac.hzims.ticket.processflow.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -44,8 +42,8 @@ public class WorkflowOperationLog implements Serializable {
/**
* 当前环节流程ID
*/
@TableField("task_definition_key")
private String taskDefinitionKey;
@TableField("process_definition_key")
private String processDefinitionKey;
/**
* 实例key

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java

@ -43,7 +43,7 @@ public class MakeProcessServiceImpl extends ProcessAbstractService {
log.info("已执行开工作票流程环节操作~~~~");
return true;
}
log.info("未是否执行开工作票流程环节操作,请联系管理员~~~~");
log.error("未是否执行开工作票流程环节操作,请联系管理员~~~~");
return false;
}

22
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java

@ -2,11 +2,15 @@ package com.hnac.hzims.ticket.standardTicket.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO;
import io.swagger.annotations.Api;
@ -20,6 +24,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@ -102,4 +107,21 @@ public class StandardTicketInfoController extends BladeController {
public void exportTicketPdf(@RequestParam Long id, HttpServletResponse response) {
standardTicketInfoService.exportTicketPdf(id, response);
}
/**
* 根据月份区域 获取操作详情数据
*
* @return
*/
@GetMapping("/areaMonthlyWithOperation/{page}/{size}")
public R<IPage<StandardTicketVo>> areaMonthlyWithOperation(
@PathVariable("page") Long page,
@PathVariable("size") Long size,
@SpringQueryMap AreaMonthlyVo areaMonthlyVo) {
Page<StandardTicketInfoEntity> searchPage = new Page<>(page, size);
IPage<StandardTicketVo> standardTicketInfoEntity =
standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage);
return R.data(standardTicketInfoEntity);
}
}

16
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java

@ -1,8 +1,11 @@
package com.hnac.hzims.ticket.standardTicket.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO;
@ -11,13 +14,10 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* @author hx
@ -97,4 +97,14 @@ public interface IStandardTicketInfoService extends BaseService<StandardTicketIn
* @return
*/
R<TicketMonthVO> getOperateWorkStatistic(LocalDateTime firstDateTime,LocalDateTime endDateTime,List<Long> list);
/**
* 根据区域Id 分页查询
* @param areaMonthly
* @param searchPage
* @return
*/
Page<StandardTicketVo> areaMonthlyWithOperation(AreaMonthlyVo areaMonthly, Page<StandardTicketInfoEntity> searchPage);
}

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

@ -2,14 +2,17 @@ package com.hnac.hzims.ticket.standardTicket.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
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.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzims.ticket.areamonthly.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketMeasureDto;
@ -33,7 +36,6 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
@ -41,6 +43,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -48,9 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
@ -177,8 +178,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
Map<String, Object> ticketInfoMap = new HashMap<>();
try {
ticketInfoMap = PdfUtils.objectToMap(infoVO);
}
catch (Exception e) {
} catch (Exception e) {
log.info("转换对象失败!");
}
/**格式化时间**/
@ -251,6 +251,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 获取双票合格率
*
* @param depatList
* @param firstDateTime
* @param now
@ -301,6 +302,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 获取首页区域当月操作票/工作票
*
* @param list
* @return
*/
@ -315,7 +317,39 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
}
/**
* 根据区域Id 分页查询
*
* @param areaMonthly
* @param searchPage
* @return
*/
@Override
public Page<StandardTicketVo> areaMonthlyWithOperation(AreaMonthlyVo areaMonthly, Page<StandardTicketInfoEntity> searchPage) {
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CREATE_DEPT", areaMonthly.getAreaId());
queryWrapper.eq(areaMonthly.getYearMonth() != null,
"date_format(create_time,'%Y-%m')", areaMonthly.getYearMonth());
Page<StandardTicketInfoEntity> standardTicketInfoEntityPage = baseMapper.selectPage(searchPage, queryWrapper);
//数据转换StandardTicketInfoEntity ==> StandardTicketVo
List<StandardTicketVo> standardTicketInfoVOList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(standardTicketInfoEntityPage.getRecords())) {
standardTicketInfoVOList = standardTicketInfoEntityPage.getRecords().stream().map(item -> {
StandardTicketVo standardTicketVo = new StandardTicketVo();
BeanUtils.copyProperties(item, standardTicketVo);
return standardTicketVo;
}).collect(Collectors.toList());
}
Page<StandardTicketVo> page = new Page<>();
page.setSize(standardTicketInfoEntityPage.getSize());
page.setCurrent(standardTicketInfoEntityPage.getCurrent());
page.setTotal(standardTicketInfoEntityPage.getTotal());
page.setRecords(standardTicketInfoVOList);
return page;
}
/**
* 首页-当月操作票获取
*
* @param firstDateTime
* @param endDateTime
* @param list
@ -348,6 +382,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 首页-当月工作票获取
*
* @param list
* @param ticketMonthVO
*/
@ -378,6 +413,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 获取StandardTicketInfoEntity - LambdaQueryWrapper
*
* @param req
* @return
*/
@ -424,6 +460,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 开启标准票流程
*
* @param processDefinitionKey 标准票流程key
* @param entity
* @return
@ -465,6 +502,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 根据站点获取双票数量
*
* @param stationMap
* @param firstDateTime
* @param now
@ -520,6 +558,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 站点统计月报 - 操作票统计
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param deptIdList 机构ID

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

@ -5,10 +5,14 @@ import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.vo.TaskList;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -49,7 +53,23 @@ public class TicketProcessServiceImpl implements TicketProcessService {
// variables.put("task_id", taskId);
// variables.put("signUserIds", formData);
// flowClient.startProcessInstanceContainNameByKey(processDefinitionKey,"workTicket:task:"+1,)
Map<String,Object> params = new HashMap<String, Object>(2) {{
put("taskId", "1644624168666353665");
put("signUserIds", AuthUtil.getUserId());
}};
flowClient.startProcessInstanceContainNameByKey(
processDefinitionKey,"workTicket:task:"+1,
"开启工作的任务",
params);
R<List<TaskList>> listR = flowClient.todoList(processDefinitionKey);
listR.getData().forEach(taskList -> {
System.out.println("任务名称:"+taskList);
System.out.println(taskList.getTaskName());
System.out.println(taskList.getStatus());
});
}
}

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/TicketInfoClient.java

@ -14,7 +14,6 @@ import com.hnac.hzims.ticket.workTicket.service.IWorkTicketDelayService;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketReportStatisticVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
import lombok.AllArgsConstructor;
@ -166,6 +165,7 @@ public class TicketInfoClient implements ITicketInfoClient {
/**
* 获取首页操作票统计结果
*
* @param params
* @return
*/
@ -188,6 +188,7 @@ public class TicketInfoClient implements ITicketInfoClient {
/**
* 获取首页月工作票,操作票统计结果
*
* @param params
* @return
*/
@ -210,6 +211,7 @@ public class TicketInfoClient implements ITicketInfoClient {
/**
* 安全检查工作票事项统计
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param dept 机构ID
@ -235,4 +237,5 @@ public class TicketInfoClient implements ITicketInfoClient {
}
return R.data(vo);
}
}

Loading…
Cancel
Save