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
f6dadefe
Commit
f6dadefe
authored
Sep 09, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-modify-cutAmount' into master-modify-cutAmount
parents
3b3cd343
4b6097bb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
195 additions
and
113 deletions
+195
-113
OrderViolateEnum.java
...fc/platform/order/contant/enumerate/OrderViolateEnum.java
+62
-0
OrderVehicleCrosstown.java
...com/xxfc/platform/order/entity/OrderVehicleCrosstown.java
+7
-0
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+124
-74
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+2
-39
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/OrderViolateEnum.java
0 → 100644
View file @
f6dadefe
package
com
.
xxfc
.
platform
.
order
.
contant
.
enumerate
;
import
java.util.HashMap
;
import
java.util.Map
;
public
enum
OrderViolateEnum
{
BEFORE
(
1
,
"提前"
),
AFTER
(
2
,
"延期"
)
;
/**
* 编码
*/
private
Integer
code
;
/**
* 类型描述
*/
private
String
desc
;
public
static
Map
<
Integer
,
OrderTypeEnum
>
codeAndDesc
=
new
HashMap
<
Integer
,
OrderTypeEnum
>();
//Maps.newHashMap();
static
{
for
(
OrderTypeEnum
enumE
:
OrderTypeEnum
.
values
()){
codeAndDesc
.
put
(
enumE
.
getCode
(),
enumE
);
}
}
OrderViolateEnum
(
Integer
code
,
String
desc
){
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
static
Boolean
exists
(
Integer
code
){
return
codeAndDesc
.
containsKey
(
code
);
}
public
static
OrderTypeEnum
get
(
Integer
code
)
{
for
(
OrderTypeEnum
enumE
:
OrderTypeEnum
.
values
())
{
if
(
enumE
.
getCode
().
equals
(
code
))
{
return
enumE
;
}
}
return
null
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderVehicleCrosstown.java
View file @
f6dadefe
...
@@ -105,6 +105,13 @@ public class OrderVehicleCrosstown {
...
@@ -105,6 +105,13 @@ public class OrderVehicleCrosstown {
*/
*/
private
String
dedDetail
;
private
String
dedDetail
;
/**
* 租车违约金明细
*/
@Column
(
name
=
"violate_amount_detail"
)
private
String
violateDetail
;
/**
/**
* 1、交车, 2、还车, 3、定损还车
* 1、交车, 2、还车, 3、定损还车
*/
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
f6dadefe
This diff is collapsed.
Click to expand it.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
f6dadefe
...
@@ -59,7 +59,6 @@ public class VehicleActiveService {
...
@@ -59,7 +59,6 @@ public class VehicleActiveService {
* @param departureVo
* @param departureVo
*/
*/
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
try
{
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
departureVo
.
getVehicleId
());
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
departureVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
...
@@ -86,11 +85,9 @@ public class VehicleActiveService {
...
@@ -86,11 +85,9 @@ public class VehicleActiveService {
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
vehicle
.
setExpectDestinationBranchCompanyId
(
departureVo
.
getExpectArrivalBranchCompanyId
());
vehicle
.
setExpectDestinationBranchCompanyId
(
departureVo
.
getExpectArrivalBranchCompanyId
());
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
// 修改车辆状态,确认是空闲状态
// 修改车辆状态,确认是空闲状态
int
result
=
vehicleMapper
.
updateStatusByIdAndStatus
(
departureVo
.
getVehicleId
(),
VehicleStatus
.
DEPARTURE
.
getCode
(),
int
result
=
vehicleMapper
.
updateStatusByIdAndStatus
(
departureVo
.
getVehicleId
(),
VehicleStatus
.
DEPARTURE
.
getCode
(),
VehicleStatus
.
NORMAL
.
getCode
());
VehicleStatus
.
NORMAL
.
getCode
());
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
...
@@ -133,9 +130,8 @@ public class VehicleActiveService {
...
@@ -133,9 +130,8 @@ public class VehicleActiveService {
departureLog
.
setUserTel
(
vehicleBookRecord
.
getVehicleUserPhone
());
departureLog
.
setUserTel
(
vehicleBookRecord
.
getVehicleUserPhone
());
}
}
vehicleDepartureLogMapper
.
insert
(
departureLog
);
vehicleDepartureLogMapper
.
insert
(
departureLog
);
log
.
info
(
"收车成功: 收车记录:departureLog = {}"
,
departureLog
.
toString
());
}
}
// 车辆活动日志
// 车辆活动日志
VehicleActiveLog
activeLog
=
new
VehicleActiveLog
();
VehicleActiveLog
activeLog
=
new
VehicleActiveLog
();
activeLog
.
setVehicleId
(
departureVo
.
getVehicleId
());
activeLog
.
setVehicleId
(
departureVo
.
getVehicleId
());
...
@@ -147,10 +143,6 @@ public class VehicleActiveService {
...
@@ -147,10 +143,6 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
...
@@ -202,10 +194,6 @@ public class VehicleActiveService {
...
@@ -202,10 +194,6 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
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());
// }
Integer
Mileagerest
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileagerest
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileagerest1
=
arrivalVo
.
getMileage
();
Integer
Mileagerest1
=
arrivalVo
.
getMileage
();
if
(
Mileagerest1
==
null
)
{
if
(
Mileagerest1
==
null
)
{
...
@@ -218,7 +206,6 @@ public class VehicleActiveService {
...
@@ -218,7 +206,6 @@ public class VehicleActiveService {
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
}
// 写入车辆公里数,还车分公司id
// 写入车辆公里数,还车分公司id
vehicle
.
setMileageLastUpdate
(
Mileagerest1
);
vehicle
.
setMileageLastUpdate
(
Mileagerest1
);
if
(
vehicleBookRecord
!=
null
)
{
if
(
vehicleBookRecord
!=
null
)
{
...
@@ -226,12 +213,8 @@ public class VehicleActiveService {
...
@@ -226,12 +213,8 @@ public class VehicleActiveService {
}
}
vehicle
.
setExpectDestinationBranchCompanyId
(
0
);
vehicle
.
setExpectDestinationBranchCompanyId
(
0
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
// 出车记录
// 出车记录
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
if
(
departureLogVo
==
null
)
{
if
(
departureLogVo
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
...
@@ -248,10 +231,6 @@ public class VehicleActiveService {
...
@@ -248,10 +231,6 @@ public class VehicleActiveService {
}
}
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
int
result
=
vehicleMapper
.
updateStatus
(
arrivalVo
.
getVehicleId
(),
VehicleStatus
.
NORMAL
.
getCode
());
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
arrivalDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
...
@@ -298,23 +277,7 @@ public class VehicleActiveService {
...
@@ -298,23 +277,7 @@ public class VehicleActiveService {
activeLog
.
setEndTime
(
new
Date
());
activeLog
.
setEndTime
(
new
Date
());
activeLog
.
setUpdateTime
(
new
Date
());
activeLog
.
setUpdateTime
(
new
Date
());
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
log
.
info
(
"收车成功: 收车记录:departureLog = {}"
,
departureLog
.
toString
());
//取消预定时间 bookInfo和bookRecord
// BookVehicleVO bookVehicleVo = new BookVehicleVO();
// BeanUtils.copyProperties(vehicleBookRecord, bookVehicleVo);
// bookVehicleVo.setNotCheckTimeLegal(Boolean.TRUE);
// bookVehicleVo.setBookStartDate(null);
// bookVehicleVo.setBookEndDate(null);
// bookVehicleVo.setUnbookStartDate(new DateTime(vehicleBookRecord.getBookStartDate()).toString(DATE_TIME_FORMATTER));
// bookVehicleVo.setUnbookEndDate(new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER));
// try {
// Boolean hasSuc = vehicleBiz.unbookVehicle(bookVehicleVo);
// if(!hasSuc){
// throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode());
// }
// } catch ( Exception e) {
// e.printStackTrace();
// }
}
else
{
}
else
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
...
...
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