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
830dfa2d
Commit
830dfa2d
authored
Jan 08, 2020
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发票
parent
10405431
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
OrderPageVO.java
.../java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
+5
-0
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+36
-3
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+3
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
View file @
830dfa2d
...
...
@@ -24,6 +24,11 @@ public class OrderPageVO extends BaseOrder {
//更换还车公司记录
List
<
BookRecordUpdateLog
>
bookRecordUpdateLogs
;
/**
* 订单最终支付金额:扣除所有费用之后
*/
private
BigDecimal
orderRealAmount
;
/**
* 用户名
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
830dfa2d
...
...
@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.
github.pagehelper.PageHelper
;
import
com.
github.pagehelper.PageInfo
;
import
com.
alibaba.fastjson.JSONArray
;
import
com.
alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
...
@@ -31,7 +31,6 @@ import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import
com.xxfc.platform.order.pojo.order.VehicleItemDTO
;
import
com.xxfc.platform.order.pojo.price.CancelStartedVO
;
import
com.xxfc.platform.order.pojo.price.CostDetailExtend
;
import
com.xxfc.platform.order.pojo.price.DelayAddPriceVO
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
...
...
@@ -39,9 +38,11 @@ import com.xxfc.platform.universal.vo.OrderRefundVo;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.jexl2.MapContext
;
import
org.apache.commons.lang3.StringUtils
;
import
org.mockito.internal.util.collections.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
...
...
@@ -792,4 +793,36 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
log
.
error
(
StrUtil
.
format
(
"退款异常{},订单号为:{}"
,
ex
.
getMessage
(),
baseOrder
.
getNo
()),
ex
);
}
}
public
List
<
OrderAccount
>
getByOrderId
(
Integer
orderId
)
{
Example
example
=
new
Example
(
OrderAccount
.
class
);
example
.
createCriteria
().
andEqualTo
(
"orderId"
,
orderId
).
andGreaterThan
(
"accountType"
,
200
);
return
mapper
.
selectByExample
(
example
);
}
public
BigDecimal
getAllOrderCost
(
Integer
orderId
)
{
List
<
OrderAccount
>
list
=
getByOrderId
(
orderId
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
"0"
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
list
.
parallelStream
().
forEach
(
result
->
{
if
(
StringUtils
.
isNotBlank
(
result
.
getAccountDetail
()))
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
.
getAccountDetail
());
log
.
info
(
"获取订单的费用金额:"
,
jsonObject
.
toJSONString
());
if
(
jsonObject
!=
null
)
{
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"deductions"
);
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
jsonObject1
=
jsonArray
.
getJSONObject
(
i
);
if
(
jsonObject1
!=
null
)
{
bigDecimal
.
add
(
new
BigDecimal
(
jsonObject1
.
getString
(
"amount"
)));
}
}
log
.
info
(
"获取订单的费用金额: {}"
,
bigDecimal
);
}
}
}
});
}
return
bigDecimal
;
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
830dfa2d
...
...
@@ -173,6 +173,7 @@ public class BaseOrderController extends CommonBaseController implements UserRes
PageDataVO
<
OrderPageVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseOrderBiz
.
pageByParm
(
query
.
getSuper
()));
pages
.
getData
().
parallelStream
().
forEach
(
data
->
{
data
.
setQrcodeStr
(
qrcodePrefix
);
data
.
setOrderRealAmount
(
orderAccountBiz
.
getAllOrderCost
(
data
.
getId
()));
});
return
new
ObjectRestResponse
<>().
data
(
pages
);
}
...
...
@@ -489,4 +490,6 @@ public class BaseOrderController extends CommonBaseController implements UserRes
return
baseOrderBiz
.
updateBaseOrder
(
baseOrder
);
}
}
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