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
652c8f95
Commit
652c8f95
authored
Mar 26, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
730274bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
91 deletions
+75
-91
LearningContent.java
...a/cn/wisenergy/chnmuseum/party/model/LearningContent.java
+1
-1
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+1
-2
LearningContentController.java
...useum/party/web/controller/LearningContentController.java
+73
-88
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContent.java
View file @
652c8f95
...
...
@@ -48,7 +48,7 @@ public class LearningContent implements Serializable {
@NotBlank
(
message
=
"学习内容宣传图不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
cover
;
@ApiModelProperty
(
"适用范围
"
)
@ApiModelProperty
(
value
=
"适用范围"
,
allowableValues
=
"ALL_PLAT, THIS_ORGAN, THIS_ORGAN_SUB
"
)
@TableField
(
"applicable_scope"
)
@NotBlank
(
message
=
"适用范围不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
applicableScope
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
652c8f95
...
...
@@ -95,8 +95,7 @@ public class CopyrightOwnerController extends BaseController {
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"copyright:owner:update"
)
@ApiOperation
(
value
=
"修改版权方信息"
,
notes
=
"修改版权方信息"
)
public
Map
<
String
,
Object
>
updateCopyrightOwner
(
@Validated
(
value
=
{
Update
.
class
})
CopyrightOwner
copyrightOwner
,
@RequestParam
(
"copyrightOwnerType"
)
CopyrightOwnerTypeEnum
copyrightOwnerTypeEnum
)
{
copyrightOwner
.
setOwnerType
(
copyrightOwnerTypeEnum
.
name
());
public
Map
<
String
,
Object
>
updateCopyrightOwner
(
@Validated
(
value
=
{
Update
.
class
})
CopyrightOwner
copyrightOwner
)
{
boolean
flag
=
copyrightOwnerService
.
updateById
(
copyrightOwner
);
List
<
String
>
assetTypeIdList
=
copyrightOwner
.
getAssetTypeIdList
();
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentController.java
View file @
652c8f95
...
...
@@ -5,10 +5,12 @@ import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.LearningContent
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentBoardCatService
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentBoardService
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentCopyrightOwnerService
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentService
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
...
...
@@ -22,7 +24,6 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -42,28 +43,30 @@ public class LearningContentController extends BaseController {
@Resource
private
LearningContentService
learningContentService
;
@PostMapping
(
"/batchSave"
)
@RequiresPermissions
(
"learning:content:batch:save"
)
@ApiOperation
(
value
=
"批量添加学习内容"
,
notes
=
"批量添加学习内容"
)
public
Map
<
String
,
Object
>
batchSaveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
List
<
LearningContent
>
learningContentList
)
{
// 保存业务节点信息
boolean
result
=
learningContentService
.
saveBatch
(
learningContentList
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@Resource
private
LearningContentBoardCatService
learningContentBoardCatService
;
@Resource
private
LearningContentBoardService
learningContentBoardService
;
@Resource
private
LearningContentCopyrightOwnerService
learningContentCopyrightOwnerService
;
@PostMapping
(
"/save"
)
@RequiresPermissions
(
"learning:content:save"
)
@ApiOperation
(
value
=
"添加学习内容"
,
notes
=
"添加学习内容"
)
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
)
{
@RequiresPermissions
(
"learning:content:save"
)
@ApiOperation
(
value
=
"添加学习内容"
,
notes
=
"添加学习内容"
)
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
)
{
// 保存业务节点信息
boolean
result
=
learningContentService
.
save
(
learningContent
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
...
...
@@ -74,40 +77,22 @@ public class LearningContentController extends BaseController {
}
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"learning:content:update"
)
@ApiOperation
(
value
=
"修改学习内容信息"
,
notes
=
"修改学习内容信息"
)
@RequiresPermissions
(
"learning:content:update"
)
@ApiOperation
(
value
=
"修改学习内容信息"
,
notes
=
"修改学习内容信息"
)
public
Map
<
String
,
Object
>
updateLearningContent
(
@Validated
(
value
=
{
Update
.
class
})
LearningContent
learningContent
)
{
boolean
flag
=
learningContentService
.
updateById
(
learningContent
);
if
(
flag
)
{
boolean
flag
=
learningContentService
.
updateById
(
learningContent
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"learning:content:update:audit:status"
)
@ApiOperation
(
value
=
"更新学习内容审核状态"
,
notes
=
"更新学习内容审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"学习内容ID不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
AuditStatusEnum
status
)
{
UpdateWrapper
<
LearningContent
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"audit_status"
,
status
.
name
());
boolean
flag
=
learningContentService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"learning:content:delete"
)
@ApiOperation
(
value
=
"根据ID删除学习内容"
,
notes
=
"根据ID删除学习内容"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
@RequiresPermissions
(
"learning:content:delete"
)
@ApiOperation
(
value
=
"根据ID删除学习内容"
,
notes
=
"根据ID删除学习内容"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteLearningContent
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
learningContentService
.
removeById
(
id
);
if
(
result
)
{
...
...
@@ -117,51 +102,51 @@ public class LearningContentController extends BaseController {
}
@GetMapping
(
"/getList"
)
@RequiresPermissions
(
"learning:content:list"
)
@ApiOperation
(
value
=
"获取学习内容全部列表(无分页)"
,
notes
=
"获取学习内容全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@RequiresPermissions
(
"learning:content:list"
)
@ApiOperation
(
value
=
"获取学习内容全部列表(无分页)"
,
notes
=
"获取学习内容全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
getLearningContentList
(
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
List
<
LearningContent
>
learningContentList
=
learningContentService
.
list
(
Wrappers
.<
LearningContent
>
lambdaQuery
().
eq
(
LearningContent:
:
getAuditStatus
,
auditStatus
.
name
()));
return
getResult
(
learningContentList
);
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"learning:content:page"
)
@ApiOperation
(
value
=
"获取学习内容分页列表"
,
notes
=
"获取学习内容分页列表"
)
@RequiresPermissions
(
"learning:content:page"
)
@ApiOperation
(
value
=
"获取学习内容分页列表"
,
notes
=
"获取学习内容分页列表"
)
public
Map
<
String
,
Object
>
getLearningContentPageList
(
GenericPageParam
genericPageParam
)
{
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
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:
:
getCreateTime
);
// 设置查询内容
queryWrapper
.
select
(
LearningContent:
:
getId
,
LearningContent:
:
getName
,
LearningContent:
:
getAuditStatus
,
LearningContent:
:
getCreateTime
,
LearningContent:
:
getUpdateTime
);
Page
<
LearningContent
>
page
=
this
.
learningContentService
.
page
(
getPage
(),
queryWrapper
);
for
(
LearningContent
learningContent
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
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:
:
getCreateTime
);
// 设置查询内容
queryWrapper
.
select
(
LearningContent:
:
getId
,
LearningContent:
:
getName
,
LearningContent:
:
getAuditStatus
,
LearningContent:
:
getCreateTime
,
LearningContent:
:
getUpdateTime
);
Page
<
LearningContent
>
page
=
this
.
learningContentService
.
page
(
getPage
(),
queryWrapper
);
for
(
LearningContent
learningContent
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取学习内容详情"
,
notes
=
"获取学习内容详情"
)
...
...
@@ -169,10 +154,10 @@ public class LearningContentController extends BaseController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
)
})
@GetMapping
(
"/get/{id}"
)
@RequiresPermissions
(
"learning:content:get:id"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
@RequiresPermissions
(
"learning:content:get:id"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
LearningContent
learningContent
=
learningContentService
.
getById
(
id
);
return
getResult
(
learningContent
);
return
getResult
(
learningContent
);
}
}
...
...
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