Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
cfa9b731fb
  1. 1
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java
  2. 25
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/to/SysLogTo.java
  3. 8
      hzims-service/hzims-middle/pom.xml
  4. 59
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/Swagger2Config.java
  5. 71
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java
  6. 93
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java
  7. 13
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java
  8. 41
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java
  9. 14
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/StatisticsService.java
  10. 13
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java
  11. 25
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  12. 70
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java
  13. 41
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java
  14. 56
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogVo.java
  15. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml
  16. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainMapper.xml
  17. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java
  18. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  19. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
  20. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java
  21. 114
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

1
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java

@ -56,6 +56,7 @@ public class SysLogAspect {
//private StopWatch stopWatch = new StopWatch();
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<>("Cost Time");

25
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/to/SysLogTo.java

@ -1,5 +1,6 @@
package com.hnac.hzims.common.logs.to;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@ -21,97 +22,115 @@ public class SysLogTo {
/**
* 租户ID
*/
@ApiModelProperty("租户ID")
private String tenantId;
/**
* 服务器ip
*/
@ApiModelProperty("服务器ip")
protected String serverIp;
/**
* 服务器地址
*/
@ApiModelProperty("服务器地址")
protected String serverHost;
/**
* 服务名称
*/
@ApiModelProperty("服务名称")
protected String serverName;
/**
* 环境
*/
@ApiModelProperty("环境")
protected String env;
/**
* 操作人 id
*/
@ApiModelProperty("操作人id")
private Long operationUserId;
/**
* 操作人
*/
@ApiModelProperty("操作人")
private String operationUserName;
/**
* 请求路径 操作地址
*/
@ApiModelProperty(" 请求路径 (操作地址)")
private String path;
/**
* 用户代理
*/
@ApiModelProperty("用户代理")
protected String userAgent;
/**
* 操作方式
*/
@ApiModelProperty("操作方式")
protected String method;
/**
* 方法类
*/
@ApiModelProperty("方法类")
protected String methodClass;
/**
* 方法名
*/
@ApiModelProperty("方法名")
protected String methodName;
/**
* 方法执行时间 消耗时间 毫秒
*/
@ApiModelProperty("法执行时间 消耗时间 毫秒")
private String costTime;
/**
* 方法入参
*/
@ApiModelProperty("方法入参")
private String parameter;
/**
* 操作方法
*/
@ApiModelProperty("操作方法")
private String title;
/**
* 方法描述
*/
@ApiModelProperty("方法描述")
private String action;
/**
* 系统类型
*/
@ApiModelProperty("系统类型")
private String operatorType;
/**
* 操作人类别
*/
@ApiModelProperty("操作人类别")
private String businessType;
@ -120,32 +139,38 @@ public class SysLogTo {
*
* @param jsonResult
*/
@ApiModelProperty("返回结果")
public String jsonResult;
/**
* 请求的Ip
*/
@ApiModelProperty("请求的Ip")
private String localIp;
/**
* 错误消息
*/
@ApiModelProperty("错误消息")
private String errorMsg;
/**
* 操作时间
*/
@ApiModelProperty("操作时间")
private LocalDateTime operationTime;
/**
* 操作状态0 正常 1 异常
*/
@ApiModelProperty("操作状态")
private Integer status;
/**
* 功能模块
*/
@ApiModelProperty("功能模块")
private String moduleName;
}

8
hzims-service/hzims-middle/pom.xml

@ -17,6 +17,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.6.13</spring-boot.version>
<swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version>
</properties>
<dependencies>
@ -59,6 +60,13 @@
</dependency>
<!--swagger-bootstrap-ui-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
</dependencies>
<build>

59
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/config/Swagger2Config.java

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

71
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java

@ -1,9 +1,24 @@
package com.hnac.hzims.middle.systemlog.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.middle.systemlog.entity.Statistics;
import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.hnac.hzims.middle.systemlog.service.StatisticsService;
import com.hnac.hzims.middle.systemlog.vo.StatisticsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
@ -13,9 +28,61 @@ import org.springframework.web.bind.annotation.RestController;
* @author dfy
* @since 2023-04-08
*/
@Api(tags = "操作日志统计数据")
@RestController
@RequestMapping("/systemlog/statistics")
public class StatisticsController {
@Autowired
private StatisticsService statisticsService;
/**
* 查询
*
* @param statistics
* @return
*/
@ApiOperation("操作日志统计数据分页查询")
@OperationAnnotation(moduleName = "操作日志",
operatorType = OperatorType.MANAGE,
businessType = BusinessType.INSERT
, title = "操作日志统计数据", action = "操作日志统计数据分页查询")
@ApiResponses({
@ApiResponse(code = 200,message = "OK",response = Statistics.class),
})
@GetMapping("/selectPage/{page}/{size}")
public R selectPage(
@PathVariable Long page,
@PathVariable Long size,
StatisticsVo statistics) {
Page<Statistics> page1 = new Page(page, size);
IPage<Statistics> pageSize = statisticsService.selectPage(page1, statistics);
return R.data(pageSize);
}
/**
* 根据Id查询日志
*
* @param id
* @return
*/
@ApiResponses({
@ApiResponse(code = 200,message = "OK",response = Statistics.class),
})
@ApiOperation("根据Id查询日志")
@OperationAnnotation(moduleName = "操作日志",
operatorType = OperatorType.MANAGE,
businessType = BusinessType.INSERT
, title = "操作日志统计数据", action = "根据Id查询日志")
@GetMapping("/get/{id}")
public R list(@PathVariable Long id) {
Statistics statistics = statisticsService.getById(id);
return R.data(statistics);
}
}

93
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java

@ -2,17 +2,26 @@ package com.hnac.hzims.middle.systemlog.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.common.logs.to.SysLogTo;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import com.hnac.hzims.middle.systemlog.vo.StatisticsVo;
import com.hnac.hzims.middle.systemlog.vo.SysLogVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
@ -39,6 +48,11 @@ public class SysLogController {
* 保存操作日志
* @param sysLogToList
*/
@OperationAnnotation(moduleName = "操作日志",
operatorType = OperatorType.MANAGE,
businessType = BusinessType.INSERT
,title = "系统日志",action = "保存操作日志")
@ApiOperation("保存操作日志")
@PostMapping("/batchSave")
public void saveBatch(@RequestBody List<SysLogTo> sysLogToList) {
//数据转换
@ -56,5 +70,76 @@ public class SysLogController {
log.info("操作日志新增失败 ~~~");
throw new IllegalArgumentException("操作日志新增失败");
}
/**
* 日志分页查询
* @param page
* @param size
* @return
*/
@OperationAnnotation(moduleName = "操作日志",
operatorType = OperatorType.MANAGE,
businessType = BusinessType.INSERT
,title = "系统日志",action = "日志分页查询")
@ApiOperation("日志分页查询")
@GetMapping("/selectPage/{page}/{size}")
@ApiResponses({
@ApiResponse(code = 200,message = "OK",response = SysLog.class),
})
public R selectPage(
@PathVariable Long page,
@PathVariable Long size,
SysLogVo sysLog) {
Page<SysLog> page1 = new Page(page, size);
IPage<SysLog> pageSize = sysLogService.selectPage(page1, sysLog);
return R.data(pageSize);
}
/**
* 根据Id获取日志数据
* @return
*/
@ApiResponses({
@ApiResponse(code = 200,message = "OK",response = SysLog.class),
})
@OperationAnnotation(moduleName = "操作日志",
operatorType = OperatorType.MANAGE,
businessType = BusinessType.INSERT
,title = "系统日志",action = "根据Id获取日志数据")
@ApiOperation("根据Id获取日志数据")
@GetMapping("/get/{id}")
public R getById(@PathVariable Long id) {
SysLog sysLog = sysLogService.getById(id);
return R.data(sysLog);
}
// /**
// * 根据Id获取日志数据
// * @return
// */
// @ApiResponses({
// @ApiResponse(code = 200,message = "OK",response = SysLog.class),
// })
// @OperationAnnotation(moduleName = "操作日志",
// operatorType = OperatorType.MANAGE,
// businessType = BusinessType.INSERT
// ,title = "系统日志",action = "根据操作模块查询信息")
// @ApiOperation("根据操作模块查询信息")
// @GetMapping("/selectPageByModuleName/{page}/{size}")
// public R selectPageByModuleName(
// @PathVariable Long page,
// @PathVariable Long size,
// SysLogVo sysLogVo) {
// Page<SysLog> objectPage = new Page<>(page,size);
// IPage<SysLog> sysLog = sysLogService.selectPageByModuleName(objectPage,sysLogVo);
// return R.data(sysLog);
// }
}

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

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.time.YearMonth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@ -22,6 +24,7 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("hzims_statistics")
@ApiModel("操作日志统计对象")
public class Statistics implements Serializable {
private static final long serialVersionUID=1L;
@ -29,12 +32,14 @@ public class Statistics implements Serializable {
/**
* 编号
*/
@ApiModelProperty("编号")
@TableField("id")
private Long id;
/**
* 统计日期
*/
@ApiModelProperty("统计日期")
@TableField("date_calculated")
private String dateCalculated;
@ -42,6 +47,7 @@ public class Statistics implements Serializable {
/**
* 操作模块
*/
@ApiModelProperty("操作模块")
@TableField("title")
private String title;
@ -49,6 +55,7 @@ public class Statistics implements Serializable {
/**
* 操作模块统计
*/
@ApiModelProperty("操作模块统计")
@TableField("title_num")
private Integer titleNum;
@ -56,6 +63,7 @@ public class Statistics implements Serializable {
/**
* 功能模块统计
*/
@ApiModelProperty("功能模块统计")
@TableField("module_name")
private String moduleName;
@ -63,6 +71,7 @@ public class Statistics implements Serializable {
/**
* 功能模块统计
*/
@ApiModelProperty("功能模块统计")
@TableField("module_name_num")
private Integer moduleNameNum;
@ -70,24 +79,28 @@ public class Statistics implements Serializable {
/**
* 请求路径统计
*/
@ApiModelProperty("请求路径统计")
@TableField("path")
private String path;
/**
* 请求路径统计
*/
@ApiModelProperty("请求路径统计")
@TableField("path_num")
private Integer pathNum;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
@TableField("create_time")
private LocalDateTime createTime;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
@TableField("update_time")
private LocalDateTime updateTime;

41
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java

@ -1,10 +1,17 @@
package com.hnac.hzims.middle.systemlog.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.sql.Blob;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@ -21,9 +28,10 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("hzims_sys_log")
@ApiModel("系统日志统计对象")
public class SysLog implements Serializable {
private static final long serialVersionUID=1L;
private static final long serialVersionUID = 1L;
/**
* 操作日志编号
@ -35,165 +43,194 @@ public class SysLog implements Serializable {
/**
* 功能模块
*/
@ApiModelProperty("功能模块")
@TableField("module_name")
private String moduleName;
/**
* 租户ID
*/
@ApiModelProperty("租户ID")
@TableField("tenant_id")
private String tenantId;
/**
* 服务器ip
*/
@ApiModelProperty("服务器ip")
@TableField("server_ip")
private String serverIp;
/**
* 服务器地址
*/
@ApiModelProperty("服务器地址")
@TableField("server_host")
private String serverHost;
/**
* 服务名称
*/
@ApiModelProperty("服务名称")
@TableField("server_name")
private String serverName;
/**
* 环境
*/
@ApiModelProperty("环境")
@TableField("env")
private String env;
/**
* 操作人Id
*/
@ApiModelProperty("操作人Id")
@TableField("operation_user_id")
private Long operationUserId;
/**
* 操作人名称
*/
@ApiModelProperty("操作人名称")
@TableField("operation_user_name")
private String operationUserName;
/**
* 请求路径 操作地址
*/
@ApiModelProperty(" 请求路径 (操作地址)")
@TableField("path")
private String path;
/**
* 用户代理
*/
@ApiModelProperty("用户代理")
@TableField("user_agent")
private String userAgent;
/**
* 操作方式
*/
@ApiModelProperty("操作方式")
@TableField("method")
private String method;
/**
* 方法类
*/
@ApiModelProperty("方法类")
@TableField("method_class")
private String methodClass;
/**
* 方法名
*/
@ApiModelProperty("方法名")
@TableField("method_name")
private String methodName;
/**
* 方法执行时间 消耗时间 毫秒
*/
@ApiModelProperty("方法执行时间 消耗时间 毫秒")
@TableField("cost_time")
private String costTime;
/**
* 方法入参
*/
@ApiModelProperty("方法入参")
@TableField("parameter")
private String parameter;
/**
* 操作方法
*/
@ApiModelProperty("操作方法")
@TableField("title")
private String title;
/**
* 方法描述
*/
@ApiModelProperty("方法描述")
@TableField("action")
private String action;
/**
* 系统类型
*/
@ApiModelProperty("系统类型")
@TableField("operator_type")
private String operatorType;
/**
* 操作人类别
*/
@ApiModelProperty("操作人类别")
@TableField("business_type")
private String businessType;
/**
* 返回结果
*/
@ApiModelProperty("返回结果")
@TableField("json_result")
private String jsonResult;
/**
* 请求的Ip
*/
@ApiModelProperty("请求的Ip")
@TableField("local_ip")
private String localIp;
/**
* 错误消息
*/
@ApiModelProperty("错误消息")
@TableField("error_msg")
private String errorMsg;
/**
* 操作时间
*/
@ApiModelProperty("操作时间")
@TableField("operation_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",shape = JsonFormat.Shape.STRING)
private LocalDateTime operationTime;
/**
* 操作状态0 正常 1 异常
*/
@ApiModelProperty("操作状态")
@TableField("status")
private Integer status;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
@TableField("create_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",shape = JsonFormat.Shape.STRING)
private LocalDateTime createTime;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
@TableField("update_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",shape = JsonFormat.Shape.STRING)
private LocalDateTime updateTime;
/**
* 逻辑删除 0 可用 1 删除
*/
@ApiModelProperty("逻辑删除")
@TableField("is_deleted")
private Integer isDeleted;
}

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

@ -1,9 +1,13 @@
package com.hnac.hzims.middle.systemlog.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.middle.systemlog.vo.StatisticsVo;
import java.time.YearMonth;
import java.util.List;
/**
* <p>
@ -26,4 +30,14 @@ public interface StatisticsService extends IService<Statistics> {
* @return
*/
Statistics getStatisticsBydateCalculated(String operationTime);
/**
* 分页查询
* @param page1
* @param statistics
* @return
*/
IPage<Statistics> selectPage(Page<Statistics> page1, StatisticsVo statistics);
}

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

@ -1,8 +1,11 @@
package com.hnac.hzims.middle.systemlog.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo;
import com.hnac.hzims.middle.systemlog.vo.SysLogVo;
import java.util.List;
@ -21,4 +24,14 @@ public interface SysLogService extends IService<SysLog> {
* @return
*/
List<SysLogStatisticsVo> countStatistics();
/**
* 分页查询
* @param page1
* @param sysLog
* @return
*/
IPage<SysLog> selectPage(Page<SysLog> page1, SysLogVo sysLog);
}

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

@ -1,13 +1,17 @@
package com.hnac.hzims.middle.systemlog.service.impl;
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.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.StatisticsVo;
import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -84,4 +88,25 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
statisticsQueryWrapper.eq("date_calculated", operationTime);
return baseMapper.selectOne(statisticsQueryWrapper);
}
/**
* 分页查询
*
* @param page1
* @param statistics
* @return
*/
@Override
public IPage<Statistics> selectPage(Page<Statistics> page1, StatisticsVo statistics) {
QueryWrapper<Statistics> queryWrapper = new QueryWrapper<>();
//开始时间
queryWrapper.lambda().ge(StringUtils.isNotEmpty(statistics.getCreateTime()),Statistics::getDateCalculated,
statistics.getCreateTime());
//结束时间
queryWrapper.lambda().le(StringUtils.isNotEmpty(statistics.getEndTime()),Statistics::getDateCalculated,
statistics.getEndTime());
IPage<Statistics> statisticsPage = baseMapper.selectPage(page1, queryWrapper);
return statisticsPage;
}
}

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

@ -1,12 +1,21 @@
package com.hnac.hzims.middle.systemlog.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.middle.systemlog.entity.Statistics;
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 com.hnac.hzims.middle.systemlog.vo.SysLogVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -29,4 +38,65 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
public List<SysLogStatisticsVo> countStatistics() {
return baseMapper.countStatistics();
}
/**
* 分页查询
*
* @param page1
* @param sysLog
* @return
*/
@Override
public IPage<SysLog> selectPage(Page<SysLog> page1, SysLogVo sysLog) {
QueryWrapper<SysLog> queryWrapper = getSysLogQueryWrapper(sysLog);
IPage<SysLog> statisticsPage = baseMapper.selectPage(page1, queryWrapper);
return statisticsPage;
}
/**
* 日志查询接口
* @param sysLog
* @return
*/
private static QueryWrapper<SysLog> getSysLogQueryWrapper(SysLogVo sysLog) {
String keyword = sysLog.getKeyword();
LocalDateTime createTime = sysLog.getCreateTime();
LocalDateTime endTime = sysLog.getEndTime();
String dateCalculated = sysLog.getDateCalculated();
String moduleName = sysLog.getModuleName();
String path = sysLog.getPath();
QueryWrapper<SysLog> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(sysLog.getKeyword())) {
queryWrapper.lambda().like(SysLog::getModuleName, keyword);
queryWrapper.lambda().or().like(SysLog::getTitle, keyword);
queryWrapper.lambda().or().like(SysLog::getAction, keyword);
}
//请求地址
if (StringUtils.isNotEmpty(path)) {
queryWrapper.lambda().eq(SysLog::getPath, path);
}
//开始时间
if (ObjectUtils.isNotEmpty(createTime)) {
queryWrapper.lambda().ge(SysLog::getOperationTime, createTime);
}
//结束时间
if (ObjectUtils.isNotEmpty(endTime)){
queryWrapper.lambda().le(SysLog::getOperationTime,endTime);
}
//根据操作时间和功能模块查询
if (StringUtils.isNotEmpty(dateCalculated) && StringUtils.isNotEmpty(moduleName)){
queryWrapper.lambda().eq(SysLog::getModuleName,moduleName);
queryWrapper.eq("date_format(operation_time,'%Y-%m')",dateCalculated);
}
return queryWrapper;
}
}

41
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java

@ -0,0 +1,41 @@
package com.hnac.hzims.middle.systemlog.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/21 9:21
*/
@Data
public class StatisticsVo {
/**
* key
*/
public String keyword;
/**
* 开始时间
*/
//@JsonFormat(pattern="yyyy-MM-dd",shape = JsonFormat.Shape.STRING)
@DateTimeFormat(pattern = "yyyy-MM-dd")
private String createTime;
/**
* 结束时间
*
*/
//@JsonFormat(pattern="yyyy-MM-dd",shape = JsonFormat.Shape.STRING)
@DateTimeFormat(pattern = "yyyy-MM-dd")
private String endTime;
}

56
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogVo.java

@ -0,0 +1,56 @@
package com.hnac.hzims.middle.systemlog.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/21 9:53
*/
@Data
public class SysLogVo {
@ApiModelProperty("功能模块")
private String moduleName;
/**
* 功能模块操作方法方法描述 模糊查询
*/
@ApiModelProperty("功能模块,操作方法,方法描述 模糊查询")
public String keyword;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
@ApiModelProperty("操作时间")
private String dateCalculated;
@ApiModelProperty("请求地址")
private String path;
}

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

@ -45,7 +45,7 @@
select
<include refid="Base_Column_List" />
from hz_ims_duty_group_p
where ID = #{groupId,jdbcType=BIGINT}
where GROUP_ID = #{groupId,jdbcType=BIGINT}
</select>
<select id="selectPersonIdsByGroupId" resultType="java.lang.String">
select

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainMapper.xml

@ -148,7 +148,12 @@
</select>
<select id="selectByIdOneV2" resultType="com.hnac.hzims.operational.duty.vo.ImsSchedulingVo">
SELECT
DM.*,
DM.ID AS id,
DM.DUTY_GROUP_ID AS groupId,
DM.CLASS_ID AS classId,
DM.PRE_DUTY_ID AS preDutyId,
DM.DUTY_PERSON_IDS AS dutyPersonIds,
DM.status ,
DC.CLASS_NAME AS className,
DC.`START_TIME` AS startTime,
DC.`END_TIME` AS endTime

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java

@ -287,6 +287,7 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
//根据班组ID获取值班信息
List<ImsDutyMainEntity> list1 = iImsDutyMainService.list(new LambdaQueryWrapper<ImsDutyMainEntity>() {{
in(ImsDutyMainEntity::getDutyGroupId, collect);
in(ImsDutyMainEntity::getStatus,Arrays.asList(0,1));
}});
if (CollectionUtil.isNotEmpty(list1)) {

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

@ -776,7 +776,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
List<ImsSchedulingVo> collect = imsSchedulingVos.stream().filter(o -> DateUtil.format(o.getDutyDate(), DateUtil.PATTERN_DATE).equals(date)).sorted(Comparator.comparing(ImsSchedulingVo::getId)).collect(Collectors.toList());
collect = collect.stream().map(s -> {
//灵活排班把班组名称拼接成人员名称
if (s.getGroupName() == null) {
if (s.getGroupId() == null) {
String[] split = s.getDutyPersonIds().split("\\^");
if (null != split && split.length > 0) {
for (int j = 0; j < split.length; j++) {
@ -791,8 +791,8 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
}
}
} else {
// ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(s.getGroupId());
s.setName(s.getName() + s.getGroupName());
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(s.getGroupId());
s.setName(s.getName() + imsDutyGroupEntity.getGroupName());
}
return s;
}).sorted(Comparator.comparing(ImsSchedulingVo::getId)).collect(Collectors.toList());

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

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

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java

@ -105,8 +105,8 @@ public class ProcessTypeController {
public void addList() {
ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse();
workTicketMessageResponse.setTaskId("1");
workTicketMessageResponse.setProcessDefinitionKey("1");
workTicketMessageResponse.setTaskName("1");
workTicketMessageResponse.setProcessDefinitionKey("newFirstWorkTicket");
workTicketMessageResponse.setTaskName("签发人签发");
workTicketMessageResponse.setFormData("1");
String qqqq = JsonUtil.toJson(workTicketMessageResponse);
queueProduceService.sendMessage("blade:queue:flow", qqqq);

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

@ -5,18 +5,25 @@ 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.aspectj.apache.bcel.generic.TABLESWITCH;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.flow.core.entity.BladeFlow;
import org.springblade.flow.core.entity.FlowAttachment;
import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.flow.core.vo.TaskList;
import org.springframework.stereotype.Service;
import javax.crypto.Mac;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 开票处理流程实现类
*
* @Author WL
* @Version v1.0
* @Serial 1.0
@ -28,11 +35,16 @@ import java.util.Map;
public class TicketProcessServiceImpl implements TicketProcessService {
private final IFlowClient flowClient;
private final IFlowClient flowClient;
private final IWorkTicketInfoService workTicketInfoService;
private Map<String,Boolean> map = new HashMap<String,Boolean>(){{
put("key",true);
}};
/**
* 启动开票流程
*
@ -40,6 +52,9 @@ public class TicketProcessServiceImpl implements TicketProcessService {
*/
@Override
public void startUp(ProcessWorkFlowResponse response) {
Boolean key = map.get("key");
//当前环节Id
String processDefinitionKey = response.getProcessDefinitionKey();
//当前任务Id
@ -54,25 +69,86 @@ public class TicketProcessServiceImpl implements TicketProcessService {
// variables.put("signUserIds", formData);
Map<String,Object> params = new HashMap<String, Object>(2) {{
put("taskId", "1644624168666353665");
put("signUserIds", "1377143375838359553");
if (key) {
Map<String, Object> params = new HashMap<String, Object>(2) {{
put("taskId", "4066d774-df2c-11ed-b33e-fa163ee12c20");
put("signUserIds", "1377143375838359553");
}};
R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(
processDefinitionKey, "workTicket:task:" + 1377143375838359553L,
"开启工作的任务",
params);
if (processInstanceContainNameByKey.getCode() != 200) {
log.error("启动开票流程失败: {}", processInstanceContainNameByKey);
return;
}
BladeFlow bladeFlow = processInstanceContainNameByKey.getData();
log.info("bladeFlow: {}", bladeFlow);
map.put("key",false);
return;
}
// R<BladeFlow> tasks = flowClient.getTaskByProcessInstanceIdAndUserId(response.getProcessInstanceId(),
// "1377143375838359553");
//
//
// flowClient.getTaskByProcessInstanceIdAndUserId(response.getProcessInstanceId(),
// "1377143375838359553");
//
// if (tasks.getCode() != 200){
// return;
// }
//
// BladeFlow bladeFlow1 = tasks.getData();
//
// String curStep = bladeFlow1.getCurStep();
// System.out.println("curStep = " + curStep);
//
// String status = bladeFlow1.getStatus();
// System.out.println("status = " + status);
//
// // 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());
// // });
//
// R<Map<String, Object>> taskedVariables = flowClient.taskVariables(response.getTaskId());
//
// System.out.println(taskedVariables);
// R<List<TaskList>> listR = flowClient.todoList(response.getProcessDefinitionKey());
// for (TaskList datum : listR.getData()) {
// System.out.println(datum);
// }
ComleteTask comleteTask = new ComleteTask();
comleteTask.setPass(true);
comleteTask.setProcessInstanceId(response.getProcessInstanceId());
comleteTask.setTaksUserId(1377143375838359553L);
comleteTask.setTaskId(response.getTaskId());
comleteTask.setComment("同意");
FlowAttachment flowAttachment= new FlowAttachment();
flowAttachment.setProcessInstanceId(response.getProcessInstanceId());
flowAttachment.setTaskId(taskId);
flowAttachment.setAttachmentType("");
List<FlowAttachment> list = new ArrayList<>();
list.add(flowAttachment);
comleteTask.setAttachments(list);
Map<String, Object> params = new HashMap<String, Object>(2) {{
put("taskId",taskId);
put("principalUserIds", "1377143375838359553");
}};
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());
// });
// flowClient.completeTask()
comleteTask.setVariables(params);
flowClient.completeTask(comleteTask);
}

Loading…
Cancel
Save