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
76b74062
Commit
76b74062
authored
Oct 31, 2020
by
yu.sun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-yu.sun-material-20201030'
parents
fca7721c
2567effe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
11 deletions
+34
-11
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+30
-11
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+3
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
76b74062
...
@@ -687,6 +687,7 @@ public class ShoppingCartConvertAdapter {
...
@@ -687,6 +687,7 @@ public class ShoppingCartConvertAdapter {
Long
finalPrice
=
isComboxGoods
?
productComboType
.
getFinalPrice
().
longValue
()
:
groupDetailType
.
getMarkUpPrice
().
longValue
();
Long
finalPrice
=
isComboxGoods
?
productComboType
.
getFinalPrice
().
longValue
()
:
groupDetailType
.
getMarkUpPrice
().
longValue
();
// 设置商品详情
// 设置商品详情
Map
<
String
,
String
>
attributes
=
getAttributesNew
(
comboxGoods
.
getExtra
());
Map
<
String
,
String
>
attributes
=
getAttributesNew
(
comboxGoods
.
getExtra
());
comboxGoods
.
setSpuId
(
comboxGoods
.
getSpuId
());
comboxGoods
.
setName
(
isComboxGoods
?
productComboType
.
getProductName
()
:
groupDetailType
.
getProductName
());
comboxGoods
.
setName
(
isComboxGoods
?
productComboType
.
getProductName
()
:
groupDetailType
.
getProductName
());
comboxGoods
.
setSpuName
(
comboxGoods
.
getName
());
comboxGoods
.
setSpuName
(
comboxGoods
.
getName
());
comboxGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
comboxGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
76b74062
...
@@ -65,6 +65,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -65,6 +65,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -780,7 +781,9 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -780,7 +781,9 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
null
);
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
null
);
//设置更新响应信息
//设置更新响应信息
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
//再来一单清除配送费
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
0L
);
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
0L
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
}
...
@@ -861,15 +864,24 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -861,15 +864,24 @@ public class ShoppingCartMCoffeeServiceImpl {
comboProducts
.
forEach
(
combo
->
{
comboProducts
.
forEach
(
combo
->
{
getComboxGoods
(
cartGoods
,
combo
,
orderItemList
);
getComboxGoods
(
cartGoods
,
combo
,
orderItemList
);
});
});
//取所有固定套餐的价格计算套餐总价
Long
originalPrice
=
comboProducts
.
stream
().
filter
(
orderItemResp
->
null
!=
orderItemResp
.
getProductPrice
()).
mapToLong
(
orderItemResp
->
orderItemResp
.
getProductPrice
().
longValue
()).
sum
();
cartGoods
.
setOriginalPrice
(
originalPrice
);
}
}
//特制
//特制
if
(
StringUtils
.
isNotEmpty
(
orderItem
.
getExtInfo
())){
if
(
StringUtils
.
isNotEmpty
(
orderItem
.
getExtInfo
())){
JSONObject
extJson
=
JSONObject
.
parseObject
(
orderItem
.
getExtInfo
());
JSONObject
extJson
=
JSONObject
.
parseObject
(
orderItem
.
getExtInfo
());
CartGoods
.
SpecialExtra
specialExtra
=
new
CartGoods
.
SpecialExtra
();
if
(
extJson
.
containsKey
(
"specialAttrs"
))
{
specialExtra
.
setAttributeId
(
extJson
.
containsKey
(
"attributeId"
)
?
extJson
.
getString
(
"attributeId"
)
:
""
);
CartGoods
.
SpecialExtra
specialExtra
=
new
CartGoods
.
SpecialExtra
();
specialExtra
.
setAttributeName
(
extJson
.
containsKey
(
"attributeName"
)
?
extJson
.
getString
(
"attributeName"
)
:
""
);
JSONArray
specialAttrs
=
JSONArray
.
parseArray
(
extJson
.
getString
(
"specialAttrs"
));
specialExtra
.
setAttributeId
(
extJson
.
containsKey
(
"specialCode"
)
?
extJson
.
getString
(
"specialCode"
)
:
""
);
for
(
Object
specialAttr
:
specialAttrs
)
{
cartGoods
.
setSpecialExtra
(
Arrays
.
asList
(
specialExtra
));
JSONObject
object
=
JSONObject
.
parseObject
(
specialAttr
.
toString
());
specialExtra
.
setAttributeId
(
object
.
containsKey
(
"attributeId"
)
?
object
.
getString
(
"attributeId"
)
:
""
);
specialExtra
.
setAttributeName
(
object
.
containsKey
(
"attributeName"
)
?
object
.
getString
(
"attributeName"
)
:
""
);
specialExtra
.
setSpecialCode
(
object
.
containsKey
(
"specialCode"
)
?
object
.
getString
(
"specialCode"
)
:
""
);
}
cartGoods
.
setSpecialExtra
(
Arrays
.
asList
(
specialExtra
));
}
}
}
if
(
ObjectUtils
.
equals
(
88
,
orderItem
.
getProductType
()))
{
if
(
ObjectUtils
.
equals
(
88
,
orderItem
.
getProductType
()))
{
...
@@ -910,15 +922,22 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -910,15 +922,22 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
comboxGoods
.
setExtra
(
extra
);
comboxGoods
.
setExtra
(
extra
);
}
}
for
(
OrderItemResp
itemResp
:
orderItemList
)
{
for
(
OrderItemResp
itemResp
:
orderItemList
)
{
//特制
//特制
if
(
StringUtils
.
isNotEmpty
(
itemResp
.
getExtInfo
())){
if
(
StringUtils
.
isNotEmpty
(
itemResp
.
getExtInfo
())){
JSONObject
extJson
=
JSONObject
.
parseObject
(
itemResp
.
getExtInfo
());
JSONObject
extJson
=
JSONObject
.
parseObject
(
itemResp
.
getExtInfo
());
CartGoods
.
SpecialExtra
specialExtra
=
new
CartGoods
.
SpecialExtra
();
if
(
extJson
.
containsKey
(
"specialAttrs"
))
{
specialExtra
.
setAttributeId
(
extJson
.
containsKey
(
"attributeId"
)
?
extJson
.
getString
(
"attributeId"
)
:
""
);
CartGoods
.
SpecialExtra
specialExtra
=
new
CartGoods
.
SpecialExtra
();
specialExtra
.
setAttributeName
(
extJson
.
containsKey
(
"attributeName"
)
?
extJson
.
getString
(
"attributeName"
)
:
""
);
JSONArray
specialAttrs
=
JSONArray
.
parseArray
(
extJson
.
getString
(
"specialAttrs"
));
specialExtra
.
setAttributeId
(
extJson
.
containsKey
(
"specialCode"
)
?
extJson
.
getString
(
"specialCode"
)
:
""
);
for
(
Object
specialAttr
:
specialAttrs
)
{
comboxGoods
.
setSpecialExtra
(
Arrays
.
asList
(
specialExtra
));
JSONObject
object
=
JSONObject
.
parseObject
(
specialAttr
.
toString
());
specialExtra
.
setAttributeId
(
object
.
containsKey
(
"attributeId"
)
?
object
.
getString
(
"attributeId"
)
:
""
);
specialExtra
.
setAttributeName
(
object
.
containsKey
(
"attributeName"
)
?
object
.
getString
(
"attributeName"
)
:
""
);
specialExtra
.
setSpecialCode
(
object
.
containsKey
(
"specialCode"
)
?
object
.
getString
(
"specialCode"
)
:
""
);
}
comboxGoods
.
setSpecialExtra
(
Arrays
.
asList
(
specialExtra
));
}
}
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
76b74062
...
@@ -423,6 +423,9 @@ public class CalculationServiceImpl {
...
@@ -423,6 +423,9 @@ public class CalculationServiceImpl {
//加料
//加料
if
(
CollectionUtils
.
isNotEmpty
(
materialGoods
.
getProductMaterialList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
materialGoods
.
getProductMaterialList
()))
{
for
(
CartGoods
.
MaterialGoods
materialGoods2
:
materialGoods
.
getProductMaterialList
())
{
for
(
CartGoods
.
MaterialGoods
materialGoods2
:
materialGoods
.
getProductMaterialList
())
{
if
(
StringUtils
.
isEmpty
(
materialGoods2
.
getSpuId
()))
{
continue
;
}
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
material
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
();
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
material
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
();
material
.
setType
(
1
);
material
.
setType
(
1
);
material
.
setGoodsId
(
materialGoods2
.
getSpuId
());
material
.
setGoodsId
(
materialGoods2
.
getSpuId
());
...
...
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