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
38b4a138
Commit
38b4a138
authored
Aug 29, 2018
by
chang20170705
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
brand
parent
a7064dc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
BrandController.java
src/main/java/com/egolm/shop/controller/BrandController.java
+10
-9
BrandServiceImpl.java
...in/java/com/egolm/shop/service/impl/BrandServiceImpl.java
+2
-2
GoodsServiceImpl.java
...in/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
+2
-2
No files found.
src/main/java/com/egolm/shop/controller/BrandController.java
View file @
38b4a138
...
@@ -84,21 +84,21 @@ public class BrandController {
...
@@ -84,21 +84,21 @@ public class BrandController {
Map
<
String
,
List
>
pinMap
=
new
HashMap
<>();
Map
<
String
,
List
>
pinMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
item:
listMap
)
{
for
(
Map
<
String
,
Object
>
item:
listMap
)
{
String
first
=((
String
)
item
.
get
(
"PinyinCode"
)).
substring
(
0
,
1
).
toUpperCase
();
String
first
=((
String
)
item
.
get
(
"PinyinCode"
)).
substring
(
0
,
1
).
toUpperCase
();
Map
<
String
,
String
>
Brand
List
=
new
HashMap
<>();
Map
<
String
,
String
>
Brand
Map
=
new
HashMap
<>();
Brand
List
.
put
(
"BrandNO"
,
(
String
)
item
.
get
(
"BrandNO"
));
Brand
Map
.
put
(
"BrandNO"
,
(
String
)
item
.
get
(
"BrandNO"
));
Brand
List
.
put
(
"BrandName"
,
(
String
)
item
.
get
(
"BrandName"
));
Brand
Map
.
put
(
"BrandName"
,
(
String
)
item
.
get
(
"BrandName"
));
Brand
List
.
put
(
"ImgPath"
,
(
String
)
item
.
get
(
"ImgPath"
));
Brand
Map
.
put
(
"ImgPath"
,
(
String
)
item
.
get
(
"ImgPath"
));
if
(
first
.
matches
(
reg
))
{
if
(
first
.
matches
(
reg
))
{
if
(
pinMap
.
containsKey
(
first
))
{
if
(
pinMap
.
containsKey
(
first
))
{
pinMap
.
get
(
first
).
add
(
Brand
List
);
pinMap
.
get
(
first
).
add
(
Brand
Map
);
}
else
{
}
else
{
pinMap
.
put
(
first
,
new
ArrayList
()
{{
add
(
BrandList
);}});
pinMap
.
put
(
first
,
new
ArrayList
<
Map
>()
{{
add
(
BrandMap
);}});
}
}
}
else
{
}
else
{
if
(
pinMap
.
containsKey
(
"#"
))
{
if
(
pinMap
.
containsKey
(
"#"
))
{
pinMap
.
get
(
"#"
).
add
(
Brand
List
);
pinMap
.
get
(
"#"
).
add
(
Brand
Map
);
}
else
{
}
else
{
pinMap
.
put
(
"#"
,
new
ArrayList
()
{{
add
(
BrandList
);}});
pinMap
.
put
(
"#"
,
new
ArrayList
<
Map
>(){{
add
(
BrandMap
);}});
}
}
}
}
...
@@ -108,7 +108,8 @@ public class BrandController {
...
@@ -108,7 +108,8 @@ public class BrandController {
for
(
Entry
<
String
,
List
>
entry
:
pinMap
.
entrySet
())
{
for
(
Entry
<
String
,
List
>
entry
:
pinMap
.
entrySet
())
{
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"PyCode"
,
entry
.
getKey
());
returnMap
.
put
(
"PyCode"
,
entry
.
getKey
());
returnMap
.
put
(
"BrandList"
,
entry
.
getValue
());
returnMap
.
put
(
"BrandList"
,
entry
.
getValue
().
toArray
());
returnList
.
add
(
returnMap
);
}
}
return
Rjx
.
jsonOk
().
set
(
"list"
,
returnList
).
toJson
();
return
Rjx
.
jsonOk
().
set
(
"list"
,
returnList
).
toJson
();
}
}
...
...
src/main/java/com/egolm/shop/service/impl/BrandServiceImpl.java
View file @
38b4a138
...
@@ -49,7 +49,7 @@ public class BrandServiceImpl implements BrandService {
...
@@ -49,7 +49,7 @@ public class BrandServiceImpl implements BrandService {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
)
{
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
listMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
listMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
String
sql
=
"SELECT
"
// TOP 20
String
sql
=
"SELECT
TOP 20 "
//
+
"BrandNO = b.sBrandID, "
+
"BrandNO = b.sBrandID, "
+
"BrandName = b.sBrandName, "
+
"BrandName = b.sBrandName, "
+
"ImgPath = b.sLogoUrl, "
+
"ImgPath = b.sLogoUrl, "
...
@@ -61,7 +61,7 @@ public class BrandServiceImpl implements BrandService {
...
@@ -61,7 +61,7 @@ public class BrandServiceImpl implements BrandService {
+
"and a.nGoodsID = acg.nGoodsID "
+
"and a.nGoodsID = acg.nGoodsID "
+
"WHERE acg.sOrgNO = ? "
+
"WHERE acg.sOrgNO = ? "
+
"GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+
"GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+
"ORDER BY sum(a.nSaleQty) DESC
limit 0,20 "
;
+
"ORDER BY sum(a.nSaleQty) DESC
"
;
//limit 0,20
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
listMap
=
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
listMap
=
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
return
listMap
;
return
listMap
;
...
...
src/main/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
View file @
38b4a138
...
@@ -52,7 +52,7 @@ public class GoodsServiceImpl implements GoodsService {
...
@@ -52,7 +52,7 @@ public class GoodsServiceImpl implements GoodsService {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
)
{
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
listMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
listMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
String
sql
=
"SELECT
"
// TOP 20
String
sql
=
"SELECT
TOP 20"
//
+
"GoodsID = a.nGoodsID, "
+
"GoodsID = a.nGoodsID, "
+
"GoodsNO = g.sGoodsNO, "
+
"GoodsNO = g.sGoodsNO, "
+
"GoodsName = g.sGoodsDesc, "
+
"GoodsName = g.sGoodsDesc, "
...
@@ -70,7 +70,7 @@ public class GoodsServiceImpl implements GoodsService {
...
@@ -70,7 +70,7 @@ public class GoodsServiceImpl implements GoodsService {
+
"WHERE acg.sOrgNO = ? "
+
"WHERE acg.sOrgNO = ? "
+
"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+
"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+
"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
+
"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
+
"ORDER BY sum(a.nSaleQty) DESC
limit 0,20"
;
+
"ORDER BY sum(a.nSaleQty) DESC
"
;
//limit 0,20
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
listMap
=
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
listMap
=
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
return
listMap
;
return
listMap
;
...
...
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