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
10fc4c07
Commit
10fc4c07
authored
Nov 30, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature_chw_zjw' into dev-chw
parents
0bb42be1
bded309f
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
116 additions
and
56 deletions
+116
-56
OrderPersonInsurance.java
.../com/xxfc/platform/order/entity/OrderPersonInsurance.java
+6
-2
OrderItemInter.java
.../com/xxfc/platform/order/entity/inter/OrderItemInter.java
+11
-0
OrderAboutParamDTO.java
...om/xxfc/platform/order/pojo/order/OrderAboutParamDTO.java
+6
-0
RentVehicleBO.java
...ava/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
+8
-0
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+14
-8
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+4
-0
AbstractOrderHandle.java
.../com/xxfc/platform/order/service/AbstractOrderHandle.java
+3
-0
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+64
-46
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderPersonInsurance.java
View file @
10fc4c07
...
...
@@ -19,6 +19,10 @@ import lombok.Data;
@Table
(
name
=
"order_person_insurance"
)
public
class
OrderPersonInsurance
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
int
STATUS_PAY
=
1
;
public
static
final
int
STATUS_CNL
=
2
;
public
static
final
int
STATUS_TOPAY
=
3
;
/**
* 主键
...
...
@@ -71,10 +75,10 @@ public class OrderPersonInsurance implements Serializable {
private
BigDecimal
amount
;
/**
* 状态 1--已支付;2--已退款
* 状态 1--已支付;2--已退款
; 3--待支付;
*/
@Column
(
name
=
"status"
)
@ApiModelProperty
(
value
=
"状态 1--已支付;2--已退款"
)
@ApiModelProperty
(
value
=
"状态 1--已支付;2--已退款
; 3--待支付;
"
)
private
Integer
status
;
/**
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/inter/OrderItemInter.java
View file @
10fc4c07
package
com
.
xxfc
.
platform
.
order
.
entity
.
inter
;
import
cn.hutool.core.collection.CollUtil
;
import
com.xxfc.platform.order.contant.enumerate.ItemTypeEnum
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderItem
;
...
...
@@ -20,4 +21,14 @@ public interface OrderItemInter {
return
null
;
}
default
List
<
OrderItem
>
getItemsByTypeEnum
(
ItemTypeEnum
itemTypeEnum
)
{
List
<
OrderItem
>
returnItems
=
CollUtil
.
newArrayList
();
for
(
OrderItem
item:
getItems
())
{
if
(
itemTypeEnum
.
getCode
().
equals
(
item
.
getType
()))
{
returnItems
.
add
(
item
);
}
}
return
returnItems
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderAboutParamDTO.java
View file @
10fc4c07
package
com
.
xxfc
.
platform
.
order
.
pojo
.
order
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@Data
public
class
OrderAboutParamDTO
{
...
...
@@ -25,6 +29,8 @@ public class OrderAboutParamDTO {
@ApiModelProperty
(
value
=
"免赔费用"
)
private
BigDecimal
damageSafe
;
List
<
Dictionary
>
personInsurances
;
// @ApiModelProperty(value = "违章保留金")
// private BigDecimal ;
}
\ No newline at end of file
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
View file @
10fc4c07
package
com
.
xxfc
.
platform
.
order
.
pojo
.
order
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.xxfc.platform.activity.entity.Coupon
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderItem
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.entity.inter.OrderDetail
;
import
com.xxfc.platform.order.entity.OrderRentVehicleDetail
;
import
com.xxfc.platform.order.pojo.OrderAccompanyDTO
;
...
...
@@ -18,6 +20,8 @@ import java.math.BigDecimal;
import
java.util.Date
;
import
java.util.List
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
@Data
public
class
RentVehicleBO
extends
OrderRentVehicleDetail
implements
OrderDetail
{
private
BaseOrder
order
;
...
...
@@ -110,6 +114,10 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
*/
private
String
endDateTimeStr
;
private
Integer
needPersonInsurance
;
private
List
<
OrderPersonInsurance
>
insurances
;
private
List
<
OrderPersonInsurance
>
confirmInsurances
=
CollUtil
.
newArrayList
();
public
void
initDate
()
{
this
.
startDate
=
DateUtil
.
date
(
getStartTime
());
this
.
endDate
=
DateUtil
.
date
(
getEndTime
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
10fc4c07
...
...
@@ -47,6 +47,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_TRUE
;
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
.
pojo
.
account
.
OrderAccountDeduction
.
ORIGIN_DEPOSIT
;
import
static
com
.
xxfc
.
platform
.
order
.
pojo
.
account
.
OrderAccountDeduction
.
ORIGIN_ORDER_DEPOSIT
;
...
...
@@ -343,29 +344,34 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
return
deductGoodsAmount
;
}
public
BigDecimal
calculatePersonInsurance
(
Long
timeLag
)
{
BigDecimal
amount
=
BigDecimal
.
ZERO
;
public
void
calculatePersonInsurance
(
Long
timeLag
,
OrderPersonInsurance
opi
)
{
opi
.
setAmount
(
BigDecimal
.
ZERO
)
;
opi
.
setStatus
(-
1
);
//获取天
Integer
remainder
=
Long
.
valueOf
(
timeLag
%(
1000L
*
60L
*
60L
*
24L
)).
intValue
();
Integer
dayLag
=
Long
.
valueOf
(
timeLag
/(
1000L
*
60L
*
60L
*
24L
)).
intValue
()
+
remainder
>
0
?
1
:
0
;
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Set
<
Dictionary
>
personInsurances
=
dictionaryMap
.
get
(
RENT_PERSON_INSURANCE
).
getChildrens
();
Set
<
Dictionary
>
personInsurances
=
dictionaryMap
.
get
(
DictionaryKey
.
APP_ORDER
+
"_"
+
RENT_PERSON_INSURANCE
).
getChildrens
();
for
(
com
.
xxfc
.
platform
.
universal
.
entity
.
Dictionary
dic
:
personInsurances
)
{
if
(
StrUtil
.
isBlank
(
dic
.
getName
()))
{
continue
;
}
String
[]
names
=
dic
.
getName
().
split
(
"\\|"
);
if
(
names
.
length
<
2
)
{
continue
;
}
//符合范围
if
(
IntervalUtil
.
staticIsInTheInterval
(
dayLag
.
toString
(),
dic
.
getName
())){
amount
=
new
BigDecimal
(
dic
.
getDetail
());
if
(
IntervalUtil
.
staticIsInTheInterval
(
dayLag
.
toString
(),
names
[
0
])){
opi
.
setAmount
(
new
BigDecimal
(
dic
.
getDetail
()));
opi
.
setStatus
(
STATUS_TOPAY
);
opi
.
setInsuranceDay
(
Integer
.
valueOf
(
names
[
1
]));
break
;
}
}
return
amount
;
}
/**
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
10fc4c07
...
...
@@ -54,6 +54,7 @@ import tk.mybatis.mapper.weekend.WeekendSqls;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -61,6 +62,7 @@ import java.util.stream.Collectors;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
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
.
RENT_PERSON_INSURANCE
;
@Controller
@RequestMapping
(
"baseOrder"
)
...
...
@@ -155,6 +157,8 @@ public class BaseOrderController extends CommonBaseController implements UserRes
setActMember
(
new
Long
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
ACT_MEMBER
).
getDetail
()));
setDamageSafe
(
new
BigDecimal
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
DAMAGE_SAFE
).
getDetail
()));
setDriverPrice
(
new
BigDecimal
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
DRIVER_PRICE
).
getDetail
()));
setPersonInsurances
(
dictionaryMap
.
get
(
DictionaryKey
.
APP_ORDER
+
"_"
+
RENT_PERSON_INSURANCE
).
getChildrens
()
.
parallelStream
().
sorted
(
Comparator
.
comparing
(
Dictionary:
:
getId
)).
collect
(
Collectors
.
toList
()));
}});
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/AbstractOrderHandle.java
View file @
10fc4c07
...
...
@@ -142,6 +142,9 @@ public abstract class AbstractOrderHandle<Biz extends BaseBiz, Detail extends Or
/**
* 处理订单详情
* 1、补充baseorder 信息 update
* 2、插入item
* 3、判断是否支付
* @param detail
*/
public
void
handleDetail
(
Detail
detail
){
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
10fc4c07
This diff is collapsed.
Click to expand it.
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