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
cb1e8bee
Commit
cb1e8bee
authored
Sep 22, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
c3d467ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
CartController.java
src/main/java/com/egolm/shop/controller/CartController.java
+1
-1
CartServiceImpl.java
...ain/java/com/egolm/shop/service/impl/CartServiceImpl.java
+4
-2
No files found.
src/main/java/com/egolm/shop/controller/CartController.java
View file @
cb1e8bee
...
...
@@ -70,7 +70,7 @@ public class CartController {
@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\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\"
}]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\"
, \"warehouseNO\": 'xxx'
}]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
...
...
src/main/java/com/egolm/shop/service/impl/CartServiceImpl.java
View file @
cb1e8bee
...
...
@@ -47,6 +47,7 @@ public class CartServiceImpl implements CartService {
String
sAgentContractNO
=
Util
.
objTo
(
cartObj
.
get
(
"agentContractNO"
),
String
.
class
);
String
sPromoPaperNO
=
Util
.
objTo
(
cartObj
.
get
(
"promoPaperNO"
),
String
.
class
,
null
);
String
sPromoGroupNO
=
Util
.
objTo
(
cartObj
.
get
(
"promoGroupNO"
),
String
.
class
,
null
);
String
sWarehouseNO
=
Util
.
objTo
(
cartObj
.
get
(
"warehouseNO"
),
String
.
class
,
null
);
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
)
&&
StringUtil
.
isNotBlank
(
sPromoGroupNO
))
{
...
...
@@ -56,6 +57,7 @@ public class CartServiceImpl implements CartService {
strs
.
add
(
"sShopNO = '"
+
shopNO
+
"'"
);
strs
.
add
(
"nTag = "
+
nGoodsTypeID
);
strs
.
add
(
"sAgentContractNO = '"
+
sAgentContractNO
+
"'"
);
strs
.
add
(
"sWarehouseNO = '"
+
sWarehouseNO
+
"'"
);
strs
.
add
(
"nGoodsID = "
+
nGoodsID
);
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
))
{
strs
.
add
(
"sPromoPaperNO = '"
+
sPromoPaperNO
+
"'"
);
...
...
@@ -69,8 +71,8 @@ public class CartServiceImpl implements CartService {
}
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
"select nIdx, nSaleQty, sPromoPaperNO from tCart"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
strs
));
if
(
list
.
size
()
==
0
)
{
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
sPromoPaperNO
,
sPromoGroupNO
};
jdbcTemplate
.
executeUpdate
(
"insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID,
nSaleQty, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO) values (
?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?)"
,
args
);
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
sWarehouseNO
,
nSaleQty
,
sPromoPaperNO
,
sPromoGroupNO
};
jdbcTemplate
.
executeUpdate
(
"insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID,
sWarehouseNO, nSaleQty, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO) values (?,
?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?)"
,
args
);
}
else
{
Integer
nIdx
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nIdx"
),
Integer
.
class
);
Double
nQty
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nSaleQty"
),
Double
.
class
);
...
...
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