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
3eab5926
Commit
3eab5926
authored
Dec 04, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
91fa395d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
CartServiceImpl.java
...ain/java/com/egolm/shop/service/impl/CartServiceImpl.java
+5
-11
No files found.
src/main/java/com/egolm/shop/service/impl/CartServiceImpl.java
View file @
3eab5926
...
@@ -60,16 +60,6 @@ public class CartServiceImpl implements CartService {
...
@@ -60,16 +60,6 @@ public class CartServiceImpl implements CartService {
strs
.
add
(
"nTag = "
+
nGoodsTypeID
);
strs
.
add
(
"nTag = "
+
nGoodsTypeID
);
strs
.
add
(
"sAgentContractNO = '"
+
sAgentContractNO
+
"'"
);
strs
.
add
(
"sAgentContractNO = '"
+
sAgentContractNO
+
"'"
);
strs
.
add
(
"nGoodsID = "
+
nGoodsID
);
strs
.
add
(
"nGoodsID = "
+
nGoodsID
);
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
))
{
strs
.
add
(
"sPromoPaperNO = '"
+
sPromoPaperNO
+
"'"
);
}
else
{
strs
.
add
(
"(sPromoPaperNO = '' or sPromoPaperNO is null)"
);
}
if
(
StringUtil
.
isNotBlank
(
sPromoGroupNO
))
{
strs
.
add
(
"sPromoGroupNO = '"
+
sPromoGroupNO
+
"'"
);
}
else
{
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
));
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
"select nIdx, nSaleQty, sPromoPaperNO from tCart"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
strs
));
if
(
list
.
size
()
==
0
)
{
if
(
list
.
size
()
==
0
)
{
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
nSetPrice
,
sPromoPaperNO
,
sPromoGroupNO
};
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
nSetPrice
,
sPromoPaperNO
,
sPromoGroupNO
};
...
@@ -77,7 +67,11 @@ public class CartServiceImpl implements CartService {
...
@@ -77,7 +67,11 @@ public class CartServiceImpl implements CartService {
}
else
{
}
else
{
Integer
nIdx
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nIdx"
),
Integer
.
class
);
Integer
nIdx
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nIdx"
),
Integer
.
class
);
Double
nQty
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nSaleQty"
),
Double
.
class
);
Double
nQty
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nSaleQty"
),
Double
.
class
);
jdbcTemplate
.
executeUpdate
(
"update tCart set nSaleQty = "
+
(
nSaleQty
+
nQty
)
+
", nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"
,
nSetPrice
,
orgNo
,
shopNO
,
nIdx
);
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
))
{
jdbcTemplate
.
executeUpdate
(
"update tCart set sPromoPaperNO = ?, sPromoGroupNO = ?, nSaleQty = "
+
(
nSaleQty
+
nQty
)
+
", nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"
,
sPromoPaperNO
,
sPromoGroupNO
,
nSetPrice
,
orgNo
,
shopNO
,
nIdx
);
}
else
{
jdbcTemplate
.
executeUpdate
(
"update tCart set nSaleQty = "
+
(
nSaleQty
+
nQty
)
+
", nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"
,
nSetPrice
,
orgNo
,
shopNO
,
nIdx
);
}
}
}
}
}
}
}
...
...
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