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
3d0cc611
Commit
3d0cc611
authored
Nov 11, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
7b5ac07c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
CartController.java
src/main/java/com/egolm/shop/controller/CartController.java
+18
-0
CartService.java
src/main/java/com/egolm/shop/service/CartService.java
+2
-0
CartServiceImpl.java
...ain/java/com/egolm/shop/service/impl/CartServiceImpl.java
+13
-0
No files found.
src/main/java/com/egolm/shop/controller/CartController.java
View file @
3d0cc611
...
...
@@ -126,6 +126,24 @@ public class CartController {
return
cartService
.
updateQty
(
jsonObj
,
terminal
);
}
@ApiOperation
(
"修改数量(JSON格式)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\", \"idx\": 2,\"setPrice\": \"2.3\"}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/setPrice"
,
method
=
RequestMethod
.
POST
)
public
String
setPrice
(
String
orgNo
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
reqJson
=
request
.
getParameter
(
"data"
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
reqJson
);
jsonObj
.
put
(
"orgNo"
,
orgNo
);
System
.
out
.
println
(
"setPrice-------"
+
reqJson
);
String
terminal
=
request
.
getParameter
(
"terminal"
);
return
cartService
.
setPrice
(
jsonObj
,
terminal
);
}
@ApiOperation
(
"清空购物车"
)
@ApiImplicitParams
({
...
...
src/main/java/com/egolm/shop/service/CartService.java
View file @
3d0cc611
...
...
@@ -17,4 +17,6 @@ public interface CartService {
public
Map
<
String
,
Object
>
count
(
String
orgNo
,
String
shopNO
);
public
void
clear
(
String
orgNo
,
String
shopNo
);
public
String
setPrice
(
JSONObject
jsonObj
,
String
terminal
);
}
src/main/java/com/egolm/shop/service/impl/CartServiceImpl.java
View file @
3d0cc611
...
...
@@ -165,6 +165,19 @@ public class CartServiceImpl implements CartService {
return
Rjx
.
jsonOk
().
set
(
"count"
,
count
(
orgNo
,
shopNO
)).
toJson
();
}
@Override
public
String
setPrice
(
JSONObject
obj
,
String
terminal
)
{
String
orgNo
=
obj
.
getString
(
"orgNo"
);
String
shopNO
=
obj
.
getString
(
"shopNO"
);
Integer
idx
=
obj
.
getInteger
(
"idx"
);
BigDecimal
setPrice
=
obj
.
getBigDecimal
(
"setPrice"
);
String
sql
=
"update tCart set nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"
;
jdbcTemplate
.
executeUpdate
(
sql
,
setPrice
,
orgNo
,
shopNO
,
idx
);
return
Rjx
.
jsonOk
().
toJson
();
}
/**
* 查询购物车
* <p>Title: query</p>
...
...
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