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
c1f6f5ae
Commit
c1f6f5ae
authored
Sep 25, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-modify-cutAmount' into master-modify-cutAmount
parents
14d83f5f
82412f0d
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
192 additions
and
113 deletions
+192
-113
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+4
-2
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+101
-72
RentVehiclePriceVO.java
...om/xxfc/platform/order/pojo/price/RentVehiclePriceVO.java
+5
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+2
-0
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+32
-7
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+3
-3
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+31
-14
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+0
-12
OrderMsgBiz.java
...n/java/com/xxfc/platform/order/biz/inner/OrderMsgBiz.java
+2
-2
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+2
-0
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+1
-1
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+9
-0
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
c1f6f5ae
...
...
@@ -1024,8 +1024,10 @@ public class AppPermissionService {
}
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetail
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
Arrays
.
asList
(
appUserLogin
.
getId
()));
AppUserDetail
appUserDetail
=
userIdAndAppUserDetail
.
get
(
appUserLogin
.
getId
());
if
(
appUserDetail
!=
null
)
{
imiVo
.
setNickname
(
appUserDetail
.
getNickname
());
imiVo
.
setHeadimgurl
(
appUserDetail
.
getHeadimgurl
());
}
return
imiVo
;
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
c1f6f5ae
...
...
@@ -17,8 +17,12 @@ import com.xxfc.platform.im.model.Comment;
import
com.xxfc.platform.im.model.Msg
;
import
com.xxfc.platform.im.model.Praise
;
import
com.xxfc.platform.im.vo.MsgVo
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.constant.ResCode
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.bson.types.ObjectId
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -30,8 +34,12 @@ import org.springframework.data.mongodb.core.query.Criteria;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
IM_TYPE
;
@Service
@Slf4j
public
class
MsgBiz
{
...
...
@@ -44,6 +52,9 @@ public class MsgBiz {
@Autowired
ImQuestionBiz
imQuestionBiz
;
@Autowired
ThirdFeign
thirdFeign
;
/**
* 获取消息列表
*
...
...
@@ -54,7 +65,7 @@ public class MsgBiz {
//获取所有朋友圈
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
page
=
page
==
null
?
1
:
page
;
...
...
@@ -69,7 +80,7 @@ public class MsgBiz {
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"time"
));
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
else
{
List
<
Integer
>
ids
=
new
ArrayList
<>();
...
...
@@ -82,7 +93,7 @@ public class MsgBiz {
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
...
...
@@ -91,7 +102,7 @@ public class MsgBiz {
public
ObjectRestResponse
getHotMsgList
(
Integer
page
,
Integer
limit
)
{
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
page
=
page
==
null
?
1
:
page
;
...
...
@@ -100,34 +111,34 @@ public class MsgBiz {
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
4
);
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
).
and
(
"count.praise"
).
gt
(
1000
));
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
).
and
(
"count.praise"
).
gt
(
getNumber
()
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
public
ObjectRestResponse
get
(
String
id
){
public
ObjectRestResponse
get
(
String
id
)
{
//获取所有朋友圈
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
if
(
id
==
null
)
{
if
(
id
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
Query
query
=
new
Query
(
Criteria
.
where
(
"id"
).
is
(
new
ObjectId
(
id
)));
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
List
<
MsgVo
>
msgVoList
=
replaceMsgResult
(
msgList
);
if
(
msgVoList
.
size
()
>
0
)
{
if
(
msgVoList
.
size
()
>
0
)
{
return
ObjectRestResponse
.
succ
(
msgVoList
.
get
(
0
));
}
return
ObjectRestResponse
.
succ
();
}
}
public
ObjectRestResponse
getMsgListByUserId
(
Integer
page
,
Integer
limit
,
Integer
type
)
{
//获取所有朋友圈
...
...
@@ -135,17 +146,17 @@ public class MsgBiz {
limit
=
limit
==
null
?
10
:
limit
;
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
else
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
"token失效"
);
}
Pageable
pageable
=
PageRequest
.
of
(--
page
,
limit
);
List
<
Integer
>
ids
=
new
ArrayList
<>();
if
(
type
!=
null
)
{
if
(
type
!=
null
)
{
ids
.
add
(
type
);
}
if
(
type
!=
null
&&
type
==
5
)
{
if
(
type
!=
null
&&
type
==
5
)
{
QuestionParamDto
questionParamDto
=
new
QuestionParamDto
();
questionParamDto
.
setUserId
(
Long
.
parseLong
(
userId
+
""
));
return
imQuestionBiz
.
getList
(
questionParamDto
);
...
...
@@ -158,20 +169,21 @@ public class MsgBiz {
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
List
<
MsgVo
>
msgVoList
=
replaceMsgResult
(
msgList
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
msgVoList
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
PageDataVO
.
pageInfo
(
goodPageInfo
));
}
/**
* 删除消息
*
* @param ids id字符串,用逗号隔开
* @return
*/
public
ObjectRestResponse
deleteByList
(
String
ids
)
{
Integer
userId
=
0
;
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
if
(
appUserDTO
==
null
)
{
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
}
if
(
StringUtils
.
isBlank
(
ids
))
{
...
...
@@ -184,7 +196,7 @@ public class MsgBiz {
Query
query
=
new
Query
(
Criteria
.
where
(
"id"
).
in
(
set
));
query
.
addCriteria
(
Criteria
.
where
(
"userId"
).
is
(
userId
));
List
<
Msg
>
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
if
(
msgList
.
size
()
!=
set
.
size
())
{
//查询到的消息条数不等于查询的Id数
if
(
msgList
.
size
()
!=
set
.
size
())
{
//查询到的消息条数不等于查询的Id数
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
IM_DELETE_FAIL_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
IM_DELETE_FAIL_CODE
));
}
DeleteResult
deleteResult
=
mongoTemplate
.
remove
(
query
,
Msg
.
class
,
"s_msg"
);
...
...
@@ -211,7 +223,7 @@ public class MsgBiz {
//添加点赞
List
<
Praise
>
praise
=
mongoTemplate
.
find
(
query
,
Praise
.
class
,
"s_praise"
);
msg
.
setPraises
(
replacePraiseResult
(
praise
));
if
(
userId
!=
null
)
{
if
(
userId
!=
null
)
{
msg
.
setIsPraise
(
this
.
exists
(
userId
,
msg
.
getId
())
?
1
:
0
);
msg
.
setIsCollect
(
this
.
existsCollect
(
userId
,
msg
.
getId
())
?
1
:
0
);
}
else
{
...
...
@@ -237,7 +249,7 @@ public class MsgBiz {
public
boolean
exists
(
int
userId
,
ObjectId
msgId
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msgId
).
and
(
"userId"
).
is
(
userId
));
List
<
Praise
>
praise
=
mongoTemplate
.
find
(
query
,
Praise
.
class
,
"s_praise"
);
return
praise
.
size
()
>
0
?
true
:
false
;
return
praise
.
size
()
>
0
?
true
:
false
;
}
/**
...
...
@@ -250,23 +262,25 @@ public class MsgBiz {
public
boolean
existsCollect
(
int
userId
,
ObjectId
msgId
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msgId
).
and
(
"userId"
).
is
(
userId
));
List
<
Comment
>
comments
=
mongoTemplate
.
find
(
query
,
Comment
.
class
,
"s_comment"
);
return
comments
.
size
()
>
0
?
true
:
false
;
return
comments
.
size
()
>
0
?
true
:
false
;
}
public
List
<
MsgVo
>
replaceMsgResult
(
List
<
Msg
>
list
)
{
List
<
MsgVo
>
msgVoList
=
new
ArrayList
<>();
for
(
Msg
msg
:
list
)
{
for
(
Msg
msg
:
list
)
{
MsgVo
msgVo
=
new
MsgVo
();
if
(
msg
!=
null
)
{
BeanUtil
.
copyProperties
(
msg
,
msgVo
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
//添加用户昵称和头像
ImiVo
imiVo
=
userBiz
.
getUserInfo
(
msg
.
getUserId
());
if
(
imiVo
!=
null
)
{
if
(
imiVo
!=
null
)
{
msgVo
.
setNickname
(
imiVo
.
getNickname
());
msgVo
.
setPicUrl
(
imiVo
.
getHeadimgurl
());
}
//String address = AddressUtils.getMapaddress(msg.getLatitude().toString(), msg.getLongitude().toString());
msgVo
.
setAddress
(
msg
.
getLocation
());
msgVo
.
setMsgId
(
msg
.
getId
().
toString
());
}
msgVoList
.
add
(
msgVo
);
}
return
msgVoList
;
...
...
@@ -274,15 +288,17 @@ public class MsgBiz {
public
List
<
PraiseVo
>
replacePraiseResult
(
List
<
Praise
>
list
)
{
List
<
PraiseVo
>
praiseVoArrayList
=
new
ArrayList
<>();
for
(
Praise
praise
:
list
)
{
for
(
Praise
praise
:
list
)
{
PraiseVo
praiseVo
=
new
PraiseVo
();
if
(
praise
!=
null
)
{
BeanUtil
.
copyProperties
(
praise
,
praiseVo
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
//添加用户昵称和头像
ImiVo
imiVo
=
userBiz
.
getUserInfo
(
praise
.
getUserId
());
if
(
imiVo
!=
null
)
{
if
(
imiVo
!=
null
)
{
praiseVo
.
setNickname
(
imiVo
.
getNickname
());
praiseVo
.
setPicUrl
(
imiVo
.
getHeadimgurl
());
}
}
praiseVoArrayList
.
add
(
praiseVo
);
}
return
praiseVoArrayList
;
...
...
@@ -290,18 +306,31 @@ public class MsgBiz {
public
List
<
CommentVo
>
replaceCommentResult
(
List
<
Comment
>
list
)
{
List
<
CommentVo
>
commentVoList
=
new
ArrayList
<>();
for
(
Comment
comment
:
list
)
{
for
(
Comment
comment
:
list
)
{
CommentVo
commentVo
=
new
CommentVo
();
if
(
comment
!=
null
)
{
BeanUtil
.
copyProperties
(
comment
,
commentVo
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
//添加用户昵称和头像
ImiVo
imiVo
=
userBiz
.
getUserInfo
(
comment
.
getUserId
());
if
(
imiVo
!=
null
)
{
if
(
imiVo
!=
null
)
{
commentVo
.
setNickname
(
imiVo
.
getNickname
());
commentVo
.
setPicUrl
(
imiVo
.
getHeadimgurl
());
}
}
commentVoList
.
add
(
commentVo
);
}
return
commentVoList
;
}
public
Integer
getNumber
()
{
Integer
number
=
0
;
Dictionary
dictionary
=
thirdFeign
.
findDictionaryByTypeAndCode
(
IM_TYPE
,
DictionaryKey
.
MSG_LIMIT_NUMBER
);
if
(
dictionary
!=
null
&&
StringUtils
.
isNotBlank
(
dictionary
.
getDetail
()))
{
log
.
info
(
"查询IM限制数为字典表的结果为: dictionary = {}"
,
dictionary
.
toString
());
number
=
Integer
.
parseInt
(
dictionary
.
getDetail
());
}
log
.
info
(
"IM消息数限制为: number = {}"
,
number
);
return
number
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/price/RentVehiclePriceVO.java
View file @
c1f6f5ae
...
...
@@ -54,6 +54,11 @@ public class RentVehiclePriceVO extends OrderPriceVO{
*/
private
BigDecimal
buyVehicleAmount
=
BigDecimal
.
ZERO
;
/**
* 最后的租车金额
*/
private
BigDecimal
realVehicleAmount
=
BigDecimal
.
ZERO
;
/**
* 优惠描述
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
c1f6f5ae
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
...
...
@@ -568,6 +569,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
if
(
updateSelectiveByIdRe
(
baseOrder
)
>
0
)
{
return
selectById
(
baseOrder
.
getId
());
}
else
{
log
.
error
(
StrUtil
.
format
(
"数据更新失败:baseOrder: {}"
,
JSONUtil
.
toJsonStr
(
baseOrder
)));
throw
new
BaseException
(
ResultCode
.
DB_OPERATION_FAIL_CODE
);
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
c1f6f5ae
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
...
...
@@ -9,6 +11,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.IntervalUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.activity.feign.ActivityFeign
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.biz.inner.OrderMsgBiz
;
import
com.xxfc.platform.order.contant.enumerate.*
;
...
...
@@ -80,6 +83,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
@Autowired
UserFeign
userFeign
;
@Autowired
ActivityFeign
activityFeign
;
/**
* 租车退款流程
...
...
@@ -208,7 +214,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
updateBaseOrder
.
setRefundTime
(
System
.
currentTimeMillis
());
updateBaseOrder
.
setVersion
(
baseOrder
.
getVersion
());
if
(
SYS_TRUE
.
equals
(
flag
)
&&
null
!=
refundStatus
)
{
BeanUtil
.
copyProperties
(
baseOrderBiz
.
updateSelectiveByIdReT
(
updateBaseOrder
),
baseOrder
);
BeanUtil
.
copyProperties
(
baseOrderBiz
.
updateSelectiveByIdReT
(
updateBaseOrder
,
Boolean
.
TRUE
),
baseOrder
);
}
}
...
...
@@ -355,6 +361,21 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
InProgressVO
inProgressVO
=
orderCalculateBiz
.
calculateOrderComplete
(
orderMQDTO
,
orderMQDTO
.
getOrderRentVehicleDetail
(),
oad
,
orderItem
,
orderMQDTO
.
getOrderRentVehicleDetail
().
getUsedDay
(),
Boolean
.
FALSE
);
//返回优惠券和免费天数
//取消租车免费天数使用
if
(
inProgressVO
.
getBackFreeDays
()
>
0
)
{
int
result
=
userFeign
.
memberDays
(
orderMQDTO
.
getUserId
(),
inProgressVO
.
getBackFreeDays
(),
UserFeign
.
MEMBER_DAYS_WITHDRAW
);
if
(
result
<
0
)
{
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
}
}
//返还优惠券
if
(
inProgressVO
.
getBackCoupons
().
size
()
>
0
)
{
for
(
String
backCoupon
:
inProgressVO
.
getBackCoupons
())
{
activityFeign
.
cancelUse
(
backCoupon
);
}
}
//还车扣除款 剩余的 钱,再减去违章预备金
oad
.
getDeductions
().
add
(
initDeduction
(
illegalReserve
,
"违章保证金"
,
DeductionTypeEnum
.
VIOLATE_TRAFFIC_KEEP
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
)
...
...
@@ -371,7 +392,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
//剩余押金 = 押金 - 违章保证金 - 定损金额
oad
.
setDepositAmount
(
oad
.
getDepositAmount
().
subtract
(
illegalReserve
).
subtract
(
csv
.
getDamagesAmount
()));
handleCrosstownDetail
(
crosstown
,
oad
);
handleCrosstownDetail
(
crosstown
,
oad
,
csv
);
//退款
BigDecimal
refundAmont
=
oad
.
getDepositAmount
().
add
(
oad
.
getOrderAmount
());
...
...
@@ -409,7 +430,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
csv
.
initParamJson
();
//设置明细
orderRentVehicleBiz
.
updateSelectiveById
(
new
OrderRentVehicleDetail
(){{
setId
(
orderMQDTO
.
getId
());
setId
(
orderMQDTO
.
get
Detail
Id
());
handelCostDetailExtend
(
csv
);
}});
...
...
@@ -437,15 +458,15 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
return
refundDesc
;
}
private
void
handleCrosstownDetail
(
OrderVehicleCrosstown
crosstown
,
OrderAccountDetail
oad
)
{
private
void
handleCrosstownDetail
(
OrderVehicleCrosstown
crosstown
,
OrderAccountDetail
oad
,
CancelStartedVO
csv
)
{
try
{
if
(
null
!=
crosstown
.
getViolateDetail
())
{
DedDetailDTO
vio
=
JSONUtil
.
toBean
(
crosstown
.
getViolateDetail
(),
DedDetailDTO
.
class
);
if
(
OrderViolateEnum
.
BEFORE
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
oad
,
vio
);
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
oad
,
vio
,
csv
);
}
else
if
(
OrderViolateEnum
.
AFTER
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_DELAY
,
oad
,
vio
);
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_DELAY
,
oad
,
vio
,
csv
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -453,7 +474,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
}
private
void
handleViolateDetail
(
DeductionTypeEnum
dte
,
OrderAccountDetail
oad
,
DedDetailDTO
vio
)
{
private
void
handleViolateDetail
(
DeductionTypeEnum
dte
,
OrderAccountDetail
oad
,
DedDetailDTO
vio
,
CancelStartedVO
csv
)
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
if
(
dte
.
getCode
().
equals
(
deduction
.
getType
()))
{
deduction
.
setName
(
vio
.
getDeductions
());
...
...
@@ -461,6 +482,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
//修改归还押金金额
oad
.
setDepositAmount
(
oad
.
getDepositAmount
().
subtract
(
diff
));
deduction
.
setAmount
(
vio
.
getCost
());
//设置订单明细参数
csv
.
setViolateAmount
(
deduction
.
getAmount
());
csv
.
setViolateDesc
(
deduction
.
getName
());
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
c1f6f5ae
...
...
@@ -193,7 +193,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
if
(
vehicle
.
getMileageLastUpdate
()
!=
null
)
{
//判断车辆公里数
if
(
orderVehicleCrosstownDto
.
getMileage
()
==
null
||
orderVehicleCrosstownDto
.
getMileage
()
<
=
vehicle
.
getMileageLastUpdate
())
{
if
(
orderVehicleCrosstownDto
.
getMileage
()
==
null
||
orderVehicleCrosstownDto
.
getMileage
()
<
vehicle
.
getMileageLastUpdate
())
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
());
}
}
...
...
@@ -357,7 +357,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
orderDepositRefundRecordBiz
.
saveFixLossRecord
(
depositRefundRecord
);
//修改訂單狀態為定損
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FIXED_LOSS
.
getCode
());
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
);
baseOrder
=
baseOrder
Biz
.
updateSelectiveByIdReT
(
baseOrder
);
orderRentVehicleDetail
.
setFixedLossStatus
(
1
);
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
orderRentVehicleDetail
);
}
else
if
(
orderVehicleCrosstown
.
getType
()
==
CrosstownTypeEnum
.
FIXED_LOSS_NOW
.
getCode
())
{
//直接定损还车
...
...
@@ -370,7 +370,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
orderDepositRefundRecordBiz
.
saveFixLossRecord
(
depositRefundRecord
);
//修改訂單狀態為已完成
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FINISH
.
getCode
());
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
);
baseOrder
=
baseOrder
Biz
.
updateSelectiveByIdReT
(
baseOrder
);
orderRentVehicleDetail
.
setFixedLossStatus
(
1
);
baseOrderBiz
.
sendOrderMq
(
orderRentVehicleDetail
,
null
,
null
,
baseOrder
,
OrderMQDTO
.
ORDER_FINISH
);
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
orderRentVehicleDetail
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
c1f6f5ae
...
...
@@ -115,20 +115,7 @@ public class OrderCalculateBiz {
consumeAmount
=
consumeAmount
.
add
(
otherItemRealAmount
);
inProgressVO
.
setConsumeAmount
(
consumeAmount
);
if
(
consumeAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
//消费金额 大于0 增加额外费用
OrderAccountDeduction
extraDeduction
=
orderAccountBiz
.
initDeduction
(
consumeAmount
,
"消费金额"
,
DeductionTypeEnum
.
CONSUME
,
OrderAccountDeduction
.
ORIGIN_ORDER_DEPOSIT
);
oad
.
getDeductions
().
add
(
extraDeduction
);
}
//消费金额 小于商品真实的金额 返回钱
if
(
consumeAmount
.
compareTo
(
goodsRealAmount
)
<=
0
)
{
//设置返回钱
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
.
subtract
(
consumeAmount
));
}
else
{
//设置额外扣减(押金里面扣)
inProgressVO
.
setExtraAmount
(
consumeAmount
.
subtract
(
goodsRealAmount
));
}
refundAmount
=
handleConsumeAmount
(
oad
,
refundAmount
,
consumeAmount
,
goodsRealAmount
,
inProgressVO
);
}
else
{
//设置免费天数
inProgressVO
.
setUsedfreeDays
(
useDays
);
...
...
@@ -138,6 +125,18 @@ public class OrderCalculateBiz {
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
);
inProgressVO
.
setBackFreeDays
(
backFreeDays
);
//返回优惠券
if
(
StrUtil
.
isNotBlank
(
baseOrder
.
getCouponTickerNos
()))
{
//返回所有优惠券
inProgressVO
.
setBackCoupons
(
StrUtil
.
split
(
baseOrder
.
getCouponTickerNos
(),
','
));
}
//设置消费金额 由于返回了优惠券,所以添加优惠券之前减免的金额
consumeAmount
=
consumeAmount
.
add
(
otherItemRealAmount
).
add
(
baseOrder
.
getCouponAmount
());
inProgressVO
.
setConsumeAmount
(
consumeAmount
);
refundAmount
=
handleConsumeAmount
(
oad
,
refundAmount
,
consumeAmount
,
goodsRealAmount
,
inProgressVO
);
}
inProgressVO
.
setRefundOrderAmount
(
refundAmount
);
...
...
@@ -177,6 +176,24 @@ public class OrderCalculateBiz {
return
inProgressVO
;
}
private
BigDecimal
handleConsumeAmount
(
OrderAccountDetail
oad
,
BigDecimal
refundAmount
,
BigDecimal
consumeAmount
,
BigDecimal
goodsRealAmount
,
InProgressVO
inProgressVO
)
{
if
(
consumeAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
//消费金额 大于0 增加额外费用
OrderAccountDeduction
consumeDeduction
=
orderAccountBiz
.
initDeduction
(
consumeAmount
,
"消费金额"
,
DeductionTypeEnum
.
CONSUME
,
OrderAccountDeduction
.
ORIGIN_ORDER_DEPOSIT
);
oad
.
getDeductions
().
add
(
consumeDeduction
);
}
//消费金额 小于商品真实的金额 返回钱
if
(
consumeAmount
.
compareTo
(
goodsRealAmount
)
<=
0
)
{
//设置返回钱
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
.
subtract
(
consumeAmount
));
}
else
{
//设置额外扣减(押金里面扣)
inProgressVO
.
setExtraAmount
(
consumeAmount
.
subtract
(
goodsRealAmount
));
}
return
refundAmount
;
}
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
OrderItem
orderItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
c1f6f5ae
...
...
@@ -144,15 +144,6 @@ public class OrderCancelBiz {
setOrderId
(
baseOrder
.
getId
());
}});
// List<OrderItem> otherOrderItems = orderItemBiz.selectByExample(new Example.Builder(OrderItem.class)
// .where(WeekendSqls.<OrderItem>custom().andNotEqualTo(OrderItem::getType, ItemTypeEnum.VEHICLE_MODEL.getCode())).build()
// );
//原退还押金
Integer
freeDays
=
(
null
==
orderItem
.
getCutNum
())?
0
:
orderItem
.
getCutNum
();
// BigDecimal freeDayAmount = BigDecimal.ZERO;
//如果超过出发时间,不能取消订单
//根据时间处理goodsAmount
//获取出发时间 到现在 距离时间
...
...
@@ -205,9 +196,6 @@ public class OrderCancelBiz {
}
else
{
// //没到出车时间
// //判断是否使用免费天数,并且进行扣款
// if(freeDays > 0) {
// freeDayAmount = orderItem.getUnitPrice().multiply(new BigDecimal(orvd.getFreeDays()+ ""));
// }
//违约金封顶 租车身份价 * 2天
BigDecimal
topAmount
=
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
(
2
+
""
));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderMsgBiz.java
View file @
c1f6f5ae
...
...
@@ -386,7 +386,7 @@ public class OrderMsgBiz {
BigDecimal
residueAmount
;
//查询订单退款记录
OrderAccount
orderAccount
;
if
(
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
equals
(
baseOrder
.
getRefundStatus
()))
{
if
(
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
().
equals
(
baseOrder
.
getRefundStatus
()))
{
smstype
=
SmsTemplateDTO
.
REFUND_A
;
orderAccount
=
orderAccountBiz
.
selectOne
(
new
OrderAccount
(){{
setOrderId
(
baseOrder
.
getId
());
...
...
@@ -396,7 +396,7 @@ public class OrderMsgBiz {
violateAmount
=
orderAccount
.
getDeductAmount
();
refundAmount
=
orderAccount
.
getAccountAmount
();
residueAmount
=
orvd
.
getReturnPayResidue
();
}
else
if
(
RefundStatusEnum
.
REFUND_DEPOSIT
.
equals
(
baseOrder
.
getRefundStatus
())){
}
else
if
(
RefundStatusEnum
.
REFUND_DEPOSIT
.
getCode
().
equals
(
baseOrder
.
getRefundStatus
())){
smstype
=
SmsTemplateDTO
.
REFUND_B
;
orderAccount
=
orderAccountBiz
.
selectOne
(
new
OrderAccount
(){{
setOrderId
(
baseOrder
.
getId
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
c1f6f5ae
...
...
@@ -143,6 +143,8 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
,
orderPageVO
.
getOrderTourDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
refundDescBuilder
);
totalDeductAmount
=
deductionAmount
;
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
deductionAmount
);
refundDesc
=
refundDescBuilder
.
toString
();
break
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
c1f6f5ae
...
...
@@ -217,7 +217,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
BigDecimal
vehicleAmount
=
BigDecimal
.
ZERO
;
BigDecimal
driverAmount
=
BigDecimal
.
ZERO
;
BigDecimal
damageSafeAmount
=
BigDecimal
.
ZERO
;
// BigDecimal modelAmount = BigDecimal.ZERO;
BigDecimal
couponAmount
=
BigDecimal
.
ZERO
;
String
couponDesc
=
""
;
Integer
vehicleDayNum
=
0
;
...
...
@@ -356,6 +355,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rvp
.
setFreeDayNum
(
freeDayNum
);
rvp
.
setFreeAmount
(
vehicleOrderItem
.
getCutAmount
());
rvp
.
setBuyVehicleAmount
(
vehicleOrderItem
.
getBuyAmount
());
rvp
.
setRealVehicleAmount
(
vehicleOrderItem
.
getRealAmount
());
rvp
.
setCouponDesc
(
couponDesc
);
rvp
.
initParamJson
();
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
c1f6f5ae
...
...
@@ -7,6 +7,15 @@ public class DictionaryKey {
*/
public
static
final
String
APP_ORDER
=
"APP_ORDER"
;
/**
* IM类型
*/
public
static
final
String
IM_TYPE
=
"IM_TYPE"
;
/**
* IM限制条数
*/
public
static
final
String
MSG_LIMIT_NUMBER
=
"MSG_LIMIT_NUMBER"
;
/**
* 支付
*/
...
...
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