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
e637d3cc
Commit
e637d3cc
authored
Sep 18, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
36190a6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
33 deletions
+42
-33
BrandController.java
src/main/java/com/egolm/shop/controller/BrandController.java
+17
-6
BrandService.java
src/main/java/com/egolm/shop/service/BrandService.java
+2
-2
BrandServiceImpl.java
...in/java/com/egolm/shop/service/impl/BrandServiceImpl.java
+23
-25
No files found.
src/main/java/com/egolm/shop/controller/BrandController.java
View file @
e637d3cc
...
...
@@ -81,13 +81,10 @@ public class BrandController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getBrandList"
,
method
=
RequestMethod
.
GET
)
public
String
getBrandList
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
@RequestMapping
(
value
=
"/get
Group
BrandList"
,
method
=
RequestMethod
.
GET
)
public
String
get
Group
BrandList
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
List
<
Map
<
String
,
Object
>>
listMap
;
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orgNo"
,
request
.
getParameter
(
"orgNo"
));
params
.
put
(
"shopNo"
,
request
.
getParameter
(
"shopNo"
));
listMap
=
brandService
.
getBrandList
(
params
);
listMap
=
brandService
.
queryBrandList
(
request
.
getParameter
(
"orgNo"
));
String
reg
=
"[A-Z]"
;
//用map把相同首字母放到同一个list中
Map
<
String
,
List
>
pinMap
=
new
HashMap
<>();
...
...
@@ -123,6 +120,20 @@ public class BrandController {
return
Rjx
.
jsonOk
().
set
(
"list"
,
returnList
).
toJson
();
}
@ApiOperation
(
"获取品牌列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"区域编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getBrandList"
,
method
=
RequestMethod
.
GET
)
public
String
getBrandList
(
String
orgNo
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
List
<
Map
<
String
,
Object
>>
returnList
=
brandService
.
queryBrandList
(
orgNo
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
returnList
).
toJson
();
}
@ApiOperation
(
"热销品牌列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"区域编号"
,
defaultValue
=
""
),
...
...
src/main/java/com/egolm/shop/service/BrandService.java
View file @
e637d3cc
...
...
@@ -9,7 +9,7 @@ public interface BrandService {
public
List
<
Map
<
String
,
Object
>>
listBanner
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
getBrandList
(
Map
<
String
,
Object
>
map
);
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
queryBrandList
(
String
orgNo
);
}
src/main/java/com/egolm/shop/service/impl/BrandServiceImpl.java
View file @
e637d3cc
...
...
@@ -41,31 +41,6 @@ public class BrandServiceImpl implements BrandService {
return
jdbcTemplate
.
limit
(
sql
,
page
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getBrandList
(
Map
<
String
,
Object
>
map
)
{
String
sql
=
"SELECT "
+
"b.sPinyinCode,"
+
"acg.sBrandID, "
+
"b.sBrandName,"
+
"b.sLogoUrl "
+
"FROM "
+
"tAgentContractGoods acg, "
+
"tBrand b "
+
"WHERE "
+
"acg.sBrandID = b.sBrandID "
+
"and acg.sOrgNO = ? "
+
"group by "
+
"b.sPinyinCode, "
+
"acg.sBrandID, "
+
"b.sBrandName, "
+
"b.sLogoUrl "
+
"ORDER BY "
+
"b.sPinyinCode "
;
String
orgNo
=(
String
)
map
.
get
(
"orgNo"
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
queryForList
(
sql
,
orgNo
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
String
sql
=
"SELECT "
...
...
@@ -88,4 +63,27 @@ public class BrandServiceImpl implements BrandService {
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
orgNo
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryBrandList
(
String
orgNo
)
{
String
sql
=
"SELECT "
+
"b.sPinyinCode,"
+
"acg.sBrandID, "
+
"b.sBrandName,"
+
"b.sLogoUrl "
+
"FROM "
+
"tAgentContractGoods acg, "
+
"tBrand b "
+
"WHERE "
+
"acg.sBrandID = b.sBrandID "
+
"and acg.sOrgNO = ? "
+
"group by "
+
"b.sPinyinCode, "
+
"acg.sBrandID, "
+
"b.sBrandName, "
+
"b.sLogoUrl "
+
"ORDER BY "
+
"b.sPinyinCode "
;
return
jdbcTemplate
.
queryForList
(
sql
,
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