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
1e589a0f
Commit
1e589a0f
authored
Oct 29, 2020
by
yu.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::fix bug about specialAttribute copyOrder
parent
5ab3f7a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+23
-10
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
1e589a0f
...
@@ -61,6 +61,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -61,6 +61,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.json.JSONString
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
...
@@ -860,11 +861,17 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -860,11 +861,17 @@ public class ShoppingCartMCoffeeServiceImpl {
//特制
//特制
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
(
extJson
.
containsKey
(
"attributeId"
)
?
extJson
.
getString
(
"attributeId"
)
:
""
);
specialExtra
.
setAttributeName
(
extJson
.
containsKey
(
"attributeName"
)
?
extJson
.
getString
(
"attributeName"
)
:
""
);
specialExtra
.
setAttributeId
(
extJson
.
containsKey
(
"specialCode"
)
?
extJson
.
getString
(
"specialCode"
)
:
""
);
}
cartGoods
.
setSpecialExtra
(
Arrays
.
asList
(
specialExtra
));
}
}
}
if
(
ObjectUtils
.
equals
(
88
,
orderItem
.
getProductType
()))
{
if
(
ObjectUtils
.
equals
(
88
,
orderItem
.
getProductType
()))
{
...
@@ -909,11 +916,17 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -909,11 +916,17 @@ public class ShoppingCartMCoffeeServiceImpl {
//特制
//特制
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
(
extJson
.
containsKey
(
"attributeId"
)
?
extJson
.
getString
(
"attributeId"
)
:
""
);
specialExtra
.
setAttributeName
(
extJson
.
containsKey
(
"attributeName"
)
?
extJson
.
getString
(
"attributeName"
)
:
""
);
specialExtra
.
setAttributeId
(
extJson
.
containsKey
(
"specialCode"
)
?
extJson
.
getString
(
"specialCode"
)
:
""
);
}
cartGoods
.
setSpecialExtra
(
Arrays
.
asList
(
specialExtra
));
}
}
}
}
}
...
...
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