Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 76c4f397
authored
Mar 23, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:自测bug修复
1 parent
acce09b7
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
300 additions
and
51 deletions
aus-admin/src/main/java/com/glsx/usedcar/export/InspectorExportBean.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/inspect/InspectorController.java
aus-config/src/main/resources/config/aus-inspector-dev.yaml
aus-config/src/main/resources/config/prod/aus-inspector-prod.yaml
aus-core/src/main/java/com/glsx/usedcar/converts/InspectorConverter.java
aus-core/src/main/java/com/glsx/usedcar/enums/common/SystemConfigKeyEnum.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionWorkOrderOpLogRepository.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectorService.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectionRootNodeSimpleVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectionWODetailRespVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorPageRespVO.java
aus-core/src/main/java/com/glsx/usedcar/util/LocalDateTimeUtil.java
aus-core/src/main/java/com/glsx/usedcar/util/SmsCodeUtil.java
aus-core/src/main/resources/messages.properties
aus-inspector/src/main/java/com/glsx/usedcar/controller/AuthController.java
aus-inspector/src/main/java/com/glsx/usedcar/resp/LoginByCodeResp.java
aus-inspector/src/main/java/com/glsx/usedcar/token/JwtProvider.java
aus-admin/src/main/java/com/glsx/usedcar/export/InspectorExportBean.java
View file @
76c4f39
...
@@ -2,8 +2,7 @@ package com.glsx.usedcar.export;
...
@@ -2,8 +2,7 @@ package com.glsx.usedcar.export;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.glsx.usedcar.module.account.enums.*
;
import
com.glsx.usedcar.module.inspect.vo.InspectorPageRespVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorRespVO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
lombok.*
;
...
@@ -40,7 +39,6 @@ public class InspectorExportBean implements Serializable {
...
@@ -40,7 +39,6 @@ public class InspectorExportBean implements Serializable {
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
private
String
name
;
private
String
name
;
/**
/**
* 手机号
* 手机号
*/
*/
...
@@ -48,40 +46,74 @@ public class InspectorExportBean implements Serializable {
...
@@ -48,40 +46,74 @@ public class InspectorExportBean implements Serializable {
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
private
String
phone
;
private
String
phone
;
@ExcelProperty
(
"所在城市"
)
@ColumnWidth
(
15
)
private
String
regionName
;
/**
/**
*
状态 1:正常 0:禁用
*
待检测数量(DISPATCHED)
*/
*/
@ExcelProperty
(
"
状态
"
)
@ExcelProperty
(
"
待检测任务
"
)
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
private
String
status
;
private
Long
dispatchedCount
;
/**
* 检测中数量(IN_PROGRESS)
*/
@ExcelProperty
(
"检测中任务"
)
@ColumnWidth
(
15
)
private
Long
inProgressCount
;
@ExcelProperty
(
"所属区域"
)
/**
* 已完成数量(COMPLETED)
*/
@ExcelProperty
(
"已完成任务"
)
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
private
String
region
;
private
Long
completedCount
;
@ExcelProperty
(
"
所属区域名称
"
)
@ExcelProperty
(
"
平均检测耗时
"
)
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
private
String
regionName
;
private
String
avgInspectCost
;
/**
/**
*
创建时间
*
状态 1:正常 0:禁用
*/
*/
@ExcelProperty
(
"
创建时间
"
)
@ExcelProperty
(
"
状态
"
)
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
private
String
createTime
;
private
String
status
;
public
InspectorExportBean
(
InspectorRespVO
vo
)
{
public
InspectorExportBean
(
Inspector
Page
RespVO
vo
)
{
if
(
vo
==
null
)
{
if
(
vo
==
null
)
{
return
;
return
;
}
}
this
.
id
=
vo
.
getId
();
this
.
id
=
vo
.
getId
();
this
.
name
=
vo
.
getName
();
this
.
name
=
vo
.
getName
();
this
.
phone
=
vo
.
getPhone
();
this
.
phone
=
vo
.
getPhone
();
this
.
status
=
vo
.
getStatus
()
==
1
?
"正常"
:
"禁用"
;
this
.
status
=
vo
.
getStatus
()
==
1
?
"启用"
:
"禁用"
;
this
.
region
=
vo
.
getRegion
();
this
.
regionName
=
vo
.
getRegionName
();
this
.
regionName
=
vo
.
getRegionName
();
this
.
createTime
=
vo
.
getCreateTime
().
toString
();
this
.
dispatchedCount
=
vo
.
getDispatchedCount
();
this
.
inProgressCount
=
vo
.
getInProgressCount
();
this
.
completedCount
=
vo
.
getCompletedCount
();
// 调用工具方法转换平均耗时(秒转时分)
this
.
avgInspectCost
=
convertToHourMinuteSecond
(
vo
.
getAvgInspectCost
());
}
/**
* 将秒数转换为"X小时X分"的格式
* @param seconds 秒数(可为null,兼容0或负数场景)
* @return 格式化后的耗时字符串(例:1小时30分、0小时5分、0小时0分)
*/
private
static
String
convertToHourMinuteSecond
(
Integer
seconds
)
{
// 处理null/0/负数的边界情况,避免空指针和不合理显示
if
(
seconds
==
null
||
seconds
<=
0
)
{
return
"0小时0分"
;
}
// 计算小时数(整除3600秒)
long
hours
=
seconds
/
3600
;
// 计算剩余秒数转分钟(取模后整除60秒)
long
minutes
=
(
seconds
%
3600
)
/
60
;
// 格式化输出(推荐用String.format,比字符串拼接更规范)
return
String
.
format
(
"%d小时%d分"
,
hours
,
minutes
);
}
}
}
}
\ No newline at end of file
\ No newline at end of file
aus-admin/src/main/java/com/glsx/usedcar/web/rest/inspect/InspectorController.java
View file @
76c4f39
...
@@ -126,7 +126,7 @@ public class InspectorController {
...
@@ -126,7 +126,7 @@ public class InspectorController {
@Operation
(
summary
=
"分页查询检测师"
,
description
=
"分页查询检测师列表,支持姓名或手机号模糊查询,自动过滤逻辑删除数据"
)
@Operation
(
summary
=
"分页查询检测师"
,
description
=
"分页查询检测师列表,支持姓名或手机号模糊查询,自动过滤逻辑删除数据"
)
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
public
Page
<
InspectorRespVO
>
pageInspectors
(
@Valid
@RequestBody
Pagination
<
Inspector
>
pagination
)
{
public
Page
<
Inspector
Page
RespVO
>
pageInspectors
(
@Valid
@RequestBody
Pagination
<
Inspector
>
pagination
)
{
log
.
info
(
"分页查询检测师请求: offset={}, limit={}"
,
pagination
.
getOffset
(),
pagination
.
getLimit
());
log
.
info
(
"分页查询检测师请求: offset={}, limit={}"
,
pagination
.
getOffset
(),
pagination
.
getLimit
());
try
{
try
{
...
@@ -142,7 +142,7 @@ public class InspectorController {
...
@@ -142,7 +142,7 @@ public class InspectorController {
@PostMapping
(
"export"
)
@PostMapping
(
"export"
)
public
void
exportAccountPreference
(
@RequestBody
Pagination
<
Inspector
>
pagination
,
HttpServletResponse
response
)
throws
IOException
{
public
void
exportAccountPreference
(
@RequestBody
Pagination
<
Inspector
>
pagination
,
HttpServletResponse
response
)
throws
IOException
{
pagination
.
setLimit
(
99999
);
pagination
.
setLimit
(
99999
);
List
<
InspectorRespVO
>
preferences
=
inspectorService
.
pageInspectors
(
pagination
).
getContent
();
List
<
Inspector
Page
RespVO
>
preferences
=
inspectorService
.
pageInspectors
(
pagination
).
getContent
();
List
<
InspectorExportBean
>
exportBeans
=
preferences
.
stream
().
map
(
InspectorExportBean:
:
new
).
toList
();
List
<
InspectorExportBean
>
exportBeans
=
preferences
.
stream
().
map
(
InspectorExportBean:
:
new
).
toList
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd_hh-mm"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd_hh-mm"
);
String
format
=
sdf
.
format
(
new
Date
());
String
format
=
sdf
.
format
(
new
Date
());
...
...
aus-config/src/main/resources/config/aus-inspector-dev.yaml
View file @
76c4f39
...
@@ -21,3 +21,7 @@ spring:
...
@@ -21,3 +21,7 @@ spring:
inspector
:
inspector
:
inspection-audit-url
:
http://localhost:6904/inspection-audit
inspection-audit-url
:
http://localhost:6904/inspection-audit
application
:
jwt
:
expiration
:
2592000
aus-config/src/main/resources/config/prod/aus-inspector-prod.yaml
View file @
76c4f39
...
@@ -18,3 +18,6 @@ spring:
...
@@ -18,3 +18,6 @@ spring:
thread-name-prefix
:
task-
thread-name-prefix
:
task-
logging
:
logging
:
location
:
/data/java_log/aus
location
:
/data/java_log/aus
application
:
jwt
:
expiration
:
2592000
aus-core/src/main/java/com/glsx/usedcar/converts/InspectorConverter.java
View file @
76c4f39
...
@@ -153,4 +153,18 @@ public interface InspectorConverter {
...
@@ -153,4 +153,18 @@ public interface InspectorConverter {
*/
*/
List
<
InspectionNodeDetailVO
>
inspectionNodeVOs2DetailVOs
(
List
<
InspectionNodeVO
>
vos
);
List
<
InspectionNodeDetailVO
>
inspectionNodeVOs2DetailVOs
(
List
<
InspectionNodeVO
>
vos
);
/**
* 检测师 转 检测师分页
* @param 检测师
* @return com.glsx.usedcar.module.inspect.vo.InspectorPageRespVO
*/
InspectorPageRespVO
inspector2PageVO
(
Inspector
inspector
);
/**
* 检测师 转 检测师分页
* @param 检测师
* @return com.glsx.usedcar.module.inspect.vo.InspectorPageRespVO
*/
List
<
InspectorPageRespVO
>
inspector2PageVOs
(
List
<
Inspector
>
inspector
);
}
}
aus-core/src/main/java/com/glsx/usedcar/enums/common/SystemConfigKeyEnum.java
0 → 100644
View file @
76c4f39
package
com
.
glsx
.
usedcar
.
enums
.
common
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
*
*/
@Getter
@AllArgsConstructor
public
enum
SystemConfigKeyEnum
{
;
private
String
key
;
private
String
desc
;
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionWorkOrderOpLogRepository.java
View file @
76c4f39
...
@@ -28,7 +28,7 @@ public interface InspectionWorkOrderOpLogRepository extends BaseRepository<Inspe
...
@@ -28,7 +28,7 @@ public interface InspectionWorkOrderOpLogRepository extends BaseRepository<Inspe
* @param deleteFlag 删除标识(N:未删除 D:已删除)
* @param deleteFlag 删除标识(N:未删除 D:已删除)
* @return 操作日志列表
* @return 操作日志列表
*/
*/
List
<
InspectionWorkOrderOpLog
>
findByWorkOrderInnerIdAndDeleteFlag
(
Long
workOrderInnerId
,
String
deleteFlag
);
List
<
InspectionWorkOrderOpLog
>
findByWorkOrderInnerIdAndDeleteFlag
OrderByIdDesc
(
Long
workOrderInnerId
,
String
deleteFlag
);
/**
/**
* 根据操作人ID和操作类型查询操作日志
* 根据操作人ID和操作类型查询操作日志
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
View file @
76c4f39
...
@@ -6,15 +6,18 @@ import com.glsx.usedcar.consts.inspect.JpaQueryConstants;
...
@@ -6,15 +6,18 @@ import com.glsx.usedcar.consts.inspect.JpaQueryConstants;
import
com.glsx.usedcar.converts.*
;
import
com.glsx.usedcar.converts.*
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.inspect.*
;
import
com.glsx.usedcar.enums.inspect.*
;
import
com.glsx.usedcar.gsc.GscApiInvoker
;
import
com.glsx.usedcar.module.inspect.dao.*
;
import
com.glsx.usedcar.module.inspect.dao.*
;
import
com.glsx.usedcar.module.inspect.entity.*
;
import
com.glsx.usedcar.module.inspect.entity.*
;
import
com.glsx.usedcar.module.inspect.vo.*
;
import
com.glsx.usedcar.module.inspect.vo.*
;
import
com.glsx.usedcar.module.system.cache.SystemConfigRedisCache
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.entity.*
;
import
com.glsx.usedcar.module.vehicle.entity.*
;
import
com.glsx.usedcar.util.RedisCacheUtil
;
import
com.glsx.usedcar.util.RedisCacheUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
...
@@ -47,6 +50,9 @@ public class InspectionWorkOrderService {
...
@@ -47,6 +50,9 @@ public class InspectionWorkOrderService {
private
final
InspectorRepository
inspectorRepository
;
private
final
InspectorRepository
inspectorRepository
;
private
final
InspectionReportService
inspectionReportService
;
private
final
InspectionReportService
inspectionReportService
;
private
final
InspectionReportRepository
inspectionReportRepository
;
private
final
InspectionReportRepository
inspectionReportRepository
;
private
final
SystemConfigRedisCache
systemConfigRedisCache
;
private
final
GscApiInvoker
gscApiInvoker
;
private
final
MessageSource
messageSource
;
/**
/**
* 保存检测工单操作日志
* 保存检测工单操作日志
...
@@ -313,12 +319,7 @@ public class InspectionWorkOrderService {
...
@@ -313,12 +319,7 @@ public class InspectionWorkOrderService {
if
(
vo
==
null
||
vo
.
getId
()
==
null
)
{
if
(
vo
==
null
||
vo
.
getId
()
==
null
)
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"工单ID不能为空"
);
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"工单ID不能为空"
);
}
}
if
(
StrUtil
.
isBlank
(
vo
.
getCancelReason
()))
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"取消原因不能为空"
);
}
InspectionWorkOrder
wo
=
inspectionWorkOrderRepository
.
findByIdAndDeleteFlag
(
vo
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
"检测工单不存在,工单ID:"
+
vo
.
getId
()));
InspectionWorkOrder
wo
=
inspectionWorkOrderRepository
.
findByIdAndDeleteFlag
(
vo
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
"检测工单不存在,工单ID:"
+
vo
.
getId
()));
if
(
Objects
.
equals
(
wo
.
getStatus
(),
InspectionWorkOrderStatusEnum
.
COMPLETED
.
getCode
())
||
Objects
.
equals
(
wo
.
getStatus
(),
InspectionWorkOrderStatusEnum
.
CANCELED
.
getCode
()))
{
if
(
Objects
.
equals
(
wo
.
getStatus
(),
InspectionWorkOrderStatusEnum
.
COMPLETED
.
getCode
())
||
Objects
.
equals
(
wo
.
getStatus
(),
InspectionWorkOrderStatusEnum
.
CANCELED
.
getCode
()))
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"工单已经检测完成或者已经取消,工单ID:"
+
vo
.
getId
());
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"工单已经检测完成或者已经取消,工单ID:"
+
vo
.
getId
());
}
}
...
@@ -331,8 +332,13 @@ public class InspectionWorkOrderService {
...
@@ -331,8 +332,13 @@ public class InspectionWorkOrderService {
wo
.
setUpdateTime
(
LocalDateTime
.
now
());
wo
.
setUpdateTime
(
LocalDateTime
.
now
());
inspectionWorkOrderRepository
.
save
(
wo
);
inspectionWorkOrderRepository
.
save
(
wo
);
// 发送取消短信
Object
[]
args
=
{
wo
.
getWoId
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.CANCEL"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送取消短信: 手机号={}, 内容={}"
,
wo
.
getInspector
().
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
wo
.
getInspector
().
getPhone
(),
message
);
String
operationContent
=
String
.
format
(
"取消检测工单,取消原因:%s,原状态:%s"
,
vo
.
getCancelReason
(),
originalStatus
);
String
operationContent
=
String
.
format
(
"取消检测工单,取消原因:%s,原状态:%s"
,
vo
.
getCancelReason
(),
originalStatus
);
String
description
=
"取消检测工单,状态从"
+
originalStatus
+
"改为"
+
InspectionWorkOrderStatusEnum
.
CANCELED
.
getCode
();
String
description
=
"取消检测工单,状态从"
+
originalStatus
+
"改为"
+
InspectionWorkOrderStatusEnum
.
CANCELED
.
getCode
()
+
", 取消类型:"
+
vo
.
getCancelType
()
+
", 取消原因:"
+
vo
.
getCancelReason
()
;
saveWorkOrderOpLog
(
wo
,
InspectionWorkOrderOperationTypeEnum
.
CANCEL_ORDER
.
getCode
(),
originalStatus
,
InspectionWorkOrderStatusEnum
.
CANCELED
.
getCode
(),
operationContent
,
description
,
Long
.
valueOf
(
opId
),
opName
,
platTypeEnum
.
getCode
());
saveWorkOrderOpLog
(
wo
,
InspectionWorkOrderOperationTypeEnum
.
CANCEL_ORDER
.
getCode
(),
originalStatus
,
InspectionWorkOrderStatusEnum
.
CANCELED
.
getCode
(),
operationContent
,
description
,
Long
.
valueOf
(
opId
),
opName
,
platTypeEnum
.
getCode
());
log
.
info
(
"检测工单取消成功: ID={}, 唯一ID={}, 取消原因={}"
,
wo
.
getId
(),
wo
.
getWoId
(),
vo
.
getCancelReason
());
log
.
info
(
"检测工单取消成功: ID={}, 唯一ID={}, 取消原因={}"
,
wo
.
getId
(),
wo
.
getWoId
(),
vo
.
getCancelReason
());
...
@@ -347,7 +353,7 @@ public class InspectionWorkOrderService {
...
@@ -347,7 +353,7 @@ public class InspectionWorkOrderService {
InspectionReport
report
=
inspectionReportRepository
.
findByWoIdAndDeleteFlag
(
wo
.
getWoId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
orElse
(
null
);
InspectionReport
report
=
inspectionReportRepository
.
findByWoIdAndDeleteFlag
(
wo
.
getWoId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
orElse
(
null
);
InspectionReportRespVO
inspectionReportRespVO
=
inspectionReportConverter
.
inspectionReportMapRespVO
(
report
);
InspectionReportRespVO
inspectionReportRespVO
=
inspectionReportConverter
.
inspectionReportMapRespVO
(
report
);
InspectionWORespVO
inspectionWORespVO
=
inspectionWorkOrderConverter
.
inspectorMapRespVO
(
wo
);
InspectionWORespVO
inspectionWORespVO
=
inspectionWorkOrderConverter
.
inspectorMapRespVO
(
wo
);
List
<
InspectionWorkOrderOpLog
>
logList
=
inspectionWorkOrderOpLogRepository
.
findByWorkOrderInnerIdAndDeleteFlag
(
wo
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
());
List
<
InspectionWorkOrderOpLog
>
logList
=
inspectionWorkOrderOpLogRepository
.
findByWorkOrderInnerIdAndDeleteFlag
OrderByIdDesc
(
wo
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
());
List
<
InspectionWOOpLogRespVo
>
inspectionWOOpLogRespVos
=
inspectionWorkOrderOpLogConverter
.
inspectionWorkOrderOpLogMapRespVO
(
logList
);
List
<
InspectionWOOpLogRespVo
>
inspectionWOOpLogRespVos
=
inspectionWorkOrderOpLogConverter
.
inspectionWorkOrderOpLogMapRespVO
(
logList
);
InspectionWODetailRespVO
result
=
new
InspectionWODetailRespVO
();
InspectionWODetailRespVO
result
=
new
InspectionWODetailRespVO
();
result
.
setInspectionWORespVO
(
inspectionWORespVO
);
result
.
setInspectionWORespVO
(
inspectionWORespVO
);
...
@@ -355,6 +361,9 @@ public class InspectionWorkOrderService {
...
@@ -355,6 +361,9 @@ public class InspectionWorkOrderService {
if
(
inspectionReportRespVO
!=
null
)
{
if
(
inspectionReportRespVO
!=
null
)
{
result
.
setInspectionReportRespVO
(
inspectionReportRespVO
);
result
.
setInspectionReportRespVO
(
inspectionReportRespVO
);
}
}
// TODO 获取检测项信息
List
<
InspectionRootNodeSimpleVO
>
nodeVOList
=
null
;
result
.
setNodeVOList
(
nodeVOList
);
return
result
;
return
result
;
}
}
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectorService.java
View file @
76c4f39
...
@@ -7,6 +7,7 @@ import com.glsx.usedcar.consts.common.SymbolConsts;
...
@@ -7,6 +7,7 @@ import com.glsx.usedcar.consts.common.SymbolConsts;
import
com.glsx.usedcar.consts.inspect.JpaQueryConstants
;
import
com.glsx.usedcar.consts.inspect.JpaQueryConstants
;
import
com.glsx.usedcar.converts.InspectorConverter
;
import
com.glsx.usedcar.converts.InspectorConverter
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.inspect.InspectionWorkOrderStatusEnum
;
import
com.glsx.usedcar.module.inspect.dao.*
;
import
com.glsx.usedcar.module.inspect.dao.*
;
import
com.glsx.usedcar.module.inspect.entity.*
;
import
com.glsx.usedcar.module.inspect.entity.*
;
import
com.glsx.usedcar.module.inspect.vo.*
;
import
com.glsx.usedcar.module.inspect.vo.*
;
...
@@ -24,6 +25,8 @@ import org.summerframework.orm.paging.Pagination;
...
@@ -24,6 +25,8 @@ import org.summerframework.orm.paging.Pagination;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
/**
* 检测师服务
* 检测师服务
...
@@ -266,7 +269,7 @@ public class InspectorService {
...
@@ -266,7 +269,7 @@ public class InspectorService {
* @author yangwei
* @author yangwei
* @since 2026/2/10 11:45
* @since 2026/2/10 11:45
*/
*/
public
Page
<
InspectorRespVO
>
pageInspectors
(
Pagination
<
Inspector
>
pagination
)
{
public
Page
<
Inspector
Page
RespVO
>
pageInspectors
(
Pagination
<
Inspector
>
pagination
)
{
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
Inspector
.
KEYWORD
);
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
Inspector
.
KEYWORD
);
if
(
keyword
instanceof
String
kw
&&
StrUtil
.
isNotBlank
(
kw
))
{
if
(
keyword
instanceof
String
kw
&&
StrUtil
.
isNotBlank
(
kw
))
{
pagination
.
removeFilter
(
JpaQueryConstants
.
Inspector
.
KEYWORD
);
pagination
.
removeFilter
(
JpaQueryConstants
.
Inspector
.
KEYWORD
);
...
@@ -275,10 +278,17 @@ public class InspectorService {
...
@@ -275,10 +278,17 @@ public class InspectorService {
builder
.
like
(
root
.
get
(
Inspector_
.
phone
),
SymbolConsts
.
PERCENT
+
kw
+
SymbolConsts
.
PERCENT
)
builder
.
like
(
root
.
get
(
Inspector_
.
phone
),
SymbolConsts
.
PERCENT
+
kw
+
SymbolConsts
.
PERCENT
)
));
));
}
}
Page
<
Inspector
>
resultPage
=
inspectorRepository
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
Page
<
Inspector
>
resultPage
=
inspectorRepository
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
Map
<
Long
,
Inspector
>
map
=
resultPage
.
getContent
().
stream
().
collect
(
Collectors
.
toMap
(
Inspector:
:
getId
,
Function
.
identity
()));
return
resultPage
.
map
(
inspectorConverter:
:
inspectorMapRespVO
);
Page
<
InspectorPageRespVO
>
result
=
resultPage
.
map
(
inspectorConverter:
:
inspector2PageVO
);
for
(
InspectorPageRespVO
vo
:
result
.
getContent
())
{
Inspector
inspector
=
map
.
get
(
vo
.
getId
());
vo
.
setInProgressCount
(
inspectionWorkOrderRepository
.
countByInspectorAndStatusAndDeleteFlag
(
inspector
,
InspectionWorkOrderStatusEnum
.
IN_PROGRESS
.
getCode
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()));
vo
.
setDispatchedCount
(
inspectionWorkOrderRepository
.
countByInspectorAndStatusAndDeleteFlag
(
inspector
,
InspectionWorkOrderStatusEnum
.
DISPATCHED
.
getCode
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()));
vo
.
setCompletedCount
(
inspectionWorkOrderRepository
.
countByInspectorAndStatusAndDeleteFlag
(
inspector
,
InspectionWorkOrderStatusEnum
.
COMPLETED
.
getCode
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()));
vo
.
setAvgInspectCost
(
inspectionWorkOrderRepository
.
summaryAVGInspectTimeByInspector
(
inspector
).
orElse
(
0
));
}
return
result
;
}
}
/**
/**
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectionRootNodeSimpleVO.java
0 → 100644
View file @
76c4f39
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
/**
* 检测跟节点简易信息,工单详情用
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"检测跟节点简易信息 VO"
)
public
class
InspectionRootNodeSimpleVO
{
@Schema
(
description
=
"节点 ID"
)
private
Long
id
;
@Schema
(
description
=
"节点名称"
)
private
String
nodeName
;
@Schema
(
description
=
"检测项"
)
private
Integer
count
;
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectionWODetailRespVO.java
View file @
76c4f39
...
@@ -22,4 +22,7 @@ public class InspectionWODetailRespVO {
...
@@ -22,4 +22,7 @@ public class InspectionWODetailRespVO {
@Schema
(
description
=
"报告信息"
)
@Schema
(
description
=
"报告信息"
)
private
InspectionReportRespVO
inspectionReportRespVO
;
private
InspectionReportRespVO
inspectionReportRespVO
;
@Schema
(
description
=
"检测项信息"
)
private
List
<
InspectionRootNodeSimpleVO
>
nodeVOList
;
}
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorPageRespVO.java
0 → 100644
View file @
76c4f39
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* 检测师查询响应VO
* @author yangwei
* @version 1.0
* @since 2026/02/10 14:12
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"检测师查询响应VO"
)
public
class
InspectorPageRespVO
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2193361787441423518L
;
/**
* 主键ID
*/
@Schema
(
description
=
"主键ID"
)
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
private
Long
id
;
/**
* 姓名
*/
@Schema
(
description
=
"姓名"
)
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
private
String
name
;
/**
* 手机号
*/
@Schema
(
description
=
"手机号"
)
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
private
String
phone
;
/**
* 状态 1:正常 0:禁用
*/
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
@Schema
(
description
=
"状态 1:正常 0:禁用"
)
@Builder
.
Default
private
Integer
status
=
1
;
@Schema
(
description
=
"所属区域"
,
example
=
"110000"
)
private
String
region
;
@Schema
(
description
=
"所属区域名称"
,
example
=
"北京"
)
private
String
regionName
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
/**
* 待检测数量(DISPATCHED)
*/
@Schema
(
description
=
"待检测工单数量(状态编码1)"
,
example
=
"10"
)
private
Long
dispatchedCount
;
/**
* 检测中数量(IN_PROGRESS)
*/
@Schema
(
description
=
"检测中工单数量(状态编码2)"
,
example
=
"5"
)
private
Long
inProgressCount
;
/**
* 已完成数量(COMPLETED)
*/
@Schema
(
description
=
"已完成工单数量(状态编码3)"
,
example
=
"20"
)
private
Long
completedCount
;
@Schema
(
description
=
"平均检测耗时,单位:秒"
)
private
Integer
avgInspectCost
;
}
aus-core/src/main/java/com/glsx/usedcar/util/LocalDateTimeUtil.java
View file @
76c4f39
package
com
.
glsx
.
usedcar
.
util
;
package
com
.
glsx
.
usedcar
.
util
;
import
java.time.*
;
import
java.time.*
;
import
java.util.Date
;
public
class
LocalDateTimeUtil
{
public
class
LocalDateTimeUtil
{
/**
/**
...
@@ -14,4 +15,14 @@ public class LocalDateTimeUtil {
...
@@ -14,4 +15,14 @@ public class LocalDateTimeUtil {
// 2. 结合系统默认时区(如Asia/Shanghai)转ZonedDateTime,再转LocalDateTime
// 2. 结合系统默认时区(如Asia/Shanghai)转ZonedDateTime,再转LocalDateTime
return
LocalDateTime
.
ofInstant
(
instant
,
ZoneId
.
systemDefault
());
return
LocalDateTime
.
ofInstant
(
instant
,
ZoneId
.
systemDefault
());
}
}
public
static
Date
localDateTimeToDate
(
LocalDateTime
localDateTime
)
{
// 空值保护(避免空指针)
if
(
localDateTime
==
null
)
{
return
null
;
}
// 指定固定时区(如东八区),避免系统时区差异导致的问题
ZoneId
zoneId
=
ZoneId
.
of
(
"Asia/Shanghai"
);
return
Date
.
from
(
localDateTime
.
atZone
(
zoneId
).
toInstant
());
}
}
}
aus-core/src/main/java/com/glsx/usedcar/util/SmsCodeUtil.java
View file @
76c4f39
...
@@ -2,13 +2,16 @@ package com.glsx.usedcar.util;
...
@@ -2,13 +2,16 @@ package com.glsx.usedcar.util;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
com.glsx.usedcar.gsc.GscApiInvoker
;
import
com.glsx.usedcar.gsc.GscApiInvoker
;
import
com.glsx.usedcar.module.system.cache.SystemConfigRedisCache
;
import
jakarta.annotation.Resource
;
import
jakarta.annotation.Resource
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Locale
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
/**
/**
...
@@ -18,8 +21,9 @@ import java.util.concurrent.TimeUnit;
...
@@ -18,8 +21,9 @@ import java.util.concurrent.TimeUnit;
@Component
@Component
@RequiredArgsConstructor
@RequiredArgsConstructor
public
class
SmsCodeUtil
{
public
class
SmsCodeUtil
{
private
final
RedisCacheUtil
redisCacheUtil
;
private
final
RedisCacheUtil
redisCacheUtil
;
private
final
SystemConfigRedisCache
systemConfigRedisCache
;
private
final
MessageSource
messageSource
;
@Lazy
@Lazy
@Resource
@Resource
private
GscApiInvoker
gscApiInvoker
;
private
GscApiInvoker
gscApiInvoker
;
...
@@ -80,9 +84,12 @@ public class SmsCodeUtil {
...
@@ -80,9 +84,12 @@ public class SmsCodeUtil {
// 3. 设置冷却期(60秒过期)
// 3. 设置冷却期(60秒过期)
String
coolDownKey
=
"SMS_COOL_DOWN:"
+
phone
;
String
coolDownKey
=
"SMS_COOL_DOWN:"
+
phone
;
redisCacheUtil
.
setCacheWithExpire
(
coolDownKey
,
System
.
currentTimeMillis
(),
coolDownSeconds
,
TimeUnit
.
SECONDS
);
redisCacheUtil
.
setCacheWithExpire
(
coolDownKey
,
System
.
currentTimeMillis
(),
coolDownSeconds
,
TimeUnit
.
SECONDS
);
Object
[]
args
=
{
code
,
codeExpire
/
60
};
String
msg
=
"【广联赛讯】您的验证码:%s, 该验证码 %s 分钟内有效。"
;
String
message
=
messageSource
.
getMessage
(
"Inspector.Login.SMSCODE"
,
args
,
Locale
.
CHINESE
);
gscApiInvoker
.
sendMsg
(
phone
,
String
.
format
(
msg
,
code
,
codeExpire
/
60
));
// String msg = "【广联赛讯】您正在登录检测系统账号,验证码:%s,%s分钟内有效。如非本人操作,请忽略此短信。";
// String template = systemConfigRedisCache.getConfigValueAsString(SystemConfigKeyEnum.INSPECTOR_NOTICE_TEMPLATE_SMS_CODE.getKey(), msg);
// gscApiInvoker.sendMsg(phone, String.format(template, code, codeExpire / 60));
gscApiInvoker
.
sendMsg
(
phone
,
message
);
// 4. 发送短信
// 4. 发送短信
log
.
info
(
"向手机号{}发送验证码:{}(冷却期{}秒,5分钟内已发送{}次)"
,
log
.
info
(
"向手机号{}发送验证码:{}(冷却期{}秒,5分钟内已发送{}次)"
,
phone
,
code
,
coolDownSeconds
,
phone
,
code
,
coolDownSeconds
,
...
@@ -100,6 +107,7 @@ public class SmsCodeUtil {
...
@@ -100,6 +107,7 @@ public class SmsCodeUtil {
String
codeKey
=
"SMS_CODE:"
+
phone
;
String
codeKey
=
"SMS_CODE:"
+
phone
;
String
redisCode
=
redisCacheUtil
.
getCache
(
codeKey
,
String
.
class
);
String
redisCode
=
redisCacheUtil
.
getCache
(
codeKey
,
String
.
class
);
if
(
redisCode
==
null
)
{
if
(
redisCode
==
null
)
{
log
.
warn
(
"手机号{}验证码已过期,{}"
,
phone
,
code
);
return
false
;
return
false
;
}
}
// 验证通过后删除验证码(防止重复使用)
// 验证通过后删除验证码(防止重复使用)
...
...
aus-core/src/main/resources/messages.properties
View file @
76c4f39
...
@@ -61,3 +61,5 @@ Account.AccountType.COMPANY=\u8F66\u5546\u7528\u6237
...
@@ -61,3 +61,5 @@ Account.AccountType.COMPANY=\u8F66\u5546\u7528\u6237
Deposit.RefundState.UNREFUND
=
\u
672A
\u9000\u
6B3E
Deposit.RefundState.UNREFUND
=
\u
672A
\u9000\u
6B3E
Deposit.RefundState.REFUNDING
=
\u9000\u
6B3E
\u
4E2D
Deposit.RefundState.REFUNDING
=
\u9000\u
6B3E
\u
4E2D
Deposit.RefundState.REFUNDED
=
\u
5DF2
\u9000\u
6B3E
Deposit.RefundState.REFUNDED
=
\u
5DF2
\u9000\u
6B3E
Inspector.Login.SMSCODE
=
\u
60a8
\u
6b63
\u5728\u
767b
\u
5f55
\u
68c0
\u
6d4b
\u
7cfb
\u
7edf
\u
8d26
\u
53f7
\u
ff0c
\u
9a8c
\u
8bc1
\u7801\u
ff1a{0}
\u
ff0c{1}
\u5206\u
949f
\u5185\u6709\u6548\u3002\u5982\u
975e
\u
672c
\u
4eba
\u
64cd
\u
4f5c
\u
ff0c
\u
8bf7
\u
5ffd
\u7565\u
6b64
\u
77ed
\u
4fe1
\u3002
SMS.INSPECTION.WO.CANCEL
=
\u
60a8
\u
597d
\u3002\u
60a8
\u6240\u
8d1f
\u
8d23
\u7684\u
68c0
\u
6d4b
\u
5de5
\u5355
{0}
\u
5df2
\u
88ab
\u
53d6
\u
6d88
\u
ff0c
\u
4efb
\u
52a1
\u
72b6
\u6001\u
5df2
\u
66f4
\u
65b0
\u
4e3a
\u
201c
\u
5df2
\u
53d6
\u
6d88
\u
201d
\u
ff0c
\u
8bf7
\u
52ff
\u
518d
\u
524d
\u
5f80
\u
68c0
\u
6d4b
\u3002
aus-inspector/src/main/java/com/glsx/usedcar/controller/AuthController.java
View file @
76c4f39
package
com
.
glsx
.
usedcar
.
controller
;
package
com
.
glsx
.
usedcar
.
controller
;
import
com.glsx.usedcar.annotation.RequireLogin
;
import
com.glsx.usedcar.annotation.RequireLogin
;
import
com.glsx.usedcar.context.InspectorContext
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
com.glsx.usedcar.module.inspect.service.InspectorService
;
import
com.glsx.usedcar.req.LoginByCodeReq
;
import
com.glsx.usedcar.req.LoginByCodeReq
;
import
com.glsx.usedcar.req.VerifyCodeReq
;
import
com.glsx.usedcar.req.VerifyCodeReq
;
import
com.glsx.usedcar.resp.BaseResp
;
import
com.glsx.usedcar.resp.LoginByCodeResp
;
import
com.glsx.usedcar.resp.LoginByCodeResp
;
import
com.glsx.usedcar.token.JwtProvider
;
import
com.glsx.usedcar.token.JwtProvider
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
com.glsx.usedcar.util.LocalDateTimeUtil
;
import
com.glsx.usedcar.module.inspect.service.InspectorService
;
import
com.glsx.usedcar.resp.BaseResp
;
import
com.glsx.usedcar.util.SmsCodeUtil
;
import
com.glsx.usedcar.util.SmsCodeUtil
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Parameter
;
...
@@ -19,9 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -19,9 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.time.LocalDateTime
;
import
static
com
.
glsx
.
usedcar
.
conts
.
Constants
.
LOGIN_INSPECTOR
;
/**
/**
* 认证控制器:负责登录、验证码发送、退出登录等认证相关接口
* 认证控制器:负责登录、验证码发送、退出登录等认证相关接口
...
@@ -90,14 +90,16 @@ public class AuthController {
...
@@ -90,14 +90,16 @@ public class AuthController {
String
phone
=
loginRequest
.
getPhone
();
String
phone
=
loginRequest
.
getPhone
();
Inspector
inspector
=
inspectorService
.
findByPhone
(
phone
);
Inspector
inspector
=
inspectorService
.
findByPhone
(
phone
);
if
(
inspector
==
null
)
{
if
(
inspector
==
null
)
{
log
.
warn
(
"用户手机号{}不存在"
,
phone
);
return
BaseResp
.
fail
(
"用户不存在"
);
return
BaseResp
.
fail
(
"用户不存在"
);
}
}
String
code
=
loginRequest
.
getVerifyCode
();
String
code
=
loginRequest
.
getVerifyCode
();
if
(!
smsCodeUtil
.
validateCode
(
phone
,
code
))
{
if
(!
smsCodeUtil
.
validateCode
(
phone
,
code
))
{
log
.
warn
(
"用户手机号{}验证码错误"
,
phone
);
return
BaseResp
.
fail
(
"验证码错误或已过期"
);
return
BaseResp
.
fail
(
"验证码错误或已过期"
);
}
}
Dat
e
expireTime
=
jwtProvider
.
getExpireTime
();
LocalDateTim
e
expireTime
=
jwtProvider
.
getExpireTime
();
String
token
=
jwtProvider
.
generateUser
(
phone
,
expireTime
);
String
token
=
jwtProvider
.
generateUser
(
phone
,
LocalDateTimeUtil
.
localDateTimeToDate
(
expireTime
)
);
LoginByCodeResp
resp
=
new
LoginByCodeResp
();
LoginByCodeResp
resp
=
new
LoginByCodeResp
();
resp
.
setToken
(
token
);
resp
.
setToken
(
token
);
resp
.
setPhone
(
phone
);
resp
.
setPhone
(
phone
);
...
@@ -117,11 +119,11 @@ public class AuthController {
...
@@ -117,11 +119,11 @@ public class AuthController {
description
=
"检测员退出登录(需携带有效JWT Token),当前仅返回成功状态,可扩展Token失效逻辑"
description
=
"检测员退出登录(需携带有效JWT Token),当前仅返回成功状态,可扩展Token失效逻辑"
)
)
@PostMapping
(
"/logout"
)
@PostMapping
(
"/logout"
)
@RequireLogin
// 自定义注解:校验请求头中的Token是否有效
@RequireLogin
public
BaseResp
<
Boolean
>
logout
(
public
BaseResp
<
Boolean
>
logout
(
@Parameter
(
hidden
=
true
)
@Parameter
(
hidden
=
true
)
HttpServletRequest
request
)
{
HttpServletRequest
request
)
{
String
phone
=
(
String
)
request
.
getAttribute
(
LOGIN_INSPECTOR
);
String
phone
=
InspectorContext
.
getPhone
(
);
log
.
info
(
"检测员{}执行退出登录操作"
,
phone
);
log
.
info
(
"检测员{}执行退出登录操作"
,
phone
);
return
BaseResp
.
success
(
true
);
return
BaseResp
.
success
(
true
);
}
}
...
...
aus-inspector/src/main/java/com/glsx/usedcar/resp/LoginByCodeResp.java
View file @
76c4f39
package
com
.
glsx
.
usedcar
.
resp
;
package
com
.
glsx
.
usedcar
.
resp
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.Data
;
import
java.
util.Dat
e
;
import
java.
time.LocalDateTim
e
;
/**
/**
...
@@ -10,7 +12,14 @@ import java.util.Date;
...
@@ -10,7 +12,14 @@ import java.util.Date;
*/
*/
@Data
@Data
public
class
LoginByCodeResp
{
public
class
LoginByCodeResp
{
@Schema
(
description
=
"token"
)
private
String
token
;
private
String
token
;
private
Date
expireTime
;
@Schema
(
description
=
"过期时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
expireTime
;
@Schema
(
description
=
"登录手机号"
)
private
String
phone
;
private
String
phone
;
}
}
aus-inspector/src/main/java/com/glsx/usedcar/token/JwtProvider.java
View file @
76c4f39
...
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.summerframework.web.auth.AbstractJwtProvider
;
import
org.summerframework.web.auth.AbstractJwtProvider
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -38,10 +39,12 @@ public class JwtProvider extends AbstractJwtProvider {
...
@@ -38,10 +39,12 @@ public class JwtProvider extends AbstractJwtProvider {
}
}
}
}
public
Date
getExpireTime
()
{
public
LocalDateTime
getExpireTime
()
{
return
new
Date
(
System
.
currentTimeMillis
()
+
jwtProperties
.
getExpiration
()
*
1000
);
LocalDateTime
now
=
LocalDateTime
.
now
();
return
now
.
plusSeconds
(
jwtProperties
.
getExpiration
());
}
}
/**
/**
* 解析token
* 解析token
*
*
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment