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
f7cc11cc
Commit
f7cc11cc
authored
Oct 24, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'holiday-price' into dev
parents
de9c6b4c
49276bda
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
30 deletions
+37
-30
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+2
-2
OrderItemBiz.java
...c/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
+1
-1
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
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+7
-9
VehicleModelCalendarPriceDTO.java
...atform/vehicle/pojo/dto/VehicleModelCalendarPriceDTO.java
+0
-1
VehicleModelHolidayPriceBiz.java
...xfc/platform/vehicle/biz/VehicleModelHolidayPriceBiz.java
+2
-1
VehicleModelCalendarPriceController.java
...orm/vehicle/rest/VehicleModelCalendarPriceController.java
+13
-8
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
f7cc11cc
...
...
@@ -347,10 +347,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
setType
(
crosstownTypeEnum
);
}});
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
orderMQDTO
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
if
(
null
==
crosstown
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
StrUtil
.
format
(
"退款第一部分押金失败,获取不了还车/定损记录,订单号:{}, crosstownTypeEnum: {}"
,
orderMQDTO
.
getId
(),
crosstownTypeEnum
)));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
View file @
f7cc11cc
...
...
@@ -55,7 +55,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
//根据延期的天数算出 对应的日期价格
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
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
)
{
overAmountList
.
add
((
VMCalendarPriceCostDTO
)
vmcpd
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
f7cc11cc
...
...
@@ -245,10 +245,10 @@ public class OrderCalculateBiz {
}
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
());
setOrderId
(
baseOrder
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
Integer
freeDays
=
(
null
==
vehicleItemDTO
.
getCutNum
())?
0
:
vehicleItemDTO
.
getCutNum
();
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 @
f7cc11cc
...
...
@@ -139,10 +139,10 @@ public class OrderCancelBiz {
setOrderId
(
baseOrder
.
getId
());
}});
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
baseOrder
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
//如果超过出发时间,不能取消订单
//根据时间处理goodsAmount
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
f7cc11cc
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
...
...
@@ -93,10 +94,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
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
());
setOrderId
(
orderPageVO
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
if
(
timeLag
<
0
)
{
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
f7cc11cc
...
...
@@ -238,11 +238,14 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
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
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
damageSafeOrderItem
=
orderItemBiz
.
initOrderItem
(
DAMAGE_SAFE
,
detail
.
getDayNum
(),
"免赔费用"
,
null
,
ItemTypeEnum
.
DAMAGE_SAFE
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
f7cc11cc
...
...
@@ -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.BranchCompanyListVO
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
/**
* Created by ace on 2017/9/15.
...
...
@@ -190,11 +188,11 @@ public interface VehicleFeign {
* @param userId
* @return
*/
@GetMapping
(
"/vehicle_model/calendar_price/app/unauth/price"
)
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Date
startDate
,
@RequestParam
(
value
=
"endDate"
)
Date
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
);
@GetMapping
(
value
=
"/vehicle_model/calendar_price/app/unauth/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
)
Long
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
);
@GetMapping
(
value
=
"/bookRecord/get"
)
public
ObjectRestResponse
<
List
<
BookRecordUpdateLog
>>
get
(
@RequestParam
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehicleModelCalendarPriceDTO.java
View file @
f7cc11cc
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelHolidayPriceBiz.java
View file @
f7cc11cc
...
...
@@ -154,6 +154,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
Example
example
=
new
Example
(
VehicleModelHolidayPrice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andBetween
(
"festivalDay"
,
startDate
,
endDate
);
criteria
.
andEqualTo
(
"isDel"
,
0
);
List
<
VehicleModelHolidayPrice
>
modelHolidayPrices
=
mapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
modelHolidayPrices
))
{
return
vehicleModelHolidayPriceDTOS
;
...
...
@@ -164,7 +165,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
modelHolidayPrices
)
{
vehicleModelHolidayPriceDTO
=
new
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
);
}
return
vehicleModelHolidayPriceDTOS
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelCalendarPriceController.java
View file @
f7cc11cc
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.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
...
@@ -12,6 +13,7 @@ import lombok.RequiredArgsConstructor;
import
lombok.SneakyThrows
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDate
;
...
...
@@ -51,13 +53,16 @@ public class VehicleModelCalendarPriceController {
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceVos
);
}
@GetMapping
(
"/price"
)
public
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Date
startDate
,
@RequestParam
(
value
=
"endDate"
)
Date
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@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
());
return
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDate
,
endDate
,
vehicleModelId
,
userId
);
@GetMapping
(
value
=
"/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
)
Long
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
)
{
Date
startDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
startDate
));
//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
));
}
}
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