Commit 09e069277932b508a5d57a243ab1d87241639996

Authored by liujun001
1 parent fb614af4

酒测未通过审核

Bsth-admin/pom.xml
... ... @@ -143,6 +143,11 @@
143 143 <version>3.1</version>
144 144 </dependency>
145 145  
  146 + <dependency>
  147 + <groupId>org.springframework.boot</groupId>
  148 + <artifactId>spring-boot-starter-actuator</artifactId>
  149 + </dependency>
  150 +
146 151 </dependencies>
147 152  
148 153 <build>
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
... ... @@ -153,7 +153,7 @@ public class KeyBoxController extends BaseController {
153 153  
154 154 Equipment eq = new Equipment();
155 155 eq.setYardId(equipment.getYardId());
156   - eq.setStatus(1);
  156 +
157 157  
158 158 List<Equipment> equipmentList = equipmentService.list(eq);
159 159 LinggangVenueInfo venueInfo = venueInfoService.getById(equipment.getYardId());
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/sign/in/exception/report/EquipmentExceptionReportController.java
... ... @@ -141,6 +141,7 @@ public class EquipmentExceptionReportController extends BaseController {
141 141 // entity.setUpdateBy(getUserId());
142 142 entity.setUpdateTime(new Date());
143 143 entity.setStatus(status);
  144 + entity.setReportTime(new Date());
144 145 boolean flag = equipmentExceptionReportService.updateByPrimaryKey(entity);
145 146 return flag ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("修改数据失败,请稍后再试");
146 147 }
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/EquipmentExceptionReport.java
... ... @@ -11,6 +11,8 @@ import lombok.NoArgsConstructor;
11 11 import lombok.experimental.Accessors;
12 12 import lombok.extern.slf4j.Slf4j;
13 13  
  14 +import java.util.Date;
  15 +
14 16  
15 17 @Data
16 18 @Slf4j
... ... @@ -99,7 +101,7 @@ public class EquipmentExceptionReport {
99 101  
100 102 /***处理时间*/
101 103 @Excel(name = "处理时间")
102   - private String reportTime;
  104 + private Date reportTime;
103 105  
104 106  
105 107 /***报告状态*/
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/dto/EquipmentExceptionReportAddDTO.java
... ... @@ -61,7 +61,7 @@ public class EquipmentExceptionReportAddDTO implements java.io.Serializable {
61 61 private String reportId;
62 62 /***处理时间*/
63 63 @ApiModelProperty(value = "处理时间")
64   - private String reportTime;
  64 + private java.util.Date reportTime;
65 65 /***报告状态*/
66 66 @ApiModelProperty(value = "报告状态", example = "1")
67 67 private Integer reportOldStatus;
... ... @@ -115,9 +115,6 @@ public class EquipmentExceptionReportAddDTO implements java.io.Serializable {
115 115 if (org.apache.commons.lang3.StringUtils.isEmpty(this.reportId)) {
116 116 this.reportId = null;
117 117 }
118   - if (org.apache.commons.lang3.StringUtils.isEmpty(this.reportTime)) {
119   - this.reportTime = null;
120   - }
121 118 if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) {
122 119 this.operator = null;
123 120 }
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/dto/EquipmentExceptionReportQueryDTO.java
... ... @@ -61,7 +61,7 @@ public class EquipmentExceptionReportQueryDTO implements java.io.Serializable {
61 61 private String reportId;
62 62 /***处理时间*/
63 63 @ApiModelProperty(value = "处理时间")
64   - private String reportTime;
  64 + private java.util.Date reportTime;
65 65 /***报告状态*/
66 66 @ApiModelProperty(value = "报告状态", example = "1")
67 67 private Integer reportOldStatus;
... ... @@ -112,9 +112,6 @@ public class EquipmentExceptionReportQueryDTO implements java.io.Serializable {
112 112 if (org.apache.commons.lang3.StringUtils.isEmpty(this.reportId)) {
113 113 this.reportId = null;
114 114 }
115   - if (org.apache.commons.lang3.StringUtils.isEmpty(this.reportTime)) {
116   - this.reportTime = null;
117   - }
118 115 }
119 116  
120 117  
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/dto/EquipmentExceptionReportUpdateDTO.java
... ... @@ -61,7 +61,7 @@ public class EquipmentExceptionReportUpdateDTO implements java.io.Serializable {
61 61 private String reportId;
62 62 /***处理时间*/
63 63 @ApiModelProperty(value = "处理时间")
64   - private String reportTime;
  64 + private java.util.Date reportTime;
65 65 /***报告状态*/
66 66 @ApiModelProperty(value = "报告状态", example = "1")
67 67 private Integer reportOldStatus;
... ... @@ -116,9 +116,7 @@ public class EquipmentExceptionReportUpdateDTO implements java.io.Serializable {
116 116 if (org.apache.commons.lang3.StringUtils.isEmpty(this.reportId)) {
117 117 this.reportId = null;
118 118 }
119   - if (org.apache.commons.lang3.StringUtils.isEmpty(this.reportTime)) {
120   - this.reportTime = null;
121   - }
  119 +
122 120 if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) {
123 121 this.operator = null;
124 122 }
... ...
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
... ... @@ -15,6 +15,7 @@ import com.ruoyi.common.utils.file.FileUploadUtils;
15 15 import com.ruoyi.config.domain.LineConfig;
16 16 import com.ruoyi.config.service.ILineConfigService;
17 17 import com.ruoyi.domain.RuleAttendanceMain;
  18 +import com.ruoyi.domain.sign.in.exception.report.EquipmentExceptionReport;
18 19 import com.ruoyi.driver.domain.Driver;
19 20 import com.ruoyi.driver.mapper.DriverMapper;
20 21 import com.ruoyi.driver.mapper.DriverSchedulingMapper;
... ... @@ -31,6 +32,7 @@ import com.ruoyi.domain.DriverScheduling;
31 32 import com.ruoyi.pojo.GlobalIndex;
32 33 import com.ruoyi.pojo.response.ResponseSchedulingDto;
33 34 import com.ruoyi.service.key.location.LinggangKeyWorkLocationService;
  35 +import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService;
34 36 import com.ruoyi.system.domain.SysNotice;
35 37 import com.ruoyi.system.service.ISysNoticeService;
36 38 import com.ruoyi.utils.ConstDateUtil;
... ... @@ -107,6 +109,8 @@ public class ThreadJobService {
107 109  
108 110 @Autowired
109 111 private EquipmentMapper equipmentMapper;
  112 + @Autowired
  113 + private EquipmentExceptionReportService equipmentExceptionReportService;
110 114  
111 115 @Value("${api.headImage}")
112 116 private String headImagePre;
... ... @@ -190,6 +194,12 @@ public class ThreadJobService {
190 194 exceptionMapper.insertEquipmentException(exception);
191 195 // 发送通知
192 196 sendNotice(signIn, driver, dto, globalIndex);
  197 +
  198 +
  199 + EquipmentExceptionReport exceptionReport =new EquipmentExceptionReport();
  200 + BeanUtils.copyProperties(exception,exceptionReport);
  201 + exceptionReport.setSignId(signIn.getId());
  202 + equipmentExceptionReportService.save(exceptionReport);
193 203 }
194 204 }
195 205  
... ...
Bsth-admin/src/main/resources/application-druid-dev.yml
... ... @@ -199,6 +199,16 @@ netty:
199 199 image: device/image
200 200 speech: device/speech
201 201 port: 8989
  202 +management:
  203 + endpoints:
  204 + web:
  205 + exposure:
  206 + include: "*"
  207 + shutdown:
  208 + enabled: true
  209 + endpoint:
  210 + shutdown:
  211 + enabled: true
202 212 bsth:
203 213 face:
204 214 app:
... ... @@ -210,5 +220,5 @@ bsth:
210 220 faceFeature:
211 221 url: http://222.76.217.238:8880/fcgi-bin/entry.fcgi/system
212 222 skip:
213   - url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/test/**;/login/no/code
  223 + url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/test/**;/login/no/code;/actuator/health;
214 224  
... ...
Bsth-admin/src/main/resources/application.yml
... ... @@ -38,6 +38,14 @@ logging:
38 38 level:
39 39 com.ruoyi: debug
40 40 org.springframework: warn
  41 + org:
  42 + springframework:
  43 + web:
  44 + servlet:
  45 + mvc:
  46 + method:
  47 + annotation:
  48 + RequestResponseBodyMethodProcessor: TRACE
41 49  
42 50 # 用户配置
43 51 user:
... ...
Bsth-admin/src/main/resources/logback.xml
... ... @@ -5,7 +5,7 @@
5 5 />
6 6 <!-- <property name="log.path" value="/home/ruoyi/logs" />-->
7 7 <!-- 日志输出格式 -->
8   - <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
  8 + <property name="log.pattern" value="%d{HH:mm:ss.SSS}[%X{userId}][%X{requestId}][%thread][%logger{20}]-[%method,%line]-%msg%n" />
9 9  
10 10 <!-- 控制台输出 -->
11 11 <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
... ...
Bsth-common/src/main/java/com/ruoyi/common/core/domain/ResponseResult.java
1 1 package com.ruoyi.common.core.domain;
2 2  
  3 +import com.alibaba.fastjson2.JSON;
3 4 import com.ruoyi.common.constant.HttpStatus;
4 5  
5 6 import java.util.Objects;
... ... @@ -214,5 +215,8 @@ public class ResponseResult&lt;T&gt; {
214 215 return Objects.equals(HttpStatus.ERROR, this.getCode());
215 216 }
216 217  
217   -
  218 + @Override
  219 + public String toString() {
  220 + return JSON.toJSONString(this);
  221 + }
218 222 }
... ...
Bsth-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java
1 1 package com.ruoyi.framework.security.filter;
2 2  
3   -import java.io.IOException;
4   -import javax.servlet.FilterChain;
5   -import javax.servlet.ServletException;
6   -import javax.servlet.http.HttpServletRequest;
7   -import javax.servlet.http.HttpServletResponse;
  3 +import cn.hutool.core.convert.Convert;
  4 +import com.ruoyi.common.core.domain.model.LoginUser;
  5 +import com.ruoyi.common.utils.SecurityUtils;
  6 +import com.ruoyi.common.utils.StringUtils;
  7 +import com.ruoyi.framework.web.service.TokenService;
  8 +import org.slf4j.MDC;
8 9 import org.springframework.beans.factory.annotation.Autowired;
9 10 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
10 11 import org.springframework.security.core.context.SecurityContextHolder;
11 12 import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
12 13 import org.springframework.stereotype.Component;
13 14 import org.springframework.web.filter.OncePerRequestFilter;
14   -import com.ruoyi.common.core.domain.model.LoginUser;
15   -import com.ruoyi.common.utils.SecurityUtils;
16   -import com.ruoyi.common.utils.StringUtils;
17   -import com.ruoyi.framework.web.service.TokenService;
  15 +
  16 +import javax.servlet.FilterChain;
  17 +import javax.servlet.ServletException;
  18 +import javax.servlet.http.HttpServletRequest;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import java.io.IOException;
  21 +import java.util.Objects;
  22 +import java.util.UUID;
18 23  
19 24 /**
20 25 * token过滤器 验证token有效性
21   - *
  26 + *
22 27 * @author ruoyi
23 28 */
24 29 @Component
25   -public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
26   -{
  30 +public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
27 31 @Autowired
28 32 private TokenService tokenService;
29 33  
  34 + private final static String USER_ID_KEY = "userId";
  35 + private final static String REQUEST_ID_KEY = "requestId";
  36 +
30 37 @Override
31 38 protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
32   - throws ServletException, IOException
33   - {
  39 + throws ServletException, IOException {
34 40 LoginUser loginUser = tokenService.getLoginUser(request);
35   - if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
36   - {
  41 + String userId = Objects.isNull(loginUser) ? getRandomValue() : Convert.toStr(loginUser.getUserId());
  42 + putMDC(userId, getRandomValue());
  43 +
  44 + if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) {
37 45 tokenService.verifyToken(loginUser);
38 46 UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
39 47 authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
... ... @@ -41,4 +49,24 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
41 49 }
42 50 chain.doFilter(request, response);
43 51 }
  52 +
  53 + public static void putMDC(String userId, String requestId) {
  54 + if (org.apache.commons.lang3.StringUtils.isEmpty(userId)) {
  55 + userId = getRandomValue();
  56 + }
  57 + MDC.put(USER_ID_KEY, userId);
  58 + MDC.put(REQUEST_ID_KEY, requestId);
  59 + }
  60 +
  61 + public static String getUserOfMDCValue() {
  62 + return MDC.get(USER_ID_KEY);
  63 + }
  64 +
  65 + public static String getRequestIdOfMDCValue() {
  66 + return MDC.get(REQUEST_ID_KEY);
  67 + }
  68 +
  69 + private static String getRandomValue() {
  70 + return UUID.randomUUID().toString().replaceAll("-", "");
  71 + }
44 72 }
... ...