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
f9b01ef5
Commit
f9b01ef5
authored
Sep 29, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
a8fc9e9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
PromoController.java
src/main/java/com/egolm/shop/controller/PromoController.java
+11
-0
PromoServiceImpl.java
...in/java/com/egolm/shop/service/impl/PromoServiceImpl.java
+10
-13
No files found.
src/main/java/com/egolm/shop/controller/PromoController.java
View file @
f9b01ef5
package
com
.
egolm
.
shop
.
controller
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -58,7 +59,16 @@ public class PromoController {
})
@GetMapping
(
"getGroupGoodsDetail"
)
public
Object
getGroupGoodsDetail
(
String
orgNo
,
String
shopNo
,
String
promoPaperNO
,
String
promoGroupNO
)
{
Integer
status
=
0
;
Date
now
=
new
Date
();
Map
<
String
,
Object
>
promoMap
=
service
.
getPromoDetail
(
promoPaperNO
);
Date
dPromoBeginDate
=
(
Date
)
promoMap
.
get
(
"dPromoBeginDate"
);
Date
dPromoEndDate
=
(
Date
)
promoMap
.
get
(
"dPromoEndDate"
);
if
(
now
.
compareTo
(
dPromoBeginDate
)
<
0
)
{
status
=
1
;
}
else
if
(
now
.
compareTo
(
dPromoEndDate
)
>
0
)
{
status
=
2
;
}
List
<
Map
<
String
,
Object
>>
list
=
service
.
getGroupGoodsDetail
(
orgNo
,
shopNo
,
promoPaperNO
,
promoGroupNO
);
BigDecimal
nTotalRealAmount
=
BigDecimal
.
ZERO
;
BigDecimal
nTotalPayAmount
=
BigDecimal
.
ZERO
;
...
...
@@ -74,6 +84,7 @@ public class PromoController {
promoMap
.
put
(
"nTotalRealAmount"
,
nTotalRealAmount
);
promoMap
.
put
(
"nTotalPayAmount"
,
nTotalPayAmount
);
promoMap
.
put
(
"nTotalQty"
,
nTotalQty
);
promoMap
.
put
(
"status"
,
status
);
promoMap
.
put
(
"sPromoGrouoNO"
,
promoGroupNO
);
List
<
Map
<
String
,
Object
>>
DLPicList
=
service
.
getGroupPicList
(
"DL"
,
promoPaperNO
,
promoGroupNO
);
List
<
Map
<
String
,
Object
>>
BNPicList
=
service
.
getGroupPicList
(
"BN"
,
promoPaperNO
,
promoGroupNO
);
...
...
src/main/java/com/egolm/shop/service/impl/PromoServiceImpl.java
View file @
f9b01ef5
...
...
@@ -50,8 +50,6 @@ public class PromoServiceImpl implements PromoService {
@Override
public
List
<
Map
<
String
,
Object
>>
getGroupGoodsDetail
(
String
orgNo
,
String
shopNo
,
String
sPromoPaperNO
,
String
sPromoGroupNO
)
{
Map
<
String
,
Object
>
custMap
=
jdbcTemplate
.
queryForMap
(
"select c.* from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ? and s.sOrgNO = ?"
,
shopNo
,
orgNo
);
String
sCustTypeID
=
(
String
)
custMap
.
get
(
"sCustTypeID"
);
String
sql
=
""
+
" SELECT DISTINCT "
+
" nGoodsID = b.nGoodsID, "
+
...
...
@@ -82,18 +80,17 @@ public class PromoServiceImpl implements PromoService {
" AND a.sPromoActionTypeID = '3' "
+
" AND a.nTag&3=2 "
+
" AND b.nTag&3=2 "
+
" AND getdate() BETWEEN a.dPromoBeginDate AND a.dPromoEndDate "
+
" AND CASE WHEN nUseCycle&1 = 1 THEN '1,' ELSE '' END + "
+
" CASE WHEN nUseCycle&2 = 2 THEN '2,' ELSE '' END + "
+
" CASE WHEN nUseCycle&4 = 4 THEN '3,' ELSE '' END + "
+
" CASE WHEN nUseCycle&8 = 8 THEN '4,' ELSE '' END + "
+
" CASE WHEN nUseCycle&16 = 16 THEN '5,' ELSE '' END + "
+
" CASE WHEN nUseCycle&32 = 32 THEN '6,' ELSE '' END + "
+
" CASE WHEN nUseCycle&64 = 64 THEN '7' ELSE '' END LIKE '%' + convert(VARCHAR,datepart(weekday,getdate())) + '%' "
+
//
" AND getdate() BETWEEN a.dPromoBeginDate AND a.dPromoEndDate " +
//
" AND CASE WHEN nUseCycle&1 = 1 THEN '1,' ELSE '' END + " +
//
" CASE WHEN nUseCycle&2 = 2 THEN '2,' ELSE '' END + " +
//
" CASE WHEN nUseCycle&4 = 4 THEN '3,' ELSE '' END + " +
//
" CASE WHEN nUseCycle&8 = 8 THEN '4,' ELSE '' END + " +
//
" CASE WHEN nUseCycle&16 = 16 THEN '5,' ELSE '' END + " +
//
" CASE WHEN nUseCycle&32 = 32 THEN '6,' ELSE '' END + " +
//
" CASE WHEN nUseCycle&64 = 64 THEN '7' ELSE '' END LIKE '%' + convert(VARCHAR,datepart(weekday,getdate())) + '%' " +
" AND a.sPromoPaperNO = ? "
+
" AND b.sPromoGroupNO = ? "
;
//" AND c.sShopNO = ? ";
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
sql
.
replaceAll
(
"\\s+"
,
" "
),
sPromoPaperNO
,
sPromoGroupNO
,
sCustTypeID
);
" AND b.sPromoGroupNO = ? "
;
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
sql
.
replaceAll
(
"\\s+"
,
" "
),
sPromoPaperNO
,
sPromoGroupNO
);
return
list
;
}
...
...
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