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
7e99f0b2
Commit
7e99f0b2
authored
Nov 14, 2018
by
zhangyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9e0d1cfb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
2 deletions
+75
-2
PageController.java
src/main/java/com/egolm/shop/controller/PageController.java
+38
-1
PageService.java
src/main/java/com/egolm/shop/service/PageService.java
+5
-1
PageServiceImpl.java
...ain/java/com/egolm/shop/service/impl/PageServiceImpl.java
+32
-0
No files found.
src/main/java/com/egolm/shop/controller/PageController.java
View file @
7e99f0b2
...
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.shop.service.PageService
;
import
com.egolm.shop.service.PageService
;
import
com.egolm.shop.util.I18NUtils
;
import
com.egolm.shop.util.I18NUtils
;
...
@@ -48,7 +49,43 @@ public class PageController {
...
@@ -48,7 +49,43 @@ public class PageController {
}
else
{
}
else
{
return
Rjx
.
jsonOk
().
set
(
"detail"
,
new
HashMap
<
String
,
Object
>()).
toString
();
return
Rjx
.
jsonOk
().
set
(
"detail"
,
new
HashMap
<
String
,
Object
>()).
toString
();
}
}
@ApiOperation
(
"查询图标"
)
@ApiImplicitParams
({
@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
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"iconGroupNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"图标组编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"int"
,
required
=
true
,
value
=
"页码"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"int"
,
required
=
true
,
value
=
"每页显示数"
,
defaultValue
=
"10"
),
})
@RequestMapping
(
value
=
"/queryIcon"
,
method
=
RequestMethod
.
GET
)
public
String
queryIcon
(
HttpServletRequest
request
)
{
String
iconGroupNO
=
request
.
getParameter
(
"iconGroupNO"
);
String
index
=
request
.
getParameter
(
"index"
);
String
limit
=
request
.
getParameter
(
"limit"
);
if
(!
StringUtil
.
isNotEmpty
(
iconGroupNO
,
index
,
limit
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
iconGroupNO
,
"Msg_Parameter_empty"
)).
toJson
();
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"iconGroupNO"
,
iconGroupNO
);
Page
page
=
new
Page
();
page
.
setIndex
(
Long
.
valueOf
(
index
));
page
.
setLimit
(
Long
.
valueOf
(
limit
));
page
.
setLimitKey
(
" IconNO asc"
);
}
List
<
Map
<
String
,
Object
>>
iconList
=
pageService
.
queryIcon
(
params
,
page
);
if
(
iconList
!=
null
&&
iconList
.
size
()
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
"list"
,
iconList
.
get
(
0
)).
toString
();
}
else
{
return
Rjx
.
jsonOk
().
set
(
"list"
,
new
HashMap
<
String
,
Object
>()).
toString
();
}
}
}
}
src/main/java/com/egolm/shop/service/PageService.java
View file @
7e99f0b2
...
@@ -3,6 +3,10 @@ package com.egolm.shop.service;
...
@@ -3,6 +3,10 @@ package com.egolm.shop.service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
public
interface
PageService
{
public
interface
PageService
{
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
);
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
);
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
}
src/main/java/com/egolm/shop/service/impl/PageServiceImpl.java
View file @
7e99f0b2
...
@@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.shop.service.PageService
;
import
com.egolm.shop.service.PageService
;
@Service
@Service
...
@@ -14,10 +16,40 @@ public class PageServiceImpl implements PageService {
...
@@ -14,10 +16,40 @@ public class PageServiceImpl implements PageService {
@Autowired
@Autowired
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
/**
* 查询首页配置
* <p>Title: query</p>
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.shop.service.PageService#query(java.util.Map)
*/
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
)
{
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
)
{
String
sql
=
"SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
String
sql
=
"SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+
" FROM tPlatformLayout "
+
"WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC "
;
+
" FROM tPlatformLayout "
+
"WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC "
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
queryForList
(
sql
);
return
jdbcTemplate
.
queryForList
(
sql
);
}
}
/**
* 查询图标
* <p>Title: queryIcon</p>
* <p>Description: </p>
* @param params
* @param page
* @return
* @see com.egolm.shop.service.PageService#queryIcon(java.util.Map, com.egolm.common.jdbc.Page)
*/
@Override
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
iconGroupNO
=
params
.
get
(
"iconGroupNO"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
" SELECT IconNO = i.sIconNO ,IconPath=i.sIconPath,DefaultTxt=i.sDefaultTxt,DefaultLinkType=i.sDefaultLinkType,DefaultLink=i.sDefaultLink "
+
" FROM tIcon i ,tIconGroup ig"
+
" WHERE i.sGroupNO = ig.sGroupNO AND ig.nTag&1=0 and ig.sGroupNO = ? "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
iconGroupNO
);
}
}
}
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