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 cda205d0
authored
Mar 10, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:检测人员管理
1 parent
417c7707
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
623 additions
and
88 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/rest/inspect/InspectorController.java
aus-config/pom.xml
aus-core/src/main/java/com/glsx/usedcar/consts/common/SymbolConsts.java
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectorOpLogRepository.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectorRepository.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/entity/Inspector.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/entity/InspectorOpLog.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/InspectorAddVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorDetailRespVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorOpLogRespVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorQryVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorRespVO.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorUpdateVO.java
aus-framework/src/main/java/org/summerframework/core/enums/ErrorCodeEnum.java
aus-framework/src/main/java/org/summerframework/core/util/StringUtils.java
aus-framework/src/main/java/org/summerframework/orm/dictionary/Dictionary_.java
aus-framework/src/main/java/org/summerframework/orm/entity/AuditingEntity_.java
aus-framework/src/main/java/org/summerframework/orm/entity/AuditingTimeEntity_.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/inspect/InspectorController.java
View file @
cda205d
...
@@ -6,6 +6,7 @@ import com.glsx.usedcar.module.inspect.vo.InspectorAddVO;
...
@@ -6,6 +6,7 @@ import com.glsx.usedcar.module.inspect.vo.InspectorAddVO;
import
com.glsx.usedcar.module.inspect.vo.InspectorQryVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorQryVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorRespVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorRespVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorUpdateVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorUpdateVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorDetailRespVO
;
import
com.glsx.usedcar.resp.BaseResp
;
import
com.glsx.usedcar.resp.BaseResp
;
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
;
...
@@ -79,7 +80,8 @@ public class InspectorController {
...
@@ -79,7 +80,8 @@ public class InspectorController {
}
}
@Operation
(
summary
=
"删除检测师"
,
description
=
"根据检测师ID删除检测师(逻辑删除)"
)
@Operation
(
summary
=
"删除检测师"
,
description
=
"根据检测师ID删除检测师(逻辑删除)"
)
@PostMapping
(
"/delete/{id}"
)
// @PostMapping("/delete/{id}")
@Deprecated
public
BaseResp
<
Void
>
deleteInspector
(
public
BaseResp
<
Void
>
deleteInspector
(
@Parameter
(
description
=
"检测师ID"
,
required
=
true
)
@Parameter
(
description
=
"检测师ID"
,
required
=
true
)
@NotNull
(
message
=
"检测师ID不能为空"
)
@NotNull
(
message
=
"检测师ID不能为空"
)
...
@@ -100,9 +102,34 @@ public class InspectorController {
...
@@ -100,9 +102,34 @@ public class InspectorController {
return
BaseResp
.
success
();
return
BaseResp
.
success
();
}
}
@Operation
(
summary
=
"禁用/启用检测师"
,
description
=
"根据检测师ID修改状态,0-禁用,1-启用"
)
@PostMapping
(
"/status/{id}"
)
public
BaseResp
<
Void
>
updateStatus
(
@Parameter
(
description
=
"检测师ID"
,
required
=
true
)
@NotNull
(
message
=
"检测师ID不能为空"
)
@Positive
(
message
=
"检测师ID必须为正数"
)
@PathVariable
(
"id"
)
Long
id
,
@Parameter
(
description
=
"状态值:0-禁用,1-启用"
,
required
=
true
)
@NotNull
(
message
=
"状态值不能为空"
)
@RequestParam
(
"status"
)
Integer
status
)
{
log
.
info
(
"禁用/启用检测师请求: ID={}, status={}"
,
id
,
status
);
try
{
inspectorService
.
updateStatus
(
id
,
status
);
}
catch
(
BusinessCodeException
be
)
{
log
.
error
(
"禁用/启用检测师失败!业务异常!"
,
be
);
return
BaseResp
.
fail
(
StrUtil
.
toString
(
be
.
getCode
()),
be
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"禁用/启用检测师失败!系统异常!"
,
e
);
return
BaseResp
.
fail
(
"系统异常: "
+
e
.
getMessage
());
}
return
BaseResp
.
success
();
}
@Operation
(
summary
=
"分页查询检测师"
,
description
=
"分页查询检测师列表,支持姓名或手机号模糊查询,自动过滤逻辑删除数据"
)
@Operation
(
summary
=
"分页查询检测师"
,
description
=
"分页查询检测师列表,支持姓名或手机号模糊查询,自动过滤逻辑删除数据"
)
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
public
BaseResp
<
Page
<
InspectorRespVO
>>
pageInspectors
(
@Valid
ated
@RequestBody
Pagination
<
InspectorQryVO
>
pagination
)
{
public
BaseResp
<
Page
<
InspectorRespVO
>>
pageInspectors
(
@Valid
@RequestBody
Pagination
<
InspectorQryVO
>
pagination
)
{
log
.
info
(
"分页查询检测师请求: offset={}, limit={}"
,
pagination
.
getOffset
(),
pagination
.
getLimit
());
log
.
info
(
"分页查询检测师请求: offset={}, limit={}"
,
pagination
.
getOffset
(),
pagination
.
getLimit
());
try
{
try
{
...
@@ -113,4 +140,25 @@ public class InspectorController {
...
@@ -113,4 +140,25 @@ public class InspectorController {
return
BaseResp
.
fail
(
"系统异常: "
+
e
.
getMessage
());
return
BaseResp
.
fail
(
"系统异常: "
+
e
.
getMessage
());
}
}
}
}
@Operation
(
summary
=
"查询检测师详情"
,
description
=
"查询检测师账号基本信息和操作日志"
)
@GetMapping
(
"/detail/{id}"
)
public
BaseResp
<
InspectorDetailRespVO
>
getDetail
(
@Parameter
(
description
=
"检测师ID"
,
required
=
true
)
@NotNull
(
message
=
"检测师ID不能为空"
)
@Positive
(
message
=
"检测师ID必须为正数"
)
@PathVariable
(
"id"
)
Long
id
)
{
log
.
info
(
"查询检测师详情请求: ID={}"
,
id
);
try
{
InspectorDetailRespVO
result
=
inspectorService
.
getDetail
(
id
);
return
BaseResp
.
success
(
result
);
}
catch
(
BusinessCodeException
be
)
{
log
.
error
(
"查询检测师详情失败!业务异常!"
,
be
);
return
BaseResp
.
fail
(
StrUtil
.
toString
(
be
.
getCode
()),
be
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"查询检测师详情失败!系统异常!"
,
e
);
return
BaseResp
.
fail
(
"系统异常: "
+
e
.
getMessage
());
}
}
}
}
aus-config/pom.xml
View file @
cda205d
...
@@ -15,6 +15,12 @@
...
@@ -15,6 +15,12 @@
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<dependencies>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
<artifactId>
spring-cloud-starter-config
</artifactId>
...
...
aus-core/src/main/java/com/glsx/usedcar/consts/common/SymbolConsts.java
View file @
cda205d
...
@@ -10,4 +10,7 @@ public interface SymbolConsts {
...
@@ -10,4 +10,7 @@ public interface SymbolConsts {
/** % */
/** % */
String
PERCENT
=
"%"
;
String
PERCENT
=
"%"
;
/** 逗号 */
String
COMMA
=
","
;
}
}
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
View file @
cda205d
...
@@ -25,6 +25,16 @@ public interface JpaQueryConstants {
...
@@ -25,6 +25,16 @@ public interface JpaQueryConstants {
String
KEYWORD
=
"keyword"
;
String
KEYWORD
=
"keyword"
;
/**
/**
* 城市编码,精确匹配
*/
String
REGION
=
"region"
;
/**
* 账号状态,精确匹配
*/
String
STATUS
=
"status"
;
/**
* 创建时间
* 创建时间
*/
*/
String
UPDATE_TIME
=
"updateTime"
;
String
UPDATE_TIME
=
"updateTime"
;
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectorOpLogRepository.java
0 → 100644
View file @
cda205d
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
dao
;
import
com.glsx.usedcar.module.inspect.entity.InspectorOpLog
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.querydsl.QuerydslPredicateExecutor
;
import
org.springframework.stereotype.Repository
;
import
org.summerframework.orm.BaseRepository
;
import
java.util.List
;
/**
* 检测师操作日志数据访问层
* @author yangwei
* @since 2026/3/9
*/
@Repository
public
interface
InspectorOpLogRepository
extends
BaseRepository
<
InspectorOpLog
,
Long
>,
JpaSpecificationExecutor
<
InspectorOpLog
>,
QuerydslPredicateExecutor
<
InspectorOpLog
>
{
/**
* 根据检测师ID查询操作日志列表
*
* @param inspectorId 检测师ID
* @return 操作日志列表
*/
List
<
InspectorOpLog
>
findByInspectorIdAndDeleteFlag
(
Long
inspectorId
,
String
deleteFlag
);
}
\ No newline at end of file
\ No newline at end of file
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectorRepository.java
View file @
cda205d
...
@@ -6,6 +6,7 @@ import org.springframework.data.querydsl.QuerydslPredicateExecutor;
...
@@ -6,6 +6,7 @@ import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
org.summerframework.orm.BaseRepository
;
import
org.summerframework.orm.BaseRepository
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
/**
/**
...
@@ -26,6 +27,14 @@ public interface InspectorRepository extends BaseRepository<Inspector, Long>, Jp
...
@@ -26,6 +27,14 @@ public interface InspectorRepository extends BaseRepository<Inspector, Long>, Jp
Optional
<
Inspector
>
findByPhoneAndDeleteFlag
(
String
phone
,
String
deletedFlag
);
Optional
<
Inspector
>
findByPhoneAndDeleteFlag
(
String
phone
,
String
deletedFlag
);
/**
/**
* 根据手机号查询检测师
*
* @param phone 手机号
* @return 检测师信息
*/
List
<
Inspector
>
findByPhone
(
String
phone
);
/**
* 根据ID查询检测师
* 根据ID查询检测师
*
*
* @param id 检测师ID
* @param id 检测师ID
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/entity/Inspector.java
View file @
cda205d
...
@@ -14,6 +14,8 @@ import org.summerframework.orm.validator.UpdateValidGroup;
...
@@ -14,6 +14,8 @@ import org.summerframework.orm.validator.UpdateValidGroup;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
jakarta
.
persistence
.
GenerationType
.
IDENTITY
;
import
static
jakarta
.
persistence
.
GenerationType
.
IDENTITY
;
...
@@ -82,6 +84,13 @@ public class Inspector extends AuditingEntity implements Serializable {
...
@@ -82,6 +84,13 @@ public class Inspector extends AuditingEntity implements Serializable {
private
String
region
;
private
String
region
;
/**
/**
* 所属区域
*/
@Size
(
max
=
128
,
groups
=
{
CreateValidGroup
.
class
,
UpdateValidGroup
.
class
})
@Column
(
name
=
"REGION_NAME"
,
nullable
=
true
,
length
=
128
)
private
String
regionName
;
/**
* 手机号
* 手机号
*/
*/
@Size
(
max
=
20
,
groups
=
{
CreateValidGroup
.
class
,
UpdateValidGroup
.
class
})
@Size
(
max
=
20
,
groups
=
{
CreateValidGroup
.
class
,
UpdateValidGroup
.
class
})
...
@@ -117,5 +126,13 @@ public class Inspector extends AuditingEntity implements Serializable {
...
@@ -117,5 +126,13 @@ public class Inspector extends AuditingEntity implements Serializable {
@Column
(
name
=
"REMARK"
,
nullable
=
true
,
length
=
512
)
@Column
(
name
=
"REMARK"
,
nullable
=
true
,
length
=
512
)
private
String
remark
;
private
String
remark
;
@OneToMany
(
mappedBy
=
"inspector"
,
fetch
=
FetchType
.
LAZY
,
cascade
=
{
CascadeType
.
PERSIST
,
CascadeType
.
MERGE
},
orphanRemoval
=
true
)
@OrderBy
(
"createTime DESC"
)
private
List
<
InspectorOpLog
>
inspectorOpLogs
=
new
ArrayList
<>();
}
}
\ No newline at end of file
\ No newline at end of file
aus-core/src/main/java/com/glsx/usedcar/module/inspect/entity/InspectorOpLog.java
0 → 100644
View file @
cda205d
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
entity
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
jakarta.persistence.*
;
import
jakarta.validation.constraints.Size
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
org.summerframework.orm.entity.AuditingEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
static
jakarta
.
persistence
.
GenerationType
.
IDENTITY
;
/**
* 检测师操作日志表(InspectorOpLog)实体类
* @author yangwei
* @since 2026/3/9
*/
@Entity
@Getter
@Setter
@Builder
@DynamicInsert
@DynamicUpdate
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"inspectors_op_log"
)
@EntityListeners
(
AuditingEntityListener
.
class
)
public
class
InspectorOpLog
extends
AuditingEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
8929192115233965496L
;
public
interface
Summary
{
}
/**
* 主键ID
*/
@Id
@GeneratedValue
(
strategy
=
IDENTITY
)
@Column
(
name
=
"ID"
,
unique
=
true
,
nullable
=
false
)
@JsonView
(
value
=
Summary
.
class
)
private
Long
id
;
/**
* inspectors.id关联外键
*/
@JsonView
(
value
=
Summary
.
class
)
@Column
(
name
=
"INSPECTOR_ID"
,
nullable
=
false
)
private
Long
inspectorId
;
/**
* 操作描述
*/
@JsonView
(
value
=
Summary
.
class
)
@Size
(
max
=
256
,
groups
=
{})
@Column
(
name
=
"DESCRIPET"
,
nullable
=
true
,
length
=
256
)
private
String
description
;
/**
* 删除标识 N:未删除 D:已删除
*/
@Builder
.
Default
@Column
(
name
=
"DELETE_FLAG"
,
nullable
=
false
,
length
=
1
)
private
String
deleteFlag
=
"N"
;
/**
* 关联的检测师
*/
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JoinColumn
(
name
=
"INSPECTOR_ID"
,
insertable
=
false
,
updatable
=
false
)
private
Inspector
inspector
;
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectorService.java
View file @
cda205d
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
service
;
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.glsx.usedcar.consts.common.SymbolConsts
;
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.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.
enums.inspect.InspectorStatus
;
import
com.glsx.usedcar.
module.inspect.dao.InspectorOpLogRepository
;
import
com.glsx.usedcar.module.inspect.dao.InspectorRepository
;
import
com.glsx.usedcar.module.inspect.dao.InspectorRepository
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
com.glsx.usedcar.module.inspect.entity.InspectorOpLog
;
import
com.glsx.usedcar.module.inspect.entity.QInspector
;
import
com.glsx.usedcar.module.inspect.entity.QInspector
;
import
com.glsx.usedcar.module.inspect.vo.InspectorAddVO
;
import
com.glsx.usedcar.module.inspect.vo.*
;
import
com.glsx.usedcar.module.inspect.vo.InspectorQryVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorRespVO
;
import
com.glsx.usedcar.module.inspect.vo.InspectorUpdateVO
;
import
com.glsx.usedcar.util.QuerydslPageHelper
;
import
com.glsx.usedcar.util.QuerydslPageHelper
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
import
com.querydsl.core.BooleanBuilder
;
import
com.querydsl.core.BooleanBuilder
;
import
com.querydsl.core.types.Projections
;
import
com.querydsl.core.types.Projections
;
...
@@ -28,12 +28,14 @@ import org.springframework.transaction.annotation.Propagation;
...
@@ -28,12 +28,14 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.summerframework.core.enums.ErrorCodeEnum
;
import
org.summerframework.core.enums.ErrorCodeEnum
;
import
org.summerframework.core.exception.BusinessCodeException
;
import
org.summerframework.core.exception.BusinessCodeException
;
import
org.summerframework.core.util.StringUtils
;
import
org.summerframework.orm.paging.Pagination
;
import
org.summerframework.orm.paging.Pagination
;
import
java.util.*
;
import
java.util.*
;
/**
/**
* 检测师服务
* 检测师服务
*
* @author yangwei
* @author yangwei
* @version 1.0
* @version 1.0
* @since 2026/02/09 15:46
* @since 2026/02/09 15:46
...
@@ -44,14 +46,18 @@ import java.util.*;
...
@@ -44,14 +46,18 @@ import java.util.*;
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
)
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
)
public
class
InspectorService
{
public
class
InspectorService
{
private
static
final
String
EDIT_TEMPLATE
=
"{0}由{1}改为{2}"
;
private
final
JPAQueryFactory
jpaQueryFactory
;
private
final
JPAQueryFactory
jpaQueryFactory
;
private
final
InspectorRepository
inspectorRepository
;
private
final
InspectorRepository
inspectorRepository
;
private
final
InspectorOpLogRepository
inspectorOpLogRepository
;
/**
/**
* 新增检测师
* 新增检测师
*
* @param addVO 新增请求VO
* @author yangwei
* @author yangwei
* @since 2026/2/9 16:10
* @since 2026/2/9 16:10
* @param addVO 新增请求VO
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addInspector
(
InspectorAddVO
addVO
)
{
public
void
addInspector
(
InspectorAddVO
addVO
)
{
...
@@ -65,23 +71,44 @@ public class InspectorService {
...
@@ -65,23 +71,44 @@ public class InspectorService {
Inspector
inspector
=
Inspector
.
builder
()
Inspector
inspector
=
Inspector
.
builder
()
.
name
(
addVO
.
getName
())
.
name
(
addVO
.
getName
())
.
phone
(
addVO
.
getPhone
())
.
phone
(
addVO
.
getPhone
())
.
password
(
addVO
.
getPassword
())
.
status
(
addVO
.
getStatus
())
.
status
(
InspectorStatus
.
NORMAL
.
getCode
())
.
region
(
addVO
.
getRegion
())
.
regionName
(
addVO
.
getRegionName
())
.
deleteFlag
(
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
deleteFlag
(
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
build
();
.
build
();
// 保存到数据库
// 保存到数据库
inspectorRepository
.
save
(
inspector
);
inspectorRepository
.
save
(
inspector
);
insertInspectorOpLog
(
inspector
.
getId
(),
"创建账号"
);
log
.
info
(
"检测师新增成功: ID={}"
,
inspector
.
getId
());
log
.
info
(
"检测师新增成功: ID={}"
,
inspector
.
getId
());
}
}
}
}
/**
/**
* 维护检测师操作日志
*
* @param inspectorId 检测师ID
* @param description 操作描述
* @author yangwei
* @since 2026/3/9 15:52
*/
private
void
insertInspectorOpLog
(
Long
inspectorId
,
String
description
)
{
InspectorOpLog
inspectorOpLog
=
new
InspectorOpLog
();
inspectorOpLog
.
setInspectorId
(
inspectorId
);
inspectorOpLog
.
setDeleteFlag
(
DeleteFlag
.
NOT_DELETED
.
getCode
());
inspectorOpLog
.
setDescription
(
description
);
inspectorOpLogRepository
.
save
(
inspectorOpLog
);
}
/**
* 修改检测师
* 修改检测师
*
* @param id 检测师ID
* @param updateVO 修改请求VO
* @author yangwei
* @author yangwei
* @since 2026/2/9 18:50
* @since 2026/2/9 18:50
* @param id 检测师ID
* @param updateVO 修改请求VO
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateInspector
(
Long
id
,
InspectorUpdateVO
updateVO
)
{
public
void
updateInspector
(
Long
id
,
InspectorUpdateVO
updateVO
)
{
...
@@ -98,22 +125,39 @@ public class InspectorService {
...
@@ -98,22 +125,39 @@ public class InspectorService {
}
}
// 更新检测师信息
// 更新检测师信息
inspector
.
setName
(
updateVO
.
getName
());
List
<
String
>
opLog
=
Lists
.
newArrayList
();
inspector
.
setPhone
(
updateVO
.
getPhone
());
if
(
StrUtil
.
isNotEmpty
(
updateVO
.
getRegion
())
&&
!
Objects
.
equals
(
inspector
.
getRegion
(),
updateVO
.
getRegion
()))
{
opLog
.
add
(
StringUtils
.
templateFormat
(
EDIT_TEMPLATE
,
"城市"
,
inspector
.
getRegionName
(),
updateVO
.
getRegionName
()));
inspector
.
setRegion
(
updateVO
.
getRegion
());
inspector
.
setRegionName
(
updateVO
.
getRegionName
());
}
if
(
StrUtil
.
isNotEmpty
(
updateVO
.
getName
())
&&
!
Objects
.
equals
(
inspector
.
getName
(),
updateVO
.
getName
()))
{
opLog
.
add
(
StringUtils
.
templateFormat
(
EDIT_TEMPLATE
,
"姓名"
,
inspector
.
getName
(),
updateVO
.
getName
()));
inspector
.
setName
(
updateVO
.
getName
());
}
if
(
StrUtil
.
isNotEmpty
(
updateVO
.
getPhone
())
&&
!
Objects
.
equals
(
inspector
.
getPhone
(),
updateVO
.
getPhone
()))
{
opLog
.
add
(
StringUtils
.
templateFormat
(
EDIT_TEMPLATE
,
"手机号"
,
inspector
.
getPhone
(),
updateVO
.
getPhone
()));
inspector
.
setPhone
(
updateVO
.
getPhone
());
}
// 保存到数据库
// 保存到数据库
inspectorRepository
.
save
(
inspector
);
inspectorRepository
.
save
(
inspector
);
if
(
CollUtil
.
isNotEmpty
(
opLog
))
{
insertInspectorOpLog
(
inspector
.
getId
(),
"编辑信息,"
+
StrUtil
.
join
(
SymbolConsts
.
COMMA
,
opLog
));
}
log
.
info
(
"检测师修改成功: ID={}"
,
inspector
.
getId
());
log
.
info
(
"检测师修改成功: ID={}"
,
inspector
.
getId
());
}
}
}
}
/**
/**
* 删除检测师(逻辑删除)
* 删除检测师(逻辑删除)
*
* @param id 检测师ID
* @author yangwei
* @author yangwei
* @since 2026/2/9 18:55
* @since 2026/2/9 18:55
* @param id 检测师ID
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Deprecated
public
void
deleteInspector
(
Long
id
)
{
public
void
deleteInspector
(
Long
id
)
{
// 查找检测师
// 查找检测师
Inspector
inspector
=
inspectorRepository
.
findByIdAndDeleteFlag
(
id
,
DeleteFlag
.
NOT_DELETED
.
getCode
())
Inspector
inspector
=
inspectorRepository
.
findByIdAndDeleteFlag
(
id
,
DeleteFlag
.
NOT_DELETED
.
getCode
())
...
@@ -126,11 +170,72 @@ public class InspectorService {
...
@@ -126,11 +170,72 @@ public class InspectorService {
}
}
/**
/**
* 禁用/启用检测师
*
* @param id 检测师ID
* @param status 状态值:1-启用,0-禁用
* @author yangwei
* @since 2026/3/9 17:00
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateStatus
(
Long
id
,
Integer
status
)
{
// 参数校验
if
(
status
==
null
||
(
status
!=
0
&&
status
!=
1
))
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
COMMON_ERROR
,
"状态值必须是0或1"
);
}
// 查找检测师
Inspector
inspector
=
inspectorRepository
.
findByIdAndDeleteFlag
(
id
,
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
"检测师不存在"
));
// 检查状态是否变化
if
(
Objects
.
equals
(
inspector
.
getStatus
(),
status
))
{
log
.
info
(
"检测师状态未变化,无需更新: ID={}, status={}"
,
id
,
status
);
return
;
}
// 更新状态
inspector
.
setStatus
(
status
);
inspectorRepository
.
save
(
inspector
);
// 记录操作日志
String
desc
=
status
==
0
?
"账号禁用"
:
"账号启用"
;
insertInspectorOpLog
(
inspector
.
getId
(),
desc
);
log
.
info
(
"检测师状态更新成功: ID={}, 新状态={}"
,
inspector
.
getId
(),
status
);
}
/**
* 查询检测师详情(包含账号基本信息和操作日志)
*
* @param id 检测师ID
* @return 检测师详情
* @author yangwei
* @since 2026/3/9 17:30
*/
public
InspectorDetailRespVO
getDetail
(
Long
id
)
{
// 查询账号基本信息
Inspector
inspector
=
inspectorRepository
.
findByIdAndDeleteFlag
(
id
,
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
"检测师不存在"
));
// 转换为VO
InspectorRespVO
accountVO
=
BeanUtil
.
copyProperties
(
inspector
,
InspectorRespVO
.
class
);
// 查询操作日志
List
<
InspectorOpLog
>
opLogs
=
inspector
.
getInspectorOpLogs
();
List
<
InspectorOpLogRespVO
>
opLogVOList
=
BeanUtil
.
copyToList
(
opLogs
,
InspectorOpLogRespVO
.
class
);
// 组装返回
return
new
InspectorDetailRespVO
(
accountVO
,
opLogVOList
);
}
/**
* 分页查询检测师
* 分页查询检测师
*
* @param pagination 分页参数
* @return 分页结果
* @author yangwei
* @author yangwei
* @since 2026/2/10 11:45
* @since 2026/2/10 11:45
* @param pagination 分页参数
* @return 分页结果
*/
*/
public
Page
<
InspectorRespVO
>
pageInspectors
(
Pagination
<
InspectorQryVO
>
pagination
)
{
public
Page
<
InspectorRespVO
>
pageInspectors
(
Pagination
<
InspectorQryVO
>
pagination
)
{
...
@@ -145,17 +250,23 @@ public class InspectorService {
...
@@ -145,17 +250,23 @@ public class InspectorService {
/**
/**
* 查询条件构建函数
* 查询条件构建函数
* @author yangwei
*
* @since 2026/2/10 17:55
* @param pagination 分页参数以及查询条件
* @param pagination 分页参数以及查询条件
* @return com.querydsl.core.BooleanBuilder
* @return com.querydsl.core.BooleanBuilder
* @author yangwei
* @since 2026/2/10 17:55
*/
*/
private
BooleanBuilder
buildInspectorPredicate
(
Pagination
<
InspectorQryVO
>
pagination
)
{
private
BooleanBuilder
buildInspectorPredicate
(
Pagination
<
InspectorQryVO
>
pagination
)
{
QInspector
qInspector
=
QInspector
.
inspector
;
QInspector
qInspector
=
QInspector
.
inspector
;
BooleanBuilder
predicate
=
new
BooleanBuilder
();
BooleanBuilder
predicate
=
new
BooleanBuilder
();
predicate
.
and
(
qInspector
.
deleteFlag
.
eq
(
DeleteFlag
.
NOT_DELETED
.
getCode
()));
predicate
.
and
(
qInspector
.
deleteFlag
.
eq
(
DeleteFlag
.
NOT_DELETED
.
getCode
()));
Set
<
String
>
queryParameters
=
Sets
.
newHashSet
(
JpaQueryConstants
.
Inspector
.
KEYWORD
);
// 查询参数添加查询条件
Set
<
String
>
queryParameters
=
Sets
.
newHashSet
(
JpaQueryConstants
.
Inspector
.
KEYWORD
,
JpaQueryConstants
.
Inspector
.
REGION
,
JpaQueryConstants
.
Inspector
.
STATUS
);
Optional
.
ofNullable
(
pagination
.
getFilters
())
Optional
.
ofNullable
(
pagination
.
getFilters
())
.
filter
(
CollUtil:
:
isNotEmpty
)
.
filter
(
CollUtil:
:
isNotEmpty
)
.
orElseGet
(
ArrayList:
:
new
)
.
orElseGet
(
ArrayList:
:
new
)
...
@@ -165,10 +276,20 @@ public class InspectorService {
...
@@ -165,10 +276,20 @@ public class InspectorService {
String
field
=
filter
.
getField
();
String
field
=
filter
.
getField
();
if
(
JpaQueryConstants
.
Inspector
.
KEYWORD
.
equals
(
field
))
{
if
(
JpaQueryConstants
.
Inspector
.
KEYWORD
.
equals
(
field
))
{
Optional
.
ofNullable
(
filter
.
getValue
())
Optional
.
ofNullable
(
filter
.
getValue
())
.
filter
(
key
->
StrUtil
.
isNotEmpty
(
(
String
)
key
))
.
filter
(
key
->
StrUtil
.
isNotEmpty
(
StrUtil
.
toString
(
key
)
))
.
map
(
value
->
SymbolConsts
.
PERCENT
+
value
+
SymbolConsts
.
PERCENT
)
.
map
(
value
->
SymbolConsts
.
PERCENT
+
value
+
SymbolConsts
.
PERCENT
)
.
ifPresent
(
value
->
predicate
.
and
(
qInspector
.
name
.
like
(
value
)
.
ifPresent
(
value
->
predicate
.
and
(
qInspector
.
name
.
like
(
value
)
.
or
(
qInspector
.
phone
.
like
(
value
))));
.
or
(
qInspector
.
phone
.
like
(
value
))));
}
else
if
(
JpaQueryConstants
.
Inspector
.
REGION
.
equals
(
field
))
{
Optional
.
ofNullable
(
filter
.
getValue
())
.
filter
(
key
->
StrUtil
.
isNotEmpty
(
StrUtil
.
toString
(
key
)))
.
map
(
StrUtil:
:
toString
)
.
ifPresent
(
region
->
predicate
.
and
(
qInspector
.
region
.
eq
(
region
)));
}
else
if
(
JpaQueryConstants
.
Inspector
.
STATUS
.
equals
(
field
))
{
Optional
.
ofNullable
(
filter
.
getValue
())
.
filter
(
key
->
StrUtil
.
isNotEmpty
(
StrUtil
.
toString
(
key
)))
.
map
(
StrUtil:
:
toString
)
.
ifPresent
(
status
->
predicate
.
and
(
qInspector
.
status
.
eq
(
Integer
.
valueOf
(
status
))));
}
}
});
});
...
@@ -177,10 +298,11 @@ public class InspectorService {
...
@@ -177,10 +298,11 @@ public class InspectorService {
/**
/**
* 总数查询函数
* 总数查询函数
* @author yangwei
*
* @since 2026/2/10 17:56
* @param predicate 查询条件
* @param predicate 查询条件
* @return java.lang.Long
* @return java.lang.Long
* @author yangwei
* @since 2026/2/10 17:56
*/
*/
private
Long
executeCountQuery
(
BooleanBuilder
predicate
)
{
private
Long
executeCountQuery
(
BooleanBuilder
predicate
)
{
QInspector
qInspector
=
QInspector
.
inspector
;
QInspector
qInspector
=
QInspector
.
inspector
;
...
@@ -192,38 +314,42 @@ public class InspectorService {
...
@@ -192,38 +314,42 @@ public class InspectorService {
/**
/**
* 数据查询函数
* 数据查询函数
* @author yangwei
*
* @since 2026/2/10 17:57
* @param predicate 查询条件
* @param predicate 查询条件
* @param pagination 分页参数
* @param pagination 分页参数
* @return java.util.List<com.glsx.usedcar.module.inspect.vo.InspectorRespVO>
* @return java.util.List<com.glsx.usedcar.module.inspect.vo.InspectorRespVO>
* @author yangwei
* @since 2026/2/10 17:57
*/
*/
private
List
<
InspectorRespVO
>
executeContentQuery
(
private
List
<
InspectorRespVO
>
executeContentQuery
(
BooleanBuilder
predicate
,
Pagination
<
InspectorQryVO
>
pagination
)
{
BooleanBuilder
predicate
,
Pagination
<
InspectorQryVO
>
pagination
)
{
QInspector
qInspector
=
QInspector
.
inspector
;
QInspector
qInspector
=
QInspector
.
inspector
;
return
jpaQueryFactory
.
select
(
return
jpaQueryFactory
.
select
(
Projections
.
constructor
(
InspectorRespVO
.
class
,
Projections
.
bean
(
InspectorRespVO
.
class
,
qInspector
.
id
,
qInspector
.
id
,
qInspector
.
name
,
qInspector
.
name
,
qInspector
.
password
,
qInspector
.
phone
,
qInspector
.
phone
,
qInspector
.
status
qInspector
.
status
,
qInspector
.
region
,
qInspector
.
regionName
,
qInspector
.
createTime
))
))
.
from
(
qInspector
)
.
from
(
qInspector
)
.
where
(
predicate
)
.
where
(
predicate
)
.
offset
(
pagination
.
getOffset
())
.
offset
(
pagination
.
getOffset
())
.
limit
(
pagination
.
getLimit
())
.
limit
(
pagination
.
getLimit
())
.
orderBy
(
qInspector
.
upd
ateTime
.
desc
(),
qInspector
.
id
.
desc
())
.
orderBy
(
qInspector
.
cre
ateTime
.
desc
(),
qInspector
.
id
.
desc
())
.
fetch
();
.
fetch
();
}
}
/**
/**
* 分页请求构建函数
* 分页请求构建函数
* @author yangwei
*
* @since 2026/2/10 17:58
* @param baseRequest 基础分页请求
* @param baseRequest 基础分页请求
* @return org.springframework.data.domain.PageRequest
* @return org.springframework.data.domain.PageRequest
* @author yangwei
* @since 2026/2/10 17:58
*/
*/
private
PageRequest
buildPageRequest
(
PageRequest
baseRequest
)
{
private
PageRequest
buildPageRequest
(
PageRequest
baseRequest
)
{
return
baseRequest
.
withSort
(
Sort
.
by
(
Sort
.
Order
.
desc
(
JpaQueryConstants
.
Inspector
.
UPDATE_TIME
)));
return
baseRequest
.
withSort
(
Sort
.
by
(
Sort
.
Order
.
desc
(
JpaQueryConstants
.
Inspector
.
UPDATE_TIME
)));
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorAddVO.java
View file @
cda205d
...
@@ -2,6 +2,7 @@ package com.glsx.usedcar.module.inspect.vo;
...
@@ -2,6 +2,7 @@ package com.glsx.usedcar.module.inspect.vo;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotNull
;
import
jakarta.validation.constraints.Pattern
;
import
jakarta.validation.constraints.Pattern
;
import
jakarta.validation.constraints.Size
;
import
jakarta.validation.constraints.Size
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -22,20 +23,59 @@ public class InspectorAddVO implements Serializable {
...
@@ -22,20 +23,59 @@ public class InspectorAddVO implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
374733149988979493L
;
private
static
final
long
serialVersionUID
=
374733149988979493L
;
@Schema
(
description
=
"姓名"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"张三"
)
@Schema
(
description
=
"姓名(最大 20 个字符)"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
maxLength
=
20
,
example
=
"张三"
)
@NotBlank
(
message
=
"姓名不能为空"
)
@NotBlank
(
message
=
"姓名不能为空"
)
@Size
(
max
=
64
,
message
=
"姓名长度不能超过64
个字符"
)
@Size
(
max
=
20
,
message
=
"姓名长度不能超过{max}
个字符"
)
private
String
name
;
private
String
name
;
@Schema
(
description
=
"手机号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"13800138000"
)
@Schema
(
description
=
"手机号(11 位)"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"13800138000"
,
maxLength
=
11
)
@NotBlank
(
message
=
"手机号不能为空"
)
@NotBlank
(
message
=
"手机号不能为空"
)
@Pattern
(
regexp
=
"^1[3-9]\\d{9}$"
,
message
=
"手机号格式不正确"
)
@Pattern
(
regexp
=
"^1[3-9]\\d{9}$"
,
message
=
"手机号格式不正确"
)
@Size
(
max
=
20
,
message
=
"手机号长度不能超过20
个字符"
)
@Size
(
max
=
11
,
message
=
"手机号长度不能超过{max}
个字符"
)
private
String
phone
;
private
String
phone
;
@Schema
(
description
=
"初始密码"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"123456"
)
/**
@NotBlank
(
message
=
"初始密码不能为空"
)
* 所属区域
@Size
(
min
=
6
,
max
=
20
,
message
=
"密码长度必须在6-20个字符之间"
)
*/
private
String
password
;
@Schema
(
description
=
"城市编码(最大 128 个字符)"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
maxLength
=
128
,
example
=
"110000"
)
@NotBlank
(
message
=
"城市不能为空"
)
private
String
region
;
/**
* 所属区域
*/
@Schema
(
description
=
"城市名称(最大 128 个字符)"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
maxLength
=
128
,
example
=
"北京"
)
@NotBlank
(
message
=
"城市不能为空"
)
private
String
regionName
;
/**
* 状态 1:正常 0:禁用
*/
@Schema
(
description
=
"状态 1:正常 0:禁用"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"1"
)
@NotNull
(
message
=
"状态不能为空"
)
private
Integer
status
;
}
}
\ No newline at end of file
\ No newline at end of file
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorDetailRespVO.java
0 → 100644
View file @
cda205d
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 检测师详情响应VO(包含账号信息和操作日志)
* @author yangwei
* @since 2026/3/9
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"检测师详情响应VO"
)
public
class
InspectorDetailRespVO
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2193361787441423520L
;
/**
* 账号基本信息
*/
@Schema
(
description
=
"账号基本信息"
)
private
InspectorRespVO
account
;
/**
* 操作日志列表
*/
@Schema
(
description
=
"操作日志列表"
)
private
List
<
InspectorOpLogRespVO
>
opLogs
;
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorOpLogRespVO.java
0 → 100644
View file @
cda205d
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
com.glsx.usedcar.module.inspect.entity.InspectorOpLog
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* 检测师操作日志查询响应VO
* @author yangwei
* @since 2026/3/9
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"检测师操作日志查询响应VO"
)
public
class
InspectorOpLogRespVO
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2193361787441423519L
;
/**
* 主键ID
*/
@Schema
(
description
=
"主键ID"
)
@JsonView
(
value
=
InspectorOpLog
.
Summary
.
class
)
private
Long
id
;
/**
* 操作描述
*/
@Schema
(
description
=
"操作描述"
)
@JsonView
(
value
=
InspectorOpLog
.
Summary
.
class
)
private
String
description
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonView
(
value
=
InspectorOpLog
.
Summary
.
class
)
private
LocalDateTime
createTime
;
/**
* 创建人
*/
@Schema
(
description
=
"创建人"
)
private
String
createBy
;
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorQryVO.java
View file @
cda205d
...
@@ -22,5 +22,11 @@ public class InspectorQryVO implements Serializable {
...
@@ -22,5 +22,11 @@ public class InspectorQryVO implements Serializable {
@Schema
(
description
=
"关键字"
)
@Schema
(
description
=
"关键字"
)
private
String
keyword
;
private
String
keyword
;
@Schema
(
description
=
"城市编码"
)
private
String
region
;
@Schema
(
description
=
"账号状态:0-禁用,1-启用"
)
private
Integer
status
;
}
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorRespVO.java
View file @
cda205d
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
com.glsx.usedcar.module.inspect.entity.Inspector
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
/**
* 检测师查询响应VO
* 检测师查询响应VO
...
@@ -17,6 +20,7 @@ import java.io.Serializable;
...
@@ -17,6 +20,7 @@ import java.io.Serializable;
* @since 2026/02/10 14:12
* @since 2026/02/10 14:12
*/
*/
@Data
@Data
@Builder
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"检测师查询响应VO"
)
@Schema
(
description
=
"检测师查询响应VO"
)
...
@@ -39,12 +43,6 @@ public class InspectorRespVO implements Serializable {
...
@@ -39,12 +43,6 @@ public class InspectorRespVO implements Serializable {
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
private
String
name
;
private
String
name
;
/**
* 初始密码
*/
@Schema
(
description
=
"初始密码"
)
@JsonView
(
value
=
Inspector
.
Summary
.
class
)
private
String
password
;
/**
/**
* 手机号
* 手机号
...
@@ -60,6 +58,23 @@ public class InspectorRespVO implements Serializable {
...
@@ -60,6 +58,23 @@ public class InspectorRespVO implements Serializable {
@Schema
(
description
=
"状态 1:正常 0:禁用"
)
@Schema
(
description
=
"状态 1:正常 0:禁用"
)
private
Integer
status
=
1
;
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
;
}
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectorUpdateVO.java
View file @
cda205d
...
@@ -2,9 +2,9 @@ package com.glsx.usedcar.module.inspect.vo;
...
@@ -2,9 +2,9 @@ package com.glsx.usedcar.module.inspect.vo;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Pattern
;
import
jakarta.validation.constraints.Size
;
import
jakarta.validation.constraints.Size
;
import
lombok.Data
;
import
lombok.Data
;
import
org.summerframework.orm.validator.UpdateValidGroup
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -21,53 +21,44 @@ public class InspectorUpdateVO implements Serializable {
...
@@ -21,53 +21,44 @@ public class InspectorUpdateVO implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
3467823456789012345L
;
private
static
final
long
serialVersionUID
=
-
3467823456789012345L
;
/**
@Schema
(
* 姓名
description
=
"姓名"
,
*/
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
@Schema
(
description
=
"姓名"
,
example
=
"张三"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
maxLength
=
20
,
@NotBlank
(
message
=
"姓名不能为空"
,
groups
=
UpdateValidGroup
.
class
)
example
=
"张三"
@Size
(
max
=
64
,
message
=
"姓名长度不能超过64个字符"
,
groups
=
UpdateValidGroup
.
class
)
)
@NotBlank
(
message
=
"姓名不能为空"
)
@Size
(
max
=
20
,
message
=
"姓名长度不能超过{max}个字符"
)
private
String
name
;
private
String
name
;
/**
@Schema
(
* 工号
description
=
"手机号"
,
*/
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
@Schema
(
description
=
"工号"
,
example
=
"EMP001"
)
example
=
"13800138000"
,
@Size
(
max
=
64
,
message
=
"工号长度不能超过64个字符"
,
groups
=
UpdateValidGroup
.
class
)
maxLength
=
11
private
String
employeeNo
;
)
@NotBlank
(
message
=
"手机号不能为空"
)
@Pattern
(
regexp
=
"^1[3-9]\\d{9}$"
,
message
=
"手机号格式不正确"
)
@Size
(
max
=
11
,
message
=
"手机号长度不能超过{max}个字符"
)
private
String
phone
;
/**
/**
* 所属区域
* 所属区域
*/
*/
@Schema
(
description
=
"所属区域"
,
example
=
"北京"
)
@Schema
(
@Size
(
max
=
128
,
message
=
"所属区域长度不能超过128个字符"
,
groups
=
UpdateValidGroup
.
class
)
description
=
"所属区域"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
maxLength
=
128
,
example
=
"110000"
)
@NotBlank
(
message
=
"所属区域不能为空"
)
private
String
region
;
private
String
region
;
/**
@Schema
(
* 手机号
description
=
"所属区域名称"
,
*/
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
@Schema
(
description
=
"手机号"
,
example
=
"13800138000"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
example
=
"北京"
@NotBlank
(
message
=
"手机号不能为空"
,
groups
=
UpdateValidGroup
.
class
)
)
@Size
(
max
=
20
,
message
=
"手机号长度不能超过{max}个字符"
,
groups
=
UpdateValidGroup
.
class
)
@NotBlank
(
message
=
"所属区域名称不能为空"
)
private
String
phone
;
private
String
regionName
;
/**
* 邮箱
*/
@Schema
(
description
=
"邮箱"
,
example
=
"zhangsan@example.com"
)
@Size
(
max
=
128
,
message
=
"邮箱长度不能超过{max}个字符"
,
groups
=
UpdateValidGroup
.
class
)
private
String
email
;
/**
* 状态 1:正常 0:禁用
*/
@Schema
(
description
=
"状态 1:正常 0:禁用"
,
example
=
"1"
)
private
Integer
status
;
/**
* 备注
*/
@Schema
(
description
=
"备注"
,
example
=
"优秀检测师"
)
@Size
(
max
=
512
,
message
=
"备注长度不能超过{max}个字符"
,
groups
=
UpdateValidGroup
.
class
)
private
String
remark
;
}
}
\ No newline at end of file
\ No newline at end of file
aus-framework/src/main/java/org/summerframework/core/enums/ErrorCodeEnum.java
View file @
cda205d
...
@@ -20,6 +20,7 @@ public enum ErrorCodeEnum {
...
@@ -20,6 +20,7 @@ public enum ErrorCodeEnum {
DATA_NOT_EXIST
(
1004
,
"数据不存在"
),
DATA_NOT_EXIST
(
1004
,
"数据不存在"
),
VALIDATION_ERROR
(
1005
,
"参数校验失败"
),
VALIDATION_ERROR
(
1005
,
"参数校验失败"
),
LOGIN_ERROR
(
1006
,
"未登录或登录已过期,请重新登录"
),
LOGIN_ERROR
(
1006
,
"未登录或登录已过期,请重新登录"
),
COMMON_ERROR
(
1000000
,
"{0}"
),
/* 七位错误码,第一位标志位,前三位模块,后三位具体错误码 */
/* 七位错误码,第一位标志位,前三位模块,后三位具体错误码 */
/** 检测模块 1001 */
/** 检测模块 1001 */
...
...
aus-framework/src/main/java/org/summerframework/core/util/StringUtils.java
View file @
cda205d
...
@@ -25,6 +25,10 @@ public class StringUtils {
...
@@ -25,6 +25,10 @@ public class StringUtils {
* @return java.lang.String
* @return java.lang.String
*/
*/
public
String
templateFormat
(
String
template
,
Object
...
params
)
{
public
String
templateFormat
(
String
template
,
Object
...
params
)
{
if
(
StrUtil
.
isEmpty
(
template
)
||
params
==
null
)
{
return
template
;
}
return
MessageFormat
.
format
(
template
,
params
);
return
MessageFormat
.
format
(
template
,
params
);
}
}
...
...
aus-framework/src/main/java/org/summerframework/orm/dictionary/Dictionary_.java
0 → 100644
View file @
cda205d
package
org
.
summerframework
.
orm
.
dictionary
;
import
jakarta.annotation.Generated
;
import
jakarta.persistence.metamodel.SingularAttribute
;
import
jakarta.persistence.metamodel.StaticMetamodel
;
@Generated
(
value
=
"org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor"
,
date
=
"2022-04-19T00:11:15.562+0800"
)
@StaticMetamodel
(
Dictionary
.
class
)
public
abstract
class
Dictionary_
extends
org
.
summerframework
.
orm
.
entity
.
AuditingEntity_
{
public
static
volatile
SingularAttribute
<
Dictionary
,
String
>
dictionaryName
;
public
static
volatile
SingularAttribute
<
Dictionary
,
String
>
optionCode
;
public
static
volatile
SingularAttribute
<
Dictionary
,
Integer
>
dictionaryId
;
public
static
volatile
SingularAttribute
<
Dictionary
,
String
>
remark
;
public
static
volatile
SingularAttribute
<
Dictionary
,
String
>
optionName
;
public
static
volatile
SingularAttribute
<
Dictionary
,
Boolean
>
enabled
;
public
static
final
String
DICTIONARY_NAME
=
"dictionaryName"
;
public
static
final
String
OPTION_CODE
=
"optionCode"
;
public
static
final
String
DICTIONARY_ID
=
"dictionaryId"
;
public
static
final
String
REMARK
=
"remark"
;
public
static
final
String
OPTION_NAME
=
"optionName"
;
public
static
final
String
ENABLED
=
"enabled"
;
}
aus-framework/src/main/java/org/summerframework/orm/entity/AuditingEntity_.java
0 → 100644
View file @
cda205d
package
org
.
summerframework
.
orm
.
entity
;
import
jakarta.annotation.Generated
;
import
jakarta.persistence.metamodel.SingularAttribute
;
import
jakarta.persistence.metamodel.StaticMetamodel
;
@Generated
(
value
=
"org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor"
,
date
=
"2022-03-23T23:13:22.492+0800"
)
@StaticMetamodel
(
AuditingEntity
.
class
)
public
abstract
class
AuditingEntity_
extends
AuditingTimeEntity_
{
public
static
volatile
SingularAttribute
<
AuditingEntity
,
String
>
createBy
;
public
static
volatile
SingularAttribute
<
AuditingEntity
,
String
>
updateBy
;
public
static
final
String
CREATE_BY
=
"createBy"
;
public
static
final
String
UPDATE_BY
=
"updateBy"
;
}
aus-framework/src/main/java/org/summerframework/orm/entity/AuditingTimeEntity_.java
0 → 100644
View file @
cda205d
package
org
.
summerframework
.
orm
.
entity
;
import
jakarta.annotation.Generated
;
import
jakarta.persistence.metamodel.SingularAttribute
;
import
jakarta.persistence.metamodel.StaticMetamodel
;
import
java.time.LocalDateTime
;
@Generated
(
value
=
"org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor"
,
date
=
"2022-03-23T23:13:22.658+0800"
)
@StaticMetamodel
(
AuditingTimeEntity
.
class
)
public
abstract
class
AuditingTimeEntity_
{
public
static
volatile
SingularAttribute
<
AuditingTimeEntity
,
LocalDateTime
>
createTime
;
public
static
volatile
SingularAttribute
<
AuditingTimeEntity
,
LocalDateTime
>
updateTime
;
public
static
final
String
CREATE_TIME
=
"createTime"
;
public
static
final
String
UPDATE_TIME
=
"updateTime"
;
}
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