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
160887f3
Commit
160887f3
authored
Aug 29, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
728931ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
14 deletions
+34
-14
RandomUtil.java
...a/com/github/wxiaoqi/security/common/util/RandomUtil.java
+1
-1
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+25
-13
VehicleMapper.java
.../java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
+2
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+6
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/RandomUtil.java
View file @
160887f3
...
...
@@ -63,7 +63,7 @@ public class RandomUtil
public
static
void
main
(
String
[]
args
)
{
int
max
=
20
;
int
n
=
2
0
;
int
n
=
3
0
;
Set
<
Integer
>
set
=
new
HashSet
<>();
randomSet
(
max
,
n
,
set
,
n
);
for
(
Integer
a
:
set
)
{
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
160887f3
...
...
@@ -198,10 +198,10 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DEPARTURE
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
}
//
if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
//
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
//
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
//
}
Integer
Mileagerest
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileagerest1
=
arrivalVo
.
getMileage
();
if
(
Mileagerest1
==
null
)
{
...
...
@@ -223,21 +223,33 @@ public class VehicleActiveService {
vehicle
.
setExpectDestinationBranchCompanyId
(
0
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
// 修改状态,确认是出车状态
int
result
=
vehicleMapper
.
updateStatusByIdAndStatus
(
arrivalVo
.
getVehicleId
(),
VehicleStatus
.
NORMAL
.
getCode
(),
VehicleStatus
.
DEPARTURE
.
getCode
());
if
(
result
==
0
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
}
// 出车记录
VehicleDepartureLog
departureLog
=
vehicleDepartureLogMapper
.
selectLastByVehicleId
(
arrivalVo
.
getVehicleId
());
if
(
departureLog
==
null
)
{
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
if
(
departureLogVo
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
}
// 修改状态,确认是出车状态
//兼容错误还车流程,先查询,是否有其他出行记录
boolean
flag
=
true
;
VehicleDepartureLog
departureLog
=
departureLogVo
.
getVehicleDeparture
(
departureLogVo
);
List
<
VehicleDepartureLogVo
>
list
=
vehicleDepartureLogMapper
.
selectByVehicleId
(
arrivalVo
.
getVehicleId
());
for
(
VehicleDepartureLogVo
vehicleDepartureLogVo
:
list
)
{
if
(
vehicleDepartureLogVo
.
getState
()
!=
1
&&
departureLogVo
.
getId
()
>
departureLog
.
getId
())
{
//后面还有未收车的记录
flag
=
false
;
}
}
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
int
result
=
vehicleMapper
.
updateStatus
(
arrivalVo
.
getVehicleId
(),
VehicleStatus
.
NORMAL
.
getCode
());
if
(
result
==
0
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
}
}
DateTime
arrivalDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
DateTime
actualArrivalDate
=
new
DateTime
(
new
Date
());
//提前还车处理
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
View file @
160887f3
...
...
@@ -29,6 +29,8 @@ public interface VehicleMapper extends Mapper<Vehicle> {
int
updateStatusByIdAndStatus
(
@Param
(
"vehicleId"
)
String
vehicleId
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"lastStatus"
)
Integer
lastStatus
);
int
updateStatus
(
@Param
(
"vehicleId"
)
String
vehicleId
,
@Param
(
"status"
)
Integer
status
);
Vehicle
selectByNumberPlate
(
String
numberPlate
);
List
<
UsableVehicleModelVO
>
searchUsableModel
(
Map
<
String
,
Object
>
params
);
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
160887f3
...
...
@@ -359,6 +359,12 @@
where id = #{vehicleId} and status = #{lastStatus}
</update>
<update
id=
"updateStatus"
>
update vehicle
set status = #{status}
where id = #{vehicleId}
</update>
<update
id=
"updateMileageStatusByIdAndStatus"
>
update vehicle
set status = #{status},maintenance_mileage=#{mileage}
...
...
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