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 c3d04421
authored
Mar 20, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.3.0' of
https://gitee.com/foutouren/aus
into v1.3.0
2 parents
0db72a9d
5a8893cb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
7 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/rest/inspect/InspectionWorkOrderController.java
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionReportService.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
aus-inspector/src/main/java/com/glsx/usedcar/controller/InspectionReportController.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/inspect/InspectionWorkOrderController.java
View file @
c3d0442
...
...
@@ -188,10 +188,15 @@ public class InspectionWorkOrderController {
@Operation
(
summary
=
"统计各状态工单数量"
,
description
=
"统计未删除的待检测、检测中、已完成、已取消工单数量"
)
@GetMapping
(
"/countByStatus"
)
public
BaseResp
<
InspectionWorkOrderStatusCountVO
>
countByStatus
()
{
public
BaseResp
<
InspectionWorkOrderStatusCountVO
>
countByStatus
(
@RequestParam
(
name
=
"inspectorId"
,
required
=
false
)
Long
id
)
{
log
.
info
(
"开始统计各状态检测工单数量"
);
try
{
InspectionWorkOrderStatusCountVO
countVO
=
inspectionWorkOrderService
.
countByStatus
();
InspectionWorkOrderStatusCountVO
countVO
=
null
;
if
(
id
==
null
)
{
countVO
=
inspectionWorkOrderService
.
countByStatus
();
}
else
{
countVO
=
inspectionWorkOrderService
.
countByStatusAndInspector
(
id
);
}
return
BaseResp
.
success
(
countVO
);
}
catch
(
BusinessCodeException
be
)
{
log
.
error
(
"统计各状态工单数量失败!业务异常!"
,
be
);
...
...
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
View file @
c3d0442
...
...
@@ -54,7 +54,7 @@ public interface JpaQueryConstants {
*/
String
KEYWORD
=
"keyword"
;
/**
*
关键字,检测师名称或手机号,模糊查询
*
精确匹配
*/
String
INSPECTOR_ID
=
"inspectorId"
;
...
...
@@ -69,4 +69,22 @@ public interface JpaQueryConstants {
String
UPDATE_TIME
=
"updateTime"
;
}
/**
* 检测报告
* @see com.glsx.usedcar.module.inspect.entity.InspectionReport
*/
interface
InspectionReport
{
String
ID
=
"id"
;
/**
* 关键字,检测师名称或手机号,模糊查询
*/
String
KEYWORD
=
"keyword"
;
/**
* 精确匹配
*/
String
INSPECTOR_ID
=
"inspectorId"
;
}
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionReportService.java
View file @
c3d0442
...
...
@@ -429,9 +429,9 @@ public class InspectionReportService {
*/
public
Page
<
InspectionReportRespVO
>
pageList
(
Pagination
<
InspectionReport
>
pagination
)
{
// 1. 处理关键词模糊查询(复用工单查询的KEYWORD常量)
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
Inspect
or
.
KEYWORD
);
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
Inspect
ionReport
.
KEYWORD
);
if
(
keyword
instanceof
String
kw
&&
StrUtil
.
isNotBlank
(
kw
))
{
pagination
.
removeFilter
(
JpaQueryConstants
.
Inspect
or
.
KEYWORD
);
pagination
.
removeFilter
(
JpaQueryConstants
.
Inspect
ionReport
.
KEYWORD
);
String
likePattern
=
SymbolConsts
.
PERCENT
+
kw
+
SymbolConsts
.
PERCENT
;
// 2. 添加多字段模糊查询条件(报告表+关联表)
...
...
@@ -450,7 +450,11 @@ public class InspectionReportService {
builder
.
like
(
root
.
get
(
InspectionReport_
.
workOrder
).
get
(
InspectionWorkOrder_
.
woId
),
likePattern
)
));
}
Object
inspectorId
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionReport
.
INSPECTOR_ID
);
if
(
inspectorId
!=
null
)
{
pagination
.
removeFilter
(
JpaQueryConstants
.
InspectionReport
.
INSPECTOR_ID
);
pagination
.
addCondition
((
root
,
query
,
builder
)
->
builder
.
equal
(
root
.
get
(
InspectionReport_
.
workOrder
).
get
(
InspectionWorkOrder_
.
inspector
).
get
(
Inspector_
.
id
),
inspectorId
));
}
// 3. 执行分页查询
Page
<
InspectionReport
>
resultPage
=
inspectionReportRepository
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
View file @
c3d0442
...
...
@@ -595,6 +595,9 @@ public class InspectionWorkOrderService {
countVO
.
getCompletedCount
(),
countVO
.
getCanceledCount
());
return
countVO
;
}
public
InspectionWorkOrderStatusCountVO
countByStatusAndInspector
(
Long
inspectorId
)
{
return
countByStatusAndInspector
(
inspectorRepository
.
findById
(
inspectorId
).
orElse
(
null
));
}
/**
* 统计指定检测师的各状态检测工单数量(仅统计未删除工单)
* @param inspector 检测师
...
...
aus-inspector/src/main/java/com/glsx/usedcar/controller/InspectionReportController.java
View file @
c3d0442
package
com
.
glsx
.
usedcar
.
controller
;
import
com.glsx.usedcar.annotation.RequireLogin
;
import
com.glsx.usedcar.consts.inspect.JpaQueryConstants
;
import
com.glsx.usedcar.context.InspectorContext
;
import
com.glsx.usedcar.module.inspect.entity.InspectionReport
;
import
com.glsx.usedcar.module.inspect.service.InspectionReportService
;
...
...
@@ -14,6 +15,7 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.*
;
import
org.summerframework.orm.paging.Operator
;
import
org.summerframework.orm.paging.Pagination
;
@Slf4j
...
...
@@ -45,7 +47,7 @@ public class InspectionReportController {
try
{
// 2. 构建分页对象(offset = (页码-1)*每页条数)
Pagination
<
InspectionReport
>
pagination
=
new
Pagination
<>((
page
-
1
)
*
size
,
size
);
pagination
.
addFilter
(
JpaQueryConstants
.
InspectionReport
.
INSPECTOR_ID
,
InspectorContext
.
getInspectorId
(),
Operator
.
eq
);
// 3. 调用Service查询(若有关键词过滤,可在此添加pagination.addFilter逻辑)
Page
<
InspectionReportRespVO
>
result
=
inspectionReportService
.
pageList
(
pagination
);
return
BaseResp
.
success
(
result
);
...
...
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