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
463552c3
Commit
463552c3
authored
Dec 03, 2020
by
xiaosl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-chw' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev-chw
parents
0dbbfc0e
fcdfb77f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
122 additions
and
40 deletions
+122
-40
BaseOrder.java
...c/main/java/com/xxfc/platform/order/entity/BaseOrder.java
+3
-0
OrderItem.java
...c/main/java/com/xxfc/platform/order/entity/OrderItem.java
+4
-0
OrderPersonInsurance.java
.../com/xxfc/platform/order/entity/OrderPersonInsurance.java
+1
-1
OrderPageVO.java
.../java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
+2
-0
RentVehiclePriceVO.java
...om/xxfc/platform/order/pojo/price/RentVehiclePriceVO.java
+12
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+1
-1
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+36
-27
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+4
-0
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+26
-1
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+9
-0
BgOrderPersonInsuranceController.java
...der/rest/background/BgOrderPersonInsuranceController.java
+1
-1
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+23
-9
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/BaseOrder.java
View file @
463552c3
...
@@ -376,4 +376,7 @@ public class BaseOrder implements Serializable {
...
@@ -376,4 +376,7 @@ public class BaseOrder implements Serializable {
@Column
(
name
=
"insure_status"
)
@Column
(
name
=
"insure_status"
)
private
Integer
insureStatus
;
private
Integer
insureStatus
;
@Column
(
name
=
"insure_amount"
)
private
BigDecimal
insureAmount
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderItem.java
View file @
463552c3
...
@@ -126,6 +126,10 @@ public class OrderItem implements Serializable {
...
@@ -126,6 +126,10 @@ public class OrderItem implements Serializable {
@ApiModelProperty
(
value
=
"真实的总价"
)
@ApiModelProperty
(
value
=
"真实的总价"
)
private
BigDecimal
realAmount
;
private
BigDecimal
realAmount
;
public
void
setRealAmount
(
BigDecimal
realAmount
)
{
this
.
realAmount
=
realAmount
;
}
/**
/**
* 订单id
* 订单id
*/
*/
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderPersonInsurance.java
View file @
463552c3
...
@@ -104,7 +104,7 @@ public class OrderPersonInsurance implements Serializable {
...
@@ -104,7 +104,7 @@ public class OrderPersonInsurance implements Serializable {
*/
*/
@Column
(
name
=
"pay_time"
)
@Column
(
name
=
"pay_time"
)
@ApiModelProperty
(
value
=
"支付时间"
)
@ApiModelProperty
(
value
=
"支付时间"
)
private
Long
pay
t
ime
;
private
Long
pay
T
ime
;
/**
/**
* 退款时间
* 退款时间
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
View file @
463552c3
...
@@ -76,6 +76,8 @@ public class OrderPageVO extends BaseOrder {
...
@@ -76,6 +76,8 @@ public class OrderPageVO extends BaseOrder {
private
List
<
OrderItem
>
items
;
private
List
<
OrderItem
>
items
;
private
List
<
OrderPersonInsurance
>
insurances
;
public
void
setQrcodeStr
(
String
prefix
)
{
public
void
setQrcodeStr
(
String
prefix
)
{
this
.
qrcodeStr
=
prefix
+
"?"
+
TYPE
+
getType
()+
"&"
+
NO
+
getNo
();
this
.
qrcodeStr
=
prefix
+
"?"
+
TYPE
+
getType
()+
"&"
+
NO
+
getNo
();
}
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/price/RentVehiclePriceVO.java
View file @
463552c3
...
@@ -95,4 +95,16 @@ public class RentVehiclePriceVO extends OrderPriceVO{
...
@@ -95,4 +95,16 @@ public class RentVehiclePriceVO extends OrderPriceVO{
//标记是否单价一样
//标记是否单价一样
private
Integer
sameUnitPrice
=
1
;
private
Integer
sameUnitPrice
=
1
;
//是否买人身保险
private
Integer
needPersonInsurance
=
0
;
//保险个数
private
Integer
personInsureNum
=
0
;
//保险单价
private
BigDecimal
personInsurePrice
=
BigDecimal
.
ZERO
;
//保险总价
private
BigDecimal
personInsureAmount
=
BigDecimal
.
ZERO
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
463552c3
...
@@ -855,7 +855,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
...
@@ -855,7 +855,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
//更新 申请状态
//更新 申请状态
insuranceList
.
forEach
(
insurance
->
{
insuranceList
.
forEach
(
insurance
->
{
insurance
.
setStatus
(
STATUS_PAY
);
insurance
.
setStatus
(
STATUS_PAY
);
insurance
.
setPay
t
ime
(
DateUtil
.
date
().
getTime
());
insurance
.
setPay
T
ime
(
DateUtil
.
date
().
getTime
());
});
});
}
}
}
finally
{
}
finally
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
463552c3
...
@@ -51,6 +51,7 @@ import java.util.*;
...
@@ -51,6 +51,7 @@ import java.util.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
BaseOrder
.
INSURE_STATUS_CNL
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
OrderPersonInsurance
.*;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
OrderPersonInsurance
.*;
import
static
com
.
xxfc
.
platform
.
order
.
contant
.
enumerate
.
AccountTypeEnum
.
OUT_RESIDUE_ORDER
;
import
static
com
.
xxfc
.
platform
.
order
.
contant
.
enumerate
.
AccountTypeEnum
.
OUT_RESIDUE_ORDER
;
import
static
com
.
xxfc
.
platform
.
order
.
pojo
.
account
.
OrderAccountDeduction
.
ORIGIN_DEPOSIT
;
import
static
com
.
xxfc
.
platform
.
order
.
pojo
.
account
.
OrderAccountDeduction
.
ORIGIN_DEPOSIT
;
...
@@ -137,6 +138,14 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -137,6 +138,14 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if
(
null
!=
orderDeductSource
&&
BigDecimal
.
ZERO
.
compareTo
(
orderDeductSource
)
<
0
)
{
if
(
null
!=
orderDeductSource
&&
BigDecimal
.
ZERO
.
compareTo
(
orderDeductSource
)
<
0
)
{
BigDecimal
orderDeductAmount
=
calculateDeduction
(
orderDeductSource
,
timeLag
,
dicParentKey
,
orderRefundDescBuilder
);
BigDecimal
orderDeductAmount
=
calculateDeduction
(
orderDeductSource
,
timeLag
,
dicParentKey
,
orderRefundDescBuilder
);
Integer
dayLag
=
Long
.
valueOf
(
timeLag
/(
1000L
*
60L
*
60L
*
24L
)).
intValue
();
if
(
dayLag
<=
0
&&
baseOrder
.
getInsureAmount
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
//扣钱
orderDeductAmount
=
orderDeductAmount
.
add
(
baseOrder
.
getInsureAmount
());
orderRefundDescBuilder
=
orderRefundDescBuilder
.
insert
(
0
,
"小于24小时扣除保险费"
);
}
//如果属于免扣费情况
//如果属于免扣费情况
if
(
noDeduct
)
{
if
(
noDeduct
)
{
orderDeductAmount
=
BigDecimal
.
ZERO
;
orderDeductAmount
=
BigDecimal
.
ZERO
;
...
@@ -172,33 +181,33 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -172,33 +181,33 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
BigDecimal
originalDepositRefundAmount
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
BigDecimal
originalDepositRefundAmount
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
BigDecimal
depositRefundAmount
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
BigDecimal
depositRefundAmount
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
if
(
null
!=
depositDeductSource
&&
BigDecimal
.
ZERO
.
compareTo
(
depositDeductSource
)
<
0
)
{
//
if(null != depositDeductSource && BigDecimal.ZERO.compareTo(depositDeductSource) < 0) {
//通过原扣除款 计算剩余款
//
//通过原扣除款 计算剩余款
BigDecimal
depositDeductAmount
=
calculateDeduction
(
depositDeductSource
,
timeLag
,
dicParentKey
,
depositRefundDescBuilder
);
//
BigDecimal depositDeductAmount = calculateDeduction(depositDeductSource, timeLag, dicParentKey, depositRefundDescBuilder);
//如果属于免扣费情况
//
//如果属于免扣费情况
if
(
noDeduct
)
{
//
if(noDeduct) {
depositDeductAmount
=
BigDecimal
.
ZERO
;
//
depositDeductAmount = BigDecimal.ZERO;
depositRefundDescBuilder
=
new
StringBuilder
(
""
);
//
depositRefundDescBuilder = new StringBuilder("");
}
//
}
depositDeductAmount
=
depositDeductAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
//
depositDeductAmount = depositDeductAmount.setScale(2, RoundingMode.HALF_UP);
if
(
null
!=
orderViolateCoverAmount
)
{
//
if(null != orderViolateCoverAmount) {
depositDeductAmount
=
orderViolateCoverAmount
;
//
depositDeductAmount = orderViolateCoverAmount;
}
//
}
if
(
null
!=
depositViolateCoverAmount
)
{
//
if (null != depositViolateCoverAmount) {
depositDeductAmount
=
depositViolateCoverAmount
;
//
depositDeductAmount = depositViolateCoverAmount;
}
//
}
if
(
topAmount
.
compareTo
(
depositDeductAmount
)
>
0
)
{
//
if(topAmount.compareTo(depositDeductAmount) > 0) {
totalDeductAmount
=
totalDeductAmount
.
add
(
depositDeductAmount
);
//
totalDeductAmount = totalDeductAmount.add(depositDeductAmount);
topAmount
=
topAmount
.
subtract
(
depositDeductAmount
);
//
topAmount = topAmount.subtract(depositDeductAmount);
}
else
{
//
}else {
totalDeductAmount
=
totalDeductAmount
.
add
(
topAmount
);
//
totalDeductAmount = totalDeductAmount.add(topAmount);
depositDeductAmount
=
topAmount
;
//
depositDeductAmount = topAmount;
topAmount
=
BigDecimal
.
ZERO
;
//
topAmount = BigDecimal.ZERO;
}
//
}
//
//返回押金
//
//返回押金
depositRefundAmount
=
originalDepositRefundAmount
.
subtract
(
depositDeductAmount
);
//
depositRefundAmount = originalDepositRefundAmount.subtract(depositDeductAmount);
}
//
}
//设置违章款账单
//设置违章款账单
StringBuilder
stringBuilder
=
new
StringBuilder
(
""
);
StringBuilder
stringBuilder
=
new
StringBuilder
(
""
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
463552c3
...
@@ -123,6 +123,10 @@ public class OrderCalculateBiz implements CalculateInterface {
...
@@ -123,6 +123,10 @@ public class OrderCalculateBiz implements CalculateInterface {
//其他消费金额 = 商品真实价格 - 主要商品真实价格 = (商品价格 - 优惠价格)- 主要商品真实价格
//其他消费金额 = 商品真实价格 - 主要商品真实价格 = (商品价格 - 优惠价格)- 主要商品真实价格
BigDecimal
otherItemRealAmount
=
goodsRealAmount
.
subtract
(
vehicleItemDTO
.
getRealAmount
());
BigDecimal
otherItemRealAmount
=
goodsRealAmount
.
subtract
(
vehicleItemDTO
.
getRealAmount
());
// //人身保险费用处理
// Long dayLong = 1000L * 60L * 60L * 24L;
// if()
InProgressVO
inProgressVO
=
new
InProgressVO
();
InProgressVO
inProgressVO
=
new
InProgressVO
();
inProgressVO
.
setUsedDays
(
useDays
);
inProgressVO
.
setUsedDays
(
useDays
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
463552c3
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.order.biz.inner;
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.order.biz.inner;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.date.DateUtil
;
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.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
...
@@ -44,6 +45,8 @@ import java.util.List;
...
@@ -44,6 +45,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
OrderPersonInsurance
.
STATUS_CNL
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
OrderPersonInsurance
.
STATUS_PAY
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.*;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.*;
/**
/**
...
@@ -93,6 +96,9 @@ public class OrderCancelBiz {
...
@@ -93,6 +96,9 @@ public class OrderCancelBiz {
@Autowired
@Autowired
SpecialRentBiz
specialRentBiz
;
SpecialRentBiz
specialRentBiz
;
@Autowired
OrderPersonInsuranceBiz
orderPersonInsuranceBiz
;
@Autowired
@Autowired
RabbitProduct
rabbitProduct
;
RabbitProduct
rabbitProduct
;
...
@@ -264,7 +270,8 @@ public class OrderCancelBiz {
...
@@ -264,7 +270,8 @@ public class OrderCancelBiz {
//退款流程
//退款流程
//违约金封顶 租车身份价 * 2天
//违约金封顶 租车身份价 * 2天
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
BigDecimal
.
ZERO
,
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
vehicleItemDTO
.
getBuyAmount
(),
oad
,
vehicleItemDTO
.
getTopAmount
(
0
),
null
,
changeViolateAmount
,
(!
overCancelBuffer
));
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
vehicleItemDTO
.
getBuyAmount
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
BigDecimal
.
ZERO
,
oad
,
vehicleItemDTO
.
getTopAmount
(
0
),
null
,
changeViolateAmount
,
(!
overCancelBuffer
));
//设置订单数据
//设置订单数据
//baseOrder.setDamagesAmount(csv.getDamagesAmount());
//baseOrder.setDamagesAmount(csv.getDamagesAmount());
...
@@ -295,6 +302,24 @@ public class OrderCancelBiz {
...
@@ -295,6 +302,24 @@ public class OrderCancelBiz {
}
}
}
}
}
}
//设置人身保险状态
if
(
BaseOrder
.
INSURE_STATUS_BUY
==
baseOrder
.
getInsureStatus
())
{
List
<
OrderPersonInsurance
>
insuranceList
=
orderPersonInsuranceBiz
.
selectList
(
new
OrderPersonInsurance
(){{
setOrderId
(
baseOrder
.
getId
());
}});
Integer
dayLag
=
Long
.
valueOf
(
timeLag
/(
1000L
*
60L
*
60L
*
24L
)).
intValue
();
if
(
dayLag
<=
0
)
{
baseOrder
.
setInsureStatus
(
BaseOrder
.
INSURE_STATUS_CNL
);
//更新 申请状态
insuranceList
.
forEach
(
insurance
->
{
insurance
.
setStatus
(
STATUS_CNL
);
insurance
.
setRefundTime
(
DateUtil
.
date
().
getTime
());
});
}
}
}
}
//已付款的取消订单发送消息
//已付款的取消订单发送消息
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
463552c3
...
@@ -60,6 +60,7 @@ import java.util.Map;
...
@@ -60,6 +60,7 @@ import java.util.Map;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
BaseOrder
.
INSURE_STATUS_NOT
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
BaseOrder
.
ORDER_TYPE_VEHICLE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
BaseOrder
.
ORDER_TYPE_VEHICLE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
RENT_PERSON_INSURANCE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
RENT_PERSON_INSURANCE
;
...
@@ -113,6 +114,9 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -113,6 +114,9 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@Autowired
@Autowired
OrderDepositRefundRecordBiz
orderDepositRefundRecordBiz
;
OrderDepositRefundRecordBiz
orderDepositRefundRecordBiz
;
@Autowired
OrderPersonInsuranceBiz
orderPersonInsuranceBiz
;
@Override
@Override
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
return
userFeign
;
return
userFeign
;
...
@@ -260,6 +264,11 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -260,6 +264,11 @@ public class BaseOrderController extends CommonBaseController implements UserRes
}
}
log
.
info
(
"no:"
+
no
+
",时间戳:"
+
System
.
currentTimeMillis
());
log
.
info
(
"no:"
+
no
+
",时间戳:"
+
System
.
currentTimeMillis
());
OrderPageVO
orderPageVO
=
page
.
getData
().
get
(
0
);
OrderPageVO
orderPageVO
=
page
.
getData
().
get
(
0
);
if
(
INSURE_STATUS_NOT
!=
orderPageVO
.
getInsureStatus
())
{
orderPageVO
.
setInsurances
(
orderPersonInsuranceBiz
.
selectList
(
new
OrderPersonInsurance
(){{
setOrderId
(
orderPageVO
.
getId
());
}}));
}
orderPageVO
.
setQrcodeStr
(
qrcodePrefix
);
orderPageVO
.
setQrcodeStr
(
qrcodePrefix
);
orderPageVO
.
setItems
(
orderItemBiz
.
selectList
(
new
OrderItem
(){{
orderPageVO
.
setItems
(
orderItemBiz
.
selectList
(
new
OrderItem
(){{
setOrderId
(
orderPageVO
.
getId
());
setOrderId
(
orderPageVO
.
getId
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/BgOrderPersonInsuranceController.java
View file @
463552c3
...
@@ -88,7 +88,7 @@ public class BgOrderPersonInsuranceController extends BaseController<OrderPerson
...
@@ -88,7 +88,7 @@ public class BgOrderPersonInsuranceController extends BaseController<OrderPerson
String
startStr
=
DateUtil
.
date
(
vo
.
getStartTime
()).
toDateStr
();
String
startStr
=
DateUtil
.
date
(
vo
.
getStartTime
()).
toDateStr
();
String
endStr
=
DateUtil
.
date
(
vo
.
getEndTime
()).
toDateStr
();
String
endStr
=
DateUtil
.
date
(
vo
.
getEndTime
()).
toDateStr
();
ped
.
setRentDateStr
(
startStr
+
"-"
+
endStr
);
ped
.
setRentDateStr
(
startStr
+
"-"
+
endStr
);
ped
.
setPayTimeStr
(
DateUtil
.
date
(
vo
.
getPay
t
ime
()).
toString
());
ped
.
setPayTimeStr
(
DateUtil
.
date
(
vo
.
getPay
T
ime
()).
toString
());
list
.
add
(
BeanUtil
.
beanToMap
(
ped
,
false
,
true
));
list
.
add
(
BeanUtil
.
beanToMap
(
ped
,
false
,
true
));
});
});
return
list
;
return
list
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
463552c3
...
@@ -443,6 +443,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -443,6 +443,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
private
RentVehiclePriceVO
dayCalculatePrice
(
RentVehicleBO
detail
)
{
private
RentVehiclePriceVO
dayCalculatePrice
(
RentVehicleBO
detail
)
{
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
BigDecimal
realAmount
=
BigDecimal
.
ZERO
;
BigDecimal
realAmount
=
BigDecimal
.
ZERO
;
BigDecimal
orderAmount
=
BigDecimal
.
ZERO
;
BigDecimal
orderAmount
=
BigDecimal
.
ZERO
;
BigDecimal
goodsAmount
=
BigDecimal
.
ZERO
;
BigDecimal
goodsAmount
=
BigDecimal
.
ZERO
;
...
@@ -561,16 +562,30 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -561,16 +562,30 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
}
if
(
SYS_TRUE
==
detail
.
getNeedPersonInsurance
()
&&
CollUtil
.
isNotEmpty
(
detail
.
getInsurances
()))
{
if
(
SYS_TRUE
==
detail
.
getNeedPersonInsurance
()
&&
CollUtil
.
isNotEmpty
(
detail
.
getInsurances
()))
{
for
(
OrderPersonInsurance
opi
:
detail
.
getInsurances
())
{
rvp
.
setNeedPersonInsurance
(
SYS_TRUE
);
opi
.
setOrderDay
(
detail
.
getDayNum
());
OrderPersonInsurance
metaopi
=
new
OrderPersonInsurance
();
//计算天数
//计算天数
orderAccountBiz
.
calculatePersonInsurance
(
detail
.
getStartTime
(),
detail
.
getEndTime
(),
opi
);
orderAccountBiz
.
calculatePersonInsurance
(
detail
.
getStartTime
(),
detail
.
getEndTime
(),
metaopi
);
if
(
STATUS_TOPAY
==
opi
.
getStatus
())
{
if
(
STATUS_TOPAY
==
metaopi
.
getStatus
())
{
for
(
OrderPersonInsurance
opi
:
detail
.
getInsurances
())
{
opi
.
setOrderDay
(
detail
.
getDayNum
());
opi
.
setAmount
(
metaopi
.
getAmount
());
opi
.
setStatus
(
metaopi
.
getStatus
());
opi
.
setInsuranceDay
(
metaopi
.
getInsuranceDay
());
opi
.
setStartTime
(
metaopi
.
getStartTime
());
opi
.
setEndTime
(
metaopi
.
getEndTime
());
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
detail
.
getItems
().
add
(
personInsuranceOrderItem
);
personInsuranceAmount
=
personInsuranceAmount
.
add
(
opi
.
getAmount
());
personInsuranceAmount
=
personInsuranceAmount
.
add
(
opi
.
getAmount
());
}
}
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
metaopi
.
getAmount
(),
detail
.
getConfirmInsurances
().
size
(),
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
metaopi
));
personInsuranceOrderItem
.
getCalculateAmount
(
true
);
rvp
.
setPersonInsureNum
(
personInsuranceOrderItem
.
getBuyNum
());
rvp
.
setPersonInsurePrice
(
metaopi
.
getAmount
());
rvp
.
setPersonInsureAmount
(
personInsuranceOrderItem
.
getRealAmount
());
detail
.
getItems
().
add
(
personInsuranceOrderItem
);
}
else
{
throw
new
BaseException
(
"人身保险信息不正确"
,
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
}
}
}
...
@@ -613,7 +628,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -613,7 +628,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
realAmount
=
orderAmount
.
subtract
(
couponAmount
);
realAmount
=
orderAmount
.
subtract
(
couponAmount
);
//生成订单明细
//生成订单明细
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
rvp
.
setOrderSign
(
detail
.
getOrderSign
());
rvp
.
setOrderSign
(
detail
.
getOrderSign
());
rvp
.
setPriceType
(
vehicle
.
getPriceType
());
rvp
.
setPriceType
(
vehicle
.
getPriceType
());
rvp
.
setDeposit
(
depositAmount
);
rvp
.
setDeposit
(
depositAmount
);
...
@@ -746,7 +760,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -746,7 +760,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
detail
.
getItems
().
add
(
personInsuranceOrderItem
);
detail
.
getItems
().
add
(
personInsuranceOrderItem
);
personInsuranceAmount
=
personInsuranceAmount
.
add
(
opi
.
getAmount
(
));
personInsuranceAmount
=
personInsuranceAmount
.
add
(
personInsuranceOrderItem
.
getCalculateAmount
(
Boolean
.
TRUE
));
}
}
}
}
}
}
...
...
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