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
0019fa51
Commit
0019fa51
authored
Aug 29, 2018
by
chang20170705
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
limit
parent
6c807939
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
14 deletions
+23
-14
BrandController.java
src/main/java/com/egolm/shop/controller/BrandController.java
+5
-1
GoodsController.java
src/main/java/com/egolm/shop/controller/GoodsController.java
+5
-1
BrandService.java
src/main/java/com/egolm/shop/service/BrandService.java
+1
-1
GoodsService.java
src/main/java/com/egolm/shop/service/GoodsService.java
+1
-1
BrandServiceImpl.java
...in/java/com/egolm/shop/service/impl/BrandServiceImpl.java
+5
-5
GoodsServiceImpl.java
...in/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
+6
-5
No files found.
src/main/java/com/egolm/shop/controller/BrandController.java
View file @
0019fa51
...
...
@@ -125,7 +125,11 @@ public class BrandController {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"OrgNO"
,
request
.
getParameter
(
"OrgNO"
));
params
.
put
(
"CompNO"
,
request
.
getParameter
(
"CompNO"
));
listMap
=
brandService
.
getHotSaleBrands
(
params
);
Page
page
=
new
Page
();
page
.
setIndex
(
1
l
);
page
.
setLimit
(
20
l
);
page
.
setLimitKey
(
"SaleQty desc"
);
listMap
=
brandService
.
getHotSaleBrands
(
params
,
page
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
listMap
).
toJson
();
}
...
...
src/main/java/com/egolm/shop/controller/GoodsController.java
View file @
0019fa51
...
...
@@ -84,7 +84,11 @@ public class GoodsController {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"OrgNO"
,
request
.
getParameter
(
"OrgNO"
));
params
.
put
(
"CompNO"
,
request
.
getParameter
(
"CompNO"
));
listMap
=
goodsService
.
getHotSaleGoods
(
params
);
Page
page
=
new
Page
();
page
.
setIndex
(
1
l
);
page
.
setLimit
(
20
l
);
page
.
setLimitKey
(
"SaleQty desc"
);
listMap
=
goodsService
.
getHotSaleGoods
(
params
,
page
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
listMap
).
toJson
();
}
}
src/main/java/com/egolm/shop/service/BrandService.java
View file @
0019fa51
...
...
@@ -11,5 +11,5 @@ public interface BrandService {
public
List
<
Map
<
String
,
Object
>>
getBrandList
(
Map
<
String
,
Object
>
map
);
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
);
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
,
Page
page
);
}
src/main/java/com/egolm/shop/service/GoodsService.java
View file @
0019fa51
...
...
@@ -9,5 +9,5 @@ public interface GoodsService {
public
List
<
Map
<
String
,
Object
>>
listThinkLike
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
);
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
,
Page
page
);
}
src/main/java/com/egolm/shop/service/impl/BrandServiceImpl.java
View file @
0019fa51
...
...
@@ -47,8 +47,8 @@ public class BrandServiceImpl implements BrandService {
}
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
)
{
String
sql
=
"SELECT
TOP 20
"
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
String
sql
=
"SELECT "
+
"BrandNO = b.sBrandID, "
+
"BrandName = b.sBrandName, "
+
"ImgPath = b.sLogoUrl, "
...
...
@@ -59,9 +59,9 @@ public class BrandServiceImpl implements BrandService {
+
"JOIN tAgentContractGoods acg ON a.sAgentContractNO = acg.sAgentContractNO "
+
"and a.nGoodsID = acg.nGoodsID "
+
"WHERE acg.sOrgNO = ? "
+
"GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+
"ORDER BY sum(a.nSaleQty) DESC "
;
+
"GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
;
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
return
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
OrgNO
);
}
}
src/main/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
View file @
0019fa51
...
...
@@ -51,8 +51,8 @@ public class GoodsServiceImpl implements GoodsService {
}
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
)
{
String
sql
=
"SELECT
TOP 20
"
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
String
sql
=
"SELECT "
+
"GoodsID = a.nGoodsID, "
+
"GoodsNO = g.sGoodsNO, "
+
"GoodsName = g.sGoodsDesc, "
...
...
@@ -69,10 +69,11 @@ public class GoodsServiceImpl implements GoodsService {
+
"and a.nGoodsID = acg.nGoodsID "
+
"WHERE acg.sOrgNO = ? "
+
"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+
"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
+
"ORDER BY sum(a.nSaleQty) DESC "
;
+
"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
;
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
return
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
OrgNO
);
}
...
...
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