Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
45a95d7e
Commit
45a95d7e
authored
Sep 30, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
ccc83c92
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
22 deletions
+107
-22
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+15
-4
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+63
-4
LessonTrainAtBannerDTO.java
.../rcisoft/business/blesson/dto/LessonTrainAtBannerDTO.java
+6
-8
BLesson.java
...ain/java/org/rcisoft/business/blesson/entity/BLesson.java
+1
-1
BLessonService.java
.../org/rcisoft/business/blesson/service/BLessonService.java
+8
-1
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+12
-2
FileUploadController.java
...a/org/rcisoft/common/controller/FileUploadController.java
+1
-1
SysUserMapper.java
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
+1
-1
No files found.
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
45a95d7e
...
...
@@ -186,11 +186,11 @@ public class BLessonController extends PaginationController<BLesson> {
businessId
);
}
@ApiOperation
(
value
=
"612 课程培训条件查询"
,
notes
=
"课程培训条件查询(
工作台
)"
,
response
=
BLesson
.
class
)
@ApiOperation
(
value
=
"612 课程培训条件查询"
,
notes
=
"课程培训条件查询(
Banner内部资源
)"
,
response
=
BLesson
.
class
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@
PostMapping
(
value
=
"/findLessonTrai
n"
)
public
Result
findLesson
Train
(
CurUser
curUser
,
@Valid
LessonTrain
DTO
lessonTrainDTO
,
BindingResult
bindingResult
)
{
bLessonService
.
findLesson
Trai
n
(
getPaginationUtility
(),
lessonTrainDTO
);
@
GetMapping
(
value
=
"/findLessonAtBannerByPaginatio
n"
)
public
Result
findLesson
AtBannerByPagination
(
CurUser
curUser
,
@Valid
LessonTrainAtBanner
DTO
lessonTrainDTO
,
BindingResult
bindingResult
)
{
bLessonService
.
findLesson
AtBannerByPaginatio
n
(
getPaginationUtility
(),
lessonTrainDTO
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -265,4 +265,15 @@ public class BLessonController extends PaginationController<BLesson> {
MessageConstant
.
MESSAGE_ALERT_ERROR
,
gridModel
);
}
@ApiOperation
(
value
=
"618 发布课程"
,
notes
=
"根据ID发布一个课程"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@PostMapping
(
value
=
"/release"
)
public
Result
release
(
CurUser
curUser
,
String
businessId
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonService
.
closeBLesson
(
businessId
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
45a95d7e
...
...
@@ -2,10 +2,7 @@ package org.rcisoft.business.blesson.dao;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.blabel.dto.QueryLabelResDTO
;
import
org.rcisoft.business.blesson.dto.FindAllLessonDTO
;
import
org.rcisoft.business.blesson.dto.FindListLessonDTO
;
import
org.rcisoft.business.blesson.dto.FirstPageQueryDTO
;
import
org.rcisoft.business.blesson.dto.ILessonCountDTO
;
import
org.rcisoft.business.blesson.dto.*
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.entity.BLessonLabel
;
import
org.rcisoft.core.base.BaseMapper
;
...
...
@@ -354,6 +351,63 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"where business_id=#{businessId}"
,
"</script>"
})
int
closeLesson
(
BLesson
model
);
/**
* 根据课程id发布课程
*
* @param model
* @return
*/
@Update
({
"<script>"
,
"update b_lesson"
,
" <set>"
,
" <if test='updateBy != null'>update_by=#{updateBy},</if>"
,
" <if test='updateDate != null'>update_date=#{updateDate},</if>"
,
" release_state = '2'"
,
" </set>"
,
"where business_id=#{businessId}"
,
"</script>"
})
int
releaseLesson
(
BLesson
model
);
/**
* 首页分页查询全部课程
* @param param
* @return
*/
@Select
(
" <script> select distinct bl.* "
+
// " ,su.name lecturerName " +
// " ,suc.name createByName " +
" from b_lesson bl "
+
// " left join s_user su on su.business_id = bl.lecturer_id " +
// " left join s_user suc on suc.business_id = bl.create_by " +
// " left join b_viewrange bv on bl.business_id = bv.lesson_id " +
// " left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id " +
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
// " and su.del_flag != 1 and su.flag = 1 " +
// " and suc.del_flag != 1 and suc.flag = 1 " +
// " and bv.del_flag != 1 and bv.flag = 1 " +
// " and bl.corp_id = #{param.corpId} "+
// " and su.corp_id = #{param.corpId} "+
// " and suc.corp_id = #{param.corpId} "+
// " and bv.corp_id = #{param.corpId} "+
" and bl.release_state = 2 "
+
// " and ((bvs.type = 0 and bvs.target_id = #{param.userId}) " +
// " <if test=\"param.departs != null and param.departs.size() > 0 \"> " +
// " or (bvs.type = 1 and bvs.target_id in " +
// " <foreach item='item' index='index' collection='param.departs' open='(' separator=',' close=')'> #{item} </foreach>)" +
// " </if>) " +
" <if test= \" lessonName !=null and lessonName != ''\">and lesson_name like CONCAT('%',#{lessonName},'%') "
+
// " or su.name like CONCAT('%',#{param.viewParam},'%'))" +
" </if> "
+
// " <if test= \" courseIds !=null and courseIds.size() > 0 \">and course_id in " +
// " <foreach item='item' index='index' collection='courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
// " </if> " +
" order by bl.release_date desc "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BLesson
>
findLessonAtBannerByPagination
(
LessonTrainAtBannerDTO
param
);
/**
* 查询我发布和我学习课程数量
...
...
@@ -468,6 +522,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"LEFT JOIN s_user u1 ON u1.business_id = les.lecturer_id "
+
"AND u1.corp_id = #{corpId}"
+
"WHERE 1=1 "
+
"and les.del_flag != 1 and les.flag = 1 "
+
"and b1.del_flag != 1 and b1.flag = 1 "
+
"and b2.del_flag != 1 and b2.flag = 1 "
+
"and b3.del_flag != 1 and b3.flag = 1 "
+
"and u1.del_flag != 1 and u1.flag = 1 "
+
"AND les.corp_id = #{corpId}"
+
"<if test='!isAdmin'>"
+
"AND les.lecturer_id IN"
+
...
...
src/main/java/org/rcisoft/business/blesson/dto/LessonTrainDTO.java
→
src/main/java/org/rcisoft/business/blesson/dto/LessonTrain
AtBanner
DTO.java
View file @
45a95d7e
...
...
@@ -7,19 +7,17 @@ import org.hibernate.validator.constraints.Length;
import
javax.persistence.Transient
;
@Data
public
class
LessonTrainDTO
{
public
class
LessonTrain
AtBanner
DTO
{
@ApiModelProperty
(
value
=
"课程名称"
,
required
=
false
)
@Length
(
min
=
1
,
max
=
200
,
message
=
"长度最小为1,最大为150"
)
private
String
lessonName
;
@ApiModelProperty
(
value
=
"发布状态(0:待发布 1:审核中 2:已发布 3:已驳回 4:已关闭)"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
private
String
releaseState
;
// @ApiModelProperty(value = "发布状态(0:待发布 1:审核中 2:已发布 3:已驳回 4:已关闭)")
// private String releaseState;
@ApiModelProperty
(
value
=
"创建人姓名"
)
@Transient
private
String
createByName
;
//
@ApiModelProperty(value = "创建人姓名")
//
@Transient
//
private String createByName;
@ApiModelProperty
(
value
=
"课程类型(0:课程 1:培训)"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
...
...
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
45a95d7e
...
...
@@ -43,7 +43,7 @@ public class BLesson extends IdEntity<BLesson> {
@Length
(
min
=
1
,
max
=
200
,
message
=
"长度最小为1,最大为150"
)
private
String
lessonName
;
@ApiModelProperty
(
value
=
"*
默认
封面图片url"
)
@ApiModelProperty
(
value
=
"*封面图片url"
)
private
String
defaultUrl
;
@ApiModelProperty
(
value
=
"课时"
)
...
...
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
45a95d7e
...
...
@@ -104,13 +104,20 @@ public interface BLessonService{
*/
PersistModel
closeBLesson
(
String
id
);
/**
* 发布课程
* @param id
* @return
*/
PersistModel
releaseBLesson
(
String
id
);
/**
* 课程培训条件查询
* @param pageUtil
* @param lessonTrainDTO
* @return
*/
List
<
BLesson
>
findLesson
Train
(
PageUtil
pageUtil
,
LessonTrain
DTO
lessonTrainDTO
);
List
<
BLesson
>
findLesson
AtBannerByPagination
(
PageUtil
pageUtil
,
LessonTrainAtBanner
DTO
lessonTrainDTO
);
/**
* 我发布的总数
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
45a95d7e
...
...
@@ -239,8 +239,18 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
public
List
<
BLesson
>
findLessonTrain
(
PageUtil
pageUtil
,
LessonTrainDTO
lessonTrainDTO
)
{
return
null
;
public
PersistModel
releaseBLesson
(
String
id
)
{
BLesson
bLesson
=
new
BLesson
();
bLesson
.
setBusinessId
(
id
);
UserUtil
.
setCurrentMergeOperation
(
bLesson
);
int
line
=
bLessonRepository
.
releaseLesson
(
bLesson
);
//int line = bLessonRepository.deleteByPrimaryKey(id);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
public
List
<
BLesson
>
findLessonAtBannerByPagination
(
PageUtil
pageUtil
,
LessonTrainAtBannerDTO
lessonTrainDTO
)
{
return
bLessonRepository
.
findLessonAtBannerByPagination
(
lessonTrainDTO
);
}
@Override
...
...
src/main/java/org/rcisoft/common/controller/FileUploadController.java
View file @
45a95d7e
...
...
@@ -33,7 +33,7 @@ public class FileUploadController extends FileController {
@Autowired
private
Global
global
;
@ApiOperation
(
value
=
"上传图片"
,
notes
=
"上传图片到服务器"
)
@ApiOperation
(
value
=
"
901
上传图片"
,
notes
=
"上传图片到服务器"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"importFile"
,
value
=
"图片文件"
,
required
=
true
,
dataType
=
"MultipartFile"
),
// @ApiImplicitParam(name = "businessId", value = "课程id", required = true, dataType = "varchar")
})
...
...
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
View file @
45a95d7e
...
...
@@ -169,7 +169,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Select
(
"<script>SELECT sr.type AS roleList "
+
"FROM s_user AS su "
+
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id "
+
"LEFT JOIN
s_role AS sr ON ru.role_id = sr.business
_id "
+
"LEFT JOIN
tm_admin_role AS sr ON ru.role_id = sr.r
_id "
+
"WHERE su.del_flag = 0 "
+
"AND su.business_id = #{userId}</script>"
)
List
<
String
>
queryRoleTypeByUserId
(
@Param
(
"userId"
)
String
userId
);
...
...
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