Commit c9d18907 authored by root's avatar root

修改接口

parent 479754df
...@@ -308,13 +308,23 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -308,13 +308,23 @@ public class BLessonController extends PaginationController<BLesson> {
} }
// @ApiOperation(value="622 推荐课程", notes="根据ID推荐课程") @ApiOperation(value="622 推荐课程", notes="根据ID推荐课程")
// @PostMapping(value = "/recommend") @PostMapping(value = "/recommend")
// public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) { public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) {
// PersistModel data = bLessonService.recommendBLesson(curUser,recommendLessonDTO); PersistModel data = bLessonService.recommendBLesson(recommendLessonDTO);
// return Result.builder(data, return Result.builder(data,
// MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
// recommendLessonDTO); 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);
}
} }
...@@ -79,12 +79,12 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -79,12 +79,12 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" blp.finish_date finishDate " + " blp.finish_date finishDate " +
"from b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " + "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 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.business_id = blp.appoint_id " +
"left join b_appoint ba on ba.lesson_id = bl.business_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 " + "where blp.del_flag != 1 and blp.flag = 1 " +
"and bl.del_flag != 1 and bl.flag = 1 " + "and bl.del_flag != 1 and bl.flag = 1 " +
"and su.del_flag != 1 and su.flag = 1 " + "and su.del_flag != 1 and su.flag = 1 " +
"and ba.del_flag != 1 and ba.flag = 1 " +
"and bl.corp_id = #{param.corpId} "+ "and bl.corp_id = #{param.corpId} "+
// "and blp.corp_id = #{param.corpId} "+ // "and blp.corp_id = #{param.corpId} "+
......
package org.rcisoft.business.blesson.dao; package org.rcisoft.business.blesson.dao;
import org.apache.ibatis.annotations.*;
import org.rcisoft.business.blesson.entity.BRecommend; import org.rcisoft.business.blesson.entity.BRecommend;
import org.rcisoft.business.blesson.entity.BRecommendSon;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -15,15 +15,45 @@ import java.util.List; ...@@ -15,15 +15,45 @@ import java.util.List;
@Repository @Repository
public interface BRecommendRepository extends BaseMapper<BRecommend> { public interface BRecommendRepository extends BaseMapper<BRecommend> {
// /** /**
// * 分页查询 bRecommend * 分页查询 bRecommend
// * *
// */ */
// @Select("<script>select * from b_recommend where 1=1 " @Select("<script>select * from b_recommend where 1=1 "
// + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> " + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
// + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> " + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
// + "</script>") + "</script>")
// @ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
// List<BRecommend> queryBRecommends(BRecommend bRecommend); 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);
} }
...@@ -27,14 +27,16 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> { ...@@ -27,14 +27,16 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
List<BViewrange> queryBViewranges(BViewrange bViewrange); List<BViewrange> queryBViewranges(BViewrange bViewrange);
@Update({"<script>", @Update({"<script>",
"update b_banner", "update b_viewrange",
" <set>", " <set>",
" <if test='updateBy != null'>update_by=#{updateBy},</if>", " <if test='updateBy != null'>update_by=#{updateBy},</if> ",
" <if test='updateDate != null'>update_date=#{updateDate},</if>", " <if test='updateDate != null'>update_date=#{updateDate},</if> ",
" <if test='delFlag != null'>del_flag=#{delFlag},</if>", " <if test='delFlag != null'>del_flag=#{delFlag},</if> ",
" <if test='flag != null'>flag=#{flag},</if>", " <if test='flag != null'>flag=#{flag},</if> ",
" <if test='remarks != null'>remarks=#{remarks},</if>", " <if test='remarks != null'>remarks=#{remarks},</if> ",
" <if test='type != null'>title=#{type},</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>", " </set>",
"where lesson_id=#{lessonId}", "where lesson_id=#{lessonId}",
"</script>"}) "</script>"})
......
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;
}
...@@ -6,7 +6,7 @@ import lombok.Data; ...@@ -6,7 +6,7 @@ import lombok.Data;
@Data @Data
public class RecommendLessonDTO { public class RecommendLessonDTO {
@ApiModelProperty(value = "课程Id") @ApiModelProperty(value = "课程Id",required = true)
private String lessonId; private String lessonId;
@ApiModelProperty(value = "推荐范围(人)多人之间用','隔开") @ApiModelProperty(value = "推荐范围(人)多人之间用','隔开")
...@@ -14,4 +14,8 @@ public class RecommendLessonDTO { ...@@ -14,4 +14,8 @@ public class RecommendLessonDTO {
@ApiModelProperty(value = "推荐范围(部门)多人之间用','隔开") @ApiModelProperty(value = "推荐范围(部门)多人之间用','隔开")
private String recommendDepart; private String recommendDepart;
private String userId;
private String corpId;
} }
...@@ -47,7 +47,7 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -47,7 +47,7 @@ public class BLesson extends IdEntity<BLesson> {
private String defaultUrl; private String defaultUrl;
@ApiModelProperty(value = "课时") @ApiModelProperty(value = "课时")
@Length(min = 1,max = 8,message = "长度最小为1,最大为5") // @Length(min = 1,max = 8,message = "长度最小为1,最大为5")
private String classHour; private String classHour;
@ApiModelProperty(value = "讲师id") @ApiModelProperty(value = "讲师id")
......
...@@ -116,7 +116,14 @@ public interface BLessonService{ ...@@ -116,7 +116,14 @@ public interface BLessonService{
* @param recommendLessonDTO * @param recommendLessonDTO
* @return * @return
*/ */
PersistModel recommendBLesson(CurUser curUser,RecommendLessonDTO recommendLessonDTO); PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO);
/**
* 指派课程
* @param appointLessonDTO
* @return
*/
PersistModel appointLessonToPerson(AppointLessonDTO appointLessonDTO);
/** /**
* 课程培训条件查询 * 课程培训条件查询
......
...@@ -6,15 +6,14 @@ import lombok.extern.slf4j.Slf4j; ...@@ -6,15 +6,14 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.bcourse.dao.BCourseRepository; import org.rcisoft.business.bcourse.dao.BCourseRepository;
import org.rcisoft.business.bcourse.dto.AllCourseDTO; 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.BLessonRepository;
import org.rcisoft.business.blesson.dao.BRecommendRepository;
import org.rcisoft.business.blesson.dto.*; 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.service.BLessonService;
import org.rcisoft.business.blesson.entity.BLessonLabel;
import org.rcisoft.business.blesson.util.recursion; import org.rcisoft.business.blesson.util.recursion;
import org.rcisoft.business.blesson.dao.BViewrangeRepository; 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.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant; import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
...@@ -57,6 +56,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -57,6 +56,12 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired @Autowired
private BViewrangeRepository bViewrangeRepository; private BViewrangeRepository bViewrangeRepository;
@Autowired
private BRecommendRepository bRecommendRepository;
@Autowired
private BAppointRepository bAppointRepository;
//获取部门(目前写死) //获取部门(目前写死)
private List<String> getDeparts(){ private List<String> getDeparts(){
...@@ -70,11 +75,13 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -70,11 +75,13 @@ public class BLessonServiceImpl implements BLessonService {
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public BLesson selectOne(String businessId) { public BLesson selectOne(String businessId) {
return bLessonRepository.selectInfoById(businessId); return bLessonRepository.selectInfoById(businessId);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public BLesson selectOne(BLesson bLesson) { public BLesson selectOne(BLesson bLesson) {
return bLessonRepository.selectOne(bLesson); return bLessonRepository.selectOne(bLesson);
} }
...@@ -86,34 +93,40 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -86,34 +93,40 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryBLessonsByPagination(PageUtil pageUtil, String releaseState, CurUser curUser) { public List<BLesson> queryBLessonsByPagination(PageUtil pageUtil, String releaseState, CurUser curUser) {
return bLessonRepository.queryBLessons(releaseState, curUser); return bLessonRepository.queryBLessons(releaseState, curUser);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryAllBLessonsByPagination(PageUtil pageUtil, FindAllLessonDTO findAllLessonDTO) { public List<BLesson> queryAllBLessonsByPagination(PageUtil pageUtil, FindAllLessonDTO findAllLessonDTO) {
return bLessonRepository.queryAllBLesson(findAllLessonDTO); return bLessonRepository.queryAllBLesson(findAllLessonDTO);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil, CurUser curUser) { public List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil, CurUser curUser) {
List<String> departs = getDeparts(); List<String> departs = getDeparts();
return bLessonRepository.queryPersonMore(curUser,departs); return bLessonRepository.queryPersonMore(curUser,departs);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryRecommendByPagination(PageUtil pageUtil,CurUser curUser) { public List<BLesson> queryRecommendByPagination(PageUtil pageUtil,CurUser curUser) {
List<String> departs = getDeparts(); List<String> departs = getDeparts();
return bLessonRepository.queryRecommend(curUser,departs); return bLessonRepository.queryRecommend(curUser,departs);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryConcernByPagination(PageUtil pageUtil,CurUser curUser) { public List<BLesson> queryConcernByPagination(PageUtil pageUtil,CurUser curUser) {
List<String> departs = getDeparts(); List<String> departs = getDeparts();
return bLessonRepository.queryConcern(curUser,departs); return bLessonRepository.queryConcern(curUser,departs);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryInterestedByPagination(PageUtil pageUtil,CurUser curUser) { public List<BLesson> queryInterestedByPagination(PageUtil pageUtil,CurUser curUser) {
List<String> departs = getDeparts(); List<String> departs = getDeparts();
return bLessonRepository.queryInterested(curUser,departs); return bLessonRepository.queryInterested(curUser,departs);
...@@ -220,6 +233,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -220,6 +233,7 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryHomeBLessonsByPagination(PageUtil pageUtil, FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) { public List<BLesson> queryHomeBLessonsByPagination(PageUtil pageUtil, FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) {
List<String> departs = getDeparts(); List<String> departs = getDeparts();
firstPageQueryDTO.setDeparts(departs); firstPageQueryDTO.setDeparts(departs);
...@@ -234,6 +248,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -234,6 +248,7 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public PersistModel closeBLesson(String id) { public PersistModel closeBLesson(String id) {
BLesson bLesson = new BLesson(); BLesson bLesson = new BLesson();
bLesson.setBusinessId(id); bLesson.setBusinessId(id);
...@@ -244,6 +259,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -244,6 +259,7 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public PersistModel releaseBLesson(String id) { public PersistModel releaseBLesson(String id) {
int state = bLessonRepository.findLessonReleaseState(id); int state = bLessonRepository.findLessonReleaseState(id);
...@@ -260,41 +276,100 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -260,41 +276,100 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override @Override
public PersistModel recommendBLesson(CurUser curUser, RecommendLessonDTO recommendLessonDTO) { @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
// public PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO) {
// if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) || StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// BLesson bLesson = new BLesson(); if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) || StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// BViewrange bViewrange = setBViewrangeInfo(model); BRecommend bRecommend = new BRecommend();
// //插入可见范围表 bRecommend.setLessonId(recommendLessonDTO.getLessonId());
// bViewrangeRepository.insertSelective(bViewrange); bRecommend.setRecommendPerson(recommendLessonDTO.getUserId());
// //插入可见范围子表 //设置推荐类型(0仅人 1仅部门 2人和部门)
// List<BViewrangeSon> bViewrangeSons = new ArrayList<>(); if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) && StringUtils.isEmpty(recommendLessonDTO.getRecommendDepart())){
// //model.getViewRangePerson()不为空 新建bViewrangeSon对象放入bViewrangeSons中 bRecommend.setType("0");
// if (StringUtils.isNotEmpty(model.getViewRangePerson())){ }else if (StringUtils.isEmpty(recommendLessonDTO.getRecommendPerson()) && StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// String[] viewRangePerson = model.getViewRangePerson().split(","); bRecommend.setType("1");
// bViewrangeSons = addBViewrangeSon(bViewrangeSons,viewRangePerson,"0",bViewrange.getBusinessId()); }else if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) && StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// } bRecommend.setType("2");
// if (StringUtils.isNotEmpty(model.getViewRangeDepart())){ }
// String[] viewRangeDepart = model.getViewRangeDepart().split(","); //查询是否存在该课程推荐
// bViewrangeSons = addBViewrangeSon(bViewrangeSons,viewRangeDepart,"1",bViewrange.getBusinessId()); List<String> recommendIds = bRecommendRepository.selectIdByLessonId(bRecommend.getLessonId());
// } if (recommendIds == null || recommendIds.size()<1){
// //插入子表 //课程表----
// bViewrangeRepository.insertBViewrangeSons(bViewrangeSons);
// } //插入推荐表
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; return null;
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> findLessonAtBanner(LessonTrainAtBannerDTO lessonTrainDTO) { public List<BLesson> findLessonAtBanner(LessonTrainAtBannerDTO lessonTrainDTO) {
return bLessonRepository.findLessonAtBanner(lessonTrainDTO); return bLessonRepository.findLessonAtBanner(lessonTrainDTO);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public ILessonCountDTO iLessonCount(String userId) { public ILessonCountDTO iLessonCount(String userId) {
return bLessonRepository.iLessonCount(userId); return bLessonRepository.iLessonCount(userId);
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryListAllLessonByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse) { public List<BLesson> queryListAllLessonByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse) {
List<String> departs = getDeparts(); List<String> departs = getDeparts();
model.setDeparts(departs); model.setDeparts(departs);
...@@ -347,7 +422,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -347,7 +422,7 @@ public class BLessonServiceImpl implements BLessonService {
return bLessonLabels; return bLessonLabels;
} }
//遍历 将可见范围添加值可见范围子表中 //遍历 将可见范围添加值可见范围子表集合
List<BViewrangeSon> addBViewrangeSon(List<BViewrangeSon> bViewrangeSons, String[] viewRanges,String type,String viewRangeId){ List<BViewrangeSon> addBViewrangeSon(List<BViewrangeSon> bViewrangeSons, String[] viewRanges,String type,String viewRangeId){
for (int index = 0 ; index<viewRanges.length;index++){ for (int index = 0 ; index<viewRanges.length;index++){
BViewrangeSon bViewrangeSon = new BViewrangeSon(); BViewrangeSon bViewrangeSon = new BViewrangeSon();
...@@ -359,6 +434,18 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -359,6 +434,18 @@ public class BLessonServiceImpl implements BLessonService {
} }
return bViewrangeSons; 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信息
BViewrange setBViewrangeInfo(BLesson model){ BViewrange setBViewrangeInfo(BLesson model){
...@@ -377,25 +464,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -377,25 +464,9 @@ public class BLessonServiceImpl implements BLessonService {
} }
return bViewrange; 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 @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> theLessonMangageByPagination(PageUtil pageUtil, CurUser curUser, BLesson bLesson) { public List<BLesson> theLessonMangageByPagination(PageUtil pageUtil, CurUser curUser, BLesson bLesson) {
//查询当前登录人所在的企业 //查询当前登录人所在的企业
String corpId = curUser.getCorpId(); String corpId = curUser.getCorpId();
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<result column="collect_number" jdbcType="VARCHAR" property="collectNumber"/> <result column="collect_number" jdbcType="VARCHAR" property="collectNumber"/>
<result column="hot_number" jdbcType="VARCHAR" property="hotNumber"/> <result column="hot_number" jdbcType="VARCHAR" property="hotNumber"/>
<result column="value" jdbcType="VARCHAR" property="value"/> <result column="value" jdbcType="VARCHAR" property="value"/>
<collection property="labelList" ofType="org.rcisoft.business.blesson.entity.BLesson" <collection property="labelList" ofType="org.rcisoft.business.blabel.dto.QueryLabelResDTO"
javaType="java.util.ArrayList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId" javaType="java.util.ArrayList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"
column="business_id"> column="business_id">
</collection> </collection>
......
<?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
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="remarks" jdbcType="VARCHAR" property="remarks"/> <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/> <result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/>
<result column="type" jdbcType="VARCHAR" property="type"/> <result column="type" jdbcType="VARCHAR" property="type"/>
<result column="corp_id" jdbcType="VARCHAR" property="corpId"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment