Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
e45c234f
Commit
e45c234f
authored
Dec 15, 2020
by
刘鹏飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coco订单详情展示的商品单价需要加上小料的价格
parent
33268a08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
23 deletions
+15
-23
order-application-service/src/main/java/cn/freemud/service/order/impl/CocoOrderRelationServiceImpl.java
+15
-23
No files found.
order-application-service/src/main/java/cn/freemud/service/order/impl/CocoOrderRelationServiceImpl.java
View file @
e45c234f
...
@@ -143,6 +143,21 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
...
@@ -143,6 +143,21 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
for
(
ProductVo
product
:
masterProducts
){
for
(
ProductVo
product
:
masterProducts
){
Integer
giftQty
=
giftMap
.
get
(
product
.
getCid
())
==
null
?
0
:
giftMap
.
get
(
product
.
getCid
());
Integer
giftQty
=
giftMap
.
get
(
product
.
getCid
())
==
null
?
0
:
giftMap
.
get
(
product
.
getCid
());
product
.
setQty
(
product
.
getQty
()
+
giftQty
);
product
.
setQty
(
product
.
getQty
()
+
giftQty
);
// 商品原单价=商品原单价+小料原单价
List
<
ProductVo
>
smallMaterial
=
product
.
getSetMaterialProducts
();
Long
smallMaterialOriTotal
=
0L
;
if
(
smallMaterial
!=
null
&&
!
smallMaterial
.
isEmpty
()){
for
(
ProductVo
sm
:
smallMaterial
){
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
}
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal
=
smallMaterialOriTotal
==
null
?
0
:
smallMaterialOriTotal
;
product
.
setOriginalPrice
(
smallMaterialOriTotal
+
(
product
.
getOriginalPrice
()
==
null
?
0L
:
product
.
getOriginalPrice
()));
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
productMap
.
get
(
product
.
getCid
());
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
productMap
.
get
(
product
.
getCid
());
if
(
productBean
==
null
||
productBean
.
getDiscountList
()
==
null
||
productBean
.
getDiscountList
().
isEmpty
()){
if
(
productBean
==
null
||
productBean
.
getDiscountList
()
==
null
||
productBean
.
getDiscountList
().
isEmpty
()){
...
@@ -162,35 +177,12 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
...
@@ -162,35 +177,12 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
ProductVo
newProduct
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
product
),
ProductVo
.
class
);
ProductVo
newProduct
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
product
),
ProductVo
.
class
);
newProduct
.
setQty
(
1
);
newProduct
.
setQty
(
1
);
// 商品原单价=商品原单价+小料原单价
List
<
ProductVo
>
smallMaterial
=
newProduct
.
getSetMaterialProducts
();
Long
smallMaterialOriTotal
=
0L
;
if
(
smallMaterial
!=
null
&&
!
smallMaterial
.
isEmpty
()){
for
(
ProductVo
sm
:
smallMaterial
){
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
}
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal
=
smallMaterialOriTotal
==
null
?
0
:
smallMaterialOriTotal
;
newProduct
.
setOriginalPrice
(
smallMaterialOriTotal
+
(
product
.
getOriginalPrice
()
==
null
?
0L
:
product
.
getOriginalPrice
()));
productVos
.
add
(
newProduct
);
productVos
.
add
(
newProduct
);
}
}
product
.
setQty
(
1
);
product
.
setQty
(
1
);
}
}
// 商品原单价=商品原单价+小料原单价
List
<
ProductVo
>
smallMaterial
=
product
.
getSetMaterialProducts
();
Long
smallMaterialOriTotal
=
0L
;
if
(
smallMaterial
!=
null
&&
!
smallMaterial
.
isEmpty
()){
for
(
ProductVo
sm
:
smallMaterial
){
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
}
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal
=
smallMaterialOriTotal
==
null
?
0
:
smallMaterialOriTotal
;
product
.
setOriginalPrice
(
smallMaterialOriTotal
+
(
product
.
getOriginalPrice
()
==
null
?
0L
:
product
.
getOriginalPrice
()));
}
}
}
}
...
...
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