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
c9d18907
Commit
c9d18907
authored
Oct 11, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
479754df
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
243 additions
and
79 deletions
+243
-79
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+19
-9
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+4
-4
BRecommendRepository.java
...rg/rcisoft/business/blesson/dao/BRecommendRepository.java
+42
-12
BViewrangeRepository.java
...rg/rcisoft/business/blesson/dao/BViewrangeRepository.java
+9
-7
AppointLessonDTO.java
...va/org/rcisoft/business/blesson/dto/AppointLessonDTO.java
+19
-0
RecommendLessonDTO.java
.../org/rcisoft/business/blesson/dto/RecommendLessonDTO.java
+5
-1
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
+114
-43
BLessonMapper.xml
...esources/mapper/business/blesson/mapper/BLessonMapper.xml
+1
-1
BRecommendMapper.xml
...urces/mapper/business/blesson/mapper/BRecommendMapper.xml
+20
-0
BViewrangeMapper.xml
...urces/mapper/business/blesson/mapper/BViewrangeMapper.xml
+1
-0
No files found.
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
c9d18907
...
...
@@ -308,13 +308,23 @@ public class BLessonController extends PaginationController<BLesson> {
}
// @ApiOperation(value="622 推荐课程", notes="根据ID推荐课程")
// @PostMapping(value = "/recommend")
// public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) {
// PersistModel data = bLessonService.recommendBLesson(curUser,recommendLessonDTO);
// return Result.builder(data,
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// recommendLessonDTO);
// }
@ApiOperation
(
value
=
"622 推荐课程"
,
notes
=
"根据ID推荐课程"
)
@PostMapping
(
value
=
"/recommend"
)
public
Result
recommend
(
CurUser
curUser
,
@Valid
RecommendLessonDTO
recommendLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonService
.
recommendBLesson
(
recommendLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
recommendLessonDTO
);
}
@ApiOperation
(
value
=
"623 指派课程"
,
notes
=
"根据ID指派课程"
)
@PostMapping
(
value
=
"/appointLessonToPerson"
)
public
Result
appointLessonToPerson
(
CurUser
curUser
,
@Valid
AppointLessonDTO
appointLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonService
.
appointLessonToPerson
(
appointLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
appointLessonDTO
);
}
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
c9d18907
...
...
@@ -79,12 +79,12 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" blp.finish_date finishDate "
+
"from b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id "
+
"left join s_user su on blp.person_id = su.business_id "
+
// "left join b_appoint ba on ba.business_id = ifnull(blp.appoint_id,'null') " +
"left join b_appoint ba on ba.lesson_id = bl.business_id "
+
"left join b_appoint ba on ba.business_id = blp.appoint_id "
+
"and ba.del_flag != 1 and ba.flag = 1 "
+
// "left join b_appoint ba on ba.lesson_id = bl.business_id " +
"where blp.del_flag != 1 and blp.flag = 1 "
+
"and bl.del_flag != 1 and bl.flag = 1 "
+
"and su.del_flag != 1 and su.flag = 1 "
+
"and ba.del_flag != 1 and ba.flag = 1 "
+
"and su.del_flag != 1 and su.flag = 1 "
+
"and bl.corp_id = #{param.corpId} "
+
// "and blp.corp_id = #{param.corpId} "+
...
...
src/main/java/org/rcisoft/business/blesson/dao/BRecommendRepository.java
View file @
c9d18907
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.blesson.entity.BRecommend
;
import
org.rcisoft.business.blesson.entity.BRecommendSon
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -15,15 +15,45 @@ import java.util.List;
@Repository
public
interface
BRecommendRepository
extends
BaseMapper
<
BRecommend
>
{
// /**
// * 分页查询 bRecommend
// *
// */
// @Select("<script>select * from b_recommend where 1=1 "
// + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
// + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
// + "</script>")
// @ResultMap(value = "BaseResultMap" )
// List<BRecommend> queryBRecommends(BRecommend bRecommend);
/**
* 分页查询 bRecommend
*
*/
@Select
(
"<script>select * from b_recommend where 1=1 "
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BRecommend
>
queryBRecommends
(
BRecommend
bRecommend
);
@Update
({
"<script>"
,
" update b_recommend"
,
" <set>"
,
" <if test='updateBy != null'>update_by=#{updateBy},</if> "
,
" <if test='updateDate != null'>update_date=#{updateDate},</if> "
,
" <if test='delFlag != null'>del_flag=#{delFlag},</if> "
,
" <if test='flag != null'>flag=#{flag},</if> "
,
" <if test='remarks != null'>remarks=#{remarks},</if> "
,
" <if test='recommend_person != null'>recommend_person=#{recommendPerson},</if> "
,
" <if test='lesson_id != null'>lesson_id=#{lessonId},</if> "
,
" <if test='type != null'>type=#{type},</if> "
,
" <if test='corp_id != null'>corp_id=#{corp_id},</if> "
,
" </set>"
,
" where lesson_id=#{lessonId} "
,
"</script>"
})
int
updateByLessonId
(
BRecommend
bRecommend
);
@Delete
(
"<script>DELETE from b_recommend_son where recommend_id=#{businessId}</script>"
)
int
deleteRecommendSon
(
BRecommend
bRecommend
);
@Select
(
"<script>select business_id from b_recommend where lesson_id = #{lessonId}</script>"
)
List
<
String
>
selectIdByLessonId
(
String
lessonId
);
@Insert
(
"<script>INSERT INTO b_recommend_son"
+
"(business_id,recommend_id,type,target_id)VALUES"
+
"<foreach collection=\"list\" item=\"item\" separator=\",\">"
+
"(#{item.businessId},#{item.recommendId},#{item.type},#{item.targetId})"
+
"</foreach></script>"
)
int
insertBRecommendSons
(
List
<
BRecommendSon
>
bRecommendSons
);
}
src/main/java/org/rcisoft/business/blesson/dao/BViewrangeRepository.java
View file @
c9d18907
...
...
@@ -27,14 +27,16 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
List
<
BViewrange
>
queryBViewranges
(
BViewrange
bViewrange
);
@Update
({
"<script>"
,
"update b_
banner
"
,
"update b_
viewrange
"
,
" <set>"
,
" <if test='updateBy != null'>update_by=#{updateBy},</if>"
,
" <if test='updateDate != null'>update_date=#{updateDate},</if>"
,
" <if test='delFlag != null'>del_flag=#{delFlag},</if>"
,
" <if test='flag != null'>flag=#{flag},</if>"
,
" <if test='remarks != null'>remarks=#{remarks},</if>"
,
" <if test='type != null'>title=#{type},</if>"
,
" <if test='updateBy != null'>update_by=#{updateBy},</if> "
,
" <if test='updateDate != null'>update_date=#{updateDate},</if> "
,
" <if test='delFlag != null'>del_flag=#{delFlag},</if> "
,
" <if test='flag != null'>flag=#{flag},</if> "
,
" <if test='remarks != null'>remarks=#{remarks},</if> "
,
" <if test='lesson_id != null'>lesson_id=#{lessonId},</if> "
,
" <if test='type != null'>type=#{type},</if> "
,
" <if test='corp_id != null'>corp_id=#{corp_id},</if> "
,
" </set>"
,
"where lesson_id=#{lessonId}"
,
"</script>"
})
...
...
src/main/java/org/rcisoft/business/blesson/dto/AppointLessonDTO.java
0 → 100644
View file @
c9d18907
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
AppointLessonDTO
{
@ApiModelProperty
(
value
=
"课程Id"
,
required
=
true
)
private
String
lessonId
;
@ApiModelProperty
(
value
=
"推荐范围(人)多人之间用','隔开"
,
required
=
true
)
private
String
appointPerson
;
private
String
userId
;
private
String
corpId
;
}
src/main/java/org/rcisoft/business/blesson/dto/RecommendLessonDTO.java
View file @
c9d18907
...
...
@@ -6,7 +6,7 @@ import lombok.Data;
@Data
public
class
RecommendLessonDTO
{
@ApiModelProperty
(
value
=
"课程Id"
)
@ApiModelProperty
(
value
=
"课程Id"
,
required
=
true
)
private
String
lessonId
;
@ApiModelProperty
(
value
=
"推荐范围(人)多人之间用','隔开"
)
...
...
@@ -14,4 +14,8 @@ public class RecommendLessonDTO {
@ApiModelProperty
(
value
=
"推荐范围(部门)多人之间用','隔开"
)
private
String
recommendDepart
;
private
String
userId
;
private
String
corpId
;
}
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
c9d18907
...
...
@@ -47,7 +47,7 @@ public class BLesson extends IdEntity<BLesson> {
private
String
defaultUrl
;
@ApiModelProperty
(
value
=
"课时"
)
@Length
(
min
=
1
,
max
=
8
,
message
=
"长度最小为1,最大为5"
)
//
@Length(min = 1,max = 8,message = "长度最小为1,最大为5")
private
String
classHour
;
@ApiModelProperty
(
value
=
"讲师id"
)
...
...
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
c9d18907
...
...
@@ -116,7 +116,14 @@ public interface BLessonService{
* @param recommendLessonDTO
* @return
*/
PersistModel
recommendBLesson
(
CurUser
curUser
,
RecommendLessonDTO
recommendLessonDTO
);
PersistModel
recommendBLesson
(
RecommendLessonDTO
recommendLessonDTO
);
/**
* 指派课程
* @param appointLessonDTO
* @return
*/
PersistModel
appointLessonToPerson
(
AppointLessonDTO
appointLessonDTO
);
/**
* 课程培训条件查询
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
c9d18907
...
...
@@ -6,15 +6,14 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.bcourse.dao.BCourseRepository
;
import
org.rcisoft.business.bcourse.dto.AllCourseDTO
;
import
org.rcisoft.business.blesson.dao.BAppointRepository
;
import
org.rcisoft.business.blesson.dao.BLessonRepository
;
import
org.rcisoft.business.blesson.dao.BRecommendRepository
;
import
org.rcisoft.business.blesson.dto.*
;
import
org.rcisoft.business.blesson.entity.
BLesson
;
import
org.rcisoft.business.blesson.entity.
*
;
import
org.rcisoft.business.blesson.service.BLessonService
;
import
org.rcisoft.business.blesson.entity.BLessonLabel
;
import
org.rcisoft.business.blesson.util.recursion
;
import
org.rcisoft.business.blesson.dao.BViewrangeRepository
;
import
org.rcisoft.business.blesson.entity.BViewrange
;
import
org.rcisoft.business.blesson.entity.BViewrangeSon
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
...
...
@@ -57,6 +56,12 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired
private
BViewrangeRepository
bViewrangeRepository
;
@Autowired
private
BRecommendRepository
bRecommendRepository
;
@Autowired
private
BAppointRepository
bAppointRepository
;
//获取部门(目前写死)
private
List
<
String
>
getDeparts
(){
...
...
@@ -70,11 +75,13 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
BLesson
selectOne
(
String
businessId
)
{
return
bLessonRepository
.
selectInfoById
(
businessId
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
BLesson
selectOne
(
BLesson
bLesson
)
{
return
bLessonRepository
.
selectOne
(
bLesson
);
}
...
...
@@ -86,34 +93,40 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryBLessonsByPagination
(
PageUtil
pageUtil
,
String
releaseState
,
CurUser
curUser
)
{
return
bLessonRepository
.
queryBLessons
(
releaseState
,
curUser
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryAllBLessonsByPagination
(
PageUtil
pageUtil
,
FindAllLessonDTO
findAllLessonDTO
)
{
return
bLessonRepository
.
queryAllBLesson
(
findAllLessonDTO
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryPersonMoreByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
List
<
String
>
departs
=
getDeparts
();
return
bLessonRepository
.
queryPersonMore
(
curUser
,
departs
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryRecommendByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
List
<
String
>
departs
=
getDeparts
();
return
bLessonRepository
.
queryRecommend
(
curUser
,
departs
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryConcernByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
List
<
String
>
departs
=
getDeparts
();
return
bLessonRepository
.
queryConcern
(
curUser
,
departs
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryInterestedByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
List
<
String
>
departs
=
getDeparts
();
return
bLessonRepository
.
queryInterested
(
curUser
,
departs
);
...
...
@@ -220,6 +233,7 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryHomeBLessonsByPagination
(
PageUtil
pageUtil
,
FirstPageQueryDTO
firstPageQueryDTO
,
List
<
AllCourseDTO
>
allCourse
)
{
List
<
String
>
departs
=
getDeparts
();
firstPageQueryDTO
.
setDeparts
(
departs
);
...
...
@@ -234,6 +248,7 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
closeBLesson
(
String
id
)
{
BLesson
bLesson
=
new
BLesson
();
bLesson
.
setBusinessId
(
id
);
...
...
@@ -244,6 +259,7 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
releaseBLesson
(
String
id
)
{
int
state
=
bLessonRepository
.
findLessonReleaseState
(
id
);
...
...
@@ -260,41 +276,100 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
public
PersistModel
recommendBLesson
(
CurUser
curUser
,
RecommendLessonDTO
recommendLessonDTO
)
{
//
// if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) || StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// BLesson bLesson = new BLesson();
// BViewrange bViewrange = setBViewrangeInfo(model);
// //插入可见范围表
// bViewrangeRepository.insertSelective(bViewrange);
// //插入可见范围子表
// List<BViewrangeSon> bViewrangeSons = new ArrayList<>();
// //model.getViewRangePerson()不为空 新建bViewrangeSon对象放入bViewrangeSons中
// if (StringUtils.isNotEmpty(model.getViewRangePerson())){
// String[] viewRangePerson = model.getViewRangePerson().split(",");
// bViewrangeSons = addBViewrangeSon(bViewrangeSons,viewRangePerson,"0",bViewrange.getBusinessId());
// }
// if (StringUtils.isNotEmpty(model.getViewRangeDepart())){
// String[] viewRangeDepart = model.getViewRangeDepart().split(",");
// bViewrangeSons = addBViewrangeSon(bViewrangeSons,viewRangeDepart,"1",bViewrange.getBusinessId());
// }
// //插入子表
// bViewrangeRepository.insertBViewrangeSons(bViewrangeSons);
// }
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
recommendBLesson
(
RecommendLessonDTO
recommendLessonDTO
)
{
if
(
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendPerson
())
||
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendDepart
())){
BRecommend
bRecommend
=
new
BRecommend
();
bRecommend
.
setLessonId
(
recommendLessonDTO
.
getLessonId
());
bRecommend
.
setRecommendPerson
(
recommendLessonDTO
.
getUserId
());
//设置推荐类型(0仅人 1仅部门 2人和部门)
if
(
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendPerson
())
&&
StringUtils
.
isEmpty
(
recommendLessonDTO
.
getRecommendDepart
())){
bRecommend
.
setType
(
"0"
);
}
else
if
(
StringUtils
.
isEmpty
(
recommendLessonDTO
.
getRecommendPerson
())
&&
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendDepart
())){
bRecommend
.
setType
(
"1"
);
}
else
if
(
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendPerson
())
&&
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendDepart
())){
bRecommend
.
setType
(
"2"
);
}
//查询是否存在该课程推荐
List
<
String
>
recommendIds
=
bRecommendRepository
.
selectIdByLessonId
(
bRecommend
.
getLessonId
());
if
(
recommendIds
==
null
||
recommendIds
.
size
()<
1
){
//课程表----
//插入推荐表
UserUtil
.
setCurrentPersistOperation
(
bRecommend
);
bRecommendRepository
.
insertSelective
(
bRecommend
);
}
else
{
//修改推荐表
UserUtil
.
setCurrentMergeOperation
(
bRecommend
);
bRecommend
.
setBusinessId
(
recommendIds
.
get
(
0
));
bRecommendRepository
.
updateByPrimaryKeySelective
(
bRecommend
);
//删除推荐子表内容
bRecommendRepository
.
deleteRecommendSon
(
bRecommend
);
}
//插入推荐子表
List
<
BRecommendSon
>
bRecommendSons
=
new
ArrayList
<>();
//model.getViewRangePerson()不为空 新建bViewrangeSon对象放入bViewrangeSons中
if
(
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendPerson
())){
String
[]
recommendPerson
=
recommendLessonDTO
.
getRecommendPerson
().
split
(
","
);
bRecommendSons
=
addBRecommendSon
(
bRecommendSons
,
recommendPerson
,
"0"
,
bRecommend
.
getBusinessId
());
}
if
(
StringUtils
.
isNotEmpty
(
recommendLessonDTO
.
getRecommendPerson
())){
String
[]
recommendDepart
=
recommendLessonDTO
.
getRecommendPerson
().
split
(
","
);
bRecommendSons
=
addBRecommendSon
(
bRecommendSons
,
recommendDepart
,
"1"
,
bRecommend
.
getBusinessId
());
}
//插入子表
int
line
=
bRecommendRepository
.
insertBRecommendSons
(
bRecommendSons
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
else
{
throw
new
ServiceException
(
ResultExceptionEnum
.
INVALID_PARAMETER_VALUE
);
}
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
appointLessonToPerson
(
AppointLessonDTO
appointLessonDTO
)
{
if
(
StringUtils
.
isEmpty
(
appointLessonDTO
.
getAppointPerson
())){
throw
new
ServiceException
(
ResultExceptionEnum
.
INVALID_PARAMETER_VALUE
);
}
//按课程查询指派表是否为空
//插入指派表
BAppoint
bAppoint
=
new
BAppoint
();
bAppoint
.
setLessonId
(
appointLessonDTO
.
getLessonId
());
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
bAppoint
.
setDesignatedId
(
appointLessonDTO
.
getAppointPerson
());
UserUtil
.
setCurrentPersistOperation
(
bAppoint
);
// bAppointRepository.insertSelective(bAppoint);
//插入b_lesson_person表
//查询已学该课程的学习business_id
//更新b_lesson_person表
//从学生Id中删除已更新的学生id
//剩余学生添加至b_lesson_person表
return
null
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
findLessonAtBanner
(
LessonTrainAtBannerDTO
lessonTrainDTO
)
{
return
bLessonRepository
.
findLessonAtBanner
(
lessonTrainDTO
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
ILessonCountDTO
iLessonCount
(
String
userId
)
{
return
bLessonRepository
.
iLessonCount
(
userId
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryListAllLessonByPagination
(
PageUtil
pageUtil
,
FindListLessonDTO
model
,
List
<
AllCourseDTO
>
allCourse
)
{
List
<
String
>
departs
=
getDeparts
();
model
.
setDeparts
(
departs
);
...
...
@@ -347,7 +422,7 @@ public class BLessonServiceImpl implements BLessonService {
return
bLessonLabels
;
}
//遍历 将可见范围添加值可见范围子表中
//遍历 将可见范围添加值可见范围子表
集合
中
List
<
BViewrangeSon
>
addBViewrangeSon
(
List
<
BViewrangeSon
>
bViewrangeSons
,
String
[]
viewRanges
,
String
type
,
String
viewRangeId
){
for
(
int
index
=
0
;
index
<
viewRanges
.
length
;
index
++){
BViewrangeSon
bViewrangeSon
=
new
BViewrangeSon
();
...
...
@@ -359,6 +434,18 @@ public class BLessonServiceImpl implements BLessonService {
}
return
bViewrangeSons
;
}
//遍历 将推荐添加值推荐子表集合中
List
<
BRecommendSon
>
addBRecommendSon
(
List
<
BRecommendSon
>
bRecommendSons
,
String
[]
recommends
,
String
type
,
String
recommendId
){
for
(
int
index
=
0
;
index
<
recommends
.
length
;
index
++){
BRecommendSon
bRecommendSon
=
new
BRecommendSon
();
bRecommendSon
.
setBusinessId
(
IdGen
.
uuid
());
bRecommendSon
.
setTargetId
(
recommends
[
index
]);
bRecommendSon
.
setType
(
type
);
bRecommendSon
.
setRecommendId
(
recommendId
);
bRecommendSons
.
add
(
bRecommendSon
);
}
return
bRecommendSons
;
}
//设置BViewrange信息
BViewrange
setBViewrangeInfo
(
BLesson
model
){
...
...
@@ -377,25 +464,9 @@ public class BLessonServiceImpl implements BLessonService {
}
return
bViewrange
;
}
// //设置BRecommend信息
// BRecommend setBRecommendInfo(RecommendLessonDTO model){
// BViewrange bViewrange = new BViewrange();
// UserUtil.setCurrentPersistOperation(bViewrange);
// //设置课程id
// bViewrange.setLessonId(model.getBusinessId());
//
// //设置可见范围类型(0仅人 1仅部门 2人和部门)
// if (StringUtils.isNotEmpty(model.getViewRangePerson()) && StringUtils.isEmpty(model.getViewRangeDepart())){
// bViewrange.setType("0");
// }else if (StringUtils.isEmpty(model.getViewRangePerson()) && StringUtils.isNotEmpty(model.getViewRangeDepart())){
// bViewrange.setType("1");
// }else if (StringUtils.isNotEmpty(model.getViewRangePerson()) && StringUtils.isNotEmpty(model.getViewRangeDepart())){
// bViewrange.setType("2");
// }
// return bViewrange;
// }
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
)
{
//查询当前登录人所在的企业
String
corpId
=
curUser
.
getCorpId
();
...
...
src/main/resources/mapper/business/blesson/mapper/BLessonMapper.xml
View file @
c9d18907
...
...
@@ -29,7 +29,7 @@
<result
column=
"collect_number"
jdbcType=
"VARCHAR"
property=
"collectNumber"
/>
<result
column=
"hot_number"
jdbcType=
"VARCHAR"
property=
"hotNumber"
/>
<result
column=
"value"
jdbcType=
"VARCHAR"
property=
"value"
/>
<collection
property=
"labelList"
ofType=
"org.rcisoft.business.bl
esson.entity.BLesson
"
<collection
property=
"labelList"
ofType=
"org.rcisoft.business.bl
abel.dto.QueryLabelResDTO
"
javaType=
"java.util.ArrayList"
select=
"org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"
column=
"business_id"
>
</collection>
...
...
src/main/resources/mapper/business/blesson/mapper/BRecommendMapper.xml
0 → 100644
View file @
c9d18907
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.rcisoft.business.blesson.dao.BRecommendRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.blesson.entity.BRecommend"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"recommend_person"
jdbcType=
"VARCHAR"
property=
"recommendPerson"
/>
<result
column=
"lesson_id"
jdbcType=
"VARCHAR"
property=
"lessonId"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"corp_id"
jdbcType=
"VARCHAR"
property=
"corpId"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
src/main/resources/mapper/business/blesson/mapper/BViewrangeMapper.xml
View file @
c9d18907
...
...
@@ -12,6 +12,7 @@
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"lesson_id"
jdbcType=
"VARCHAR"
property=
"lessonId"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"corp_id"
jdbcType=
"VARCHAR"
property=
"corpId"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
...
...
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