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
ba9024ca
Commit
ba9024ca
authored
Mar 31, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
307725e5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
19 deletions
+38
-19
LearningContentBoardMapper.java
...gy/chnmuseum/party/mapper/LearningContentBoardMapper.java
+18
-3
LearningContent.java
...a/cn/wisenergy/chnmuseum/party/model/LearningContent.java
+3
-3
LearningContentBoardService.java
.../chnmuseum/party/service/LearningContentBoardService.java
+1
-1
LearningContentBoardServiceImpl.java
...m/party/service/impl/LearningContentBoardServiceImpl.java
+2
-2
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+10
-5
LearningContentController.java
...useum/party/web/controller/LearningContentController.java
+2
-3
LearningContentMapper.xml
src/main/resources/mapper/LearningContentMapper.xml
+2
-2
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/mapper/LearningContentBoardMapper.java
View file @
ba9024ca
...
@@ -31,13 +31,28 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
...
@@ -31,13 +31,28 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
)
)
IPage
<
ExhibitionBoard
>
selectBoardPageByLearningContentId
(
Page
<?>
page
,
String
learningContentId
,
String
nameOrCode
);
IPage
<
ExhibitionBoard
>
selectBoardPageByLearningContentId
(
Page
<?>
page
,
String
learningContentId
,
String
nameOrCode
);
@Select
(
"<script>"
+
"SELECT a.* FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
@Select
(
"<script>"
+
"SELECT a.* FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
+
"and lcb.exhibition_board_id = eb.id "
+
"and eb.asset_id = a.id "
+
"and eb.asset_id = a.id "
+
"and lc.organ_id = #{organId}"
+
"and lc.applicable_scope = 'THIS_ORGAN' "
+
"and lc.organ_code = #{organCode} "
+
"UNION "
+
"SELECT a.* FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
+
"and eb.asset_id = a.id "
+
"and lc.applicable_scope = 'THIS_ORGAN_SUB'"
+
"and lc.organ_code like CONCAT(#{organCode},'%') "
+
"UNION "
+
"SELECT a.* FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
+
"and eb.asset_id = a.id "
+
"and lc.applicable_scope = 'ALL_PLAT'"
+
"</script>"
+
"</script>"
)
)
IPage
<
Asset
>
selectAssetPageByOrgan
Id
(
Page
<?>
page
,
String
organId
);
IPage
<
Asset
>
selectAssetPageByOrgan
Code
(
Page
<?>
page
,
String
organCode
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContent.java
View file @
ba9024ca
...
@@ -54,9 +54,9 @@ public class LearningContent implements Serializable {
...
@@ -54,9 +54,9 @@ public class LearningContent implements Serializable {
@NotBlank
(
message
=
"适用范围不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"适用范围不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
applicableScope
;
private
String
applicableScope
;
@ApiModelProperty
(
value
=
"机构
ID
"
)
@ApiModelProperty
(
value
=
"机构
编码
"
)
@TableField
(
"organ_
id
"
)
@TableField
(
"organ_
code
"
)
private
String
organ
Id
;
private
String
organ
Code
;
@ApiModelProperty
(
"学习项目ID"
)
@ApiModelProperty
(
"学习项目ID"
)
@TableField
(
"learning_project_id"
)
@TableField
(
"learning_project_id"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/LearningContentBoardService.java
View file @
ba9024ca
...
@@ -23,6 +23,6 @@ public interface LearningContentBoardService extends IService<LearningContentBoa
...
@@ -23,6 +23,6 @@ public interface LearningContentBoardService extends IService<LearningContentBoa
IPage
<
ExhibitionBoard
>
getBoardPageByLearningContentId
(
Page
<
ExhibitionBoard
>
page
,
String
learningContentId
,
String
nameOrCode
);
IPage
<
ExhibitionBoard
>
getBoardPageByLearningContentId
(
Page
<
ExhibitionBoard
>
page
,
String
learningContentId
,
String
nameOrCode
);
IPage
<
Asset
>
getAssetPageByOrgan
Id
(
Page
<
ExhibitionBoard
>
page
,
String
organId
);
IPage
<
Asset
>
getAssetPageByOrgan
Code
(
Page
<
ExhibitionBoard
>
page
,
String
organCode
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/LearningContentBoardServiceImpl.java
View file @
ba9024ca
...
@@ -38,8 +38,8 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent
...
@@ -38,8 +38,8 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent
}
}
@Override
@Override
public
IPage
<
Asset
>
getAssetPageByOrgan
Id
(
Page
<
ExhibitionBoard
>
page
,
String
organId
)
{
public
IPage
<
Asset
>
getAssetPageByOrgan
Code
(
Page
<
ExhibitionBoard
>
page
,
String
organCode
)
{
return
learningContentBoardMapper
.
selectAssetPageByOrgan
Id
(
page
,
organId
);
return
learningContentBoardMapper
.
selectAssetPageByOrgan
Code
(
page
,
organCode
);
}
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
ba9024ca
...
@@ -384,7 +384,8 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -384,7 +384,8 @@ public class ChinaMobileRestApiController extends BaseController {
final
String
assetId
=
exhibitionBoard
.
getAssetId
();
final
String
assetId
=
exhibitionBoard
.
getAssetId
();
final
Asset
asset
=
this
.
assetService
.
getById
(
assetId
);
final
Asset
asset
=
this
.
assetService
.
getById
(
assetId
);
final
String
videoUrl
=
asset
.
getVideoUrl
();
final
String
videoUrl
=
asset
.
getVideoUrl
();
final
List
<
VideoVo
>
videoVoList
=
JSONObject
.
parseObject
(
videoUrl
,
new
TypeReference
<
List
<
VideoVo
>>()
{},
Feature
.
OrderedField
);
final
List
<
VideoVo
>
videoVoList
=
JSONObject
.
parseObject
(
videoUrl
,
new
TypeReference
<
List
<
VideoVo
>>()
{
},
Feature
.
OrderedField
);
exhibitionBoard
.
setVideoUrlList
(
videoVoList
.
stream
().
map
(
VideoVo:
:
getFileUrl
).
collect
(
Collectors
.
toList
()));
exhibitionBoard
.
setVideoUrlList
(
videoVoList
.
stream
().
map
(
VideoVo:
:
getFileUrl
).
collect
(
Collectors
.
toList
()));
exhibitionBoard
.
setVideoUrl
(
videoUrl
);
exhibitionBoard
.
setVideoUrl
(
videoUrl
);
exhibitionBoard
.
setLearningContentId
(
learningContentId
);
exhibitionBoard
.
setLearningContentId
(
learningContentId
);
...
@@ -548,7 +549,8 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -548,7 +549,8 @@ public class ChinaMobileRestApiController extends BaseController {
final
ExhibitionBoard
exhibitionBoard
=
this
.
exhibitionBoardService
.
getById
(
boardId
);
final
ExhibitionBoard
exhibitionBoard
=
this
.
exhibitionBoardService
.
getById
(
boardId
);
final
String
refMaterialUrl
=
exhibitionBoard
.
getRefMaterialUrl
();
final
String
refMaterialUrl
=
exhibitionBoard
.
getRefMaterialUrl
();
final
List
<
DatumVo
>
datumVoList
=
JSONObject
.
parseObject
(
refMaterialUrl
,
new
TypeReference
<
List
<
DatumVo
>>()
{},
Feature
.
OrderedField
);
final
List
<
DatumVo
>
datumVoList
=
JSONObject
.
parseObject
(
refMaterialUrl
,
new
TypeReference
<
List
<
DatumVo
>>()
{
},
Feature
.
OrderedField
);
return
getResult
(
datumVoList
);
return
getResult
(
datumVoList
);
}
}
...
@@ -575,10 +577,13 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -575,10 +577,13 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiOperation
(
value
=
"获取当前用户可查看的视频信息"
,
notes
=
"获取当前用户可查看的视频信息"
)
@ApiOperation
(
value
=
"获取当前用户可查看的视频信息"
,
notes
=
"获取当前用户可查看的视频信息"
)
public
Map
<
String
,
Object
>
getAssetPageByOrganId
()
{
public
Map
<
String
,
Object
>
getAssetPageByOrganId
()
{
final
TUser
tUser
=
getcurUser
();
final
TUser
tUser
=
getcurUser
();
final
String
orgId
=
tUser
.
getOrgId
();
if
(
tUser
!=
null
&&
tUser
.
getOrgCode
()
!=
null
)
{
IPage
<
Asset
>
page
=
this
.
learningContentBoardService
.
getAssetPageByOrganId
(
getPage
(),
orgId
);
final
String
orgCode
=
tUser
.
getOrgCode
();
IPage
<
Asset
>
page
=
this
.
learningContentBoardService
.
getAssetPageByOrganCode
(
getPage
(),
orgCode
);
return
getResult
(
page
);
return
getResult
(
page
);
}
}
return
getFailResult
(
"400"
,
"用户未登录"
);
}
@ApiOperation
(
value
=
"app最新版本查询"
)
@ApiOperation
(
value
=
"app最新版本查询"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentController.java
View file @
ba9024ca
...
@@ -77,15 +77,14 @@ public class LearningContentController extends BaseController {
...
@@ -77,15 +77,14 @@ public class LearningContentController extends BaseController {
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
)
{
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
)
{
final
TUser
tUser
=
getcurUser
();
final
TUser
tUser
=
getcurUser
();
if
(
tUser
!=
null
)
{
if
(
tUser
!=
null
)
{
final
String
orgId
=
tUser
.
getOrgId
();
learningContent
.
setOrganCode
(
tUser
.
getOrgCode
());
learningContent
.
setOrganId
(
orgId
);
}
}
learningContent
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
learningContent
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
learningContent
.
setIsPublished
(
false
);
learningContent
.
setIsPublished
(
false
);
QueryWrapper
<
LearningContent
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
LearningContent
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"max(sortorder) as sortorder"
);
queryWrapper
.
select
(
"max(sortorder) as sortorder"
);
LearningContent
content
=
this
.
learningContentService
.
getOne
(
queryWrapper
);
LearningContent
content
=
this
.
learningContentService
.
getOne
(
queryWrapper
);
if
(
content
!=
null
)
{
if
(
content
!=
null
&&
content
.
getSortorder
()
!=
null
)
{
learningContent
.
setSortorder
(
content
.
getSortorder
()
+
1
);
learningContent
.
setSortorder
(
content
.
getSortorder
()
+
1
);
}
else
{
}
else
{
learningContent
.
setSortorder
(
1
);
learningContent
.
setSortorder
(
1
);
...
...
src/main/resources/mapper/LearningContentMapper.xml
View file @
ba9024ca
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<result
column=
"name"
property=
"name"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"cover"
property=
"cover"
/>
<result
column=
"cover"
property=
"cover"
/>
<result
column=
"applicable_scope"
property=
"applicableScope"
/>
<result
column=
"applicable_scope"
property=
"applicableScope"
/>
<result
column=
"organ_
id"
property=
"organId
"
/>
<result
column=
"organ_
code"
property=
"organCode
"
/>
<result
column=
"learning_project_id"
property=
"learningProjectId"
/>
<result
column=
"learning_project_id"
property=
"learningProjectId"
/>
<result
column=
"audit_status"
property=
"auditStatus"
/>
<result
column=
"audit_status"
property=
"auditStatus"
/>
<result
column=
"is_published"
property=
"isPublished"
/>
<result
column=
"is_published"
property=
"isPublished"
/>
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, name, cover, applicable_scope, organ_
id
, learning_project_id, audit_status, is_published, is_deleted, sortorder, create_time, update_time
id, name, cover, applicable_scope, organ_
code
, learning_project_id, audit_status, is_published, is_deleted, sortorder, create_time, update_time
</sql>
</sql>
</mapper>
</mapper>
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