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
33bab768
Commit
33bab768
authored
Sep 20, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://key@gitlab.egolm.com/key/shop.git
parents
b8265ac0
87647a66
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
286 additions
and
158 deletions
+286
-158
PageController.java
src/main/java/com/egolm/shop/controller/PageController.java
+168
-91
PageService.java
src/main/java/com/egolm/shop/service/PageService.java
+17
-12
PageServiceImpl.java
...ain/java/com/egolm/shop/service/impl/PageServiceImpl.java
+101
-55
No files found.
src/main/java/com/egolm/shop/controller/PageController.java
View file @
33bab768
...
@@ -22,7 +22,7 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -22,7 +22,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"
页面相关接口"
})
@Api
(
tags
={
"
首页相关接口"
})
@RestController
@RestController
@RequestMapping
(
"page"
)
@RequestMapping
(
"page"
)
public
class
PageController
{
public
class
PageController
{
...
@@ -30,7 +30,84 @@ public class PageController {
...
@@ -30,7 +30,84 @@ public class PageController {
@Autowired
@Autowired
private
PageService
pageService
;
private
PageService
pageService
;
@ApiOperation
(
"查询(只有一条)"
)
@ApiOperation
(
"查询banner"
)
@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
=
"orgNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"组织机构"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"typeID"
,
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
=
"/queryBanner"
,
method
=
RequestMethod
.
GET
)
public
String
queryBanner
(
HttpServletRequest
request
)
{
String
orgNO
=
request
.
getParameter
(
"orgNO"
);
String
typeID
=
request
.
getParameter
(
"typeID"
);
String
index
=
request
.
getParameter
(
"index"
);
String
limit
=
request
.
getParameter
(
"limit"
);
if
(!
StringUtil
.
isNotEmpty
(
orgNO
,
typeID
,
index
,
limit
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
orgNO
,
typeID
,
"Msg_Parameter_empty"
)).
toJson
();
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"orgNO"
,
orgNO
);
params
.
put
(
"typeID"
,
typeID
);
Page
page
=
new
Page
();
page
.
setIndex
(
Long
.
valueOf
(
index
));
page
.
setLimit
(
Long
.
valueOf
(
limit
));
page
.
setLimitKey
(
" Idx asc"
);
List
<
Map
<
String
,
Object
>>
iconList
=
pageService
.
queryBanner
(
params
,
page
);
if
(
iconList
!=
null
&&
iconList
.
size
()
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
"list"
,
iconList
).
toString
();
}
else
{
return
Rjx
.
jsonOk
().
set
(
"list"
,
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
=
"orgNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"组织机构"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"msgTypeID"
,
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
=
"/queryNews"
,
method
=
RequestMethod
.
GET
)
public
String
queryNews
(
HttpServletRequest
request
)
{
String
orgNO
=
request
.
getParameter
(
"orgNO"
);
String
msgTypeID
=
request
.
getParameter
(
"msgTypeID"
);
String
index
=
request
.
getParameter
(
"index"
);
String
limit
=
request
.
getParameter
(
"limit"
);
if
(!
StringUtil
.
isNotEmpty
(
orgNO
,
msgTypeID
,
index
,
limit
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
orgNO
,
msgTypeID
,
"Msg_Parameter_empty"
)).
toJson
();
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"orgNO"
,
orgNO
);
params
.
put
(
"msgTypeID"
,
msgTypeID
);
Page
page
=
new
Page
();
page
.
setIndex
(
Long
.
valueOf
(
index
));
page
.
setLimit
(
Long
.
valueOf
(
limit
));
page
.
setLimitKey
(
" Sort desc ,TradeDate desc "
);
List
<
Map
<
String
,
Object
>>
iconList
=
pageService
.
queryNews
(
params
,
page
);
if
(
iconList
!=
null
&&
iconList
.
size
()
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
"list"
,
iconList
).
toString
();
}
else
{
return
Rjx
.
jsonOk
().
set
(
"list"
,
new
HashMap
<
String
,
Object
>()).
toString
();
}
}
/*@ApiOperation("查询(只有一条)")
@ApiImplicitParams({
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@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 = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
...
@@ -86,6 +163,6 @@ public class PageController {
...
@@ -86,6 +163,6 @@ public class PageController {
return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString();
return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString();
}
}
}
}
*/
}
}
src/main/java/com/egolm/shop/service/PageService.java
View file @
33bab768
...
@@ -9,4 +9,9 @@ public interface PageService {
...
@@ -9,4 +9,9 @@ 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
);
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
queryBanner
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
queryNews
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
}
src/main/java/com/egolm/shop/service/impl/PageServiceImpl.java
View file @
33bab768
...
@@ -51,5 +51,51 @@ public class PageServiceImpl implements PageService {
...
@@ -51,5 +51,51 @@ public class PageServiceImpl implements PageService {
return
jdbcTemplate
.
limit
(
sql
,
page
,
iconGroupNO
);
return
jdbcTemplate
.
limit
(
sql
,
page
,
iconGroupNO
);
}
}
/**
* 查询banner
* @Title: queryBanner
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public
List
<
Map
<
String
,
Object
>>
queryBanner
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
orgNO
=
params
.
get
(
"orgNO"
)+
""
;
String
typeID
=
params
.
get
(
"typeID"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
"SELECT BannerAdNO = b.sBannerAdNO, BannerAdTitle = b.sBannerAdTitle,OrgNO = b.sOrgNO,AdPostionTypeID = b.sAdPositionTypeID,AdPostionType = b.sAdPositionType,"
+
" LayoutTypeID = b.sLayoutTypeID,LayoutType = b.sLayoutType,JumpTypeID = b.sJumpTypeID,JumpType = b.sJumpType,JumpList = b.sJumpList,Idx = b.nIdx,ImagePath = b.sImagePath,"
+
" LinkPath = b.sLinkPath "
+
" from tBannerAd b "
+
" WHERE sOrgNO = ? AND sAdPositionTypeID =? AND b.dStartTime <=getdate() AND b.dEndTime >= getdate() AND b.nTag&2 = 2 "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
orgNO
,
typeID
);
}
/**
* 查快报
* @Title: queryNews
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public
List
<
Map
<
String
,
Object
>>
queryNews
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
orgNO
=
params
.
get
(
"orgNO"
)+
""
;
String
msgTypeID
=
params
.
get
(
"msgTypeID"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
"SELECT BillBoardID = b.nBillboardID, MsgTypeID = b.sMsgTypeID,MsgType = b.sMsgType,Title = b.sTitle,Content = b.sText,Sort = b.nSort,TradeDate = b.dTradeDate"
+
" FROM tBillboard b "
+
" WHERE b.nTag&2=2 AND b.sMsgTypeID = ? "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
msgTypeID
);
}
}
}
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