Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
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
西魏
cms_sys
Commits
c4ea16f0
Commit
c4ea16f0
authored
Mar 05, 2019
by
sunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释修改
parent
00a8a7c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
SearchAction.java
src/main/java/net/mingsoft/cms/action/web/SearchAction.java
+9
-5
No files found.
src/main/java/net/mingsoft/cms/action/web/SearchAction.java
View file @
c4ea16f0
...
@@ -160,7 +160,7 @@ public class SearchAction extends BaseAction {
...
@@ -160,7 +160,7 @@ public class SearchAction extends BaseAction {
ColumnEntity
column
=
null
;
// 当前栏目
ColumnEntity
column
=
null
;
// 当前栏目
ContentModelEntity
contentModel
=
null
;
// 栏目对应模型
ContentModelEntity
contentModel
=
null
;
// 栏目对应模型
List
<
ContentModelFieldEntity
>
fieldList
=
new
ArrayList
<
ContentModelFieldEntity
>();
// 栏目对应字段
List
<
ContentModelFieldEntity
>
fieldList
=
new
ArrayList
<
ContentModelFieldEntity
>();
// 栏目对应字段
List
<
DiyM
ap
>
fieldValueList
=
new
ArrayList
<
Diy
Map
>();
// 栏目对应字段的值
List
<
DiyM
odelMap
>
fieldValueList
=
new
ArrayList
<
DiyModel
Map
>();
// 栏目对应字段的值
int
typeId
=
BasicUtil
.
getInt
(
"categoryId"
,
0
);
int
typeId
=
BasicUtil
.
getInt
(
"categoryId"
,
0
);
//记录自定义模型字段名
//记录自定义模型字段名
List
filedStr
=
new
ArrayList
<>();
List
filedStr
=
new
ArrayList
<>();
...
@@ -207,7 +207,7 @@ public class SearchAction extends BaseAction {
...
@@ -207,7 +207,7 @@ public class SearchAction extends BaseAction {
//判断请求中的是否是自定义模型中的字段
//判断请求中的是否是自定义模型中的字段
if
(
filedStr
.
contains
(
entry
.
getKey
())){
if
(
filedStr
.
contains
(
entry
.
getKey
())){
//设置自定义模型字段和值
//设置自定义模型字段和值
DiyM
ap
diyMap
=
new
Diy
Map
();
DiyM
odelMap
diyMap
=
new
DiyModel
Map
();
diyMap
.
setKey
(
entry
.
getKey
());
diyMap
.
setKey
(
entry
.
getKey
());
diyMap
.
setValue
(
value
);
diyMap
.
setValue
(
value
);
fieldValueList
.
add
(
diyMap
);
fieldValueList
.
add
(
diyMap
);
...
@@ -221,9 +221,9 @@ public class SearchAction extends BaseAction {
...
@@ -221,9 +221,9 @@ public class SearchAction extends BaseAction {
if
(
fieldValueList
.
size
()>
0
){
if
(
fieldValueList
.
size
()>
0
){
map
.
put
(
"diyModel"
,
fieldValueList
);
map
.
put
(
"diyModel"
,
fieldValueList
);
}
}
//组织where查询条件
Map
whereMap
=
this
.
searchMap
(
articleFieldName
,
diyFieldName
,
fieldList
);
Map
whereMap
=
this
.
searchMap
(
articleFieldName
,
diyFieldName
,
fieldList
);
// 获取符合条件的文章总数
// 获取符合条件的文章总数
@SuppressWarnings
(
"deprecation"
)
int
count
=
articleBiz
.
getSearchCount
(
contentModel
,
whereMap
,
BasicUtil
.
getAppId
(),
null
);
int
count
=
articleBiz
.
getSearchCount
(
contentModel
,
whereMap
,
BasicUtil
.
getAppId
(),
null
);
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
...
@@ -235,7 +235,6 @@ public class SearchAction extends BaseAction {
...
@@ -235,7 +235,6 @@ public class SearchAction extends BaseAction {
map
.
put
(
ParserUtil
.
SIZE
,
size
);
map
.
put
(
ParserUtil
.
SIZE
,
size
);
//设置列表当前页
//设置列表当前页
map
.
put
(
ParserUtil
.
PAGE_NO
,
BasicUtil
.
getInt
(
ParserUtil
.
PAGE_NO
,
1
));
map
.
put
(
ParserUtil
.
PAGE_NO
,
BasicUtil
.
getInt
(
ParserUtil
.
PAGE_NO
,
1
));
@SuppressWarnings
(
"unused"
)
int
pageNo
=
(
int
)
map
.
get
(
ParserUtil
.
PAGE_NO
);
int
pageNo
=
(
int
)
map
.
get
(
ParserUtil
.
PAGE_NO
);
int
next
,
pre
;
int
next
,
pre
;
if
(
StringUtil
.
isBlank
(
pageNo
)
||
pageNo
==
1
){
if
(
StringUtil
.
isBlank
(
pageNo
)
||
pageNo
==
1
){
...
@@ -389,7 +388,12 @@ public class SearchAction extends BaseAction {
...
@@ -389,7 +388,12 @@ public class SearchAction extends BaseAction {
}
}
return
null
;
return
null
;
}
}
public
class
DiyMap
{
/**
* 存储自定义模型字段和接口参数
* @author 铭飞开源团队
* @date 2019年3月5日
*/
public
class
DiyModelMap
{
String
key
;
String
key
;
Object
value
;
Object
value
;
public
String
getKey
()
{
public
String
getKey
()
{
...
...
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