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
b6131c24
Commit
b6131c24
authored
Oct 24, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev
parents
b83cd84b
a9c6838f
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
210 additions
and
209 deletions
+210
-209
DeductionTypeEnum.java
...c/platform/order/contant/enumerate/DeductionTypeEnum.java
+1
-0
RentVehicleBO.java
...ava/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
+1
-1
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+31
-10
OrderItemBiz.java
...c/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
+1
-1
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+3
-3
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+2
-2
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+2
-2
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+3
-2
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+5
-2
UserAuthentication.java
...l/service/authenticationInterface/UserAuthentication.java
+1
-1
BJCYAuthentication.java
...vice/authenticationInterface/impl/BJCYAuthentication.java
+4
-3
XCFQAuthentication.java
...vice/authenticationInterface/impl/XCFQAuthentication.java
+2
-5
Festival.java
.../main/java/com/xxfc/platform/vehicle/entity/Festival.java
+2
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+7
-9
BranchCompanyListDTO.java
.../xxfc/platform/vehicle/pojo/dto/BranchCompanyListDTO.java
+1
-0
VehicleModelCalendarPriceDTO.java
...atform/vehicle/pojo/dto/VehicleModelCalendarPriceDTO.java
+0
-1
BranchCompanyListVO.java
...om/xxfc/platform/vehicle/pojo/vo/BranchCompanyListVO.java
+1
-0
FestivalBiz.java
.../main/java/com/xxfc/platform/vehicle/biz/FestivalBiz.java
+11
-2
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+2
-0
VehicleBookRecordBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
+0
-86
VehicleModelCalendarPriceBiz.java
...fc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
+7
-7
VehicleModelHolidayPriceBiz.java
...xfc/platform/vehicle/biz/VehicleModelHolidayPriceBiz.java
+22
-12
VehicleModelHolidayPriceMapper.java
...atform/vehicle/mapper/VehicleModelHolidayPriceMapper.java
+1
-0
VehicleModelCalendarPriceController.java
...orm/vehicle/rest/VehicleModelCalendarPriceController.java
+13
-8
VehicleModelHolidayPriceAdminController.java
...e/rest/admin/VehicleModelHolidayPriceAdminController.java
+15
-3
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+1
-0
VehicleBookRecordMapper.xml
...ver/src/main/resources/mapper/VehicleBookRecordMapper.xml
+19
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+52
-48
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/DeductionTypeEnum.java
View file @
b6131c24
...
@@ -8,6 +8,7 @@ public enum DeductionTypeEnum {
...
@@ -8,6 +8,7 @@ public enum DeductionTypeEnum {
VIOLATE_CANCEL
(
101
,
"提前取消违约金"
),
VIOLATE_CANCEL
(
101
,
"提前取消违约金"
),
VIOLATE_ADVANCE
(
102
,
"提前还车违约金"
),
VIOLATE_ADVANCE
(
102
,
"提前还车违约金"
),
VIOLATE_DELAY
(
103
,
"延迟还车违约金"
),
VIOLATE_DELAY
(
103
,
"延迟还车违约金"
),
VIOLATE_CHANGE_C
(
104
,
"更换还车公司费用"
),
CONSUME
(
201
,
"消费金额"
),
CONSUME
(
201
,
"消费金额"
),
DAMAGES
(
301
,
"赔偿金(定损)"
),
DAMAGES
(
301
,
"赔偿金(定损)"
),
VIOLATE_TRAFFIC_DEDUCT
(
401
,
"违章扣款"
),
VIOLATE_TRAFFIC_DEDUCT
(
401
,
"违章扣款"
),
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
View file @
b6131c24
...
@@ -74,6 +74,6 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
...
@@ -74,6 +74,6 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
public
void
initDate
()
{
public
void
initDate
()
{
this
.
startDate
=
DateUtil
.
date
(
getStartTime
());
this
.
startDate
=
DateUtil
.
date
(
getStartTime
());
this
.
endDate
=
DateUtil
.
date
(
getEnd
Dat
e
());
this
.
endDate
=
DateUtil
.
date
(
getEnd
Tim
e
());
}
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
b6131c24
...
@@ -347,10 +347,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -347,10 +347,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
setType
(
crosstownTypeEnum
);
setType
(
crosstownTypeEnum
);
}});
}});
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
orderMQDTO
.
getId
());
setOrderId
(
orderMQDTO
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
if
(
null
==
crosstown
)
{
if
(
null
==
crosstown
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
StrUtil
.
format
(
"退款第一部分押金失败,获取不了还车/定损记录,订单号:{}, crosstownTypeEnum: {}"
,
orderMQDTO
.
getId
(),
crosstownTypeEnum
)));
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
StrUtil
.
format
(
"退款第一部分押金失败,获取不了还车/定损记录,订单号:{}, crosstownTypeEnum: {}"
,
orderMQDTO
.
getId
(),
crosstownTypeEnum
)));
...
@@ -482,12 +482,18 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -482,12 +482,18 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
private
void
handleCrosstownDetail
(
OrderVehicleCrosstown
crosstown
,
OrderAccountDetail
oad
,
CancelStartedVO
csv
)
{
private
void
handleCrosstownDetail
(
OrderVehicleCrosstown
crosstown
,
OrderAccountDetail
oad
,
CancelStartedVO
csv
)
{
try
{
try
{
if
(
null
!=
crosstown
.
getViolateDetail
())
{
if
(
null
!=
crosstown
.
getViolateDetail
())
{
DedDetailDTO
vio
=
JSONUtil
.
toBean
(
crosstown
.
getViolateDetail
(),
DedDetailDTO
.
class
);
//修改代码
List
<
DedDetailDTO
>
vios
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
crosstown
.
getViolateDetail
()),
DedDetailDTO
.
class
);
//DedDetailDTO vio = JSONUtil.toBean(crosstown.getViolateDetail(), DedDetailDTO.class);
for
(
DedDetailDTO
vio
:
vios
)
{
if
(
OrderViolateEnum
.
BEFORE
.
getCode
().
equals
(
vio
.
getType
()))
{
if
(
OrderViolateEnum
.
BEFORE
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
oad
,
vio
,
csv
);
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
oad
,
vio
,
csv
);
}
else
if
(
OrderViolateEnum
.
AFTER
.
getCode
().
equals
(
vio
.
getType
()))
{
}
else
if
(
OrderViolateEnum
.
AFTER
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_DELAY
,
oad
,
vio
,
csv
);
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_DELAY
,
oad
,
vio
,
csv
);
}
else
if
(
OrderViolateEnum
.
CHANGE
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_CHANGE_C
,
oad
,
vio
,
csv
);
}
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -496,6 +502,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -496,6 +502,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
}
private
void
handleViolateDetail
(
DeductionTypeEnum
dte
,
OrderAccountDetail
oad
,
DedDetailDTO
vio
,
CancelStartedVO
csv
)
{
private
void
handleViolateDetail
(
DeductionTypeEnum
dte
,
OrderAccountDetail
oad
,
DedDetailDTO
vio
,
CancelStartedVO
csv
)
{
Boolean
flag
=
Boolean
.
FALSE
;
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
if
(
dte
.
getCode
().
equals
(
deduction
.
getType
()))
{
if
(
dte
.
getCode
().
equals
(
deduction
.
getType
()))
{
deduction
.
setName
(
vio
.
getDeductions
());
deduction
.
setName
(
vio
.
getDeductions
());
...
@@ -505,9 +512,23 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -505,9 +512,23 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
deduction
.
setAmount
(
vio
.
getCost
());
deduction
.
setAmount
(
vio
.
getCost
());
//设置订单明细参数
//设置订单明细参数
csv
.
setViolateAmount
(
deduction
.
getAmount
());
csv
.
setViolateAmount
(
csv
.
getViolateAmount
().
add
(
diff
));
csv
.
setViolateDesc
(
deduction
.
getName
());
csv
.
setViolateDesc
(
csv
.
getViolateDesc
()+
deduction
.
getName
());
flag
=
Boolean
.
TRUE
;
break
;
}
}
}
//如果没有修改,则添加
if
(
Boolean
.
FALSE
.
equals
(
flag
))
{
OrderAccountDeduction
oadNew
=
initDeduction
(
vio
.
getCost
(),
vio
.
getDeductions
(),
dte
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
);
oad
.
getDeductions
().
add
(
oadNew
);
//修改归还押金金额
oad
.
setDepositAmount
(
oad
.
getDepositAmount
().
subtract
(
oadNew
.
getAmount
()));
//设置订单明细参数
csv
.
setViolateAmount
(
csv
.
getViolateAmount
().
add
(
oadNew
.
getAmount
()));
csv
.
setViolateDesc
(
csv
.
getViolateDesc
()+
oadNew
.
getName
());
}
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
View file @
b6131c24
...
@@ -55,7 +55,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
...
@@ -55,7 +55,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
//根据延期的天数算出 对应的日期价格
//根据延期的天数算出 对应的日期价格
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
Date
overEnd
=
DateUtil
.
offsetDay
(
endDate
,
overDays
);
Date
overEnd
=
DateUtil
.
offsetDay
(
endDate
,
overDays
);
List
<
VehicleModelCalendarPriceDTO
>
overlist
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
overStart
,
overEnd
,
modelId
,
userId
);
List
<
VehicleModelCalendarPriceDTO
>
overlist
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
overStart
.
getTime
(),
overEnd
.
getTime
(),
modelId
,
userId
).
getData
(
);
for
(
VehicleModelCalendarPriceDTO
vmcpd
:
overlist
)
{
for
(
VehicleModelCalendarPriceDTO
vmcpd
:
overlist
)
{
overAmountList
.
add
((
VMCalendarPriceCostDTO
)
vmcpd
);
overAmountList
.
add
((
VMCalendarPriceCostDTO
)
vmcpd
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
b6131c24
...
@@ -171,9 +171,9 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -171,9 +171,9 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
if
(
orderVehicleCrosstownDto
.
getType
()
==
CrosstownTypeEnum
.
DEPARTURE
.
getCode
())
{
if
(
orderVehicleCrosstownDto
.
getType
()
==
CrosstownTypeEnum
.
DEPARTURE
.
getCode
())
{
boolean
flag
=
getTodayTime
(
orderRentVehicleDetail
.
getStartTime
());
boolean
flag
=
getTodayTime
(
orderRentVehicleDetail
.
getStartTime
());
//
if (!flag) {
if
(!
flag
)
{
//
return ObjectRestResponse.createFailedResult(3502, "今日不是交车日期");
return
ObjectRestResponse
.
createFailedResult
(
3502
,
"今日不是交车日期"
);
//
}
}
if
(
null
==
userDTO
.
getCompanyId
()
||
!
userDTO
.
getCompanyId
().
equals
(
orderRentVehicleDetail
.
getStartCompanyId
()))
{
if
(
null
==
userDTO
.
getCompanyId
()
||
!
userDTO
.
getCompanyId
().
equals
(
orderRentVehicleDetail
.
getStartCompanyId
()))
{
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"无交车权限"
);
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"无交车权限"
);
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
b6131c24
...
@@ -245,10 +245,10 @@ public class OrderCalculateBiz {
...
@@ -245,10 +245,10 @@ public class OrderCalculateBiz {
}
}
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
Integer
freeDays
=
(
null
==
vehicleItemDTO
.
getCutNum
())?
0
:
vehicleItemDTO
.
getCutNum
();
Integer
freeDays
=
(
null
==
vehicleItemDTO
.
getCutNum
())?
0
:
vehicleItemDTO
.
getCutNum
();
return
inProgressCalculate
(
baseOrder
,
vehicleItemDTO
,
freeDays
,
useDays
,
new
OrderAccountDetail
(),
Boolean
.
FALSE
);
return
inProgressCalculate
(
baseOrder
,
vehicleItemDTO
,
freeDays
,
useDays
,
new
OrderAccountDetail
(),
Boolean
.
FALSE
);
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
b6131c24
...
@@ -139,10 +139,10 @@ public class OrderCancelBiz {
...
@@ -139,10 +139,10 @@ public class OrderCancelBiz {
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}});
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
//如果超过出发时间,不能取消订单
//如果超过出发时间,不能取消订单
//根据时间处理goodsAmount
//根据时间处理goodsAmount
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
b6131c24
package
com
.
xxfc
.
platform
.
order
.
rest
;
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
...
@@ -93,10 +94,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -93,10 +94,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
Long
timeLag
=
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
();
Long
timeLag
=
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
();
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
orderPageVO
.
getId
());
setOrderId
(
orderPageVO
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
if
(
timeLag
<
0
)
{
if
(
timeLag
<
0
)
{
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
b6131c24
...
@@ -238,11 +238,14 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -238,11 +238,14 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
detail
.
initDate
();
detail
.
initDate
();
List
<
VehicleModelCalendarPriceDTO
>
vmcpds
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
detail
.
getStart
Date
(),
detail
.
getEndDate
(),
detail
.
getModelId
(),
dto
.
getUserid
()
);
List
<
VehicleModelCalendarPriceDTO
>
vmcpds
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
detail
.
getStart
Time
(),
detail
.
getEndTime
(),
detail
.
getModelId
(),
dto
.
getUserid
()).
getData
(
);
//设置Item
//设置Item
VehicleItemDTO
vehicleOrderItem
=
(
VehicleItemDTO
)
orderItemBiz
.
initOrderItem
(
vehicleModel
.
getPrice
(),
detail
.
getDayNum
(),
vehicleModel
.
getName
(),
vehicleModel
.
getId
(),
ItemTypeEnum
.
VEHICLE_MODEL
,
JSONUtil
.
parseArray
(
vmcpds
).
toString
());
VehicleItemDTO
vehicleOrderItem
=
BeanUtil
.
toBean
(
orderItemBiz
.
initOrderItem
(
vehicleModel
.
getPrice
(),
detail
.
getDayNum
(),
vehicleModel
.
getName
()
,
vehicleModel
.
getId
(),
ItemTypeEnum
.
VEHICLE_MODEL
,
JSONUtil
.
parseArray
(
vmcpds
).
toString
())
,
VehicleItemDTO
.
class
);
OrderItem
driverOrderItem
=
orderItemBiz
.
initOrderItem
(
DRIVER_PRICE
,
detail
.
getDayNum
(),
"平台司机"
,
null
,
ItemTypeEnum
.
DRIVER
);
OrderItem
driverOrderItem
=
orderItemBiz
.
initOrderItem
(
DRIVER_PRICE
,
detail
.
getDayNum
(),
"平台司机"
,
null
,
ItemTypeEnum
.
DRIVER
);
OrderItem
damageSafeOrderItem
=
orderItemBiz
.
initOrderItem
(
DAMAGE_SAFE
,
detail
.
getDayNum
(),
"免赔费用"
,
null
,
ItemTypeEnum
.
DAMAGE_SAFE
);
OrderItem
damageSafeOrderItem
=
orderItemBiz
.
initOrderItem
(
DAMAGE_SAFE
,
detail
.
getDayNum
(),
"免赔费用"
,
null
,
ItemTypeEnum
.
DAMAGE_SAFE
);
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/authenticationInterface/UserAuthentication.java
View file @
b6131c24
...
@@ -5,7 +5,7 @@ import com.xxfc.platform.universal.biz.UserMessage;
...
@@ -5,7 +5,7 @@ import com.xxfc.platform.universal.biz.UserMessage;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* 用户认证
类
* 用户认证
接口 (使用@Primary实现的优先级提升优先级)
* @author Administrator
* @author Administrator
*/
*/
public
interface
UserAuthentication
{
public
interface
UserAuthentication
{
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/authenticationInterface/impl/BJCYAuthentication.java
View file @
b6131c24
...
@@ -25,7 +25,7 @@ import java.util.Map;
...
@@ -25,7 +25,7 @@ import java.util.Map;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
@Primary
//
@Primary
public
class
BJCYAuthentication
implements
UserAuthentication
{
public
class
BJCYAuthentication
implements
UserAuthentication
{
private
final
String
host
=
"http://aliyunverifyidcard.haoservice.com"
;
private
final
String
host
=
"http://aliyunverifyidcard.haoservice.com"
;
private
final
String
path
=
"/idcard/VerifyIdcardv2"
;
private
final
String
path
=
"/idcard/VerifyIdcardv2"
;
...
@@ -39,7 +39,8 @@ public class BJCYAuthentication implements UserAuthentication {
...
@@ -39,7 +39,8 @@ public class BJCYAuthentication implements UserAuthentication {
private
final
String
ret
=
"error_code"
;
private
final
String
ret
=
"error_code"
;
@Override
@Override
public
boolean
certificate
(
UserMessage
message
)
{
public
boolean
certificate
(
UserMessage
message
)
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
return
true
;
/*Map<String, String> headers = new HashMap<String, String>();
headers.put(tokenHead, token);
headers.put(tokenHead, token);
Map<String, String> querys = new HashMap<String, String>();
Map<String, String> querys = new HashMap<String, String>();
querys.put(cardNo, message.getIdNumber());
querys.put(cardNo, message.getIdNumber());
...
@@ -66,7 +67,7 @@ public class BJCYAuthentication implements UserAuthentication {
...
@@ -66,7 +67,7 @@ public class BJCYAuthentication implements UserAuthentication {
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
}
return
false
;
return false;
*/
}
}
}
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/authenticationInterface/impl/XCFQAuthentication.java
View file @
b6131c24
...
@@ -12,6 +12,7 @@ import org.apache.commons.lang.StringUtils;
...
@@ -12,6 +12,7 @@ import org.apache.commons.lang.StringUtils;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.StatusLine
;
import
org.apache.http.StatusLine
;
import
org.apache.http.util.EntityUtils
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -24,6 +25,7 @@ import java.util.Map;
...
@@ -24,6 +25,7 @@ import java.util.Map;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
@Primary
public
class
XCFQAuthentication
implements
UserAuthentication
{
public
class
XCFQAuthentication
implements
UserAuthentication
{
private
String
cAppcode
=
"acea1c8811f748b3a65815f11db357c4"
;
private
String
cAppcode
=
"acea1c8811f748b3a65815f11db357c4"
;
...
@@ -33,10 +35,8 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -33,10 +35,8 @@ public class XCFQAuthentication implements UserAuthentication {
*/
*/
private
String
cHost
=
"https://idcert.market.alicloudapi.com"
;
private
String
cHost
=
"https://idcert.market.alicloudapi.com"
;
private
String
cPath
=
"/idcard"
;
private
String
cPath
=
"/idcard"
;
private
String
cMethod
=
"GET"
;
private
String
cMethod
=
"GET"
;
//响应:认证错误码字段名
//响应:认证错误码字段名
...
@@ -45,7 +45,6 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -45,7 +45,6 @@ public class XCFQAuthentication implements UserAuthentication {
//响应:认证通过码
//响应:认证通过码
private
String
certifResultCode
=
"01"
;
private
String
certifResultCode
=
"01"
;
//请求:身份证号字段名
//请求:身份证号字段名
private
String
idCardName
=
"idCard"
;
private
String
idCardName
=
"idCard"
;
...
@@ -55,11 +54,9 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -55,11 +54,9 @@ public class XCFQAuthentication implements UserAuthentication {
@Override
@Override
public
boolean
certificate
(
UserMessage
message
)
{
public
boolean
certificate
(
UserMessage
message
)
{
//map携带身份证和姓名进行认证
//map携带身份证和姓名进行认证
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
idCardName
,
message
.
getIdNumber
());
querys
.
put
(
idCardName
,
message
.
getIdNumber
());
querys
.
put
(
cName
,
message
.
getName
());
querys
.
put
(
cName
,
message
.
getName
());
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Authorization"
,
"APPCODE "
+
cAppcode
);
headers
.
put
(
"Authorization"
,
"APPCODE "
+
cAppcode
);
try
{
try
{
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Festival.java
View file @
b6131c24
...
@@ -27,4 +27,6 @@ public class Festival {
...
@@ -27,4 +27,6 @@ public class Festival {
private
String
name
;
private
String
name
;
@Column
(
name
=
"crt_time"
)
@Column
(
name
=
"crt_time"
)
private
Date
crtTime
;
private
Date
crtTime
;
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
b6131c24
...
@@ -12,12 +12,10 @@ import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
...
@@ -12,12 +12,10 @@ import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* Created by ace on 2017/9/15.
* Created by ace on 2017/9/15.
...
@@ -190,9 +188,9 @@ public interface VehicleFeign {
...
@@ -190,9 +188,9 @@ public interface VehicleFeign {
* @param userId
* @param userId
* @return
* @return
*/
*/
@GetMapping
(
"/vehicle_model/calendar_price/app/unauth/price"
)
@GetMapping
(
value
=
"/vehicle_model/calendar_price/app/unauth/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Date
startDate
,
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
)
Date
endDate
,
@RequestParam
(
value
=
"endDate"
)
Long
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
);
@RequestParam
(
value
=
"userId"
)
Integer
userId
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/BranchCompanyListDTO.java
View file @
b6131c24
...
@@ -20,6 +20,7 @@ public class BranchCompanyListDTO {
...
@@ -20,6 +20,7 @@ public class BranchCompanyListDTO {
*/
*/
@ApiModelProperty
(
"分公司名称"
)
@ApiModelProperty
(
"分公司名称"
)
private
String
name
;
private
String
name
;
private
String
companyName
;
/**
/**
* 公司封面
* 公司封面
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehicleModelCalendarPriceDTO.java
View file @
b6131c24
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
dto
;
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/BranchCompanyListVO.java
View file @
b6131c24
...
@@ -20,6 +20,7 @@ public class BranchCompanyListVO {
...
@@ -20,6 +20,7 @@ public class BranchCompanyListVO {
*/
*/
@ApiModelProperty
(
"分公司名称"
)
@ApiModelProperty
(
"分公司名称"
)
private
String
name
;
private
String
name
;
private
String
companyName
;
/**
/**
* 公司封面
* 公司封面
*/
*/
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/FestivalBiz.java
View file @
b6131c24
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.biz;
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.vehicle.entity.Festival
;
import
com.xxfc.platform.vehicle.entity.Festival
;
import
com.xxfc.platform.vehicle.mapper.FestivalMapper
;
import
com.xxfc.platform.vehicle.mapper.FestivalMapper
;
import
io.swagger.models.auth.In
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -30,11 +31,11 @@ public class FestivalBiz extends BaseBiz<FestivalMapper,Festival> {
...
@@ -30,11 +31,11 @@ public class FestivalBiz extends BaseBiz<FestivalMapper,Festival> {
}
}
}
}
public
void
deleteById
(
Integer
festivalId
){
/*
public void deleteById(Integer festivalId){
Festival festival = new Festival();
Festival festival = new Festival();
festival.setId(festivalId);
festival.setId(festivalId);
mapper.deleteByPrimaryKey(festival);
mapper.deleteByPrimaryKey(festival);
}
}
*/
public
Map
<
Integer
,
Festival
>
findFestivalsByIds
(
List
<
Integer
>
festivalIds
)
{
public
Map
<
Integer
,
Festival
>
findFestivalsByIds
(
List
<
Integer
>
festivalIds
)
{
Map
<
Integer
,
Festival
>
festivalMap
=
new
HashMap
<>(
20
);
Map
<
Integer
,
Festival
>
festivalMap
=
new
HashMap
<>(
20
);
...
@@ -44,4 +45,12 @@ public class FestivalBiz extends BaseBiz<FestivalMapper,Festival> {
...
@@ -44,4 +45,12 @@ public class FestivalBiz extends BaseBiz<FestivalMapper,Festival> {
}
}
return
festivalMap
;
return
festivalMap
;
}
}
@Override
public
void
deleteById
(
Object
id
)
{
Festival
festival
=
new
Festival
();
festival
.
setId
((
Integer
)
id
);
festival
.
setIsDel
(
1
);
mapper
.
updateByPrimaryKey
(
festival
);
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
b6131c24
...
@@ -317,6 +317,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -317,6 +317,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return
RestResponse
.
codeAndMessage
(
objectRestResponse
.
getStatus
(),
objectRestResponse
.
getMessage
());
return
RestResponse
.
codeAndMessage
(
objectRestResponse
.
getStatus
(),
objectRestResponse
.
getMessage
());
}
}
}
else
{
continue
;
}
}
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
View file @
b6131c24
...
@@ -197,51 +197,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
...
@@ -197,51 +197,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
}
}
}
}
vehicleBookRecordQueryVo
.
setCompanyIds
(
companyList
);
vehicleBookRecordQueryVo
.
setCompanyIds
(
companyList
);
if
(
vehicleBookRecordQueryVo
.
getStatus
()
!=
null
&&
vehicleBookRecordQueryVo
.
getStatus
()
==
3
)
{
//待出行
vehicleBookRecordQueryVo
.
setStatus
(
2
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
List
<
VehicleBookRecordVo
>
list
=
mapper
.
getBookRecordInfo
(
query
.
getSuper
());
removeStatus3
(
list
);
PageInfo
<
VehicleBookRecordVo
>
vehicleBookRecordVoPageInfo
=
new
PageInfo
<>(
list
);
getupKeeps
(
vehicleBookRecordVoPageInfo
.
getList
());
PageDataVO
<
VehicleBookRecordVo
>
vehicleBookRecordVoPageDataVO
=
PageDataVO
.
pageInfo
(
vehicleBookRecordVoPageInfo
);
vehicleBookRecordVoPageDataVO
.
setPageNum
(
pageNo
);
vehicleBookRecordVoPageDataVO
.
setPageSize
(
pageSize
);
vehicleBookRecordVoPageDataVO
.
setTotalCount
((
long
)
vehicleBookRecordVoPageInfo
.
getList
().
size
());
vehicleBookRecordVoPageDataVO
.
setTotalPage
((
vehicleBookRecordVoPageInfo
.
getList
().
size
()
+
pageSize
-
1
)
/
pageSize
);
vehicleBookRecordVoPageDataVO
.
setData
(
getData
(
vehicleBookRecordVoPageInfo
.
getList
(),
pageNo
,
pageSize
));
return
RestResponse
.
suc
(
vehicleBookRecordVoPageDataVO
);
}
if
(
vehicleBookRecordQueryVo
.
getStatus
()
!=
null
&&
vehicleBookRecordQueryVo
.
getStatus
()
==
5
)
{
//出行中
vehicleBookRecordQueryVo
.
setStatus
(
2
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
List
<
VehicleBookRecordVo
>
list
=
mapper
.
getBookRecordInfo
(
query
.
getSuper
());
removeStatus5
(
list
);
PageInfo
<
VehicleBookRecordVo
>
vehicleBookRecordVoPageInfo
=
new
PageInfo
<>(
list
);
getupKeeps
(
vehicleBookRecordVoPageInfo
.
getList
());
PageDataVO
<
VehicleBookRecordVo
>
vehicleBookRecordVoPageDataVO
=
PageDataVO
.
pageInfo
(
vehicleBookRecordVoPageInfo
);
vehicleBookRecordVoPageDataVO
.
setPageNum
(
pageNo
);
vehicleBookRecordVoPageDataVO
.
setPageSize
(
pageSize
);
vehicleBookRecordVoPageDataVO
.
setTotalCount
((
long
)
vehicleBookRecordVoPageInfo
.
getList
().
size
());
vehicleBookRecordVoPageDataVO
.
setTotalPage
((
vehicleBookRecordVoPageInfo
.
getList
().
size
()
+
pageSize
-
1
)
/
pageSize
);
vehicleBookRecordVoPageDataVO
.
setData
(
getData
(
vehicleBookRecordVoPageInfo
.
getList
(),
pageNo
,
pageSize
));
return
RestResponse
.
suc
(
vehicleBookRecordVoPageDataVO
);
}
if
(
vehicleBookRecordQueryVo
.
getStatus
()
!=
null
&&
vehicleBookRecordQueryVo
.
getStatus
()
==
7
)
{
//已完成
vehicleBookRecordQueryVo
.
setStatus
(
2
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
List
<
VehicleBookRecordVo
>
list
=
mapper
.
getBookRecordInfo
(
query
.
getSuper
());
removeStatus7
(
list
);
PageInfo
<
VehicleBookRecordVo
>
vehicleBookRecordVoPageInfo
=
new
PageInfo
<>(
list
);
getupKeeps
(
vehicleBookRecordVoPageInfo
.
getList
());
PageDataVO
<
VehicleBookRecordVo
>
vehicleBookRecordVoPageDataVO
=
PageDataVO
.
pageInfo
(
vehicleBookRecordVoPageInfo
);
vehicleBookRecordVoPageDataVO
.
setPageNum
(
pageNo
);
vehicleBookRecordVoPageDataVO
.
setPageSize
(
pageSize
);
vehicleBookRecordVoPageDataVO
.
setTotalCount
((
long
)
vehicleBookRecordVoPageInfo
.
getList
().
size
());
vehicleBookRecordVoPageDataVO
.
setTotalPage
((
vehicleBookRecordVoPageInfo
.
getList
().
size
()
+
pageSize
-
1
)
/
pageSize
);
vehicleBookRecordVoPageDataVO
.
setData
(
getData
(
vehicleBookRecordVoPageInfo
.
getList
(),
pageNo
,
pageSize
));
return
RestResponse
.
suc
(
vehicleBookRecordVoPageDataVO
);
}
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
PageDataVO
<
VehicleBookRecordVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getBookRecordInfo
(
query
.
getSuper
()));
PageDataVO
<
VehicleBookRecordVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getBookRecordInfo
(
query
.
getSuper
()));
getupKeeps
(
pageDataVO
.
getData
());
getupKeeps
(
pageDataVO
.
getData
());
...
@@ -261,47 +216,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
...
@@ -261,47 +216,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
}
}
}
}
}
}
//筛选未出车的记录
public
void
removeStatus3
(
List
<
VehicleBookRecordVo
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
Iterator
<
VehicleBookRecordVo
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
VehicleBookRecordVo
vehicleBookRecordVo
=
iterator
.
next
();
if
(
vehicleBookRecordVo
.
getVehicleDepartureLogVo
()
!=
null
)
{
iterator
.
remove
();
}
vehicleBookRecordVo
.
setState
(
3
);
}
}
}
//筛选已出车未还车记录
public
void
removeStatus5
(
List
<
VehicleBookRecordVo
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
Iterator
<
VehicleBookRecordVo
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
VehicleBookRecordVo
vehicleBookRecordVo
=
iterator
.
next
();
if
(
vehicleBookRecordVo
.
getVehicleDepartureLogVo
()
==
null
||
(
vehicleBookRecordVo
.
getVehicleDepartureLogVo
()
!=
null
&&
vehicleBookRecordVo
.
getVehicleDepartureLogVo
().
getState
()
==
1
))
{
iterator
.
remove
();
}
vehicleBookRecordVo
.
setState
(
5
);
}
}
}
//筛选已完成记录
public
void
removeStatus7
(
List
<
VehicleBookRecordVo
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
Iterator
<
VehicleBookRecordVo
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
VehicleBookRecordVo
vehicleBookRecordVo
=
iterator
.
next
();
if
(
vehicleBookRecordVo
.
getVehicleDepartureLogVo
()
==
null
||
(
vehicleBookRecordVo
.
getVehicleDepartureLogVo
()
!=
null
&&
vehicleBookRecordVo
.
getVehicleDepartureLogVo
().
getState
()
!=
1
))
{
iterator
.
remove
();
}
vehicleBookRecordVo
.
setState
(
5
);
}
}
}
/**
/**
* 获取随身物品
* 获取随身物品
*/
*/
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
View file @
b6131c24
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
cn.hutool.core.map.MapUtil
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
...
@@ -132,12 +133,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -132,12 +133,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
for
(
VehicleModelDTO
vehicleModelDTO
:
vehicleModelDTOS
)
{
for
(
VehicleModelDTO
vehicleModelDTO
:
vehicleModelDTOS
)
{
vehicleModelDayPriceVo
=
new
VehicleModelDayPriceVo
();
vehicleModelDayPriceVo
=
new
VehicleModelDayPriceVo
();
BeanUtils
.
copyProperties
(
vehicleModelDTO
,
vehicleModelDayPriceVo
);
BeanUtils
.
copyProperties
(
vehicleModelDTO
,
vehicleModelDayPriceVo
);
boolean
isNullOfVehicleModelPrice
=
vehicleModelCalendarPriceMap
==
null
?
true
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
())
==
null
;
boolean
isNullOfVehicleModelPrice
=
MapUtil
.
isEmpty
(
vehicleModelCalendarPriceMap
)
?
true
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
())
==
null
;
Double
multiple
=
isNullOfVehicleModelPrice
?
null
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
()).
getMultiple
();
Double
multiple
=
isNullOfVehicleModelPrice
?
null
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
()).
getMultiple
();
vehicleModelDayPriceVo
.
setMultiple
(
multiple
);
vehicleModelDayPriceVo
.
setMultiple
(
multiple
);
BigDecimal
aPrice
=
isNullOfVehicleModelPrice
?
null
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
()).
getPrice
();
BigDecimal
aPrice
=
isNullOfVehicleModelPrice
?
BigDecimal
.
ZERO
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
()).
getPrice
();
vehicleModelDayPriceVo
.
setPrice
(
aPrice
);
vehicleModelDayPriceVo
.
setPrice
(
aPrice
);
Integer
level
=
isNullOfVehicleModelPrice
?
null
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
()).
getLevel
();
Integer
level
=
isNullOfVehicleModelPrice
?
null
:
vehicleModelCalendarPriceMap
.
get
(
vehicleModelDTO
.
getVehicleModelId
()).
getLevel
();
vehicleModelDayPriceVo
.
setLevel
(
level
);
vehicleModelDayPriceVo
.
setLevel
(
level
);
vehicleModelDayPriceVos
.
add
(
vehicleModelDayPriceVo
);
vehicleModelDayPriceVos
.
add
(
vehicleModelDayPriceVo
);
}
}
...
@@ -267,7 +268,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -267,7 +268,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
Map
<
String
,
Object
>
price_freeDays_map
=
null
;
Map
<
String
,
Object
>
price_freeDays_map
=
null
;
Date
current_date
=
DateUtils
.
localDateToDate
(
final_startLocalDate
);
Date
current_date
=
DateUtils
.
localDateToDate
(
final_startLocalDate
);
vehicleModelCalendarPriceDTO
.
setDate
(
current_date
);
vehicleModelCalendarPriceDTO
.
setDate
(
current_date
);
if
(
calendarPriceMap
!=
null
&&
!
calendarPriceMap
.
isEmpty
(
))
{
if
(
MapUtil
.
isNotEmpty
(
calendarPriceMap
))
{
VehicleModelCalendarPrice
vehicleModelCalendarPrice
=
calendarPriceMap
.
get
(
current_date
);
VehicleModelCalendarPrice
vehicleModelCalendarPrice
=
calendarPriceMap
.
get
(
current_date
);
if
(
Objects
.
isNull
(
vehicleModelCalendarPrice
))
{
if
(
Objects
.
isNull
(
vehicleModelCalendarPrice
))
{
price_freeDays_map
=
transfromPriceAndFreeDaysByDate
(
festivalDayMap
,
current_date
,
vehicle_base_price
,
discount
);
price_freeDays_map
=
transfromPriceAndFreeDaysByDate
(
festivalDayMap
,
current_date
,
vehicle_base_price
,
discount
);
...
@@ -294,7 +295,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -294,7 +295,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
}
else
{
}
else
{
price_freeDays_map
=
transfromPriceAndFreeDaysByDate
(
festivalDayMap
,
current_date
,
vehicle_base_price
,
discount
);
price_freeDays_map
=
transfromPriceAndFreeDaysByDate
(
festivalDayMap
,
current_date
,
vehicle_base_price
,
discount
);
}
}
if
(
price_freeDays_map
!=
null
&&
!
price_freeDays_map
.
isEmpty
(
))
{
if
(
MapUtil
.
isNotEmpty
(
price_freeDays_map
))
{
vehicle_price
=
(
BigDecimal
)
price_freeDays_map
.
get
(
PRICE_VAL
);
vehicle_price
=
(
BigDecimal
)
price_freeDays_map
.
get
(
PRICE_VAL
);
free_days
=
(
Integer
)
price_freeDays_map
.
get
(
DAYS_VAL
);
free_days
=
(
Integer
)
price_freeDays_map
.
get
(
DAYS_VAL
);
no_discount_price
=
(
BigDecimal
)
price_freeDays_map
.
get
(
BASE_PRICE_VAL
);
no_discount_price
=
(
BigDecimal
)
price_freeDays_map
.
get
(
BASE_PRICE_VAL
);
...
@@ -322,7 +323,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -322,7 +323,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
Map
<
String
,
Object
>
vehicle_price_days_map
=
new
HashMap
<>(
3
);
Map
<
String
,
Object
>
vehicle_price_days_map
=
new
HashMap
<>(
3
);
Integer
free_days
=
DEFAULT_FREE_DAYS
;
Integer
free_days
=
DEFAULT_FREE_DAYS
;
vehicle_price_days_map
.
put
(
BASE_PRICE_VAL
,
vehicle_price
);
vehicle_price_days_map
.
put
(
BASE_PRICE_VAL
,
vehicle_price
);
if
(
festivalDayMap
!=
null
&&
!
festivalDayMap
.
isEmpty
(
))
{
if
(
MapUtil
.
isNotEmpty
(
festivalDayMap
))
{
VehicleModelHolidayPriceDTO
vehicleModelHolidayPriceDTO
=
festivalDayMap
.
get
(
current_date
);
VehicleModelHolidayPriceDTO
vehicleModelHolidayPriceDTO
=
festivalDayMap
.
get
(
current_date
);
if
(
Objects
.
nonNull
(
vehicleModelHolidayPriceDTO
))
{
if
(
Objects
.
nonNull
(
vehicleModelHolidayPriceDTO
))
{
vehicle_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
vehicleModelHolidayPriceDTO
.
getMultiple
().
doubleValue
()));
vehicle_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
vehicleModelHolidayPriceDTO
.
getMultiple
().
doubleValue
()));
...
@@ -412,7 +413,6 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -412,7 +413,6 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
AtomicReference
<
Date
>
start
=
new
AtomicReference
<>(
Date
.
from
(
LocalDate
.
parse
(
"2019-10-03"
).
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
AtomicReference
<
Date
>
start
=
new
AtomicReference
<>(
Date
.
from
(
LocalDate
.
parse
(
"2019-10-03"
).
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
AtomicReference
<
Date
>
end
=
new
AtomicReference
<>(
Date
.
from
(
LocalDate
.
parse
(
"2019-10-29"
).
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
AtomicReference
<
Date
>
end
=
new
AtomicReference
<>(
Date
.
from
(
LocalDate
.
parse
(
"2019-10-29"
).
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelHolidayPriceBiz.java
View file @
b6131c24
...
@@ -24,9 +24,7 @@ import java.time.LocalDate;
...
@@ -24,9 +24,7 @@ import java.time.LocalDate;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.time.temporal.TemporalAdjusters
;
import
java.time.temporal.TemporalAdjusters
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Supplier
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
/**
* @author libin
* @author libin
...
@@ -56,7 +54,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -56,7 +54,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
while
(
startLocaldate
.
isBefore
(
endLocaldate
)
||
startLocaldate
.
isEqual
(
endLocaldate
)){
while
(
startLocaldate
.
isBefore
(
endLocaldate
)
||
startLocaldate
.
isEqual
(
endLocaldate
)){
vehicleModelHolidayPrice
=
new
VehicleModelHolidayPrice
();
vehicleModelHolidayPrice
=
new
VehicleModelHolidayPrice
();
BeanUtils
.
copyProperties
(
vehicleModelHolidayPriceSaveDTO
,
vehicleModelHolidayPrice
);
BeanUtils
.
copyProperties
(
vehicleModelHolidayPriceSaveDTO
,
vehicleModelHolidayPrice
);
Date
date
=
DateUtils
.
localDateToDate
(
startLocaldate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toLocalDate
()
);
Date
date
=
DateUtils
.
localDateToDate
(
startLocaldate
);
vehicleModelHolidayPrice
.
setFestivalDay
(
date
);
vehicleModelHolidayPrice
.
setFestivalDay
(
date
);
vehicleModelHolidayPriceList
.
add
(
vehicleModelHolidayPrice
);
vehicleModelHolidayPriceList
.
add
(
vehicleModelHolidayPrice
);
startLocaldate
=
startLocaldate
.
plusDays
(
1
);
startLocaldate
=
startLocaldate
.
plusDays
(
1
);
...
@@ -69,8 +67,12 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -69,8 +67,12 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
vehicleModelHolidayPriceList
)
{
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
vehicleModelHolidayPriceList
)
{
modelHolidayPrice
.
setUpdUserId
(
userId
);
modelHolidayPrice
.
setUpdUserId
(
userId
);
modelHolidayPrice
.
setUpdTime
(
new
Date
());
modelHolidayPrice
.
setUpdTime
(
new
Date
());
mapper
.
updateByExample
(
modelHolidayPrice
,
example
);
mapper
.
updateByExample
Selective
(
modelHolidayPrice
,
example
);
}
}
Festival
festival
=
new
Festival
();
festival
.
setName
(
vehicleModelHolidayPriceSaveDTO
.
getFestival
());
festival
.
setId
(
vehicleModelHolidayPriceSaveDTO
.
getId
());
festivalBiz
.
add
(
festival
);
}
else
{
}
else
{
Festival
festival
=
new
Festival
();
Festival
festival
=
new
Festival
();
festival
.
setName
(
vehicleModelHolidayPriceSaveDTO
.
getFestival
());
festival
.
setName
(
vehicleModelHolidayPriceSaveDTO
.
getFestival
());
...
@@ -87,19 +89,15 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -87,19 +89,15 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
/**
/**
* @param multiple 倍数
* @param multiple 倍数
* @param freeDays 免费天数
* @param freeDays 免费天数
* @param configDate 设置的日期*月份
*/
*/
public
void
updateVehicleModelHolidayPrice
(
Double
multiple
,
Integer
freeDays
,
Date
configDate
)
{
public
void
updateVehicleModelHolidayPrice
(
Double
multiple
,
Integer
freeDays
)
{
VehicleModelHolidayPrice
vehicleModelHolidayPrice
=
new
VehicleModelHolidayPrice
();
VehicleModelHolidayPrice
vehicleModelHolidayPrice
=
new
VehicleModelHolidayPrice
();
vehicleModelHolidayPrice
.
setMultiple
(
multiple
);
vehicleModelHolidayPrice
.
setMultiple
(
multiple
);
vehicleModelHolidayPrice
.
setFreeDays
(
freeDays
);
vehicleModelHolidayPrice
.
setFreeDays
(
freeDays
);
Example
example
=
new
Example
(
VehicleModelHolidayPrice
.
class
);
Example
example
=
new
Example
(
VehicleModelHolidayPrice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
setCondtionDate
(
configDate
,
null
,
criteria
);
criteria
.
andEqualTo
(
"isDel"
,
0
);
int
effect
=
mapper
.
updateByExampleSelective
(
vehicleModelHolidayPrice
,
example
);
mapper
.
updateByExampleSelective
(
vehicleModelHolidayPrice
,
example
);
if
(
effect
<
1
)
{
throw
new
BaseException
(
"车型节假日更新失败"
);
}
}
}
/**
/**
...
@@ -120,6 +118,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -120,6 +118,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
if
(
StringUtils
.
isNotEmpty
(
vehicleModelHolidayPriceFindDTO
.
getFestival
())
&&
vehicleModelHolidayPriceFindDTO
.
getFestival
().
trim
().
length
()
>
0
)
{
if
(
StringUtils
.
isNotEmpty
(
vehicleModelHolidayPriceFindDTO
.
getFestival
())
&&
vehicleModelHolidayPriceFindDTO
.
getFestival
().
trim
().
length
()
>
0
)
{
criteria
.
andLike
(
"festival"
,
String
.
format
(
"%%%s%%"
,
vehicleModelHolidayPriceFindDTO
.
getFestival
()));
criteria
.
andLike
(
"festival"
,
String
.
format
(
"%%%s%%"
,
vehicleModelHolidayPriceFindDTO
.
getFestival
()));
}
}
criteria
.
andEqualTo
(
"isDel"
,
0
);
List
<
VehicleModelHolidayPrice
>
holidayPrices
=
mapper
.
selectByExample
(
example
);
List
<
VehicleModelHolidayPrice
>
holidayPrices
=
mapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
holidayPrices
))
{
if
(
CollectionUtils
.
isEmpty
(
holidayPrices
))
{
return
vehicleModelHolidayPriceVos
;
return
vehicleModelHolidayPriceVos
;
...
@@ -137,6 +136,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -137,6 +136,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
Date
endDate
=
listMap
.
get
(
festivalId
).
stream
().
map
(
VehicleModelHolidayPrice:
:
getFestivalDay
).
max
(
Date:
:
compareTo
).
get
();
Date
endDate
=
listMap
.
get
(
festivalId
).
stream
().
map
(
VehicleModelHolidayPrice:
:
getFestivalDay
).
max
(
Date:
:
compareTo
).
get
();
vehicleModelHolidayPriceVo
.
setStartDate
(
startDate
);
vehicleModelHolidayPriceVo
.
setStartDate
(
startDate
);
vehicleModelHolidayPriceVo
.
setEndDate
(
endDate
);
vehicleModelHolidayPriceVo
.
setEndDate
(
endDate
);
vehicleModelHolidayPriceVo
.
setId
(
Long
.
valueOf
(
festivalId
));
vehicleModelHolidayPriceVos
.
add
(
vehicleModelHolidayPriceVo
);
vehicleModelHolidayPriceVos
.
add
(
vehicleModelHolidayPriceVo
);
}
}
return
vehicleModelHolidayPriceVos
;
return
vehicleModelHolidayPriceVos
;
...
@@ -164,7 +164,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -164,7 +164,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
modelHolidayPrices
)
{
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
modelHolidayPrices
)
{
vehicleModelHolidayPriceDTO
=
new
VehicleModelHolidayPriceDTO
();
vehicleModelHolidayPriceDTO
=
new
VehicleModelHolidayPriceDTO
();
BeanUtils
.
copyProperties
(
modelHolidayPrice
,
vehicleModelHolidayPriceDTO
);
BeanUtils
.
copyProperties
(
modelHolidayPrice
,
vehicleModelHolidayPriceDTO
);
vehicleModelHolidayPriceDTO
.
setFestival
(
festivalMap
==
null
?
""
:
festivalMap
.
get
(
modelHolidayPrice
.
getFestivalId
()).
getName
());
vehicleModelHolidayPriceDTO
.
setFestival
(
(
festivalMap
==
null
||
null
==
festivalMap
.
get
(
modelHolidayPrice
.
getFestivalId
()))
?
""
:
festivalMap
.
get
(
modelHolidayPrice
.
getFestivalId
()).
getName
());
vehicleModelHolidayPriceDTOS
.
add
(
vehicleModelHolidayPriceDTO
);
vehicleModelHolidayPriceDTOS
.
add
(
vehicleModelHolidayPriceDTO
);
}
}
return
vehicleModelHolidayPriceDTOS
;
return
vehicleModelHolidayPriceDTOS
;
...
@@ -192,6 +192,16 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -192,6 +192,16 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
return
modelHolidayPriceSaveDTO
;
return
modelHolidayPriceSaveDTO
;
}
}
public
void
deleteById
(
Integer
festivalId
){
Example
example
=
new
Example
(
VehicleModelHolidayPrice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"festivalId"
,
festivalId
);
VehicleModelHolidayPrice
vehicleModelHolidayPrice
=
new
VehicleModelHolidayPrice
();
vehicleModelHolidayPrice
.
setIsDel
(
1
);
mapper
.
updateByExampleSelective
(
vehicleModelHolidayPrice
,
example
);
festivalBiz
.
deleteById
(
festivalId
);
}
/**
/**
* 设置查询条件日期
* 设置查询条件日期
*
*
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleModelHolidayPriceMapper.java
View file @
b6131c24
...
@@ -11,4 +11,5 @@ import tk.mybatis.mapper.common.Mapper;
...
@@ -11,4 +11,5 @@ import tk.mybatis.mapper.common.Mapper;
* @data 2019/10/14 17:32
* @data 2019/10/14 17:32
*/
*/
public
interface
VehicleModelHolidayPriceMapper
extends
Mapper
<
VehicleModelHolidayPrice
>,
InsertListMapper
<
VehicleModelHolidayPrice
>
{
public
interface
VehicleModelHolidayPriceMapper
extends
Mapper
<
VehicleModelHolidayPrice
>,
InsertListMapper
<
VehicleModelHolidayPrice
>
{
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelCalendarPriceController.java
View file @
b6131c24
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.date.DateUtil
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
@@ -12,6 +13,7 @@ import lombok.RequiredArgsConstructor;
...
@@ -12,6 +13,7 @@ import lombok.RequiredArgsConstructor;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
...
@@ -51,13 +53,16 @@ public class VehicleModelCalendarPriceController {
...
@@ -51,13 +53,16 @@ public class VehicleModelCalendarPriceController {
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceVos
);
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceVos
);
}
}
@GetMapping
(
"/price"
)
@GetMapping
(
value
=
"/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Date
startDate
,
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
)
Date
endDate
,
@RequestParam
(
value
=
"endDate"
)
Long
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
)
{
@RequestParam
(
value
=
"userId"
)
Integer
userId
)
{
startDate
=
Date
.
from
(
startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
().
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
endDate
=
Date
.
from
(
endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
().
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
Date
startDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
startDate
));
return
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDate
,
endDate
,
vehicleModelId
,
userId
);
//Date.from(startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
Date
endDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
endDate
));
//Date.from(endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDateDay
,
endDateDay
,
vehicleModelId
,
userId
));
}
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/VehicleModelHolidayPriceAdminController.java
View file @
b6131c24
...
@@ -35,15 +35,27 @@ public class VehicleModelHolidayPriceAdminController {
...
@@ -35,15 +35,27 @@ public class VehicleModelHolidayPriceAdminController {
}
}
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
public
ObjectRestResponse
<
VehicleModelHolidayPriceSaveDTO
>
findVehicleModelHolidayPrice
(
@PathVariable
(
value
=
"id"
)
Long
id
){
public
ObjectRestResponse
<
VehicleModelHolidayPriceSaveDTO
>
findVehicleModelHolidayPrice
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
VehicleModelHolidayPriceSaveDTO
vehicleModelHolidayPriceSaveDTO
=
vehicleModelHolidayPriceBiz
.
findVehicleModelHolidayPriceFestivalId
(
id
);
VehicleModelHolidayPriceSaveDTO
vehicleModelHolidayPriceSaveDTO
=
vehicleModelHolidayPriceBiz
.
findVehicleModelHolidayPriceFestivalId
(
id
);
return
ObjectRestResponse
.
succ
(
vehicleModelHolidayPriceSaveDTO
);
return
ObjectRestResponse
.
succ
(
vehicleModelHolidayPriceSaveDTO
);
}
}
@ApiOperation
(
"节假日页查询"
)
@ApiOperation
(
"节假日页查询"
)
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
public
ObjectRestResponse
<
List
<
VehicleModelHolidayPriceVo
>>
listVehicleModelHolidayPrice
(
@RequestBody
VehicleModelHolidayPriceFindDTO
vehicleModelHolidayPriceFindDTO
){
public
ObjectRestResponse
<
List
<
VehicleModelHolidayPriceVo
>>
listVehicleModelHolidayPrice
(
@RequestBody
VehicleModelHolidayPriceFindDTO
vehicleModelHolidayPriceFindDTO
)
{
List
<
VehicleModelHolidayPriceVo
>
priceVoPageDataVO
=
vehicleModelHolidayPriceBiz
.
listVehicleModelHolidayPrice
(
vehicleModelHolidayPriceFindDTO
);
List
<
VehicleModelHolidayPriceVo
>
priceVoPageDataVO
=
vehicleModelHolidayPriceBiz
.
listVehicleModelHolidayPrice
(
vehicleModelHolidayPriceFindDTO
);
return
ObjectRestResponse
.
succ
(
priceVoPageDataVO
);
return
ObjectRestResponse
.
succ
(
priceVoPageDataVO
);
}
}
@DeleteMapping
(
"/{id}"
)
public
ObjectRestResponse
<
Void
>
delete
(
@PathVariable
(
value
=
"id"
)
Integer
id
)
{
vehicleModelHolidayPriceBiz
.
deleteById
(
id
);
return
ObjectRestResponse
.
succ
();
}
@PutMapping
(
"/update"
)
public
ObjectRestResponse
<
Void
>
update
(
@RequestParam
(
value
=
"multiple"
,
required
=
false
)
Double
multiple
,
@RequestParam
(
value
=
"freeDays"
,
required
=
false
)
Integer
freeDays
)
{
vehicleModelHolidayPriceBiz
.
updateVehicleModelHolidayPrice
(
multiple
,
freeDays
);
return
ObjectRestResponse
.
succ
();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
b6131c24
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
cb.town_name AS `townName`,
cb.town_name AS `townName`,
bc.addr_detail AS `address`,
bc.addr_detail AS `address`,
bc.NAME AS `name`,
bc.NAME AS `name`,
cb.name AS `companyName`,
cb.cover,
cb.cover,
bc.leader,
bc.leader,
bc.leader_contact_info AS `leaderContactInfo`,
bc.leader_contact_info AS `leaderContactInfo`,
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBookRecordMapper.xml
View file @
b6131c24
...
@@ -490,15 +490,33 @@
...
@@ -490,15 +490,33 @@
#{id}
#{id}
</foreach>
)
</foreach>
)
</if>
</if>
<if
test=
"status != null and status != 0 and status != -1 and status != -2"
>
<if
test=
"status != null and status != 0 and status != -1 and status != -2
and status != 3 and status != 5 and status != 7
"
>
and v1.status = #{status}
and v1.status = #{status}
</if>
</if>
<if
test=
"status != null and status == 3 "
>
and v4.id is null and v1.status = 2
</if>
<if
test=
"status != null and status == 5 "
>
and v4.id is not null and v1.status = 2 and v4.state = 0
</if>
<if
test=
"status != null and status == 7 "
>
and v4.id is not null and v1.status = 2 and v4.state = 1
</if>
<if
test=
"status != null and status == 0 "
>
<if
test=
"status != null and status == 0 "
>
and v4.state = 0
and v4.state = 0
</if>
</if>
<if
test=
"status != null and status == -1 "
>
<if
test=
"status != null and status == -1 "
>
and v4.state = 1
and v4.state = 1
</if>
</if>
<if
test=
"status != null and status == 3 "
>
and v4.id is null and v1.status = 2
</if>
<if
test=
"status != null and status == 5 "
>
and v4.id is not null and v1.status = 2 and v4.state = 0
</if>
<if
test=
"status != null and status == 7 "
>
and v4.id is not null and v1.status = 2 and v4.state = 1
</if>
<if
test=
"code != null"
>
<if
test=
"code != null"
>
and v3.code = #{code}
and v3.code = #{code}
</if>
</if>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
b6131c24
...
@@ -41,11 +41,10 @@
...
@@ -41,11 +41,10 @@
SELECT r.* FROM (
SELECT r.* FROM (
select DISTINCT v.`id`,
select DISTINCT v.`id`,
v.`code`,
v.`code`,
v.`status`,
(CASE WHEN #{status} != null THEN #{status}
ELSE v.status END) status ,
v.number_plate,
v.number_plate,
v.brand,
v.brand,
-- IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
-- IFNULL(bc.name,bc1.name) AS subBranchName,
v.park_branch_company_id,
v.park_branch_company_id,
bc.name as parkBranchCompanyName,
bc.name as parkBranchCompanyName,
v.expect_destination_branch_company_id,
v.expect_destination_branch_company_id,
...
@@ -80,15 +79,13 @@
...
@@ -80,15 +79,13 @@
left join
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
</if>
-- LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
-- LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
-- 停车分公司
-- 停车分公司
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
-- 目的地分公司
-- 目的地分公司
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
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
LEFT JOIN vehicle_book_record v2 on v2.
vehicle_id = v.id
LEFT JOIN vehicle_book_record v2 on v2.
id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
where
where
v.is_del=0
v.is_del=0
...
@@ -116,15 +113,15 @@
...
@@ -116,15 +113,15 @@
<if
test=
"insuranceCompany !=null"
>
<if
test=
"insuranceCompany !=null"
>
and v.insurance_company = #{insuranceCompany}
and v.insurance_company = #{insuranceCompany}
</if>
</if>
<if
test=
"belongToName !=null"
>
<if
test=
"belongToName !=null
and belongToName != ''
"
>
and v.belong_to_name
= #{belongToName}
and v.belong_to_name
like concat('%',#{belongToName},'%')
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
and v.vin = #{vin}
</if>
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<!-- </if>-->
<if
test=
"code !=null"
>
<if
test=
"code !=null"
>
and v.code = #{code}
and v.code = #{code}
</if>
</if>
...
@@ -174,7 +171,6 @@
...
@@ -174,7 +171,6 @@
and bc.zone_id=#{zoneId}
and bc.zone_id=#{zoneId}
</if>
</if>
</if>
</if>
order by v.code
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
...
@@ -183,7 +179,8 @@
...
@@ -183,7 +179,8 @@
SELECT r.* FROM (
SELECT r.* FROM (
select DISTINCT v.`id`,
select DISTINCT v.`id`,
v.`code`,
v.`code`,
v.`status`,
(CASE WHEN #{status} != null THEN #{status}
ELSE v.status END) status ,
v.number_plate,
v.number_plate,
v.brand,
v.brand,
-- IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
-- IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
...
@@ -228,6 +225,8 @@
...
@@ -228,6 +225,8 @@
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
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
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
where
where
v.is_del=0
v.is_del=0
<if
test=
"companyList != null"
>
<if
test=
"companyList != null"
>
...
@@ -277,21 +276,27 @@
...
@@ -277,21 +276,27 @@
<if
test=
"insuranceCompany !=null"
>
<if
test=
"insuranceCompany !=null"
>
and v.insurance_company = #{insuranceCompany}
and v.insurance_company = #{insuranceCompany}
</if>
</if>
<if
test=
"belongToName !=null"
>
<if
test=
"belongToName !=null
and belongToName != ''
"
>
and v.belong_to_name
= #{belongToName}
and v.belong_to_name
like concat('%',#{belongToName},'%')
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
and v.vin = #{vin}
</if>
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<!-- </if>-->
<if
test=
"code !=null"
>
<if
test=
"code !=null"
>
and v.code = #{code}
and v.code = #{code}
</if>
</if>
<if
test=
"status !=null"
>
<if
test=
"status !=null
and status != 6 and status != 7
"
>
and v.status = #{status}
and v.status = #{status}
</if>
</if>
<if
test=
"status !=null and status == 6"
>
and v3.id is not NULL and v2.book_type = 3 and v3.state = 0
</if>
<if
test=
"status !=null and status == 7"
>
and v3.id is not NULL and v2.book_type = 6 and v3.state = 0
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate like concat('%',#{numberPlate},'%')
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
</if>
...
@@ -329,7 +334,6 @@
...
@@ -329,7 +334,6 @@
and bc.zone_id=#{zoneId}
and bc.zone_id=#{zoneId}
</if>
</if>
</if>
</if>
order by v.code
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
...
...
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