Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
1f8c1752
Commit
1f8c1752
authored
Jul 01, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车型列表添加和查询接口2
parent
28ceb95f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
ResCode.java
...a/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
+1
-1
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+10
-2
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+8
-6
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
View file @
1f8c1752
...
...
@@ -12,7 +12,7 @@ public enum ResCode {
VEHICLE_BOOKED_INFO_ALREADY_CHANGED
(
101001
,
"车辆预定信息已更改,请刷新后继续操作"
),
//车辆信息相关返回码-车辆信息
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
(
102001
,
"该车牌
车辆
已经存在"
),
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
(
102001
,
"该车牌已经存在"
),
VEHICLE_INFO_BRANCH_NOT_EXIST
(
102002
,
"分公司信息非法"
),
VEHICLE_INFO_CODE_EXIST
(
102003
,
"车辆编码已存在"
),
VEHICLE_INFO_SAME_NUM_PLATE_AND_CODE_EMPTY
(
102004
,
"车辆编码和车牌号为空"
),
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
1f8c1752
...
...
@@ -200,12 +200,16 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo:
addOrUpdateVehicleVoList
)
{
Vehicle
vehicle
=
new
Vehicle
();
if
(
vehicle
.
getParkBranchCompanyId
()==
null
)
{
throw
new
CustomIllegalParamException
(
"Stop at branch office cannot be empty"
);
}
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
vehicle
.
setId
(
UUID
.
randomUUID
().
toString
());
// 检查车牌或者编码是否已存在,已存在则返回失败
List
<
Vehicle
>
exitsVehicles
=
lockByCode
(
addOrUpdateVehicleVo
);
if
(
CollectionUtils
.
isNotEmpty
(
exitsVehicles
)){
return
RestResponse
.
code
(
ResCode
.
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
.
getCode
());
return
RestResponse
.
codeAndMessage
(
ResCode
.
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
.
getCode
(),
ResCode
.
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
.
getDesc
());
// if(addOrUpdateVehicleVo.getCode()!= null &&
// addOrUpdateVehicleVo.getCode().equals(exitsVehicles.get(0).getCode())){
...
...
@@ -250,6 +254,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo:
addOrUpdateVehicleVoList
){
Vehicle
vehicle
=
new
Vehicle
();
if
(
vehicle
.
getParkBranchCompanyId
()==
null
)
{
throw
new
CustomIllegalParamException
(
"Stop at branch office cannot be empty"
);
}
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
//悲观锁,检查是否已存在车牌或编码
List
<
Vehicle
>
exitsVehicles
=
lockByCode
(
addOrUpdateVehicleVo
);
...
...
@@ -258,7 +265,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
if
(
exitsVehicle
.
getId
().
equals
(
addOrUpdateVehicleVo
.
getId
())){
continue
;
}
return
RestResponse
.
code
(
ResCode
.
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
.
getCode
());
return
RestResponse
.
codeAndMessage
(
ResCode
.
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
.
getCode
(),
ResCode
.
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
.
getDesc
());
// if(addOrUpdateVehicleVo.getCode()!= null &&
// addOrUpdateVehicleVo.getCode().equals(exitsVehicles.get(0).getCode())){
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
1f8c1752
...
...
@@ -106,9 +106,9 @@
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
</if>
<if
test=
"subordinateBranch !=null"
>
and v.subordinate_branch = #{subordinateBranch}
</if
>
<!-- <if test="subordinateBranch !=null">--
>
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>--
>
<if
test=
"code !=null"
>
and v.code = #{code}
</if>
...
...
@@ -209,7 +209,7 @@
-- 目的地分公司
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
-- 所属分公司
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
--
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
where
v.is_del=0
<if
test=
"companyList != null"
>
...
...
@@ -323,9 +323,11 @@
v.number_plate
from vehicle v
where
-- `code` = #{code} or
numberPlate=#{numberPlate}
number_plate=#{numberPlate}
and is_del=0
for update
</select>
<select
id=
"selectByNumberPlate"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
select * from vehicle
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment