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
24fe754b
Commit
24fe754b
authored
Aug 06, 2021
by
胡博文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回退代码
parent
fb2685be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+33
-33
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
24fe754b
...
@@ -2619,39 +2619,39 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -2619,39 +2619,39 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if
(
Objects
.
nonNull
(
cartGoods
))
{
if
(
Objects
.
nonNull
(
cartGoods
))
{
qty
+=
cartGoods
.
getQty
();
qty
+=
cartGoods
.
getQty
();
}
}
//
String redisKey = limitCartKey + appid;
String
redisKey
=
limitCartKey
+
appid
;
//
//
Object value = redisCache.hashGet(redisKey, "2");
Object
value
=
redisCache
.
hashGet
(
redisKey
,
"2"
);
//
if (value == null) {
if
(
value
==
null
)
{
//
return qty;
return
qty
;
//
} else {
}
else
{
//
boolean bool = value.getClass().getName().equals("java.lang.String");
boolean
bool
=
value
.
getClass
().
getName
().
equals
(
"java.lang.String"
);
//
if (bool) {
if
(
bool
)
{
//
return qty;
return
qty
;
//
}
}
//
JSONArray jsonArray = (JSONArray) value;
JSONArray
jsonArray
=
(
JSONArray
)
value
;
//
int cartLimitFlag = 0;
int
cartLimitFlag
=
0
;
//
int cartLimitCount = 0;
int
cartLimitCount
=
0
;
//
for (Object object : jsonArray) {
for
(
Object
object
:
jsonArray
)
{
//
JSONObject jsonObject = (JSONObject) object;
JSONObject
jsonObject
=
(
JSONObject
)
object
;
//
HashMap hashMap = JSONObject.parseObject(jsonObject.toJSONString(), HashMap.class);
HashMap
hashMap
=
JSONObject
.
parseObject
(
jsonObject
.
toJSONString
(),
HashMap
.
class
);
//
if ("cartLimitFlag".equals(hashMap.get("appKey"))) {
if
(
"cartLimitFlag"
.
equals
(
hashMap
.
get
(
"appKey"
)))
{
//
if (StringUtils.isBlank((String) hashMap.get("appValue"))) {
if
(
StringUtils
.
isBlank
((
String
)
hashMap
.
get
(
"appValue"
)))
{
//
return qty;
return
qty
;
//
}
}
//
cartLimitFlag = Integer.parseInt((String) hashMap.get("appValue"));
cartLimitFlag
=
Integer
.
parseInt
((
String
)
hashMap
.
get
(
"appValue"
));
//
}
}
//
if ("cartLimitCount".equals(hashMap.get("appKey"))) {
if
(
"cartLimitCount"
.
equals
(
hashMap
.
get
(
"appKey"
)))
{
//
if (StringUtils.isBlank((String) hashMap.get("appValue"))) {
if
(
StringUtils
.
isBlank
((
String
)
hashMap
.
get
(
"appValue"
)))
{
//
return qty;
return
qty
;
//
}
}
//
cartLimitCount = Integer.parseInt((String) hashMap.get("appValue"));
cartLimitCount
=
Integer
.
parseInt
((
String
)
hashMap
.
get
(
"appValue"
));
//
}
}
//
}
}
//
if (cartLimitFlag == 1 && cartLimitCount != 0 && qty > cartLimitCount) {
if
(
cartLimitFlag
==
1
&&
cartLimitCount
!=
0
&&
qty
>
cartLimitCount
)
{
//
throw new ServiceException(ResponseResult.SHOPPING_CART_LIMIT_ADD);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_LIMIT_ADD
);
//
}
}
//
}
}
return
qty
;
return
qty
;
}
}
...
...
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