Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
66443abd
Commit
66443abd
authored
Oct 17, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
394245b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
CartController.java
src/main/java/com/egolm/shop/controller/CartController.java
+2
-2
CartService.java
src/main/java/com/egolm/shop/service/CartService.java
+1
-1
CartServiceImpl.java
...ain/java/com/egolm/shop/service/impl/CartServiceImpl.java
+4
-3
No files found.
src/main/java/com/egolm/shop/controller/CartController.java
View file @
66443abd
...
...
@@ -40,8 +40,8 @@ public class CartController {
@RequestMapping
(
value
=
"/getCartCount"
,
method
=
RequestMethod
.
GET
)
public
String
cartQuery
(
String
orgNo
,
String
shopNo
)
{
Integer
count
=
cartService
.
count
(
orgNo
,
shopNo
);
return
Rjx
.
jsonOk
().
set
(
"count"
,
count
).
toJson
();
Map
<
String
,
Object
>
map
=
cartService
.
count
(
orgNo
,
shopNo
);
return
Rjx
.
jsonOk
().
set
(
"count"
,
map
.
get
(
"totalCount"
)).
set
(
"qty"
,
map
.
get
(
"totalSaleQty"
)
).
toJson
();
}
...
...
src/main/java/com/egolm/shop/service/CartService.java
View file @
66443abd
...
...
@@ -14,7 +14,7 @@ public interface CartService {
public
String
query
(
Map
<
String
,
Object
>
params
);
public
Integer
count
(
String
orgNo
,
String
shopNO
);
public
Map
<
String
,
Object
>
count
(
String
orgNo
,
String
shopNO
);
public
void
clear
(
String
orgNo
,
String
shopNo
);
}
src/main/java/com/egolm/shop/service/impl/CartServiceImpl.java
View file @
66443abd
...
...
@@ -92,8 +92,8 @@ public class CartServiceImpl implements CartService {
* @return: Integer
* @throws
*/
public
Integer
count
(
String
orgNo
,
String
shopNO
)
{
return
jdbcTemplate
.
queryFor
Int
(
"select count(1)
from V_Cart where sOrgNO = '"
+
orgNo
+
"' and sShopNO = '"
+
shopNO
+
"'"
);
public
Map
<
String
,
Object
>
count
(
String
orgNo
,
String
shopNO
)
{
return
jdbcTemplate
.
queryFor
Map
(
"select count(nSaleQty) totalCount , sum(nSaleQty) totalSaleQty
from V_Cart where sOrgNO = '"
+
orgNo
+
"' and sShopNO = '"
+
shopNO
+
"'"
);
}
...
...
@@ -179,8 +179,9 @@ public class CartServiceImpl implements CartService {
String
orgNo
=
(
String
)
params
.
get
(
"orgNo"
);
String
shopNO
=
params
.
get
(
"shopNO"
)+
""
;
String
terminal
=
params
.
get
(
"terminal"
)+
""
;
Map
<
String
,
Object
>
queryMap
=
cartRedisService
.
querySync
(
orgNo
,
shopNO
,
terminal
);
Map
<
String
,
Object
>
countMap
=
this
.
count
(
orgNo
,
shopNO
);
queryMap
.
putAll
(
countMap
);
return
Rjx
.
jsonOk
().
setData
(
queryMap
).
toJson
();
}
...
...
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