Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
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 5ba67e2b
authored
Apr 19, 2022
by
王欣伟
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改车辆时车架号的唯一性判断修改
1 parent
ed20bea3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
src/main/java/cn/com/glsx/admin/common/constants/Constants.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/java/cn/com/glsx/admin/common/constants/Constants.java
View file @
5ba67e2
...
...
@@ -8,6 +8,11 @@ package cn.com.glsx.admin.common.constants;
public
final
class
Constants
{
/**
* 删除标识 0:正常
*/
public
static
final
Integer
NORMAL_FLAG
=
0
;
/**
* 删除标识 -1:删除
*/
public
static
final
Integer
DELETE_FLAG
=
-
1
;
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
5ba67e2
...
...
@@ -1259,9 +1259,13 @@ public class VehicleService extends AbstractCommonService {
public
void
updateVehicleInfo
(
VehicleInfoVo
vehicleInfoVo
)
{
Vehicle
dbVehicle
=
vehicleMapper
.
selectById
(
vehicleInfoVo
.
getId
());
//校验修改后的车架号在系统中是否存在
Vehicle
vehicleByVin
=
vehicleMapper
.
getVehicleByVin
(
vehicleInfoVo
.
getVin
());
if
(!
dbVehicle
.
getVin
().
equals
(
vehicleInfoVo
.
getVin
())
&&
vehicleByVin
!=
null
)
{
//校验修改后的车架号在系统中是否存在,通过车架号+工单ID确认唯一
Vehicle
vinValidCondition
=
new
Vehicle
();
vinValidCondition
.
setVin
(
vehicleInfoVo
.
getVin
());
vinValidCondition
.
setWorkOrderId
(
dbVehicle
.
getWorkOrderId
());
vinValidCondition
.
setDelFlag
(
Constants
.
NORMAL_FLAG
);
Vehicle
vehicleByWorkOrder
=
vehicleMapper
.
selectOne
(
vinValidCondition
);
if
(!
dbVehicle
.
getVin
().
equals
(
vehicleByWorkOrder
.
getVin
())
&&
vehicleByWorkOrder
!=
null
)
{
throw
new
AdminException
(
ResultEnum
.
VEHICLE_VIN_EXISTED
);
}
...
...
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