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 ed5dbd85
authored
Apr 23, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:必填校验
1 parent
706edb46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
1 deletions
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrAuditService.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrAuditService.java
View file @
ed5dbd8
...
...
@@ -315,8 +315,10 @@ public class VrAuditService {
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
saveOrUpdate
(
VrAuditSaveReqVO
req
,
String
operator
)
{
// 校验当前步骤必填字段(草稿保存也需校验)
validateStepFields
(
req
);
VrAudit
entity
;
boolean
isNew
=
(
req
.
getId
()
==
null
)
;
boolean
isNew
=
req
.
getId
()
==
null
||
req
.
getId
()
==
0
;
if
(
isNew
)
{
// 新增:初始化实体
...
...
@@ -546,11 +548,65 @@ public class VrAuditService {
}
/**
* 分步校验当前步骤的必填字段(草稿保存和最终提交均需校验)
*/
private
void
validateStepFields
(
VrAuditSaveReqVO
req
)
{
switch
(
req
.
getStep
())
{
case
1
->
{
assertNotBlank
(
req
.
getVin
(),
"VIN车架号"
);
assertNotNull
(
req
.
getCarBrandId
(),
"品牌ID"
);
assertNotBlank
(
req
.
getCarBrandName
(),
"品牌名称"
);
assertNotNull
(
req
.
getCarChildsBrandId
(),
"子品牌ID"
);
assertNotBlank
(
req
.
getCarChildsBrandName
(),
"子品牌名称"
);
assertNotNull
(
req
.
getCarSeriesId
(),
"车系ID"
);
assertNotBlank
(
req
.
getCarSeriesName
(),
"车系名称"
);
assertNotNull
(
req
.
getCarTypeId
(),
"车型ID"
);
assertNotBlank
(
req
.
getCarTypeName
(),
"车型名称"
);
assertNotBlank
(
req
.
getDisplacement
(),
"排量"
);
assertNotNull
(
req
.
getTransmissionType
(),
"变速箱类型"
);
assertNotNull
(
req
.
getVehicleNature
(),
"车辆性质"
);
assertNotNull
(
req
.
getFuelType
(),
"燃料类型"
);
assertNotBlank
(
req
.
getBodyColor
(),
"车身颜色"
);
assertNotBlank
(
req
.
getInteriorColor
(),
"内饰颜色"
);
assertNotBlank
(
req
.
getProvinceCode
(),
"省份编码"
);
assertNotBlank
(
req
.
getProvinceName
(),
"省份名称"
);
assertNotBlank
(
req
.
getCityCode
(),
"城市编码"
);
assertNotBlank
(
req
.
getCityName
(),
"城市名称"
);
}
case
2
->
{
assertNotBlank
(
req
.
getRegisterDate
(),
"上牌日期"
);
assertNotNull
(
req
.
getMileage
(),
"表显里程"
);
assertNotNull
(
req
.
getTransferCount
(),
"过户次数"
);
}
case
3
->
{
assertNotNull
(
req
.
getReservePrice
(),
"保留价"
);
}
case
4
->
{
assertNotBlank
(
req
.
getPhotoFront
(),
"前脸照片"
);
assertNotBlank
(
req
.
getPhotoLeftFront
(),
"左前45°照片"
);
assertNotBlank
(
req
.
getPhotoRightRear
(),
"右后45°照片"
);
assertNotBlank
(
req
.
getPhotoInterior
(),
"内饰照片"
);
assertNotBlank
(
req
.
getPhotoDashboard
(),
"仪表盘照片"
);
assertNotBlank
(
req
.
getPhotoEngine
(),
"发动机舱照片"
);
assertNotBlank
(
req
.
getPhotoTrunk
(),
"后备箱照片"
);
}
}
}
/**
* 最终提交时全量必填项校验
*/
private
void
validateForSubmit
(
VrAudit
entity
,
VrAuditSaveReqVO
req
)
{
// 第一步必填校验
assertNotBlank
(
entity
.
getVin
(),
"VIN车架号"
);
assertNotNull
(
entity
.
getCarBrandId
(),
"品牌ID"
);
assertNotBlank
(
entity
.
getCarBrandName
(),
"品牌名称"
);
assertNotNull
(
entity
.
getCarChildsBrandId
(),
"子品牌ID"
);
assertNotBlank
(
entity
.
getCarChildsBrandName
(),
"子品牌名称"
);
assertNotNull
(
entity
.
getCarSeriesId
(),
"车系ID"
);
assertNotBlank
(
entity
.
getCarSeriesName
(),
"车系名称"
);
assertNotNull
(
entity
.
getCarTypeId
(),
"车型ID"
);
assertNotBlank
(
entity
.
getCarTypeName
(),
"车型名称"
);
assertNotBlank
(
entity
.
getDisplacement
(),
"排量"
);
assertNotNull
(
entity
.
getTransmissionType
(),
"变速箱类型"
);
assertNotNull
(
entity
.
getVehicleNature
(),
"车辆性质"
);
...
...
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