Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
39ef6648fd
  1. 21
      .editorconfig
  2. 2
      hzims-biz-common/pom.xml
  3. 48
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/annotation/OperationAnnotation.java
  4. 259
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java
  5. 118
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java
  6. 43
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java
  7. 33
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessStatus.java
  8. 73
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessType.java
  9. 45
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/OperatorType.java
  10. 29
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/SysLogFeignService.java
  11. 30
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/SysLogFeignServiceFallback.java
  12. 88
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/CharsetKit.java
  13. 1009
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/Convert.java
  14. 93
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/StrFormatter.java
  15. 145
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/to/SysLogTo.java
  16. 130
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/utils/Constants.java
  17. 567
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/utils/StringUtils.java
  18. 49
      hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/IPUtils.java
  19. 85
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyEmergencyEntity.java
  20. 9
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyMainEntity.java
  21. 82
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyMainPersonEntity.java
  22. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyMainTemplateEntity.java
  23. 41
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ChangeDutyMainVo.java
  24. 28
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/FlexibleSchedulingVo.java
  25. 86
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ImsDutyEmergencyVo.java
  26. 10
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ImsSchedulingVo.java
  27. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/feign/IAccessTaskClient.java
  28. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java
  29. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  30. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/GenerationVo.java
  31. 29
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceChartsVo.java
  32. 87
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceVo.java
  33. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicGenerateYearVo.java
  34. 14
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java
  35. 17
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicPowerVo.java
  36. 54
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicRealVo.java
  37. 89
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationVo.java
  38. 67
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicTargetVo.java
  39. 87
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/SubordinateVo.java
  40. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
  41. 7
      hzims-service-api/inspect-api/pom.xml
  42. 6
      hzims-service-api/pom.xml
  43. 117
      hzims-service-api/weather-api/.mvn/wrapper/MavenWrapperDownloader.java
  44. BIN
      hzims-service-api/weather-api/.mvn/wrapper/maven-wrapper.jar
  45. 2
      hzims-service-api/weather-api/.mvn/wrapper/maven-wrapper.properties
  46. 1
      hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/vo/RainFallCountByMonthVo.java
  47. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java
  48. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java
  49. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceivesController.java
  50. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java
  51. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java
  52. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java
  53. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpManagementController.java
  54. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpProviderController.java
  55. 9
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpToolBasicController.java
  56. 9
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpTotalController.java
  57. 11
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpWarehouseController.java
  58. 3
      hzims-service/assets/src/main/resources/application.yml
  59. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  60. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/PlanGenertionController.java
  61. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/WorkshopInfoController.java
  62. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  63. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpFaultController.java
  64. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java
  65. 9
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpTaskController.java
  66. 21
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java
  67. 104
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/mybatisplus/CodeGenerator.java
  68. 60
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java
  69. 191
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java
  70. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java
  71. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java
  72. 20
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java
  73. 38
      hzims-service/hzims-middle/src/main/resources/application.yml
  74. 7
      hzims-service/hzims-middle/src/main/resources/bootstrap.yml
  75. 5
      hzims-service/hzims-middle/src/main/resources/mapper/SysLogMapper.xml
  76. 15
      hzims-service/hzims-middle/src/test/java/com/hnac/hzims/middle/MiddleApplicationTests.java
  77. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessBaseMaterialController.java
  78. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessContentController.java
  79. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessContentDetailController.java
  80. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java
  81. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryDetailController.java
  82. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessMaterialController.java
  83. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessPlanController.java
  84. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java
  85. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java
  86. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskDetailController.java
  87. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java
  88. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java
  89. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java
  90. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  91. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/CensusController.java
  92. 19
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java
  93. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  94. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/FocusAttributeController.java
  95. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java
  96. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StFocusPropertiesController.java
  97. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java
  98. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java
  99. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StFocusPropertiesServiceImpl.java
  100. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/controller/HzimsDataController.java
  101. Some files were not shown because too many files have changed in this diff Show More

21
.editorconfig

@ -1,21 +0,0 @@
# http://editorconfig.org
root = true
# 空格替代Tab缩进在各种编辑工具下效果一致
[*]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.java]
indent_style = tab
[*.{json,yml}]
indent_size = 2
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

2
hzims-biz-common/pom.xml

@ -40,6 +40,8 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-starter-datascope</artifactId> <artifactId>blade-starter-datascope</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

48
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/annotation/OperationAnnotation.java

@ -0,0 +1,48 @@
package com.hnac.hzims.common.logs.annotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import java.lang.annotation.*;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/29 11:38
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PARAMETER, ElementType.METHOD })
public @interface OperationAnnotation {
/**
* 操作模块
* @return
*/
String title() default "操作模块";
/**
* 系统类型网页端app端
*/
OperatorType operatorType() default OperatorType.OTHER;
/**
* 操作类型
* @return
*/
BusinessType businessType() default BusinessType.OTHER;
/**
* 是否保存响应的参数
*/
public boolean isSaveResponseData() default true;
/**
* 功能说明
* @return
*/
String action() default "功能说明";
}

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

@ -0,0 +1,259 @@
package com.hnac.hzims.common.logs.aop;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.consumer.SysLogQueue;
import com.hnac.hzims.common.logs.to.SysLogTo;
import com.hnac.hzims.common.logs.enums.BusinessStatus;
import com.hnac.hzims.common.logs.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.CodeSignature;
import org.springblade.core.launch.props.BladeProperties;
import org.springblade.core.launch.server.ServerInfo;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* @author dfy
* @date 2023/3/29
* @description: 操作日志切面处理类
*/
@Aspect
@Component
@Slf4j
public class SysLogAspect {
@Autowired
private ServerInfo serverInfo;
@Autowired
private BladeProperties bladeProperties;
@Autowired
private SysLogQueue sysLogQueue;
/**
* 请求地址
*/
private String requestPath = null;
/**
* 操作人
*/
private String userName = null;
/**
* 请求
*/
private HttpServletRequest request = null;
private Long userId = -1L;
private StopWatch stopWatch = new StopWatch();
/**
* 设置操作日志切入点 在注解的位置切入代码
*/
@Pointcut("@annotation(com.hnac.hzims.common.logs.annotation.OperationAnnotation)")
public void logPointCut() {
}
/**
* @param joinPoint
* @Description 前置通知 方法调用前触发 记录开始时间,从session中获取操作人
*/
@Before(value = "logPointCut()")
public void before(JoinPoint joinPoint) {
stopWatch.start();
log.info("前置通知");
}
/**
* @param joinPoint
* @Description 后置通知 方法调用后触发 记录结束时间 ,操作人 ,入参等
*/
@AfterReturning(value = "logPointCut()", returning = "jsonResult")
public void after(JoinPoint joinPoint, Object jsonResult) {
log.info("=========返回通知==============");
request = getHttpServletRequest();
handleLog(joinPoint, jsonResult, null);
}
/**
* @param joinPoint
* @return
* @Description 获取入参方法参数
*/
public Map<String, Object> getNameAndValue(JoinPoint joinPoint) {
Map<String, Object> param = new HashMap<>(16);
Object[] paramValues = joinPoint.getArgs();
String[] paramNames = ((CodeSignature) joinPoint.getSignature()).getParameterNames();
for (int i = 0; i < paramNames.length; i++) {
if (paramValues[i] instanceof Integer || paramValues[i] instanceof String) {
param.put(paramNames[i], paramValues[i]);
}
}
return param;
}
/**
* @Description: 获取request
*/
public HttpServletRequest getHttpServletRequest() {
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
return request;
}
/**
* @param joinPoint
* @Description 异常通知
*/
@AfterThrowing(pointcut = "logPointCut()", throwing = "e")
public void throwing(JoinPoint joinPoint, Exception e) {
log.info("=========异常通知==============");
handleLog(joinPoint, null, e);
}
/**
* 转换request 请求参数
*
* @param paramMap request获取的参数数组
*/
public Map<String, String> converMap(Map<String, String[]> paramMap) {
Map<String, String> rtnMap = new HashMap<String, String>();
for (String key : paramMap.keySet()) {
rtnMap.put(key, paramMap.get(key)[0]);
}
return rtnMap;
}
/**
* 转换异常信息为字符串
*
* @param exceptionName 异常名称
* @param exceptionMessage 异常信息
* @param elements 堆栈信息
*/
public String stackTraceToString(String exceptionName, String exceptionMessage, StackTraceElement[] elements) {
StringBuffer strbuff = new StringBuffer();
for (StackTraceElement stet : elements) {
strbuff.append(stet + "\n");
}
String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString();
return message;
}
/**
* 处理操作日志结果集
*
* @param joinPoint
* @param jsonResult
* @param exception
*/
private void handleLog(JoinPoint joinPoint, Object jsonResult, Exception exception) {
String targetName = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
Object[] arguments = joinPoint.getArgs();
Class<?> targetClass = null;
try {
targetClass = Class.forName(targetName);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Method[] methods = targetClass.getMethods();
String title;
String action;
String businessType;
String operatorType;
Class<?>[] clazzs;
for (Method method : methods) {
if (method.getName().equals(methodName)) {
clazzs = method.getParameterTypes();
if (clazzs != null && clazzs.length == arguments.length && method.getAnnotation(OperationAnnotation.class) != null) {
// 获取请求的类名
String className = joinPoint.getTarget().getClass().getName();
methodName = className + "." + methodName;
request = getHttpServletRequest();
requestPath = request.getServletPath();
OperationAnnotation annotation = method.getAnnotation(OperationAnnotation.class);
title = annotation.title();
action = annotation.action();
businessType = annotation.businessType().getValue();
operatorType = annotation.operatorType().getValue();
// 获取当前用户信息
userName = AuthUtil.getUserAccount(request);
userId = AuthUtil.getUserId(request);
SysLogTo sysLog = new SysLogTo();
if (StringUtils.isBlank(userName) && userId == -1) {
userName = "当前用户未登录";
}
sysLog.setOperationUserName(userName);
sysLog.setOperationUserId(userId);
sysLog.setTenantId(Func.toStr(AuthUtil.getTenantId(), BladeConstant.ADMIN_TENANT_ID));
sysLog.setLocalIp(WebUtil.getIP(request));// 请求IP
stopWatch.stop();
sysLog.setCostTime(stopWatch.getTotalTimeMillis() + "ms");
sysLog.setPath(requestPath);
sysLog.setTitle(title);
sysLog.setAction(action);
sysLog.setOperatorType(operatorType);
sysLog.setBusinessType(businessType);
sysLog.setParameter(getNameAndValue(joinPoint).toString());
sysLog.setMethodClass(className);
sysLog.setMethodName(methodName);
sysLog.setServerName(bladeProperties.getName());
sysLog.setServerHost(serverInfo.getHostName());
sysLog.setServerIp(serverInfo.getIpWithPort());
sysLog.setEnv(bladeProperties.getEnv());
sysLog.setMethod(request.getMethod());
sysLog.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER));
sysLog.setOperationTime(LocalDateTime.now());
//返回结果集
if (ObjectUtils.isNotEmpty(jsonResult)) {
sysLog.setStatus(BusinessStatus.SUCCESS.getKey());
sysLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
}
//异常结果集
if (exception != null) {
sysLog.setStatus(BusinessStatus.FAIL.getKey());
sysLog.setErrorMsg(StringUtils.substring(exception.getMessage(), 0, 2000));
}
//保存到阻塞队列里
sysLogQueue.add(sysLog);
}
}
}
}
}

118
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java

@ -0,0 +1,118 @@
package com.hnac.hzims.common.logs.consumer;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.hnac.hzims.common.logs.to.SysLogTo;
import com.hnac.hzims.common.logs.fegin.SysLogFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 执行异步线程操作
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/3 14:00
*/
@Slf4j
@Component
public class SysLogConsumer implements Runnable {
/**
* 默认16
*/
private static final int DEFAULT_BATCH_SIZE = 16;
@Resource
private SysLogQueue auditLogQueue;
/**
* 批次数
*/
private int batchSize = DEFAULT_BATCH_SIZE;
@Autowired
private SysLogFeignService sysLogFeignService;
/**
* 默认为true
*/
private boolean active = true;
private Thread thread;
/**
* 启动线程
*/
@PostConstruct
public void init() {
thread = new Thread(this);
thread.start();
}
/**
* 使用该注解在项目结束的舒缓关闭
*/
@PreDestroy
public void close() {
active = false;
}
/**
* 执行线程操作
*/
@Override
public void run() {
while (active) {
execute();
}
}
/**
* 执行业务处理操作新增日志记录
*/
public void execute() {
List<SysLogTo> sysLogs = new ArrayList<>();
try {
int size = 0;
while (size < batchSize) {
//从队列中取出一个
SysLogTo sysLog = auditLogQueue.poll();
if (sysLog == null) {
break;
}
sysLogs.add(sysLog);
size++;
}
} catch (InterruptedException e) {
e.printStackTrace();
log.error(e.toString());
}
//如果当前的日志list不为空
if (CollectionUtils.isNotEmpty(sysLogs)) {
log.info("日志操作数据:" + sysLogs);
// TODO: 2023/4/4 添加到数据库
try {
// TODO: 2023/4/4 后期采取kafka+elk实现,可以提高效率,操作日志数据越来越大,查询效率变大,提高性能
sysLogFeignService.saveBatch(sysLogs);
} catch (Exception e) {
// TODO: 2023/4/4 出现异常呢,
e.printStackTrace();
}
}
}
}

43
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java

@ -0,0 +1,43 @@
package com.hnac.hzims.common.logs.consumer;
import com.hnac.hzims.common.logs.to.SysLogTo;
import org.springframework.stereotype.Component;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
/**
* 定义队列
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/3 14:01
*/
@Component
public class SysLogQueue {
/**
* BlockingDequeue为双端阻塞队列blockingQueue阻塞队列
*/
private BlockingQueue<SysLogTo> blockingQueue = new LinkedBlockingQueue<>();
/**
* 存入数据
* @param auditLog
*/
public void add(SysLogTo auditLog) {
blockingQueue.add(auditLog);
}
/**
* poll从队列的头部获取到信息
* @return
* @throws InterruptedException
*/
public SysLogTo poll() throws InterruptedException {
//每秒钟执行一次
return blockingQueue.poll(1, TimeUnit.SECONDS);
}
}

33
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessStatus.java

@ -0,0 +1,33 @@
package com.hnac.hzims.common.logs.enums;
import lombok.Getter;
/**
* 操作状态
*
* @author ruoyi
*
*/
public enum BusinessStatus
{
/**
* 成功
*/
SUCCESS(0,"执行成功"),
/**
* 异常
*/
FAIL(1,"执行异常");
@Getter
private Integer key;
@Getter
private String value;
BusinessStatus(Integer key,String value){
this.key = key;
this.value = value;
}
}

73
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessType.java

@ -0,0 +1,73 @@
package com.hnac.hzims.common.logs.enums;
import lombok.Getter;
/**
* 业务操作类型
*
* @author ruoyi
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER("OTHER","其他"),
/**
* 新增
*/
INSERT("INSERT","新增"),
/**
* 修改
*/
UPDATE("UPDATE","修改"),
/**
* 删除
*/
DELETE("DELETE","删除"),
/**
* 授权
*/
GRANT("GRANT","授权"),
/**
* 导出
*/
EXPORT("EXPORT","导出"),
/**
* 导入
*/
IMPORT("IMPORT","导入"),
/**
* 强退
*/
FORCE("FORCE","强退"),
/**
* 查询
*/
GENCODE("GENCODE","查询"),
/**
* 清空数据
*/
CLEAN("CLEAN","清空数据");
@Getter
private String key;
@Getter
private String value;
BusinessType(String key,String value){
this.key = key;
this.value = value;
}
}

45
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/OperatorType.java

@ -0,0 +1,45 @@
package com.hnac.hzims.common.logs.enums;
import lombok.Getter;
/**
* 操作人类别
*
* @author ruoyi
*/
public enum OperatorType
{
/**
* 其它
*/
OTHER("OTHER","其它"),
/**
* 后台用户
*/
MANAGE("MANAGE","后台用户"),
/**
* web
*/
MOBILE("MOBILE","web端"),
/**
* app
*/
APPSYSTEMS("APPSYSTEMS","app端");
@Getter
private String key;
@Getter
private String value;
OperatorType(String key,String value){
this.key = key;
this.value = value;
}
}

29
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/SysLogFeignService.java

@ -0,0 +1,29 @@
package com.hnac.hzims.common.logs.fegin;
import com.hnac.hzims.common.logs.to.SysLogTo;
import com.hnac.hzims.common.logs.fegin.fallback.SysLogFeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/3 13:46
*/
@Repository
@FeignClient(value = "hzims-middle",fallback = SysLogFeignServiceFallback.class)
public interface SysLogFeignService {
/**
* 报存日志操作
*
* @param sysLogs
*/
@PostMapping("/systemlog/sys-log/batchSave")
void saveBatch(@RequestBody List<SysLogTo> sysLogs);
}

30
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/SysLogFeignServiceFallback.java

@ -0,0 +1,30 @@
package com.hnac.hzims.common.logs.fegin.fallback;
import com.hnac.hzims.common.logs.to.SysLogTo;
import com.hnac.hzims.common.logs.fegin.SysLogFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/4 9:45
*/
@Slf4j
@Service
public class SysLogFeignServiceFallback implements SysLogFeignService {
/**
* 报存日志操作
*
* @param sysLogs
*/
@Override
public void saveBatch(List<SysLogTo> sysLogs) {
log.error("报存日志操作异常发生,进入fallback方法");
log.error("获取异常的数据 {}", sysLogs);
throw new IllegalArgumentException("报存日志操作异常发生,进入fallback方法");
}
}

88
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/CharsetKit.java

@ -0,0 +1,88 @@
package com.hnac.hzims.common.logs.text;
import com.hnac.hzims.common.logs.utils.StringUtils;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
/**
* 字符集工具类
*
* @author dfy
*/
public class CharsetKit
{
/** ISO-8859-1 */
public static final String ISO_8859_1 = "ISO-8859-1";
/** UTF-8 */
public static final String UTF_8 = "UTF-8";
/** GBK */
public static final String GBK = "GBK";
/** ISO-8859-1 */
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
/** UTF-8 */
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
/** GBK */
public static final Charset CHARSET_GBK = Charset.forName(GBK);
/**
* 转换为Charset对象
*
* @param charset 字符集为空则返回默认字符集
* @return Charset
*/
public static Charset charset(String charset)
{
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
}
/**
* 转换字符串的字符集编码
*
* @param source 字符串
* @param srcCharset 源字符集默认ISO-8859-1
* @param destCharset 目标字符集默认UTF-8
* @return 转换后的字符集
*/
public static String convert(String source, String srcCharset, String destCharset)
{
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
}
/**
* 转换字符串的字符集编码
*
* @param source 字符串
* @param srcCharset 源字符集默认ISO-8859-1
* @param destCharset 目标字符集默认UTF-8
* @return 转换后的字符集
*/
public static String convert(String source, Charset srcCharset, Charset destCharset)
{
if (null == srcCharset)
{
srcCharset = StandardCharsets.ISO_8859_1;
}
if (null == destCharset)
{
destCharset = StandardCharsets.UTF_8;
}
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
{
return source;
}
return new String(source.getBytes(srcCharset), destCharset);
}
/**
* @return 系统字符集编码
*/
public static String systemCharset()
{
return Charset.defaultCharset().name();
}
}

1009
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/Convert.java

File diff suppressed because it is too large Load Diff

93
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/StrFormatter.java

@ -0,0 +1,93 @@
package com.hnac.hzims.common.logs.text;
import com.hnac.hzims.common.logs.utils.StringUtils;
/**
* 字符串格式化
*
* @author ruoyi
*/
public class StrFormatter
{
public static final String EMPTY_JSON = "{}";
public static final char C_BACKSLASH = '\\';
public static final char C_DELIM_START = '{';
public static final char C_DELIM_END = '}';
/**
* 格式化字符串<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
* 如果想输出 {} 使用 \\转义 { 即可如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* <br>
* 通常使用format("this is {} for {}", "a", "b") -> this is a for b<br>
* 转义{} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* 转义\ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
* @param strPattern 字符串模板
* @param argArray 参数列表
* @return 结果
*/
public static String format(final String strPattern, final Object... argArray)
{
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
{
return strPattern;
}
final int strPatternLength = strPattern.length();
// 初始化定义好的长度以获得更好的性能
StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
int handledPosition = 0;
int delimIndex;// 占位符所在位置
for (int argIndex = 0; argIndex < argArray.length; argIndex++)
{
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
if (delimIndex == -1)
{
if (handledPosition == 0)
{
return strPattern;
}
else
{ // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
sbuf.append(strPattern, handledPosition, strPatternLength);
return sbuf.toString();
}
}
else
{
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
{
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
{
// 转义符之前还有一个转义符,占位符依旧有效
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
}
else
{
// 占位符被转义
argIndex--;
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(C_DELIM_START);
handledPosition = delimIndex + 1;
}
}
else
{
// 正常占位符
sbuf.append(strPattern, handledPosition, delimIndex);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
}
}
}
// 加入最后一个占位符后所有的字符
sbuf.append(strPattern, handledPosition, strPattern.length());
return sbuf.toString();
}
}

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

@ -0,0 +1,145 @@
package com.hnac.hzims.common.logs.to;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/29 13:24
*/
@Data
public class SysLogTo {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 租户ID
*/
private String tenantId;
/**
* 服务器ip
*/
protected String serverIp;
/**
* 服务器地址
*/
protected String serverHost;
/**
* 服务名称
*/
protected String serverName;
/**
* 环境
*/
protected String env;
/**
* 操作人 id
*/
private Long operationUserId;
/**
* 操作人
*/
private String operationUserName;
/**
* 请求路径 操作地址
*/
private String path;
/**
* 用户代理
*/
protected String userAgent;
/**
* 操作方式
*/
protected String method;
/**
* 方法类
*/
protected String methodClass;
/**
* 方法名
*/
protected String methodName;
/**
* 方法执行时间 消耗时间 毫秒
*/
private String costTime;
/**
* 方法入参
*/
private String parameter;
/**
* 操作方法
*/
private String title;
/**
* 方法描述
*/
private String action;
/**
* 系统类型
*/
private String operatorType;
/**
* 操作人类别
*/
private String businessType;
/**
* 返回结果
*
* @param jsonResult
*/
public String jsonResult;
/**
* 请求的Ip
*/
private String localIp;
/**
* 错误消息
*/
private String errorMsg;
/**
* 操作时间
*/
private LocalDateTime operationTime;
/**
* 操作状态0 正常 1 异常
*/
private Integer status;
}

130
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/utils/Constants.java

@ -0,0 +1,130 @@
package com.hnac.hzims.common.logs.utils;
/**
* 通用常量信息
*
* @author ruoyi
*/
public class Constants
{
/**
* UTF-8 字符集
*/
public static final String UTF8 = "UTF-8";
/**
* GBK 字符集
*/
public static final String GBK = "GBK";
/**
* www主域
*/
public static final String WWW = "www.";
/**
* RMI 远程方法调用
*/
public static final String LOOKUP_RMI = "rmi:";
/**
* LDAP 远程方法调用
*/
public static final String LOOKUP_LDAP = "ldap:";
/**
* LDAPS 远程方法调用
*/
public static final String LOOKUP_LDAPS = "ldaps:";
/**
* http请求
*/
public static final String HTTP = "http://";
/**
* https请求
*/
public static final String HTTPS = "https://";
/**
* 成功标记
*/
public static final Integer SUCCESS = 200;
/**
* 失败标记
*/
public static final Integer FAIL = 500;
/**
* 登录成功状态
*/
public static final String LOGIN_SUCCESS_STATUS = "0";
/**
* 登录失败状态
*/
public static final String LOGIN_FAIL_STATUS = "1";
/**
* 登录成功
*/
public static final String LOGIN_SUCCESS = "Success";
/**
* 注销
*/
public static final String LOGOUT = "Logout";
/**
* 注册
*/
public static final String REGISTER = "Register";
/**
* 登录失败
*/
public static final String LOGIN_FAIL = "Error";
/**
* 当前记录起始索引
*/
public static final String PAGE_NUM = "pageNum";
/**
* 每页显示记录数
*/
public static final String PAGE_SIZE = "pageSize";
/**
* 排序列
*/
public static final String ORDER_BY_COLUMN = "orderByColumn";
/**
* 排序的方向 "desc" 或者 "asc".
*/
public static final String IS_ASC = "isAsc";
/**
* 验证码有效期分钟
*/
public static final long CAPTCHA_EXPIRATION = 2;
/**
* 资源映射路径 前缀
*/
public static final String RESOURCE_PREFIX = "/profile";
/**
* 定时任务白名单配置仅允许访问的包名如其他需要可以自行添加
*/
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
/**
* 定时任务违规的字符
*/
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" };
}

567
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/utils/StringUtils.java

@ -0,0 +1,567 @@
package com.hnac.hzims.common.logs.utils;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/31 15:43
*/
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.hnac.hzims.common.logs.text.StrFormatter;
import org.springframework.util.AntPathMatcher;
/**
* 字符串工具类
*
* @author ruoyi
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils
{
/** 空字符串 */
private static final String NULLSTR = "";
/** 下划线 */
private static final char SEPARATOR = '_';
/**
* 获取参数不为空值
*
* @param value defaultValue 要判断的value
* @return value 返回值
*/
public static <T> T nvl(T value, T defaultValue)
{
return value != null ? value : defaultValue;
}
/**
* * 判断一个Collection是否为空 包含ListSetQueue
*
* @param coll 要判断的Collection
* @return true为空 false非空
*/
public static boolean isEmpty(Collection<?> coll)
{
return isNull(coll) || coll.isEmpty();
}
/**
* * 判断一个Collection是否非空包含ListSetQueue
*
* @param coll 要判断的Collection
* @return true非空 false
*/
public static boolean isNotEmpty(Collection<?> coll)
{
return !isEmpty(coll);
}
/**
* * 判断一个对象数组是否为空
*
* @param objects 要判断的对象数组
** @return true为空 false非空
*/
public static boolean isEmpty(Object[] objects)
{
return isNull(objects) || (objects.length == 0);
}
/**
* * 判断一个对象数组是否非空
*
* @param objects 要判断的对象数组
* @return true非空 false
*/
public static boolean isNotEmpty(Object[] objects)
{
return !isEmpty(objects);
}
/**
* * 判断一个Map是否为空
*
* @param map 要判断的Map
* @return true为空 false非空
*/
public static boolean isEmpty(Map<?, ?> map)
{
return isNull(map) || map.isEmpty();
}
/**
* * 判断一个Map是否为空
*
* @param map 要判断的Map
* @return true非空 false
*/
public static boolean isNotEmpty(Map<?, ?> map)
{
return !isEmpty(map);
}
/**
* * 判断一个字符串是否为空串
*
* @param str String
* @return true为空 false非空
*/
public static boolean isEmpty(String str)
{
return isNull(str) || NULLSTR.equals(str.trim());
}
/**
* * 判断一个字符串是否为非空串
*
* @param str String
* @return true非空串 false空串
*/
public static boolean isNotEmpty(String str)
{
return !isEmpty(str);
}
/**
* * 判断一个对象是否为空
*
* @param object Object
* @return true为空 false非空
*/
public static boolean isNull(Object object)
{
return object == null;
}
/**
* * 判断一个对象是否非空
*
* @param object Object
* @return true非空 false
*/
public static boolean isNotNull(Object object)
{
return !isNull(object);
}
/**
* * 判断一个对象是否是数组类型Java基本型别的数组
*
* @param object 对象
* @return true是数组 false不是数组
*/
public static boolean isArray(Object object)
{
return isNotNull(object) && object.getClass().isArray();
}
/**
* 去空格
*/
public static String trim(String str)
{
return (str == null ? "" : str.trim());
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始
* @return 结果
*/
public static String substring(final String str, int start)
{
if (str == null)
{
return NULLSTR;
}
if (start < 0)
{
start = str.length() + start;
}
if (start < 0)
{
start = 0;
}
if (start > str.length())
{
return NULLSTR;
}
return str.substring(start);
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始
* @param end 结束
* @return 结果
*/
public static String substring(final String str, int start, int end)
{
if (str == null)
{
return NULLSTR;
}
if (end < 0)
{
end = str.length() + end;
}
if (start < 0)
{
start = str.length() + start;
}
if (end > str.length())
{
end = str.length();
}
if (start > end)
{
return NULLSTR;
}
if (start < 0)
{
start = 0;
}
if (end < 0)
{
end = 0;
}
return str.substring(start, end);
}
/**
* 判断是否为空并且不是空白字符
*
* @param str 要判断的value
* @return 结果
*/
public static boolean hasText(String str)
{
return (str != null && !str.isEmpty() && containsText(str));
}
private static boolean containsText(CharSequence str)
{
int strLen = str.length();
for (int i = 0; i < strLen; i++)
{
if (!Character.isWhitespace(str.charAt(i)))
{
return true;
}
}
return false;
}
/**
* 格式化文本, {} 表示占位符<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
* 如果想输出 {} 使用 \\转义 { 即可如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* <br>
* 通常使用format("this is {} for {}", "a", "b") -> this is a for b<br>
* 转义{} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* 转义\ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
* @param template 文本模板被替换的部分用 {} 表示
* @param params 参数值
* @return 格式化后的文本
*/
public static String format(String template, Object... params)
{
if (isEmpty(params) || isEmpty(template))
{
return template;
}
return StrFormatter.format(template, params);
}
/**
* 是否为http(s)://开头
*
* @param link 链接
* @return 结果
*/
public static boolean ishttp(String link)
{
return startsWithAny(link, Constants.HTTP, Constants.HTTPS);
}
/**
* 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
*
* @param array 给定的数组
* @return boolean 结果
*/
public static boolean containsAny(Collection<String> collection, String... array)
{
if (isEmpty(collection) || isEmpty(array))
{
return false;
}
else
{
for (String str : array)
{
if (collection.contains(str))
{
return true;
}
}
return false;
}
}
/**
* 驼峰转下划线命名
*/
public static String toUnderScoreCase(String str)
{
if (str == null)
{
return null;
}
StringBuilder sb = new StringBuilder();
// 前置字符是否大写
boolean preCharIsUpperCase = true;
// 当前字符是否大写
boolean curreCharIsUpperCase = true;
// 下一字符是否大写
boolean nexteCharIsUpperCase = true;
for (int i = 0; i < str.length(); i++)
{
char c = str.charAt(i);
if (i > 0)
{
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
}
else
{
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
if (i < (str.length() - 1))
{
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
{
sb.append(SEPARATOR);
}
else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
{
sb.append(SEPARATOR);
}
sb.append(Character.toLowerCase(c));
}
return sb.toString();
}
/**
* 是否包含字符串
*
* @param str 验证字符串
* @param strs 字符串组
* @return 包含返回true
*/
public static boolean inStringIgnoreCase(String str, String... strs)
{
if (str != null && strs != null)
{
for (String s : strs)
{
if (str.equalsIgnoreCase(trim(s)))
{
return true;
}
}
}
return false;
}
/**
* 将下划线大写方式命名的字符串转换为驼峰式如果转换前的下划线大写方式命名的字符串为空则返回空字符串 例如HELLO_WORLD->HelloWorld
*
* @param name 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
public static String convertToCamelCase(String name)
{
StringBuilder result = new StringBuilder();
// 快速检查
if (name == null || name.isEmpty())
{
// 没必要转换
return "";
}
else if (!name.contains("_"))
{
// 不含下划线,仅将首字母大写
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
// 用下划线将原始字符串分割
String[] camels = name.split("_");
for (String camel : camels)
{
// 跳过原始字符串中开头、结尾的下换线或双重下划线
if (camel.isEmpty())
{
continue;
}
// 首字母大写
result.append(camel.substring(0, 1).toUpperCase());
result.append(camel.substring(1).toLowerCase());
}
return result.toString();
}
/**
* 驼峰式命名法
* 例如user_name->userName
*/
public static String toCamelCase(String s)
{
if (s == null)
{
return null;
}
if (s.indexOf(SEPARATOR) == -1)
{
return s;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c == SEPARATOR)
{
upperCase = true;
}
else if (upperCase)
{
sb.append(Character.toUpperCase(c));
upperCase = false;
}
else
{
sb.append(c);
}
}
return sb.toString();
}
/**
* 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
*
* @param str 指定字符串
* @param strs 需要检查的字符串数组
* @return 是否匹配
*/
public static boolean matches(String str, List<String> strs)
{
if (isEmpty(str) || isEmpty(strs))
{
return false;
}
for (String pattern : strs)
{
if (isMatch(pattern, str))
{
return true;
}
}
return false;
}
/**
* 判断url是否与规则配置:
* ? 表示单个字符;
* * 表示一层路径内的任意字符串不可跨层级;
* ** 表示任意层路径;
*
* @param pattern 匹配规则
* @param url 需要匹配的url
* @return
*/
public static boolean isMatch(String pattern, String url)
{
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, url);
}
@SuppressWarnings("unchecked")
public static <T> T cast(Object obj)
{
return (T) obj;
}
/**
* 数字左边补齐0使之达到指定长度注意如果数字转换为字符串后长度大于size则只保留 最后size个字符
*
* @param num 数字对象
* @param size 字符串指定长度
* @return 返回数字的字符串格式该字符串为指定长度
*/
public static final String padl(final Number num, final int size)
{
return padl(num.toString(), size, '0');
}
/**
* 字符串左补齐如果原始字符串s长度大于size则只保留最后size个字符
*
* @param s 原始字符串
* @param size 字符串指定长度
* @param c 用于补齐的字符
* @return 返回指定长度的字符串由原字符串左补齐或截取得到
*/
public static final String padl(final String s, final int size, final char c)
{
final StringBuilder sb = new StringBuilder(size);
if (s != null)
{
final int len = s.length();
if (s.length() <= size)
{
for (int i = size - len; i > 0; i--)
{
sb.append(c);
}
sb.append(s);
}
else
{
return s.substring(len - size, len);
}
}
else
{
for (int i = size; i > 0; i--)
{
sb.append(c);
}
}
return sb.toString();
}
}

49
hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/IPUtils.java

@ -0,0 +1,49 @@
package com.hnac.hzims.common.utils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import javax.servlet.http.HttpServletRequest;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/29 11:45
*/
public class IPUtils {
/**
* 获取客户端ip地址
* @param request
* @return
*/
public static String getIpAddress(HttpServletRequest request) {
String sourceIp = null;
String ipAddresses = request.getHeader("x-forwarded-for");
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
ipAddresses = request.getHeader("Proxy-Client-IP");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
ipAddresses = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
ipAddresses = request.getHeader("HTTP_CLIENT_IP");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
ipAddresses = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
ipAddresses = request.getRemoteAddr();
}
if (StringUtils.isEmpty(ipAddresses)) {
sourceIp = ipAddresses.split(",")[0];
}
return sourceIp;
}
}

85
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyEmergencyEntity.java

@ -0,0 +1,85 @@
package com.hnac.hzims.operational.duty.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
*
* @author ty
*/
@Data
@TableName("hz_ims_duty_emergency")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ImsDutyEmergency对象", description = "突发事件登记")
public class ImsDutyEmergencyEntity extends TenantEntity {
private static final long serialVersionUID = 4259568798118459986L;
/**
* 值班日期
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ApiModelProperty(value = "值班日期")
private Date dutyTime;
/**
* 班次
*/
@ApiModelProperty(value = "班次")
private Long dutyClass;
/**
* 登记人
*/
@ApiModelProperty(value = "登记人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long registrant;
/**
* 值班长
*/
@ApiModelProperty(value = "值班长")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long chargePerson;
/**
* 登记时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ApiModelProperty(value = "登记时间")
private Date registerTime;
/**
* 事件主题
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "事件主题")
private String eventTitle;
/**
* 事件内容
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "事件内容")
private String eventInfo;
/**
* 事件方式
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "事件方式")
private String eventType;
}

9
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyMainEntity.java

@ -22,17 +22,22 @@ import java.util.Date;
@Data @Data
@TableName("hz_ims_duty_main") @TableName("hz_ims_duty_main")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ImsDutyMain对象", description = "值班信息") @ApiModel(value = "ImsDutyMain对象", description = "值班-班组信息")
public class ImsDutyMainEntity extends TenantEntity { public class ImsDutyMainEntity extends TenantEntity {
private static final long serialVersionUID = -1913292438493450113L; private static final long serialVersionUID = -1913292438493450113L;
/**
* 主键ID
*/
@ApiModelProperty(value = "排班计划id")
private Long id;
/** /**
* 值班组id * 值班组id
*/ */
@ApiModelProperty(value = "值班组id") @ApiModelProperty(value = "值班组id")
private Long dutyGroupId; private Long dutyGroupId;
/** /**
* 值班人IDS, ID之间用^隔开 * 值班人IDS, ID之间用^隔开
*/ */

82
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyMainPersonEntity.java

@ -0,0 +1,82 @@
package com.hnac.hzims.operational.duty.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
*
* @author TY
*/
@Data
@TableName("hz_ims_duty_main_person")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ImsDutyMainPerson对象", description = "值班-人员信息")
public class ImsDutyMainPersonEntity extends TenantEntity {
private static final long serialVersionUID = -1913292438493450113L;
/**
* 值班组id
*/
@ApiModelProperty(value = "值班组id")
private Long dutyGroupId;
/**
* 值班人ID
*/
@ApiModelProperty(value = "值班人ID")
private Long dutyPerson;
/**
* 值班负责人ID
*/
@ApiModelProperty(value = "值班负责人ID")
private Long dutyChargePerson;
/**
* 值班日期
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@ApiModelProperty(value = "值班日期")
private Date dutyDate;
/**
* 班次ID
*/
@ApiModelProperty(value = "班次ID")
private Long classId;
// /**
// * 班次名称
// */
// @TableField(exist=false)
// @ApiModelProperty(value = "班次名称")
// private String className;
/**
* 值班班组名称
*/
@TableField(exist=false)
@ApiModelProperty(value = "值班班组名称")
private String dutyGroupName;
/**
* 值班-班组ID
*/
@ApiModelProperty(value = "值班-班组ID")
private Long dutyMainId;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
}

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/entity/ImsDutyMainTemplateEntity.java

@ -30,6 +30,9 @@ public class ImsDutyMainTemplateEntity extends TenantEntity {
private Integer dutyNum; private Integer dutyNum;
@ApiModelProperty("班次类型ID") @ApiModelProperty("班次类型ID")
private Long dutyClassTypeId; private Long dutyClassTypeId;
@ApiModelProperty("灵活排班人员IDs")
private String flexible;
@ApiModelProperty("排班类型")//1:班组,2:灵活排班
private Integer type;
} }

41
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ChangeDutyMainVo.java

@ -0,0 +1,41 @@
package com.hnac.hzims.operational.duty.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@ApiModel(value = "调班对象", description = "调班填写的相关信息")
public class ChangeDutyMainVo extends ImsDutyMainEntity {
@ApiModelProperty(value = "人员ID")
private List<String> personId;
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@ApiModelProperty(value = "调班开始日期")
private Date changeStartDate;
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@ApiModelProperty(value = "调班开始日期")
private Date changeEndtDate;
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "班次ID")
private Long classId;
/**
* 调班类型
* 1为调入2为调出
*/
@ApiModelProperty(value = "调班类型")
private Integer type;//1为调入,2为调出
}

28
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/FlexibleSchedulingVo.java

@ -0,0 +1,28 @@
package com.hnac.hzims.operational.duty.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class FlexibleSchedulingVo {
/**
* 值班组长ID
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty("值班组长ID")
private String chargeId;
/**
* 人员IDs
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty("人员ID")
private List<String> personIds;
}

86
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ImsDutyEmergencyVo.java

@ -0,0 +1,86 @@
package com.hnac.hzims.operational.duty.vo;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* 实体类
*
* @author ty
*/
@Data
public class ImsDutyEmergencyVo extends TenantEntity {
private static final long serialVersionUID = 4259568798118459986L;
/**
* 值班开始日期
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ApiModelProperty(value = "值班开始日期")
private Date dutyStartTime;
/**
* 值班结束日期
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ApiModelProperty(value = "值班结束日期")
private Date dutyEndTime;
/**
* 班次
*/
@ApiModelProperty(value = "班次")
private List<Long> dutyClass;
/**
* 登记人
*/
@ApiModelProperty(value = "登记人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private List<Long> registrant;
/**
* 值班长
*/
@ApiModelProperty(value = "值班长")
@JsonSerialize(nullsUsing = NullSerializer.class)
private List<Long> chargePerson;
/**
* 登记时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ApiModelProperty(value = "登记时间")
private Date registerTime;
/**
* 事件主题
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "事件主题")
private String eventTitle;
/**
* 事件内容
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "事件内容")
private String eventInfo;
/**
* 事件方式
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "事件方式")
private String eventType;
}

10
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ImsSchedulingVo.java

@ -6,6 +6,7 @@ import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
import java.util.Map; import java.util.Map;
@Data @Data
@ -55,6 +56,8 @@ public class ImsSchedulingVo extends ImsDutyMainEntity {
private String classTypeName; private String classTypeName;
@ApiModelProperty("班组负责人") @ApiModelProperty("班组负责人")
private Long managerId; private Long managerId;
@ApiModelProperty("班组负责人名称")
private String managerName;
@ApiModelProperty("用户名称") @ApiModelProperty("用户名称")
private String userName; private String userName;
@ -68,10 +71,15 @@ public class ImsSchedulingVo extends ImsDutyMainEntity {
private String templateName; private String templateName;
@ApiModelProperty("排班类型: 1、轮询 2 、周期") @ApiModelProperty("排班类型: 1、轮询 2 、周期")
private Integer schedulingType; private Integer schedulingType;
@ApiModelProperty("人员类型: 1、班组 2 、人员")
private Integer personType;
@ApiModelProperty("是否保存为模版,true 是,false 否") @ApiModelProperty("是否保存为模版,true 是,false 否")
private Boolean template; private Boolean template;
@ApiModelProperty("班次类型ID") @ApiModelProperty("班次类型ID")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Long dutyClassTypeId; private Long dutyClassTypeId;
@ApiModelProperty("灵活人员排班-轮询")
private Map<String, List<String>> rosters;
@ApiModelProperty("灵活人员排班-周期")
private Map<String, List<FlexibleSchedulingVo>> flexible;
} }

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/feign/IAccessTaskClient.java

@ -6,6 +6,7 @@ import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.feign.ITaskClient; import com.hnac.hzims.feign.ITaskClient;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/** /**
* @author hx * @author hx
*/ */
@Repository
@FeignClient( @FeignClient(
value = OperationalConstants.APP_NAME value = OperationalConstants.APP_NAME
) )

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/constants/HomePageConstant.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.maintenance.constants; package com.hnac.hzims.operational.main.constant;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -175,6 +175,10 @@ public interface HomePageConstant {
/**遥信1**/ /**遥信1**/
String PV_JOINT_RELAY = "joint_relay"; String PV_JOINT_RELAY = "joint_relay";
/*==========================================================================================*/ /*==========================================================================================*/
// 光伏指标属性
String PHOTOVOLTAIC_GENERATE = "generation_capacity"; // 发电量
String PHOTOVOLTAIC_LOAD = "active_power"; // 功率
/*==========================================================================================*/
// 水电集团、区域指标关联 // 水电集团、区域指标关联
/**功率**/ /**功率**/
Integer POWER = 0; Integer POWER = 0;

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -70,4 +70,10 @@ public interface MainConstants {
// 通讯中断数据处理 // 通讯中断数据处理
String ALARM_DATA_HANDLE = "alarmDataHandle"; String ALARM_DATA_HANDLE = "alarmDataHandle";
// 光伏站-机组指标数据
String LOAD_PHOTOVOLTAIC_TARGET = "loadPhotovoltaicTarget";
// 光伏站-机组指标数据
String LOAD_PHOTOVOLTAIC_REAL = "loadPhotovoltaicReal";
} }

22
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/GenerationVo.java

@ -0,0 +1,22 @@
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/24 09:58:57
* @version 4.0.0
*/
@Data
@ApiModel(value = "发电量数据")
public class GenerationVo {
@ApiModelProperty(value = "周期")
private String period;
@ApiModelProperty(value = "月发电量")
private Float power;
}

29
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceChartsVo.java

@ -0,0 +1,29 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "光伏设备排行对象")
public class PhotovoltaicDeviceChartsVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "设备Code")
private String deviceCode;
@ApiModelProperty(value = "设备名称")
private String deviceName;
@ApiModelProperty(value = "实时功率: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
}

87
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceVo.java

@ -0,0 +1,87 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
* @date 2023/03/29 15:14:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "光伏设备数据对象")
public class PhotovoltaicDeviceVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "设备Code")
private String deviceCode;
@ApiModelProperty(value = "设备名称")
private String deviceName;
@ApiModelProperty(value = "容量: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "实时功率: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "环比功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double loadRatio;
@ApiModelProperty(value = "发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "日发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "环比功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDayRatio;
@ApiModelProperty(value = "月发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateMon;
@ApiModelProperty(value = "年发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateYear;
@ApiModelProperty(value = "电压: V")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double voltage;
@ApiModelProperty(value = "电流: A")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double current;
@ApiModelProperty(value = "co2减排: kg")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double co2;
@ApiModelProperty(value = "节约标准煤减排: kt")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double tec;
@ApiModelProperty(value = "收益: 元")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double income;
@ApiModelProperty(value = "当日机组有功功率")
private List<PhotovoltaicPowerVo> activePowerVoList;
@ApiModelProperty(value = "近30天用电量")
private List<GenerationPowerVo> generationPowerVoList;
}

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicGenerateYearVo.java

@ -0,0 +1,21 @@
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/29 15:26:07
* @version 4.0.0
*/
@Data
@ApiModel(value = "月发电对象")
public class PhotovoltaicGenerateYearVo {
@ApiModelProperty(value = "月份")
private String mon;
@ApiModelProperty(value = "发电量")
private Float generate;
}

14
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java

@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author ysj * @author ysj
* @date 2023/03/23 16:54:36 * @date 2023/03/23 16:54:36
@ -26,9 +28,21 @@ public class PhotovoltaicKPIsVo {
@ApiModelProperty(value = "年发电量:单位-kWh") @ApiModelProperty(value = "年发电量:单位-kWh")
private Double powerYear; private Double powerYear;
@ApiModelProperty(value = "二氧化碳减排:1kwh = 0.997kg二氧化碳排放")
private Double co2;
@ApiModelProperty(value = "节约标准煤:1kwh = 0.0001229吨煤")
private Double tec;
@ApiModelProperty(value = "减少森林砍伐:1kwh = 0.000553")
private Double deforest;
@ApiModelProperty(value = "月发电量:单位-kWh") @ApiModelProperty(value = "月发电量:单位-kWh")
private Double powerMon; private Double powerMon;
@ApiModelProperty(value = "日发电量:单位-kWh") @ApiModelProperty(value = "日发电量:单位-kWh")
private Double powerDay; private Double powerDay;
@ApiModelProperty(value = "近年发电量集合")
private List<PowerYearVo> powerYearVoList;
} }

17
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicPowerVo.java

@ -0,0 +1,17 @@
package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "当日机组有功功率")
public class PhotovoltaicPowerVo {
@ApiModelProperty(value = "小时")
private String hour;
@ApiModelProperty(value = "有功功率")
private String activePower;
}

54
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicRealVo.java

@ -0,0 +1,54 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/24 10:55:02
* @version 4.0.0
*/
@Data
@ApiModel(value = "光伏实时数据")
public class PhotovoltaicRealVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "设备Code")
private String deviceCode;
@ApiModelProperty(value = "设备名称")
private String deviceName;
@ApiModelProperty(value = "状态: 0-运行")
private Integer state;
@ApiModelProperty(value = "容量: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "总发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "电压: V")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double voltage;
@ApiModelProperty(value = "电流: A")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double current;
@ApiModelProperty(value = "功率: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "上次功率: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double lastLoad;
}

89
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationVo.java

@ -0,0 +1,89 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ysj
* @date 2023/03/29 15:14:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "水利站点首页对象")
public class PhotovoltaicStationVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "站点编码")
private String stationCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "投运时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private LocalDateTime operationTime;
@ApiModelProperty(value = "总装机容量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "安全运行天数")
private Integer runDay;
@ApiModelProperty(value = "总发电负荷")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "日发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "月发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateMon;
@ApiModelProperty(value = "年发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateYear;
@ApiModelProperty(value = "总发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "站点实时温度")
private String temp;
@ApiModelProperty(value = "站点收益")
private Double income;
@ApiModelProperty(value = "逆变器数量")
private Integer inverterCount;
@ApiModelProperty(value = "七日内天气")
private List<Daily> weather;
@ApiModelProperty(value = "发电排行")
private List<PhotovoltaicDeviceVo> devices;
@ApiModelProperty(value = "年发电量完成百分比")
private List<PowerYearVo> generateSurvey;
@ApiModelProperty(value = "设备信息")
private List<PhotovoltaicDeviceChartsVo> charts;
}

67
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicTargetVo.java

@ -0,0 +1,67 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "光伏指标数据对象")
public class PhotovoltaicTargetVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "设备Code")
private String deviceCode;
@ApiModelProperty(value = "设备名称")
private String deviceName;
@ApiModelProperty(value = "当日运行时长")
private Double runHours;
@ApiModelProperty(value = "年发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationYear;
@ApiModelProperty(value = "月发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationMon;
@ApiModelProperty(value = "节约标准煤:1kwh = 0.0001229吨煤")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double tec;
@ApiModelProperty(value = "二氧化碳减排:1kwh = 0.000997吨二氧化碳排放")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double co2;
@ApiModelProperty(value = "收益:1kwh = 0.3 ~ 0.425人名币")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double income;
@ApiModelProperty(value = "减少森林砍伐:1kwh = 0.000553")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double deforest;
@ApiModelProperty(value = "日发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationDay;
@ApiModelProperty(value = "昨日发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationYesterday;
@ApiModelProperty(value = "当日机组有功功率")
private List<PhotovoltaicPowerVo> activePowerVoList;
@ApiModelProperty(value = "近30天用电量")
private List<GenerationPowerVo> generationPowerVoList;
}

87
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/SubordinateVo.java

@ -0,0 +1,87 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
* @date 2023/03/24 09:58:57
* @version 4.0.0
*/
@Data
@ApiModel(value = "发电量数据")
public class SubordinateVo {
@ApiModelProperty(value = "机构ID")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "地市编码")
private String areaCode;
@ApiModelProperty(value = "地市名称")
private String areaName;
@ApiModelProperty(value = "光伏站点类型:0-个体光伏站 1-厂房光伏站")
private Long type;
@ApiModelProperty("经度(东经)")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float lgtd;
@ApiModelProperty("纬度(北纬)")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float lttd;
@ApiModelProperty(value = "容量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generation;
@ApiModelProperty(value = "发电占比")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationRate;
@ApiModelProperty(value = "容量利用率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacityUse;
@ApiModelProperty(value = "电站利用率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double stationUse;
@ApiModelProperty(value = "站点实时温度")
private String temp;
@ApiModelProperty(value = "七日内天气")
private List<Daily> weather;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "站点数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long stationCount;
@ApiModelProperty(value = "站点使用数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long stationUseCount;
}

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java

@ -147,4 +147,7 @@ public class StationEntity extends TenantEntity implements Serializable {
@ApiModelProperty("实时画面绑定账号秘钥") @ApiModelProperty("实时画面绑定账号秘钥")
private String secretKey; private String secretKey;
@ApiModelProperty("光伏站点配置类型: 0-个体光伏站 1-厂房光伏站")
private Long photovoltaicType;
} }

7
hzims-service-api/inspect-api/pom.xml

@ -23,6 +23,12 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-starter-mybatis</artifactId> <artifactId>blade-starter-mybatis</artifactId>
<version>${bladex.project.version}</version> <version>${bladex.project.version}</version>
<exclusions>
<exclusion>
<artifactId>lettuce-core</artifactId>
<groupId>io.lettuce</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
@ -57,6 +63,7 @@
<artifactId>common-api</artifactId> <artifactId>common-api</artifactId>
<version>4.0.0-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

6
hzims-service-api/pom.xml

@ -32,6 +32,12 @@
<dependency> <dependency>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-starter-mybatis</artifactId> <artifactId>blade-starter-mybatis</artifactId>
<exclusions>
<exclusion>
<artifactId>lettuce-core</artifactId>
<groupId>io.lettuce</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>

117
hzims-service-api/weather-api/.mvn/wrapper/MavenWrapperDownloader.java vendored

@ -1,117 +0,0 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

BIN
hzims-service-api/weather-api/.mvn/wrapper/maven-wrapper.jar vendored

Binary file not shown.

2
hzims-service-api/weather-api/.mvn/wrapper/maven-wrapper.properties vendored

@ -1,2 +0,0 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

1
hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/vo/RainFallCountByMonthVo.java

@ -1,5 +1,6 @@
package com.hnac.hzims.hzimsweather.vo; package com.hnac.hzims.hzimsweather.vo;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.SpAllocationEntity; import com.hnac.hzims.spare.entity.SpAllocationEntity;
import com.hnac.hzims.spare.service.ISpAllocationService; import com.hnac.hzims.spare.service.ISpAllocationService;
import com.hnac.hzims.spare.vo.SpAllocationVO; import com.hnac.hzims.spare.vo.SpAllocationVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -59,9 +63,12 @@ public class SpAllocationController extends BladeController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog
@GetMapping("/pageList") @GetMapping("/pageList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入sp_allocation") @ApiOperation(value = "分页", notes = "传入sp_allocation")
@OperationAnnotation(title = "调泼单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<SpAllocationVO>> pageList(SpAllocationVO allocationVO, Query query) { public R<IPage<SpAllocationVO>> pageList(SpAllocationVO allocationVO, Query query) {
IPage<SpAllocationVO> pages = sp_allocationService.selectPageList(Condition.getPage(query),allocationVO); IPage<SpAllocationVO> pages = sp_allocationService.selectPageList(Condition.getPage(query),allocationVO);
return R.data(pages); return R.data(pages);

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.SpReceiveEntity; import com.hnac.hzims.spare.entity.SpReceiveEntity;
import com.hnac.hzims.spare.service.ISpReceiveService; import com.hnac.hzims.spare.service.ISpReceiveService;
import com.hnac.hzims.spare.vo.SpReceiveVO; import com.hnac.hzims.spare.vo.SpReceiveVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -46,9 +50,12 @@ public class SpReceiveController extends BladeController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入sp_receive") @ApiOperation(value = "分页", notes = "传入sp_receive")
@OperationAnnotation(title = "工具领用",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<SpReceiveVO>> list(SpReceiveVO receiveVO, Query query) { public R<IPage<SpReceiveVO>> list(SpReceiveVO receiveVO, Query query) {
IPage<SpReceiveVO> pages = sp_receiveService.selectPageList(Condition.getPage(query), receiveVO); IPage<SpReceiveVO> pages = sp_receiveService.selectPageList(Condition.getPage(query), receiveVO);
return R.data(pages); return R.data(pages);

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceivesController.java

@ -1,6 +1,9 @@
package com.hnac.hzims.spare.controller; package com.hnac.hzims.spare.controller;
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.spare.entity.SpReceivesEntity; import com.hnac.hzims.spare.entity.SpReceivesEntity;
import com.hnac.hzims.spare.service.ISpReceivesService; import com.hnac.hzims.spare.service.ISpReceivesService;
import com.hnac.hzims.spare.vo.SpReceivesVO; import com.hnac.hzims.spare.vo.SpReceivesVO;
@ -13,6 +16,7 @@ import javax.validation.Valid;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -49,9 +53,12 @@ public class SpReceivesController extends BladeController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
// @ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入sp_receives") @ApiOperation(value = "分页", notes = "传入sp_receives")
@OperationAnnotation(title = "工具回退",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<SpReceivesVO>> list(SpReceivesVO sp_receives, Query query) { public R<IPage<SpReceivesVO>> list(SpReceivesVO sp_receives, Query query) {
IPage<SpReceivesVO> pages = sp_receivesService.selectPageList(Condition.getPage(query), sp_receives); IPage<SpReceivesVO> pages = sp_receivesService.selectPageList(Condition.getPage(query), sp_receives);
return R.data(pages); return R.data(pages);

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.SpWarehouseInEntity; import com.hnac.hzims.spare.entity.SpWarehouseInEntity;
import com.hnac.hzims.spare.service.ISpWarehouseInService; import com.hnac.hzims.spare.service.ISpWarehouseInService;
import com.hnac.hzims.spare.vo.SpWarehouseInVO; import com.hnac.hzims.spare.vo.SpWarehouseInVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -58,9 +62,12 @@ public class SpWarehouseInController extends BladeController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog
@GetMapping("/pageList") @GetMapping("/pageList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入sp_warehouse_in") @ApiOperation(value = "分页", notes = "传入sp_warehouse_in")
@OperationAnnotation(title = "入库单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<IPage<SpWarehouseInVO>> pageList(SpWarehouseInVO warehouseInVO, Query query) { public R<IPage<SpWarehouseInVO>> pageList(SpWarehouseInVO warehouseInVO, Query query) {
IPage<SpWarehouseInVO> pages = sp_warehouse_inService.selectPageList(Condition.getPage(query),warehouseInVO); IPage<SpWarehouseInVO> pages = sp_warehouse_inService.selectPageList(Condition.getPage(query),warehouseInVO);
return R.data(pages); return R.data(pages);

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.SpWarehouseOutEntity; import com.hnac.hzims.spare.entity.SpWarehouseOutEntity;
import com.hnac.hzims.spare.service.ISpWarehouseOutService; import com.hnac.hzims.spare.service.ISpWarehouseOutService;
import com.hnac.hzims.spare.vo.SpWarehouseOutVO; import com.hnac.hzims.spare.vo.SpWarehouseOutVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -46,9 +50,12 @@ public class SpWarehouseOutController extends BladeController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入sp_warehouse_out") @ApiOperation(value = "分页", notes = "传入sp_warehouse_out")
@OperationAnnotation(title = "出库单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<SpWarehouseOutVO>> list(SpWarehouseOutVO warehouseOutVO, Query query) { public R<IPage<SpWarehouseOutVO>> list(SpWarehouseOutVO warehouseOutVO, Query query) {
IPage<SpWarehouseOutVO> pages = sp_warehouse_outService.selectPageList(Condition.getPage(query),warehouseOutVO); IPage<SpWarehouseOutVO> pages = sp_warehouse_outService.selectPageList(Condition.getPage(query),warehouseOutVO);
return R.data(pages); return R.data(pages);

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java

@ -3,6 +3,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.SpTemporaryStockDetailEntity; import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity;
import com.hnac.hzims.spare.entity.SpTemporaryStockEntity; import com.hnac.hzims.spare.entity.SpTemporaryStockEntity;
import com.hnac.hzims.spare.entity.WtSpBasicEntity; import com.hnac.hzims.spare.entity.WtSpBasicEntity;
@ -14,6 +17,7 @@ import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -92,9 +96,12 @@ public class WtSpBasicController extends BladeController {
/** /**
* 基础信息分页列表 * 基础信息分页列表
*/ */
@ApiLog
@GetMapping("/pageList") @GetMapping("/pageList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入SP_BASIC") @ApiOperation(value = "分页", notes = "传入SP_BASIC")
@OperationAnnotation(title = "物资库存台账",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<IPage<WtSpBasicVO>> pageList(WtSpBasicEntity SP_BASIC, Query query, Long warehouseId, String sign) { public R<IPage<WtSpBasicVO>> pageList(WtSpBasicEntity SP_BASIC, Query query, Long warehouseId, String sign) {
IPage<WtSpBasicVO> pages = SP_BASICService.selectPage(SP_BASIC, query,warehouseId,sign); IPage<WtSpBasicVO> pages = SP_BASICService.selectPage(SP_BASIC, query,warehouseId,sign);
return R.data(pages); return R.data(pages);

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpManagementController.java

@ -3,6 +3,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.WtSpManagementEntity; import com.hnac.hzims.spare.entity.WtSpManagementEntity;
import com.hnac.hzims.spare.service.IWtSpManagementService; import com.hnac.hzims.spare.service.IWtSpManagementService;
import com.hnac.hzims.spare.vo.WtSpManagementVO; import com.hnac.hzims.spare.vo.WtSpManagementVO;
@ -10,6 +13,7 @@ import com.hnac.hzims.spare.wrapper.WtSpManagementWrapper;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -70,6 +74,7 @@ public class WtSpManagementController extends BladeController {
* @param managent * @param managent
* @return * @return
*/ */
@ApiLog
@GetMapping("/lazy-list") @GetMapping("/lazy-list")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "code", value = "备品备件分类编码", paramType = "query", dataType = "string"), @ApiImplicitParam(name = "code", value = "备品备件分类编码", paramType = "query", dataType = "string"),
@ -77,6 +82,8 @@ public class WtSpManagementController extends BladeController {
}) })
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "懒加载列表", notes = "传入parentId") @ApiOperation(value = "懒加载列表", notes = "传入parentId")
@OperationAnnotation(title = "物资类型",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<List<WtSpManagementVO>> lazyList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> managent) { public R<List<WtSpManagementVO>> lazyList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> managent) {
List<WtSpManagementVO> list = SP_MANAGEMENTService.lazyList(parentId, managent); List<WtSpManagementVO> list = SP_MANAGEMENTService.lazyList(parentId, managent);
return R.data(WtSpManagementWrapper.build().listNodeLazyVO(list)); return R.data(WtSpManagementWrapper.build().listNodeLazyVO(list));

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpProviderController.java

@ -3,6 +3,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.WtSpProviderEntity; import com.hnac.hzims.spare.entity.WtSpProviderEntity;
import com.hnac.hzims.spare.service.IWtSpProviderService; import com.hnac.hzims.spare.service.IWtSpProviderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -52,6 +56,7 @@ public class WtSpProviderController extends BladeController {
* 获取供应商列表 * 获取供应商列表
* @return * @return
*/ */
@ApiLog
@GetMapping("/getProviderList") @GetMapping("/getProviderList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "获取供应商列表") @ApiOperation(value = "获取供应商列表")
@ -65,6 +70,8 @@ public class WtSpProviderController extends BladeController {
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入SP_PROVIDER") @ApiOperation(value = "分页", notes = "传入SP_PROVIDER")
@OperationAnnotation(title = "供应商管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<WtSpProviderEntity>> list(WtSpProviderEntity providerEntity, Query query) { public R<IPage<WtSpProviderEntity>> list(WtSpProviderEntity providerEntity, Query query) {
QueryWrapper<WtSpProviderEntity> queryWrapper = Condition.getQueryWrapper(providerEntity); QueryWrapper<WtSpProviderEntity> queryWrapper = Condition.getQueryWrapper(providerEntity);
if(Func.isNotEmpty(providerEntity.getProviderName())){ if(Func.isNotEmpty(providerEntity.getProviderName())){

9
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpToolBasicController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.WtSpToolBasicEntity; import com.hnac.hzims.spare.entity.WtSpToolBasicEntity;
import com.hnac.hzims.spare.service.IWtSpToolBasicService; import com.hnac.hzims.spare.service.IWtSpToolBasicService;
import com.hnac.hzims.spare.vo.WtSpToolBasicVO; import com.hnac.hzims.spare.vo.WtSpToolBasicVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -59,9 +63,12 @@ public class WtSpToolBasicController extends BladeController {
/** /**
* 工具台账分页列表 * 工具台账分页列表
*/ */
@ApiLog
@GetMapping("/pageList") @GetMapping("/pageList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入toolBasicEntity") @ApiOperation(value = "分页", notes = "传入toolBasicEntity")
@OperationAnnotation(title = "工具台账",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<IPage<WtSpToolBasicVO>> pageList(WtSpToolBasicVO toolBasicVO, Query query) { public R<IPage<WtSpToolBasicVO>> pageList(WtSpToolBasicVO toolBasicVO, Query query) {
IPage<WtSpToolBasicVO> pages = SP_TOOL_BASICService.selectPageList(Condition.getPage(query), toolBasicVO); IPage<WtSpToolBasicVO> pages = SP_TOOL_BASICService.selectPageList(Condition.getPage(query), toolBasicVO);
return R.data(pages); return R.data(pages);
@ -71,7 +78,7 @@ public class WtSpToolBasicController extends BladeController {
* 新增 代码自定义代号 * 新增 代码自定义代号
*/ */
@PostMapping("/save") @PostMapping("/save")
@ApiOperationSupport(order = 4) // @ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入SP_TOOL_BASIC") @ApiOperation(value = "新增", notes = "传入SP_TOOL_BASIC")
public R save(@Valid @RequestBody WtSpToolBasicEntity SP_TOOL_BASIC) { public R save(@Valid @RequestBody WtSpToolBasicEntity SP_TOOL_BASIC) {
return R.status(SP_TOOL_BASICService.save(SP_TOOL_BASIC)); return R.status(SP_TOOL_BASICService.save(SP_TOOL_BASIC));

9
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpTotalController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.WtSpTotalEntity; import com.hnac.hzims.spare.entity.WtSpTotalEntity;
import com.hnac.hzims.spare.service.IWtSpBasicService; import com.hnac.hzims.spare.service.IWtSpBasicService;
import com.hnac.hzims.spare.service.IWtSpTotalService; import com.hnac.hzims.spare.service.IWtSpTotalService;
@ -11,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -61,9 +65,12 @@ public class WtSpTotalController extends BladeController {
/** /**
* 库存分页列表 * 库存分页列表
*/ */
@ApiLog
@GetMapping("/pageList") @GetMapping("/pageList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入spToolVO") @ApiOperation(value = "分页", notes = "传入spToolVO")
@OperationAnnotation(title = "库存清单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<IPage<WtSpToolVO>> pageList(WtSpToolVO spToolVO, Query query) { public R<IPage<WtSpToolVO>> pageList(WtSpToolVO spToolVO, Query query) {
IPage<WtSpToolVO> pages = SP_TOTALService.selectSpToolList(Condition.getPage(query),spToolVO); IPage<WtSpToolVO> pages = SP_TOTALService.selectSpToolList(Condition.getPage(query),spToolVO);
return R.data(pages); return R.data(pages);
@ -74,6 +81,8 @@ public class WtSpTotalController extends BladeController {
@GetMapping("/warnPageList") @GetMapping("/warnPageList")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "库存预警列表", notes = "传入spToolVO") @ApiOperation(value = "库存预警列表", notes = "传入spToolVO")
@OperationAnnotation(title = "库存预警",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<WtSpToolVO>> warnPageList(WtSpToolVO spToolVO, Query query) { public R<IPage<WtSpToolVO>> warnPageList(WtSpToolVO spToolVO, Query query) {
IPage<WtSpToolVO> pages = SP_TOTALService.warnPageList(Condition.getPage(query),spToolVO); IPage<WtSpToolVO> pages = SP_TOTALService.warnPageList(Condition.getPage(query),spToolVO);
return R.data(pages); return R.data(pages);

11
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpWarehouseController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.spare.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.spare.entity.WtSpWarehouseEntity; import com.hnac.hzims.spare.entity.WtSpWarehouseEntity;
import com.hnac.hzims.spare.service.IWtSpWarehouseService; import com.hnac.hzims.spare.service.IWtSpWarehouseService;
import com.hnac.hzims.spare.vo.WtSpWarehouseVO; import com.hnac.hzims.spare.vo.WtSpWarehouseVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
@ -50,9 +54,12 @@ public class WtSpWarehouseController extends BladeController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入SP_WAREHOUSE") @ApiOperation(value = "分页", notes = "传入SP_WAREHOUSE")
@OperationAnnotation(title = "库存管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<WtSpWarehouseVO>> list(WtSpWarehouseEntity wtSpWarehouseEntity, Query query) { public R<IPage<WtSpWarehouseVO>> list(WtSpWarehouseEntity wtSpWarehouseEntity, Query query) {
IPage<WtSpWarehouseVO> pages = SP_WAREHOUSEService.selectPage(wtSpWarehouseEntity, query); IPage<WtSpWarehouseVO> pages = SP_WAREHOUSEService.selectPage(wtSpWarehouseEntity, query);
return R.data(pages); return R.data(pages);
@ -62,10 +69,12 @@ public class WtSpWarehouseController extends BladeController {
* @param * @param
* @return * @return
*/ */
@ApiLog
@GetMapping("/selectOptionList") @GetMapping("/selectOptionList")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "仓库列表(下拉框)") @ApiOperation(value = "仓库列表(下拉框)")
public R<List<WtSpWarehouseEntity>> selectOptionList(Long deptId) { public R<List<WtSpWarehouseEntity>>
selectOptionList(Long deptId) {
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
if(null!=user){ if(null!=user){
List<WtSpWarehouseEntity> list = SP_WAREHOUSEService.selectOptionList(user.getTenantId(),deptId); List<WtSpWarehouseEntity> list = SP_WAREHOUSEService.selectOptionList(user.getTenantId(),deptId);

3
hzims-service/assets/src/main/resources/application.yml

@ -19,3 +19,6 @@ oss:
access-key: D99KGE6ZTQXSATTJWU24 access-key: D99KGE6ZTQXSATTJWU24
secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ
bucket-name: bladex bucket-name: bladex

7
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.service.IEmInfoService; import com.hnac.hzims.equipment.service.IEmInfoService;
import com.hnac.hzims.equipment.vo.EmInfoAddVo; import com.hnac.hzims.equipment.vo.EmInfoAddVo;
@ -16,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -76,11 +80,14 @@ public class EmInfoController extends BladeController {
/** /**
* 设备列表 分页 * 设备列表 分页
*/ */
@ApiLog
@RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "设备分页", notes = "传入em_info") @ApiOperation(value = "设备分页", notes = "传入em_info")
@ApiImplicitParams({ @ApiImplicitParams({
}) })
@OperationAnnotation(title = "设备信息",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<IPage<EmInfoEntity>> list(@ApiIgnore @RequestParam Map<String, Object> em_info, Query query) { public R<IPage<EmInfoEntity>> list(@ApiIgnore @RequestParam Map<String, Object> em_info, Query query) {
QueryWrapper<EmInfoEntity> queryWrapper = Condition.getQueryWrapper(em_info, EmInfoEntity.class); QueryWrapper<EmInfoEntity> queryWrapper = Condition.getQueryWrapper(em_info, EmInfoEntity.class);
queryWrapper.lambda().eq(EmInfoEntity::getGpid, 0); queryWrapper.lambda().eq(EmInfoEntity::getGpid, 0);

7
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/PlanGenertionController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.equipment.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.equipment.entity.PlanGenerationEntity; import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.equipment.service.IPlanGenerationService; import com.hnac.hzims.equipment.service.IPlanGenerationService;
import com.hnac.hzims.equipment.vo.PlanGenerationVo; import com.hnac.hzims.equipment.vo.PlanGenerationVo;
@ -9,6 +12,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -45,8 +49,11 @@ public class PlanGenertionController {
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@OperationAnnotation(title = "计划发电量填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
@ApiOperation(value = "分页", notes = "传入entity") @ApiOperation(value = "分页", notes = "传入entity")
public R<IPage<PlanGenerationVo>> list(PlanGenerationVo vo, Query query) { public R<IPage<PlanGenerationVo>> list(PlanGenerationVo vo, Query query) {
return R.data(service.doPage(Condition.getPage(query), vo)); return R.data(service.doPage(Condition.getPage(query), vo));

7
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/WorkshopInfoController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.equipment.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.equipment.dto.WorkshopInfoDTO; import com.hnac.hzims.equipment.dto.WorkshopInfoDTO;
import com.hnac.hzims.equipment.service.IEmParamService; import com.hnac.hzims.equipment.service.IEmParamService;
import com.hnac.hzims.equipment.service.IWorkshopInfoService; import com.hnac.hzims.equipment.service.IWorkshopInfoService;
@ -11,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apiguardian.api.API; import org.apiguardian.api.API;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -55,9 +59,12 @@ public class WorkshopInfoController extends BladeController {
return R.success("更新成功"); return R.success("更新成功");
} }
@ApiLog
@RequestMapping(value = "/listPage",method = RequestMethod.GET) @RequestMapping(value = "/listPage",method = RequestMethod.GET)
@ApiOperation("列表分页查询") @ApiOperation("列表分页查询")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@OperationAnnotation(title = "产房管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "列表分页查询")
public R<IPage> listPage(WorkshopInfoDTO req, Query query) { public R<IPage> listPage(WorkshopInfoDTO req, Query query) {
return R.data(service.page(Condition.getPage(query),service.getLambdaQuery(req))); return R.data(service.page(Condition.getPage(query),service.getLambdaQuery(req)));
} }

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

@ -12,7 +12,7 @@ import com.hnac.hzims.equipment.mapper.EmInfoMapper;
import com.hnac.hzims.equipment.mapper.EmInfoNoScopeMapper; import com.hnac.hzims.equipment.mapper.EmInfoNoScopeMapper;
import com.hnac.hzims.equipment.service.*; import com.hnac.hzims.equipment.service.*;
import com.hnac.hzims.equipment.vo.*; import com.hnac.hzims.equipment.vo.*;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.util.TableJsonUtils; import com.hnac.hzims.util.TableJsonUtils;

7
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpFaultController.java

@ -3,6 +3,9 @@ package com.hnac.hzims.fdp.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.fdp.dto.FdpFaultDTO; import com.hnac.hzims.fdp.dto.FdpFaultDTO;
import com.hnac.hzims.fdp.entity.FdpFaultEntity; import com.hnac.hzims.fdp.entity.FdpFaultEntity;
import com.hnac.hzims.fdp.response.FaultStateResp; import com.hnac.hzims.fdp.response.FaultStateResp;
@ -14,6 +17,7 @@ import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import oracle.jdbc.proxy.annotation.Post; import oracle.jdbc.proxy.annotation.Post;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -95,8 +99,11 @@ public class FdpFaultController extends BladeController {
* @param query * @param query
* @return * @return
*/ */
@ApiLog
@GetMapping("/queryFaultListOrd") @GetMapping("/queryFaultListOrd")
@ApiOperationSupport(order = 60) @ApiOperationSupport(order = 60)
@OperationAnnotation(title = "智能诊断",operatorType = OperatorType.APPSYSTEMS,businessType = BusinessType.GENCODE,
action = "分页查询")
@ApiOperation(value = "分页 查询参数:name,fdpId,emId,detectability,severity,fdpDeviceId,fdpDeviceName") @ApiOperation(value = "分页 查询参数:name,fdpId,emId,detectability,severity,fdpDeviceId,fdpDeviceName")
public R queryFaultListOrd(FdpFaultDTO req, Query query) { public R queryFaultListOrd(FdpFaultDTO req, Query query) {
return R.data(service.queryFaultListOrd(req, query)); return R.data(service.queryFaultListOrd(req, query));

7
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java

@ -3,6 +3,9 @@ package com.hnac.hzims.fdp.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.fdp.dto.FdpMonitorDTO; import com.hnac.hzims.fdp.dto.FdpMonitorDTO;
import com.hnac.hzims.fdp.dto.FdpMonitorExtendDTO; import com.hnac.hzims.fdp.dto.FdpMonitorExtendDTO;
import com.hnac.hzims.fdp.dto.FdpTaskDTO; import com.hnac.hzims.fdp.dto.FdpTaskDTO;
@ -21,6 +24,7 @@ import io.swagger.annotations.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -144,9 +148,12 @@ public class FdpMonitorController extends BladeController {
/** /**
* 查询列表树 * 查询列表树
*/ */
@ApiLog
@GetMapping("/listPage") @GetMapping("/listPage")
@ApiOperationSupport(order = 110) @ApiOperationSupport(order = 110)
@ApiOperation(value = "查询监测点列表") @ApiOperation(value = "查询监测点列表")
@OperationAnnotation(title = "监测点绑定",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<FdpMonitorEntity>> listPage(FdpMonitorEntity entity, Query query) { public R<IPage<FdpMonitorEntity>> listPage(FdpMonitorEntity entity, Query query) {
return service.listPage(Condition.getPage(query), entity); return service.listPage(Condition.getPage(query), entity);
} }

9
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpTaskController.java

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.fdp.dto.FdpTaskDTO; import com.hnac.hzims.fdp.dto.FdpTaskDTO;
import com.hnac.hzims.fdp.entity.FdpTaskEntity; import com.hnac.hzims.fdp.entity.FdpTaskEntity;
import com.hnac.hzims.fdp.service.IFdpTaskService; import com.hnac.hzims.fdp.service.IFdpTaskService;
@ -16,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -84,14 +88,17 @@ public class FdpTaskController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:name,emId,faultId,reasonId,satisfaction") @ApiOperation(value = "分页 查询参数:name,emId,faultId,reasonId,satisfaction")
@OperationAnnotation(title = "智能诊断任务",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页查询")
public R<IPage<FdpTaskVO>> list(FdpTaskDTO req, Query query) { public R<IPage<FdpTaskVO>> list(FdpTaskDTO req, Query query) {
return service.list(req, query); return service.list(req, query);
} }
@GetMapping("/updateTaskStatus") // @GetMapping("/updateTaskStatus")
@ApiOperationSupport(order = 60) @ApiOperationSupport(order = 60)
@ApiOperation("更新任务状态") @ApiOperation("更新任务状态")
public R updateTaskStatus(@RequestParam Long id) { public R updateTaskStatus(@RequestParam Long id) {

21
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java

@ -0,0 +1,21 @@
package com.hnac.hzims.middle;
import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.cloud.feign.EnableBladeFeign;
import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.context.annotation.ComponentScan;
@EnableBladeFeign
@SpringCloudApplication
@MapperScan("com.hnac.hzims.*.**.mapper.**")
@ComponentScan(basePackages = {"com.hnac.*"})
public class MiddleApplication {
public static void main(String[] args) {
BladeApplication.run("hzims-middle", MiddleApplication.class, args);
}
}

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

@ -0,0 +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_sys_log");
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix("hzims_");
mpg.setStrategy(strategy);
// mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}

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

@ -0,0 +1,60 @@
package com.hnac.hzims.middle.systemlog.controller;
import com.hnac.hzims.common.logs.to.SysLogTo;
import com.hnac.hzims.middle.systemlog.entity.SysLog;
import com.hnac.hzims.middle.systemlog.service.SysLogService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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 java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 前端控制器
* </p>
*
* @author dfy
* @since 2023-04-04
*/
@Api(tags = "系统日志")
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/systemlog/sys-log")
public class SysLogController {
private final SysLogService sysLogService;
/**
* 保存操作日志
* @param sysLogToList
*/
@PostMapping("/batchSave")
public void saveBatch(@RequestBody List<SysLogTo> sysLogToList) {
//数据转换
List<SysLog> collect = sysLogToList.stream().map(item -> {
SysLog sysLog = new SysLog();
BeanUtils.copyProperties(item, sysLog);
return sysLog;
}).collect(Collectors.toList());
//添加到数据库
boolean save = sysLogService.saveBatch(collect);
if (save) {
log.info("操作日志新增成功 ~~~");
return;
}
log.info("操作日志新增失败 ~~~");
throw new IllegalArgumentException("操作日志新增失败");
}
}

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

@ -0,0 +1,191 @@
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 lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author dfy
* @since 2023-04-04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("hzims_sys_log")
public class SysLog implements Serializable {
private static final long serialVersionUID=1L;
/**
* 操作日志编号
*/
@TableField("id")
private Long id;
/**
* 租户ID
*/
@TableField("tenant_id")
private String tenantId;
/**
* 服务器ip
*/
@TableField("server_ip")
private String serverIp;
/**
* 服务器地址
*/
@TableField("server_host")
private String serverHost;
/**
* 服务名称
*/
@TableField("server_name")
private String serverName;
/**
* 环境
*/
@TableField("env")
private String env;
/**
* 操作人Id
*/
@TableField("operation_user_id")
private Long operationUserId;
/**
* 操作人名称
*/
@TableField("operation_user_name")
private String operationUserName;
/**
* 请求路径 操作地址
*/
@TableField("path")
private String path;
/**
* 用户代理
*/
@TableField("user_agent")
private String userAgent;
/**
* 操作方式
*/
@TableField("method")
private String method;
/**
* 方法类
*/
@TableField("method_class")
private String methodClass;
/**
* 方法名
*/
@TableField("method_name")
private String methodName;
/**
* 方法执行时间 消耗时间 毫秒
*/
@TableField("cost_time")
private String costTime;
/**
* 方法入参
*/
@TableField("parameter")
private String parameter;
/**
* 操作方法
*/
@TableField("title")
private String title;
/**
* 方法描述
*/
@TableField("action")
private String action;
/**
* 系统类型
*/
@TableField("operator_type")
private String operatorType;
/**
* 操作人类别
*/
@TableField("business_type")
private String businessType;
/**
* 返回结果
*/
@TableField("json_result")
private String jsonResult;
/**
* 请求的Ip
*/
@TableField("local_ip")
private String localIp;
/**
* 错误消息
*/
@TableField("error_msg")
private String errorMsg;
/**
* 操作时间
*/
@TableField("operation_time")
private LocalDateTime operationTime;
/**
* 操作状态0 正常 1 异常
*/
@TableField("status")
private Integer status;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 更新时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
/**
* 逻辑删除 0 可用 1 删除
*/
@TableField("is_deleted")
private Integer isDeleted;
}

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

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

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

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

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

@ -0,0 +1,20 @@
package com.hnac.hzims.middle.systemlog.service.impl;
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 org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author dfy
* @since 2023-04-04
*/
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
}

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

@ -0,0 +1,38 @@
#服务器端口
server:
port: 8400
#数据源配置
spring:
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
url: 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
username: root
password: 123
#mybatis-plus配置
mybatis-plus:
mapper-locations:
- classpath:com/hnac/hzims/**/mapper/*Mapper.xml
- classpath:/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity
#swagger扫描路径配置
swagger:
base-packages:
- org.springbalde
- com.hnac
blade:
data-scope:
enabled: false
lock:
enabled: true
address: redis://192.168.1.20:3577
password: 1qaz2WSX@redis
database: 0
ssl: false

7
hzims-service/hzims-middle/src/main/resources/bootstrap.yml

@ -0,0 +1,7 @@
spring:
cloud:
nacos:
discovery:
server-addr: 175.6.40.67:10042

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

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

15
hzims-service/hzims-middle/src/test/java/com/hnac/hzims/middle/MiddleApplicationTests.java

@ -0,0 +1,15 @@
package com.hnac.hzims.middle;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MiddleApplicationTests {
@Test
void contextLoads() {
System.out.println("1");
}
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessBaseMaterialController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -65,6 +66,7 @@ public class OperAccessBaseMaterialController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -75,6 +77,7 @@ public class OperAccessBaseMaterialController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:typeCode,name,model,unit") @ApiOperation(value = "分页 查询参数:typeCode,name,model,unit")

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessContentController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -64,6 +65,7 @@ public class OperAccessContentController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -74,6 +76,7 @@ public class OperAccessContentController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:name,emCode,gradeCode,manager") @ApiOperation(value = "分页 查询参数:name,emCode,gradeCode,manager")

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessContentDetailController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -64,6 +65,7 @@ public class OperAccessContentDetailController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -74,6 +76,7 @@ public class OperAccessContentDetailController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:contentId") @ApiOperation(value = "分页 查询参数:contentId")

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.operational.access.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.operational.access.dto.OperAccessLibraryDTO; import com.hnac.hzims.operational.access.dto.OperAccessLibraryDTO;
import com.hnac.hzims.operational.access.dto.OperAccessLibraryListDTO; import com.hnac.hzims.operational.access.dto.OperAccessLibraryListDTO;
import com.hnac.hzims.operational.access.service.IOperAccessLibraryService; import com.hnac.hzims.operational.access.service.IOperAccessLibraryService;
@ -11,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -66,6 +70,7 @@ public class OperAccessLibraryController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -76,9 +81,12 @@ public class OperAccessLibraryController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:emCode,gradeCode") @ApiOperation(value = "分页 查询参数:emCode,gradeCode")
@OperationAnnotation(title = "检修库",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页 查询参数:emCode,gradeCode")
public R<IPage<OperAccessLibraryVO>> list(OperAccessLibraryListDTO req, Query query) { public R<IPage<OperAccessLibraryVO>> list(OperAccessLibraryListDTO req, Query query) {
return service.list(req, query); return service.list(req, query);
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryDetailController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -64,6 +65,7 @@ public class OperAccessLibraryDetailController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -74,6 +76,7 @@ public class OperAccessLibraryDetailController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:pid,name") @ApiOperation(value = "分页 查询参数:pid,name")

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessMaterialController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -64,6 +65,7 @@ public class OperAccessMaterialController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -74,6 +76,7 @@ public class OperAccessMaterialController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:materialId,planId") @ApiOperation(value = "分页 查询参数:materialId,planId")

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessPlanController.java

@ -3,6 +3,9 @@ package com.hnac.hzims.operational.access.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; import com.hnac.hzims.common.invalid.ObjectRequiredInvalid;
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.operational.OperationalConstants; import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO; import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanFlowDTO; import com.hnac.hzims.operational.access.dto.OperAccessPlanFlowDTO;
@ -17,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
@ -96,6 +100,7 @@ public class OperAccessPlanController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -116,13 +121,17 @@ public class OperAccessPlanController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@OperationAnnotation(title = "检修计划",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页 查询参数:code,name,gradeCode,manager,techLead,handleStatus,status")
@ApiOperation(value = "分页 查询参数:code,name,gradeCode,manager,techLead,handleStatus,status") @ApiOperation(value = "分页 查询参数:code,name,gradeCode,manager,techLead,handleStatus,status")
public R<IPage<OperAccessPlanVO>> list(OperAccessPlanListDTO req, Query query) { public R<IPage<OperAccessPlanVO>> list(OperAccessPlanListDTO req, Query query) {
return service.list(req, query); return service.list(req, query);
} }
@GetMapping("/getMaterialsByTaskId") @GetMapping("/getMaterialsByTaskId")
@ApiOperationSupport(order = 60) @ApiOperationSupport(order = 60)
@ApiOperation(value = "查询任务材料列表") @ApiOperation(value = "查询任务材料列表")
@ -156,7 +165,7 @@ public class OperAccessPlanController extends BladeController {
// } // }
// return R.data(userList); // return R.data(userList);
// } // }
@ApiLog
@GetMapping("/getUserByRoleAlias") @GetMapping("/getUserByRoleAlias")
@ApiOperationSupport(order = 80) @ApiOperationSupport(order = 80)
@ApiOperation(value = "根据角色别称获取人员列表") @ApiOperation(value = "根据角色别称获取人员列表")

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.operational.access.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
import com.hnac.hzims.operational.access.service.IOperAccessStatisticsService; import com.hnac.hzims.operational.access.service.IOperAccessStatisticsService;
import com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO; import com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO;
@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -65,7 +69,7 @@ public class OperAccessStatisticsController extends BladeController {
/** /**
* 详情 * 详情
*/ // */
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -76,9 +80,12 @@ public class OperAccessStatisticsController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:pid,taskId,manager") @ApiOperation(value = "分页 查询参数:pid,taskId,manager")
@OperationAnnotation(title = "检修记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页 查询参数:pid,taskId,manager")
public R<IPage<OperAccessStatisticsVO>> list(OperAccessStatisticsDTO req, Query query) { public R<IPage<OperAccessStatisticsVO>> list(OperAccessStatisticsDTO req, Query query) {
return service.list(req, Condition.getPage(query)); return service.list(req, Condition.getPage(query));
} }

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java

@ -2,6 +2,9 @@ package com.hnac.hzims.operational.access.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.operational.access.dto.OperAccessTaskDTO; import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO;
import com.hnac.hzims.operational.access.dto.OperAccessTaskFlowDTO; import com.hnac.hzims.operational.access.dto.OperAccessTaskFlowDTO;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
@ -11,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -65,6 +69,7 @@ public class OperAccessTaskController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "详情") @ApiOperation(value = "详情")
@ -75,8 +80,11 @@ public class OperAccessTaskController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@OperationAnnotation(title = "我的检修任务",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页 查询参数:name,code,handler,status,planId,planCode")
@ApiOperation(value = "分页 查询参数:name,code,handler,status,planId,planCode") @ApiOperation(value = "分页 查询参数:name,code,handler,status,planId,planCode")
public R<IPage<OperAccessTaskVO>> list(OperAccessTaskDTO req, Query query) { public R<IPage<OperAccessTaskVO>> list(OperAccessTaskDTO req, Query query) {
return service.list(req, query); return service.list(req, query);

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskDetailController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -74,6 +75,7 @@ public class OperAccessTaskDetailController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:taskId,name") @ApiOperation(value = "分页 查询参数:taskId,name")

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java

@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -33,6 +34,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* 统计通讯中断时间 * 统计通讯中断时间
*/ */
@ApiLog
@GetMapping("/statisticsTime") @GetMapping("/statisticsTime")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity") @ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity")
@ -44,6 +46,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* 统计通讯中断二级目录查询 * 统计通讯中断二级目录查询
*/ */
@ApiLog
@GetMapping("/queryByEntity") @GetMapping("/queryByEntity")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "统计通讯中断二级目录查询", notes = "传入imsDutyMainEntity") @ApiOperation(value = "统计通讯中断二级目录查询", notes = "传入imsDutyMainEntity")
@ -52,6 +55,7 @@ public class AbnormalAlarmController extends BladeController {
return R.data(pages); return R.data(pages);
} }
@ApiLog
@GetMapping("/queryStationName") @GetMapping("/queryStationName")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "查询站点") @ApiOperation(value = "查询站点")
@ -62,6 +66,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* 详情 * 详情
*/ */
@ApiLog
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity") @ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity")
@ -73,6 +78,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "传入HistoryAbnormalAlarmEntity") @ApiOperation(value = "分页", notes = "传入HistoryAbnormalAlarmEntity")
@ -105,6 +111,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* *
*/ */
@ApiLog
@ApiOperation(value = "智能优化接口") @ApiOperation(value = "智能优化接口")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@RequestMapping(value = "/alarms", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/alarms", method = {RequestMethod.GET, RequestMethod.POST})
@ -115,6 +122,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* 智能告警数量: 时间范围当天 * 智能告警数量: 时间范围当天
*/ */
@ApiLog
@ApiOperation(value = "智能告警数量") @ApiOperation(value = "智能告警数量")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@RequestMapping(value = "/count", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/count", method = {RequestMethod.GET, RequestMethod.POST})
@ -126,6 +134,7 @@ public class AbnormalAlarmController extends BladeController {
/** /**
* 智能告警数据: 时间范围当天 * 智能告警数据: 时间范围当天
*/ */
@ApiLog
@ApiOperation(value = "智能告警数据") @ApiOperation(value = "智能告警数据")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
@RequestMapping(value = "/data", method = RequestMethod.GET) @RequestMapping(value = "/data", method = RequestMethod.GET)

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java

@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
@ -44,6 +45,7 @@ public class AlarmHandleController extends BladeController {
/** /**
* 分页 * 分页
*/ */
@ApiLog
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入AlarmHandleEntity") @ApiOperation(value = "分页", notes = "传入AlarmHandleEntity")
@ -55,6 +57,7 @@ public class AlarmHandleController extends BladeController {
/** /**
* 告警处理用户查询 * 告警处理用户查询
*/ */
@ApiLog
@GetMapping("/handleUser") @GetMapping("/handleUser")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "告警通知人", notes = "告警通知人") @ApiOperation(value = "告警通知人", notes = "告警通知人")

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

@ -6,7 +6,7 @@ import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.mapper.AbnormalAlarmMapper; import com.hnac.hzims.operational.alert.mapper.AbnormalAlarmMapper;
import com.hnac.hzims.operational.alert.service.AbnormalAlarmService; import com.hnac.hzims.operational.alert.service.AbnormalAlarmService;
import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService; import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzinfo.datasearch.soe.ISoeClient; import com.hnac.hzinfo.datasearch.soe.ISoeClient;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -14,8 +14,7 @@ import com.hnac.hzims.operational.alert.vo.AlarmDataVo;
import com.hnac.hzims.operational.alert.vo.AlarmParamVo; import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.alert.vo.AlarmReustVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.config.vo.*; import com.hnac.hzims.operational.config.vo.*;
import com.hnac.hzims.operational.main.vo.WaterMonDataVo; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo; import com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo;

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/CensusController.java

@ -6,6 +6,7 @@ import com.hnac.hzims.operational.census.vo.WaterFlowVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -25,6 +26,7 @@ public class CensusController {
private final CensusService service; private final CensusService service;
@ApiLog
@ApiOperation("水位-流量统计") @ApiOperation("水位-流量统计")
@PostMapping("/water-flow") @PostMapping("/water-flow")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)

19
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java

@ -11,6 +11,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -43,6 +44,8 @@ public class TargetController {
return R.data(service.electricGeneration(stationName,type)); return R.data(service.electricGeneration(stationName,type));
} }
@ApiLog
@ApiOperation("计划发电量/实际发电量统计:区分填报/接入站点") @ApiOperation("计划发电量/实际发电量统计:区分填报/接入站点")
@PostMapping("/complete-generation") @PostMapping("/complete-generation")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ -50,6 +53,8 @@ public class TargetController {
return R.data(service.completeGeneration(stationName,type)); return R.data(service.completeGeneration(stationName,type));
} }
@ApiLog
@ApiOperation("两票统计:区分填报/平台业务数据") @ApiOperation("两票统计:区分填报/平台业务数据")
@PostMapping("/complete-ticket") @PostMapping("/complete-ticket")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@ -57,6 +62,7 @@ public class TargetController {
return R.data(service.completeTicket(areaName,type)); return R.data(service.completeTicket(areaName,type));
} }
@ApiLog
@ApiOperation("缺陷率统计:区分填报/平台业务数据") @ApiOperation("缺陷率统计:区分填报/平台业务数据")
@GetMapping("/complete-defect") @GetMapping("/complete-defect")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ -64,6 +70,8 @@ public class TargetController {
return R.data(service.defect(areaName,type)); return R.data(service.defect(areaName,type));
} }
@ApiLog
@ApiOperation("上线率/Fa投入条数统计") @ApiOperation("上线率/Fa投入条数统计")
@GetMapping("/complete-other") @GetMapping("/complete-other")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ -71,6 +79,7 @@ public class TargetController {
return R.data(service.completeOther(stationName,type,queryType)); return R.data(service.completeOther(stationName,type,queryType));
} }
@ApiLog
@ApiOperation("日常维护统计") @ApiOperation("日常维护统计")
@GetMapping("/routine-maintenance") @GetMapping("/routine-maintenance")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@ -78,6 +87,8 @@ public class TargetController {
return service.routineMaintenance(params,query,type); return service.routineMaintenance(params,query,type);
} }
@ApiLog
@ApiOperation("检修任务统计") @ApiOperation("检修任务统计")
@GetMapping("/examine-repair") @GetMapping("/examine-repair")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@ -85,6 +96,8 @@ public class TargetController {
return service.examineRepair(params, query,type); return service.examineRepair(params, query,type);
} }
@ApiLog
@ApiOperation("检修卡统计") @ApiOperation("检修卡统计")
@GetMapping("/examineCard") @GetMapping("/examineCard")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
@ -92,6 +105,7 @@ public class TargetController {
return R.data(service.examineCard(stationName,type)); return R.data(service.examineCard(stationName,type));
} }
@ApiLog
@ApiOperation("设备统计") @ApiOperation("设备统计")
@GetMapping("/device-classify") @GetMapping("/device-classify")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
@ -99,6 +113,8 @@ public class TargetController {
return R.data(service.deviceClassify(stationName,deptId,status)); return R.data(service.deviceClassify(stationName,deptId,status));
} }
@ApiLog
@ApiOperation("水电集团、区域指标关联") @ApiOperation("水电集团、区域指标关联")
@GetMapping("/hydropower-target") @GetMapping("/hydropower-target")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
@ -107,6 +123,7 @@ public class TargetController {
} }
@ApiLog
@ApiOperation("水利集团、区域指标关联") @ApiOperation("水利集团、区域指标关联")
@GetMapping("/water-target") @GetMapping("/water-target")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
@ -114,6 +131,7 @@ public class TargetController {
return R.data(service.waterTarget(stationName,deptId,target)); return R.data(service.waterTarget(stationName,deptId,target));
} }
@ApiLog
@ApiOperation("集团设备统计") @ApiOperation("集团设备统计")
@GetMapping("/device-group") @GetMapping("/device-group")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
@ -122,6 +140,7 @@ public class TargetController {
} }
@ApiLog
@ApiOperation("集团操作票/工作票") @ApiOperation("集团操作票/工作票")
@GetMapping("/ticket-group") @GetMapping("/ticket-group")
@ApiOperationSupport(order = 12) @ApiOperationSupport(order = 12)

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -3,16 +3,11 @@ package com.hnac.hzims.operational.census.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity; import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.equipment.feign.IPlanGenertionClient; import com.hnac.hzims.equipment.feign.IPlanGenertionClient;
import com.hnac.hzims.equipment.vo.EmInfoExtendVo;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO;
import com.hnac.hzims.operational.access.service.IOperAccessStatisticsService;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO;
import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; import com.hnac.hzims.operational.access.vo.OperAccessTaskVO;
import com.hnac.hzims.operational.census.constants.CensusConstant; import com.hnac.hzims.operational.census.constants.CensusConstant;
import com.hnac.hzims.operational.census.service.TargetService; import com.hnac.hzims.operational.census.service.TargetService;
@ -24,7 +19,7 @@ import com.hnac.hzims.operational.fill.service.*;
import com.hnac.hzims.operational.main.service.AreaService; import com.hnac.hzims.operational.main.service.AreaService;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
@ -33,7 +28,6 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/FocusAttributeController.java

@ -3,6 +3,7 @@ package com.hnac.hzims.operational.config.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -44,6 +45,7 @@ public class FocusAttributeController extends BladeController {
return R.status(attributeService.save(attributeEntity)); return R.status(attributeService.save(attributeEntity));
} }
@ApiLog
@PostMapping("/getMainList") @PostMapping("/getMainList")
@ApiOperation("查询列表(主界面)") @ApiOperation("查询列表(主界面)")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ -58,7 +60,6 @@ public class FocusAttributeController extends BladeController {
List<FocusAttributeEntity> focusAttributeEntityList = JSONArray.parseArray(JSON.toJSONString(focusAttributeDtoList),FocusAttributeEntity.class); List<FocusAttributeEntity> focusAttributeEntityList = JSONArray.parseArray(JSON.toJSONString(focusAttributeDtoList),FocusAttributeEntity.class);
return attributeService.modify(focusAttributeEntityList); return attributeService.modify(focusAttributeEntityList);
} }
@PostMapping("/list") @PostMapping("/list")
@ApiOperation("查询列表") @ApiOperation("查询列表")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java

@ -4,6 +4,9 @@ package com.hnac.hzims.operational.config.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.operational.config.entity.StAlarmRecordEntity; import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
import com.hnac.hzims.operational.config.service.StAlamRecordService; import com.hnac.hzims.operational.config.service.StAlamRecordService;
import com.hnac.hzims.operational.config.vo.FaultVo; import com.hnac.hzims.operational.config.vo.FaultVo;
@ -47,7 +50,8 @@ public class StAlamRecordController {
* <option value="5">遥测越限</option> * <option value="5">遥测越限</option>
* <option value="6">遥信变位</option> * <option value="6">遥信变位</option>
*/ */
@OperationAnnotation(title = "集中监控", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取当天的告警列表")
@ApiOperation("获取当天的告警列表") @ApiOperation("获取当天的告警列表")
@RequestMapping(value = "/getDaySoeList", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getDaySoeList", method = {RequestMethod.GET, RequestMethod.POST})
public R<SoeBodyVo> getDaySoeList(@ApiParam(value = "时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String date, public R<SoeBodyVo> getDaySoeList(@ApiParam(value = "时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String date,
@ -61,7 +65,8 @@ public class StAlamRecordController {
} }
return stAlamRecordService.getDaySoeList(AuthUtil.getUser(), date, type,current,size,code); return stAlamRecordService.getDaySoeList(AuthUtil.getUser(), date, type,current,size,code);
} }
@OperationAnnotation(title = "集中监控", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取故障列表数据")
@ApiOperation("获取故障列表数据") @ApiOperation("获取故障列表数据")
@RequestMapping(value = "/getFaultList", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getFaultList", method = {RequestMethod.GET, RequestMethod.POST})
public R<List<FaultVo>> getFaultList(@ApiParam(value = "站点编码") @RequestParam(required = false) String code) { public R<List<FaultVo>> getFaultList(@ApiParam(value = "站点编码") @RequestParam(required = false) String code) {
@ -75,6 +80,8 @@ public class StAlamRecordController {
@GetMapping("/listPage") @GetMapping("/listPage")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入vo") @ApiOperation(value = "分页", notes = "传入vo")
@OperationAnnotation(title = "系统预警处理", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "分页查询")
public R<IPage<StAlarmRecordVo>> list(StAlarmRecordVo vo, Query query) { public R<IPage<StAlarmRecordVo>> list(StAlarmRecordVo vo, Query query) {
return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo)); return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo));
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StFocusPropertiesController.java

@ -6,6 +6,7 @@ import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
import com.hnac.hzims.operational.config.service.StFocusPropertiesService; import com.hnac.hzims.operational.config.service.StFocusPropertiesService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -26,6 +27,7 @@ public class StFocusPropertiesController {
private StFocusPropertiesService stFocusPropertiesService; private StFocusPropertiesService stFocusPropertiesService;
@ApiLog
@ApiOperation("分页查询") @ApiOperation("分页查询")
@RequestMapping(value = "/pageList", method = RequestMethod.GET) @RequestMapping(value = "/pageList", method = RequestMethod.GET)
public R<IPage<StFocusPropertiesEntity>> pageList(StFocusPropertiesEntity entity, Query query) { public R<IPage<StFocusPropertiesEntity>> pageList(StFocusPropertiesEntity entity, Query query) {

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java

@ -1,8 +1,7 @@
package com.hnac.hzims.operational.config.service.impl; package com.hnac.hzims.operational.config.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.operational.config.service.CentralMonitorService; import com.hnac.hzims.operational.config.service.CentralMonitorService;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.vo.RealStationVo; import com.hnac.hzims.operational.station.vo.RealStationVo;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java

@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.fdp.feign.IFdpMonitorClient; import com.hnac.hzims.fdp.feign.IFdpMonitorClient;
@ -23,7 +22,6 @@ import com.hnac.hzims.operational.config.service.StFocusPropertiesService;
import com.hnac.hzims.operational.config.vo.*; import com.hnac.hzims.operational.config.vo.*;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.vo.SoeDataVo; import com.hnac.hzims.operational.main.vo.SoeDataVo;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.util.ExcelUtil; import com.hnac.hzims.operational.util.ExcelUtil;
@ -50,7 +48,6 @@ import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StFocusPropertiesServiceImpl.java

@ -1,7 +1,6 @@
package com.hnac.hzims.operational.config.service.impl; package com.hnac.hzims.operational.config.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -14,7 +13,7 @@ import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
import com.hnac.hzims.operational.config.mapper.StFocusPropertiesMapper; import com.hnac.hzims.operational.config.mapper.StFocusPropertiesMapper;
import com.hnac.hzims.operational.config.service.StFocusPropertiesService; import com.hnac.hzims.operational.config.service.StFocusPropertiesService;
import com.hnac.hzims.operational.config.vo.StationRealVo; import com.hnac.hzims.operational.config.vo.StationRealVo;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity; import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationAttributeService; import com.hnac.hzims.operational.station.service.IStationAttributeService;
@ -34,7 +33,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/controller/HzimsDataController.java

@ -5,6 +5,7 @@ import com.hnac.hzims.operational.data.service.HzimsDataService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -25,6 +26,7 @@ public class HzimsDataController {
/** /**
* 获取区域列表数据 * 获取区域列表数据
*/ */
@ApiLog
@GetMapping("/saveArea") @GetMapping("/saveArea")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "获取区域列表数据", notes = "无需传入参数") @ApiOperation(value = "获取区域列表数据", notes = "无需传入参数")
@ -35,6 +37,7 @@ public class HzimsDataController {
/** /**
* 获取区域列表数据 * 获取区域列表数据
*/ */
@ApiLog
@GetMapping("/saveStation") @GetMapping("/saveStation")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "获取站点统计数据", notes = "无需传入参数") @ApiOperation(value = "获取站点统计数据", notes = "无需传入参数")

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save