Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
300a9409
Commit
300a9409
authored
Apr 26, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
84af5cc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
46 deletions
+45
-46
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+45
-46
No files found.
src/main/java/cn/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
300a9409
...
...
@@ -30,7 +30,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.shiro.authc.DisabledAccountException
;
import
org.apache.shiro.authc.IncorrectCredentialsException
;
import
org.apache.shiro.authz.annotation.RequiresAuthentication
;
import
org.bytedeco.opencv.presets.opencv_core
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -553,51 +552,6 @@ public class ChinaMobileRestApiController extends BaseController {
}
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"learningProjectId"
,
value
=
"学习项目ID"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/learningContent/getPage"
)
@RequiresAuthentication
//@RequiresPermissions("learning:content:page")
@ApiOperation
(
value
=
"查询学习内容"
,
notes
=
"查询学习内容"
)
public
Map
<
String
,
Object
>
getLearningContentPageList
(
GenericPageParam
genericPageParam
,
@RequestParam
(
value
=
"learningProjectId"
,
required
=
false
)
String
learningProjectId
)
{
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
LearningContent:
:
getPublished
,
true
);
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
learningProjectId
))
{
queryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProjectId
);
}
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
LearningContent:
:
getName
,
genericPageParam
.
getNameOrCode
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
LearningContent:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
LearningContent:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
LearningContent:
:
getSortorder
);
// 设置查询内容
queryWrapper
.
select
(
LearningContent:
:
getId
,
LearningContent:
:
getName
,
LearningContent:
:
getCover
,
LearningContent:
:
getSortorder
,
LearningContent:
:
getCreateTime
,
LearningContent:
:
getUpdateTime
);
Page
<
LearningContent
>
page
=
this
.
learningContentService
.
page
(
getPage
(),
queryWrapper
);
for
(
LearningContent
learningContent
:
page
.
getRecords
())
{
LambdaQueryWrapper
<
LearningContentBoard
>
lambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
learningContent
.
getId
());
int
exhibitionBoardCount
=
this
.
learningContentBoardService
.
count
(
lambdaQueryWrapper
);
learningContent
.
setExhibitionBoardCount
(
exhibitionBoardCount
);
}
return
getResult
(
page
);
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
...
...
@@ -644,6 +598,51 @@ public class ChinaMobileRestApiController extends BaseController {
return
getResult
(
page
);
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"learningProjectId"
,
value
=
"学习项目ID"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/learningContent/getPage"
)
@RequiresAuthentication
//@RequiresPermissions("learning:content:page")
@ApiOperation
(
value
=
"查询学习内容"
,
notes
=
"查询学习内容"
)
public
Map
<
String
,
Object
>
getLearningContentPageList
(
GenericPageParam
genericPageParam
,
@RequestParam
(
value
=
"learningProjectId"
,
required
=
false
)
String
learningProjectId
)
{
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
LearningContent:
:
getPublished
,
true
);
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
learningProjectId
))
{
queryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProjectId
);
}
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
LearningContent:
:
getName
,
genericPageParam
.
getNameOrCode
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
LearningContent:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
LearningContent:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
LearningContent:
:
getSortorder
);
// 设置查询内容
queryWrapper
.
select
(
LearningContent:
:
getId
,
LearningContent:
:
getName
,
LearningContent:
:
getCover
,
LearningContent:
:
getSortorder
,
LearningContent:
:
getCreateTime
,
LearningContent:
:
getUpdateTime
);
Page
<
LearningContent
>
page
=
this
.
learningContentService
.
page
(
getPage
(),
queryWrapper
);
for
(
LearningContent
learningContent
:
page
.
getRecords
())
{
LambdaQueryWrapper
<
LearningContentBoard
>
lambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
learningContent
.
getId
());
int
exhibitionBoardCount
=
this
.
learningContentBoardService
.
count
(
lambdaQueryWrapper
);
learningContent
.
setExhibitionBoardCount
(
exhibitionBoardCount
);
}
return
getResult
(
page
);
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
...
...
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