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
767da70a
Commit
767da70a
authored
Aug 23, 2024
by
张永
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://zhangyong@gitlab.linkfern.com/key/shop.git
parents
cb68c842
a9d83ac4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
CartServiceImpl.java
...java/com/egolm/shop/api/service/impl/CartServiceImpl.java
+10
-1
No files found.
src/main/java/com/egolm/shop/api/service/impl/CartServiceImpl.java
View file @
767da70a
...
@@ -102,7 +102,16 @@ public class CartServiceImpl implements CartService {
...
@@ -102,7 +102,16 @@ public class CartServiceImpl implements CartService {
}
else
{
}
else
{
strs
.
add
(
"(sPromoGroupNO = '' or sPromoGroupNO is null)"
);
strs
.
add
(
"(sPromoGroupNO = '' or sPromoGroupNO is null)"
);
}
}
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
"select nIdx, nSaleQty, sPromoPaperNO from tCart"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
strs
));
//查询购物车是否已存在,改为按sOrgNO、sShopNO、nTag、sAgentContractNO、nGoodsID来检查唯一性
List
<
String
>
strQuery
=
new
ArrayList
<
String
>();
strQuery
.
add
(
"sShopNO = '"
+
shopNO
+
"'"
);
strQuery
.
add
(
"sAgentContractNO = '"
+
sAgentContractNO
+
"'"
);
strQuery
.
add
(
"nGoodsID = "
+
nGoodsID
);
strQuery
.
add
(
"sOrgNO = '"
+
orgNo
+
"'"
);
strQuery
.
add
(
"nTag = "
+
nGoodsTypeID
);
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
"select nIdx, nSaleQty, sPromoPaperNO from tCart"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
strQuery
));
if
(
list
.
size
()
==
0
)
{
if
(
list
.
size
()
==
0
)
{
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
nSetPrice
,
sPromoPaperNO
,
sPromoGroupNO
,
sSaleUnit
,
saleBigQty
};
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
nSetPrice
,
sPromoPaperNO
,
sPromoGroupNO
,
sSaleUnit
,
saleBigQty
};
jdbcTemplate
.
executeUpdate
(
"insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID, nSaleQty, nSetPrice, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO,sSaleUnit,nSaleBigQty) values (?, ?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?,?,?)"
,
args
);
jdbcTemplate
.
executeUpdate
(
"insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID, nSaleQty, nSetPrice, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO,sSaleUnit,nSaleBigQty) values (?, ?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?,?,?)"
,
args
);
...
...
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