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
daa14e7d
Commit
daa14e7d
authored
Apr 26, 2023
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d067b57b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
173 deletions
+189
-173
CartController.java
src/main/java/com/egolm/shop/api/CartController.java
+172
-163
CartQueryService.java
...ain/java/com/egolm/shop/api/service/CartQueryService.java
+7
-7
CartQueryServiceImpl.java
...com/egolm/shop/api/service/impl/CartQueryServiceImpl.java
+8
-2
CartServiceImpl.java
...java/com/egolm/shop/api/service/impl/CartServiceImpl.java
+2
-1
No files found.
src/main/java/com/egolm/shop/api/CartController.java
View file @
daa14e7d
...
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.shop.api.service.CartService
;
...
...
@@ -49,6 +50,7 @@ public class CartController {
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"店铺编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"isCalcPromo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"是否计算汇总 0为不计算,1为计算"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
...
...
@@ -57,11 +59,18 @@ public class CartController {
@RequestMapping
(
value
=
"/cartQuery"
,
method
=
RequestMethod
.
GET
)
public
String
cartQuery
(
String
orgNo
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
isCaclPromo
=
request
.
getParameter
(
"isCalcPromo"
);
if
(
StringUtil
.
isNotUndefinedAndNull
(
isCaclPromo
)
&&
StringUtil
.
isNotEmpty
(
isCaclPromo
))
{
}
else
{
isCaclPromo
=
"1"
;
//
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"orgNo"
,
orgNo
);
params
.
put
(
"shopNO"
,
request
.
getParameter
(
"shopNO"
));
params
.
put
(
"terminal"
,
request
.
getParameter
(
"terminal"
));
params
.
put
(
"langID"
,
request
.
getParameter
(
"langID"
));
params
.
put
(
"isCalcPromo"
,
isCaclPromo
);
return
cartService
.
query
(
params
);
}
...
...
src/main/java/com/egolm/shop/api/service/CartQueryService.java
View file @
daa14e7d
...
...
@@ -3,5 +3,5 @@ package com.egolm.shop.api.service;
import
java.util.Map
;
public
interface
CartQueryService
{
public
Map
<
String
,
Object
>
query
(
String
orgNo
,
String
shopNo
,
String
terminal
)
;
public
Map
<
String
,
Object
>
query
(
String
orgNo
,
String
shopNo
,
String
terminal
,
String
isCalcPromo
)
;
}
src/main/java/com/egolm/shop/api/service/impl/CartQueryServiceImpl.java
View file @
daa14e7d
...
...
@@ -43,7 +43,7 @@ public class CartQueryServiceImpl implements CartQueryService {
@Autowired
private
JdbcTemplate
jdbcTemplate
;
public
Map
<
String
,
Object
>
query
(
String
orgNo
,
String
shopNo
,
String
terminal
)
{
public
Map
<
String
,
Object
>
query
(
String
orgNo
,
String
shopNo
,
String
terminal
,
String
isCalcPromo
)
{
Rjx
rjx
=
Rjx
.
json
().
set
(
"IsValid"
,
true
);
if
(!
StringUtil
.
isNotUndefinedAndNull
(
shopNo
,
terminal
))
{
throw
new
ReflectException
(
"Query the shopping cart parameter error:"
...
...
@@ -72,6 +72,12 @@ public class CartQueryServiceImpl implements CartQueryService {
e1
.
printStackTrace
();
}
try
{
String
sql1
=
"exec up_B2BCartToCartTempItem '"
+
shopNo
+
"', '"
+
isCalcPromo
+
"' "
;
//是否计算促销
jdbcTemplate
.
executeUpdate
(
sql1
);
}
catch
(
Exception
e1
)
{
e1
.
printStackTrace
();
}
List
<
Map
<
String
,
Object
>>
datas
=
this
.
getGoodsList
(
orgNo
,
shopNo
,
terminal
);
...
...
src/main/java/com/egolm/shop/api/service/impl/CartServiceImpl.java
View file @
daa14e7d
...
...
@@ -216,7 +216,8 @@ 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
.
query
(
orgNo
,
shopNO
,
terminal
);
String
isCalcPromo
=
params
.
get
(
"isCalcPromo"
)+
""
;
//"是否计算汇总 0为不计算,1为计算"
Map
<
String
,
Object
>
queryMap
=
cartRedisService
.
query
(
orgNo
,
shopNO
,
terminal
,
isCalcPromo
);
/*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