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 f9ed6776
authored
Aug 10, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:需求《中拍后链路缩减操作步骤》相关代码开发:后台接口平台合同列表分页查询接口新增筛选参数
1 parent
6a904e12
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
129 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/rest/account/PlatformContractController.java
aus-core/src/main/java/com/glsx/usedcar/module/account/service/PlatformContractService.java
aus-core/src/main/java/com/glsx/usedcar/module/account/vo/PlatformContractPageQueryVO.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/account/PlatformContractController.java
View file @
f9ed677
package
com
.
glsx
.
usedcar
.
web
.
rest
.
account
;
import
com.glsx.usedcar.module.account.entity.Account
;
import
com.glsx.usedcar.module.account.entity.Account_
;
import
com.glsx.usedcar.module.account.entity.PlatformContract
;
import
com.glsx.usedcar.module.account.entity.PlatformContract_
;
import
com.glsx.usedcar.module.account.service.PlatformContractService
;
import
com.glsx.usedcar.module.account.vo.PlatformContractPageQueryVO
;
import
com.glsx.usedcar.module.account.vo.PlatformContractPageRespVO
;
import
com.glsx.usedcar.module.account.vo.PlatformContractRespVO
;
import
com.glsx.usedcar.resp.BaseResp
;
...
...
@@ -15,12 +11,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.summerframework.orm.paging.Operator
;
import
org.summerframework.orm.paging.Pagination
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -45,19 +38,15 @@ public class PlatformContractController {
/**
* 分页查询平台合同列表
*
* @param
queryVO
分页查询参数
* @param
pagination
分页查询参数
* @return 平台合同分页列表
*/
@PostMapping
(
"/page"
)
@Operation
(
summary
=
"分页查询平台合同"
,
description
=
"支持按合同编号/签署人姓名/手机号/状态/账户ID筛选"
)
public
BaseResp
<
Page
<
PlatformContractPageRespVO
>>
page
(
@RequestBody
PlatformContractPageQueryVO
queryVO
)
{
Pagination
<
PlatformContract
>
pagination
=
buildPagination
(
queryVO
);
// 关联查询账户信息
pagination
.
addFetch
(
root
->
root
.
fetch
(
PlatformContract_
.
account
,
jakarta
.
persistence
.
criteria
.
JoinType
.
LEFT
));
Page
<
PlatformContractPageRespVO
>
result
=
platformContractService
.
pagePlatformContractVO
(
pagination
);
return
BaseResp
.
success
(
result
);
@Operation
(
summary
=
"分页查询平台合同"
,
description
=
"支持按合同编号/合同名称/签署人姓名/手机号/状态/账户ID/创建时间/签署时间筛选"
)
public
Page
<
PlatformContractPageRespVO
>
page
(
@RequestBody
Pagination
<
PlatformContract
>
pagination
)
{
log
.
info
(
"分页查询平台合同列表请求:offset={}, limit={}"
,
pagination
.
getOffset
(),
pagination
.
getLimit
());
Page
<
PlatformContractPageRespVO
>
result
=
platformContractService
.
pageList
(
pagination
);
return
result
;
}
/**
...
...
@@ -100,60 +89,4 @@ public class PlatformContractController {
@Parameter
(
description
=
"账户ID"
,
required
=
true
,
example
=
"1"
)
@RequestParam
int
accountId
)
{
return
BaseResp
.
success
(
platformContractService
.
hasSignedPlatformContract
(
accountId
));
}
/**
* 构建分页查询参数
*/
private
Pagination
<
PlatformContract
>
buildPagination
(
PlatformContractPageQueryVO
queryVO
)
{
int
page
=
queryVO
.
getPage
()
==
null
||
queryVO
.
getPage
()
<
1
?
1
:
queryVO
.
getPage
();
int
size
=
queryVO
.
getSize
()
==
null
||
queryVO
.
getSize
()
<
1
?
20
:
queryVO
.
getSize
();
Pagination
<
PlatformContract
>
pagination
=
new
Pagination
<>((
page
-
1
)
*
size
,
size
);
pagination
.
setSort
(
"createTime"
);
pagination
.
setOrder
(
"desc"
);
// 合同编号筛选
if
(
StringUtils
.
hasText
(
queryVO
.
getContractCode
()))
{
pagination
.
addFilter
(
PlatformContract_
.
CONTRACT_CODE
,
queryVO
.
getContractCode
(),
Operator
.
like
);
}
// 签署人姓名筛选
if
(
StringUtils
.
hasText
(
queryVO
.
getSignerName
()))
{
pagination
.
addFilter
(
PlatformContract_
.
SIGNER_NAME
,
queryVO
.
getSignerName
(),
Operator
.
like
);
}
// 签署人手机号筛选
if
(
StringUtils
.
hasText
(
queryVO
.
getSignerMobile
()))
{
pagination
.
addFilter
(
PlatformContract_
.
SIGNER_MOBILE
,
queryVO
.
getSignerMobile
(),
Operator
.
eq
);
}
// 合同状态筛选
if
(
StringUtils
.
hasText
(
queryVO
.
getContractStatus
()))
{
pagination
.
addFilter
(
PlatformContract_
.
CONTRACT_STATUS
,
PlatformContract
.
ContractStatus
.
valueOf
(
queryVO
.
getContractStatus
()),
Operator
.
eq
);
}
// 账户ID筛选
if
(
queryVO
.
getAccountId
()
!=
null
)
{
pagination
.
addFilter
(
PlatformContract_
.
ACCOUNT
,
new
Account
(
queryVO
.
getAccountId
()),
Operator
.
eq
);
}
// 账户名称筛选
if
(
StringUtils
.
hasText
(
queryVO
.
getAccountName
()))
{
pagination
.
addCondition
((
root
,
query
,
builder
)
->
{
var
accountPath
=
root
.
get
(
PlatformContract_
.
account
).
get
(
Account_
.
ACCOUNT_NAME
);
return
builder
.
like
(
accountPath
,
"%"
+
queryVO
.
getAccountName
()
+
"%"
);
});
}
// 创建时间范围筛选
if
(
queryVO
.
getCreateTimeStart
()
!=
null
)
{
LocalDateTime
startTime
=
queryVO
.
getCreateTimeStart
().
atStartOfDay
();
pagination
.
addFilter
(
"createTime"
,
startTime
,
Operator
.
ge
);
}
if
(
queryVO
.
getCreateTimeEnd
()
!=
null
)
{
LocalDateTime
endTime
=
queryVO
.
getCreateTimeEnd
().
atTime
(
23
,
59
,
59
);
pagination
.
addFilter
(
"createTime"
,
endTime
,
Operator
.
le
);
}
return
pagination
;
}
}
aus-core/src/main/java/com/glsx/usedcar/module/account/service/PlatformContractService.java
View file @
f9ed677
...
...
@@ -9,6 +9,7 @@ import com.glsx.usedcar.esign.exception.EsignDemoException;
import
com.glsx.usedcar.module.account.dao.PlatformContractDao
;
import
com.glsx.usedcar.module.account.entity.Account
;
import
com.glsx.usedcar.module.account.entity.PlatformContract
;
import
com.glsx.usedcar.module.account.entity.PlatformContract_
;
import
com.glsx.usedcar.module.account.vo.PlatformContractPageRespVO
;
import
com.glsx.usedcar.module.account.vo.PlatformContractRespVO
;
import
com.glsx.usedcar.module.auction.dao.ContractTemplateDao
;
...
...
@@ -17,6 +18,7 @@ import com.glsx.usedcar.util.CoderGenerator;
import
com.google.gson.Gson
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonObject
;
import
cn.hutool.core.util.StrUtil
;
import
jakarta.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.hibernate.ObjectNotFoundException
;
...
...
@@ -90,6 +92,37 @@ public class PlatformContractService {
}
/**
* 分页查询平台合同列表(返回VO)
* <p>
* 支持筛选条件:contractCode、contractName、signerName、signerMobile、contractStatus、
* account.accountId、account.accountName、createTime、signTime
* </p>
* <p>
* 前端通过 filters 数组传递筛选条件,Pagination 会自动处理。
* 对于关联对象属性,使用点号分隔,如:account.accountName
* </p>
*
* @param pagination 分页参数
* @return 平台合同VO分页列表
*/
public
Page
<
PlatformContractPageRespVO
>
pageList
(
Pagination
<
PlatformContract
>
pagination
)
{
// 1. 设置默认排序
if
(
StrUtil
.
isBlank
(
pagination
.
getSort
()))
{
pagination
.
setSort
(
"createTime"
);
}
if
(
StrUtil
.
isBlank
(
pagination
.
getOrder
()))
{
pagination
.
setOrder
(
"desc"
);
}
// 2. 关联查询账户信息
pagination
.
addFetch
(
root
->
root
.
fetch
(
PlatformContract_
.
account
,
jakarta
.
persistence
.
criteria
.
JoinType
.
LEFT
));
// 3. 执行查询
Page
<
PlatformContract
>
result
=
platformContractDao
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
return
result
.
map
(
platformContractConverter:
:
toPageRespVO
);
}
/**
* 根据ID查询平台合同详情(返回VO)
*
* @param platformContractId 主键
...
...
aus-core/src/main/java/com/glsx/usedcar/module/account/vo/PlatformContractPageQueryVO.java
deleted
100644 → 0
View file @
6a904e1
package
com
.
glsx
.
usedcar
.
module
.
account
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.time.LocalDate
;
/**
* 平台合同分页查询请求VO
*
* @author yangwei
* @since 2026-08-04
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"平台合同分页查询请求参数"
)
public
class
PlatformContractPageQueryVO
{
@Schema
(
description
=
"页码,默认1(从1开始)"
,
example
=
"1"
)
private
Integer
page
;
@Schema
(
description
=
"每页条数,默认20"
,
example
=
"20"
)
private
Integer
size
;
@Schema
(
description
=
"合同编号,模糊匹配"
,
example
=
"HT20260804"
)
private
String
contractCode
;
@Schema
(
description
=
"签署人姓名,模糊匹配"
,
example
=
"张三"
)
private
String
signerName
;
@Schema
(
description
=
"签署人手机号,精确匹配"
,
example
=
"13800138000"
)
private
String
signerMobile
;
@Schema
(
description
=
"合同状态:PENDING-待签署/SIGNING-签署中/SIGNED-已签署/EXPIRED-已过期/CANCELLED-已作废"
,
example
=
"SIGNED"
)
private
String
contractStatus
;
@Schema
(
description
=
"账户ID"
,
example
=
"1"
)
private
Integer
accountId
;
@Schema
(
description
=
"账户名称,模糊匹配"
,
example
=
"李四"
)
private
String
accountName
;
@Schema
(
description
=
"创建时间-起始"
,
example
=
"2026-08-01"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
LocalDate
createTimeStart
;
@Schema
(
description
=
"创建时间-结束"
,
example
=
"2026-08-04"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
LocalDate
createTimeEnd
;
}
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