Commit bfc6e277 authored by 王淑君's avatar 王淑君

Merge remote-tracking branch 'origin/meiteng' into meiteng

parents 512de1bb 8b029b71
...@@ -404,7 +404,10 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -404,7 +404,10 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
@Select("select lesson_id from b_chapter where business_id = #{businessId}") @Select("select lesson_id from b_chapter where business_id = #{businessId}")
String getLessonIdBychaperId(@Param("businessId") String businessId); String getLessonIdBychaperId(@Param("businessId") String businessId);
@Update("delete from b_r_student_chapter where chapter_id = #{chapterId} and student_id = #{uid} ") @Delete("delete from b_r_student_chapter where chapter_id = #{chapterId} and student_id = #{uid} ")
int deleteStudentChapter(@Param("chapterId") String chapterId,@Param("uid") String uid); int deleteBStudentChapter(@Param("chapterId") String chapterId,@Param("uid") String uid);
@Select("select count(0) from b_chapter where lesson_id = #{lessonId} and chapter_level = 2 and del_flag != 1 and flag =1")
int getlessonHours(@Param("lessonId") String lessonId);
} }
...@@ -8,7 +8,7 @@ import lombok.Data; ...@@ -8,7 +8,7 @@ import lombok.Data;
@Data @Data
public class ChapterDTO { public class ChapterDTO {
@ApiModelProperty(value = "课程id 修改章节时传入") @ApiModelProperty(value = "章节id 修改章节时传入")
private String businessId; private String businessId;
@ApiModelProperty(value = "课程ID") @ApiModelProperty(value = "课程ID")
......
...@@ -154,17 +154,22 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -154,17 +154,22 @@ public class BChapterServiceImpl implements BChapterService {
if (bLesson == null){ if (bLesson == null){
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA); throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
} }
//判断课程是否被关闭 // //判断课程是否被关闭
if ("4".equals(bLesson.getReleaseState())){ // if ("4".equals(bLesson.getReleaseState())){
throw new ServiceException(ResultServiceEnums.LESSON_CLOSED); // throw new ServiceException(ResultServiceEnums.LESSON_CLOSED);
} // }
//判断该登录人是否可见该课程 //判断该登录人是否可见该课程
List<String> ids = Arrays.asList(new String[]{curUser.getUserId()}); List<String> ids = Arrays.asList(new String[]{curUser.getUserId()});
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO(); MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
int result = bLessonRepository.isInViewRange(curUser,lessonId,departs); int result = bLessonRepository.isInViewRange(curUser,lessonId,departs);
if (result < 1){ if (result < 1){
throw new ServiceException(ResultServiceEnums.NO_ACCESS); throw new ServiceException(ResultServiceEnums.NO_ACCESS);
...@@ -295,18 +300,19 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -295,18 +300,19 @@ public class BChapterServiceImpl implements BChapterService {
UserUtil.setCurrentMergeOperation(model); UserUtil.setCurrentMergeOperation(model);
bFile.setChapterId(model.getBusinessId()); bFile.setChapterId(model.getBusinessId());
UserUtil.setCurrentMergeOperation(bFile); UserUtil.setCurrentMergeOperation(bFile);
model.setCourseTime(dto.getFileTime());
model.setIsTest(dto.getType()); model.setIsTest(dto.getType());
if (StringUtils.isNotEmpty(dto.getFileTime()) && dto.getFileTime().contains(".")) { if (StringUtils.isNotEmpty(dto.getFileTime()) && dto.getFileTime().contains(".")) {
model.setCourseTime(dto.getFileTime().substring(0, dto.getFileTime().lastIndexOf("."))); model.setCourseTime(dto.getFileTime().substring(0, dto.getFileTime().lastIndexOf(".")));
bFile.setFileTime(dto.getFileTime().substring(0, dto.getFileTime().lastIndexOf("."))); bFile.setFileTime(dto.getFileTime().substring(0, dto.getFileTime().lastIndexOf(".")));
} }
//先判断该课程的第一节是否是本节 更新blesson表中course_time字段 //先判断该课程的第一节是否是本节 更新blesson表中course_time字段
String cid = bChapterRepository.getFirstChapter(model.getLessonId()); String cid = bChapterRepository.getFirstChapter(model.getLessonId());
log.debug("--------------------------------第一节id--------:"+cid);
log.debug("------------------------------当前章节id--------:"+model.getBusinessId());
if (model.getBusinessId().equals(cid)) { if (model.getBusinessId().equals(cid)) {
bChapterRepository.updateVideoTimeInLesson(model.getCourseTime(), model.getLessonId()); int linex = bChapterRepository.updateVideoTimeInLesson(model.getCourseTime(), model.getLessonId());
log.debug("----------------------更新lesson表中第一节时长--"+(linex==0?"失败":"成功")+"----------");
log.debug("--------------------------时长-----------:"+model.getCourseTime());
} }
line = bChapterRepository.updateByPrimaryKeySelective(model); line = bChapterRepository.updateByPrimaryKeySelective(model);
...@@ -333,6 +339,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -333,6 +339,7 @@ public class BChapterServiceImpl implements BChapterService {
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson); bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
studentChapter.setProgress(0); studentChapter.setProgress(0);
brStudentChapterRepository.updateById(studentChapter); brStudentChapterRepository.updateById(studentChapter);
} }
} }
} }
...@@ -405,15 +412,21 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -405,15 +412,21 @@ public class BChapterServiceImpl implements BChapterService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false) @Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public PersistModel removeBChapter(String id,String userId) { public PersistModel removeBChapter(String id,String userId) {
BChapter bChapter = bChapterRepository.selectByPrimaryKey(id); BChapter bChapter = bChapterRepository.selectByPrimaryKey(id);
String lessonId = bChapterRepository.getLessonIdBychaperId(id);
if (bChapter == null) if (bChapter == null)
throw new ServiceException(ResultServiceEnums.CHAPTER_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.CHAPTER_NOT_EXISTS);
int chapterCount =bChapterRepository.getlessonHours(lessonId);
BLesson bLesson = bLessonRepository.selectByPrimaryKey(lessonId);
if("2".equals(bLesson.getReleaseState()) && chapterCount == 1){
throw new ServiceException(ResultServiceEnums.CHAPTER_ONLY_ONE);
}
List<QueryChapterListResDTO> childList = bChapterRepository.queryBChaptersByPid(id); List<QueryChapterListResDTO> childList = bChapterRepository.queryBChaptersByPid(id);
boolean hasChild = childList != null && childList.size() > 0; boolean hasChild = childList != null && childList.size() > 0;
boolean isChapter = bChapter.getChapterLevel() == ChapterLevelEnum.CHAPTER.getCode(); boolean isChapter = bChapter.getChapterLevel() == ChapterLevelEnum.CHAPTER.getCode();
if (isChapter && hasChild) { if (isChapter && hasChild) {
throw new ServiceException(ResultServiceEnums.CHAPTER_HAS_CHILD); throw new ServiceException(ResultServiceEnums.CHAPTER_HAS_CHILD);
} }
String lessonId = bChapterRepository.getLessonIdBychaperId(id);
//获取第一节课的id 与当前id对比 //获取第一节课的id 与当前id对比
String firstId = bChapterRepository.getFirstChapter(lessonId); String firstId = bChapterRepository.getFirstChapter(lessonId);
int line = bChapterRepository.removeByPrimaryKey(id); int line = bChapterRepository.removeByPrimaryKey(id);
...@@ -423,11 +436,11 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -423,11 +436,11 @@ public class BChapterServiceImpl implements BChapterService {
String secondId = bChapterRepository.getFirstChapter(lessonId); String secondId = bChapterRepository.getFirstChapter(lessonId);
String time = bChapterRepository.getTimeByChapterId(secondId); String time = bChapterRepository.getTimeByChapterId(secondId);
//更新到b_lesson 表 //更新到b_lesson 表
bChapterRepository.updateCourseTimeForLesson(time,lessonId); bChapterRepository.updateVideoTimeInLesson(time,lessonId);
// 更新学生 对应章节总进度 // 更新学生 对应章节总进度
this.updateLessonProgress(lessonId, false); this.updateLessonProgress(lessonId, false);
//删除student_chapter表中数据 //删除student_chapter表中数据
bChapterRepository.deleteStudentChapter(id,userId); bChapterRepository.deleteBStudentChapter(id,userId);
} }
return new PersistModel(line); return new PersistModel(line);
......
...@@ -565,7 +565,7 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -565,7 +565,7 @@ public class BLessonController extends PaginationController<BLesson> {
} }
@ApiOperation(value="634 单一查询指派人员", notes="单一查询指派人员",response = SysUser.class) @ApiOperation(value="634 查询指派人员", notes="查询指派人员",response = SysUser.class)
@ApiImplicitParam(name = "lessonId", value = "培训/课程id", required = true, dataType = "varchar") @ApiImplicitParam(name = "lessonId", value = "培训/课程id", required = true, dataType = "varchar")
@GetMapping(value = "/findAppointPerson") @GetMapping(value = "/findAppointPerson")
public Result findAppointPerson(CurUser curUser,String lessonId) { public Result findAppointPerson(CurUser curUser,String lessonId) {
...@@ -624,4 +624,15 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -624,4 +624,15 @@ public class BLessonController extends PaginationController<BLesson> {
bLessonService.getLessonState(lessonId)); bLessonService.getLessonState(lessonId));
} }
@ApiOperation(value = "639 判断可见权限 ", notes = "判断可见权限 ")
@PostMapping(value = "/judgeVisibleAuthority")
public Result judgeVisibleAuthority(CurUser curUser, @Valid String lessonId, BindingResult bindingResult) {
PersistModel data = bLessonService.judgeVisibleAuthority(curUser, lessonId);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
lessonId);
}
} }
...@@ -54,28 +54,40 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -54,28 +54,40 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@Select("<script> select " + @Select("<script> select " +
"(select lesson_name from b_lesson where business_id = #{param.lessonId}) LessonTitle, " + "(select lesson_name from b_lesson where business_id = #{param.lessonId}) LessonTitle, " +
"(select count(*) from b_lesson_person where " + "(select count(*) from b_lesson_person blp " +
" del_flag != 1 and flag = 1 " + " left join s_user su on blp.person_id = su.business_id " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " + " where " +
" and lesson_id = #{param.lessonId}) countAll, " + " blp.del_flag != 1 and blp.flag = 1 " +
" and su.del_flag != 1 and su.flag = 1 " +
"(select count(*) from b_lesson_person where " + " <if test= \" param.isAppoint != null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
" del_flag != 1 and flag = 1 " + " and blp.lesson_id = #{param.lessonId}) countAll, " +
" and is_finish = 0 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " + "(select count(*) from b_lesson_person blp " +
" and lesson_id = #{param.lessonId}) countNotStart, " + " left join s_user su on blp.person_id = su.business_id " +
" where " +
"(select count(*) from b_lesson_person where " + " blp.del_flag != 1 and blp.flag = 1 " +
" del_flag != 1 and flag = 1 " + " and su.del_flag != 1 and su.flag = 1 " +
" and is_finish = 1 " + " and blp.is_finish = 0 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " + " <if test= \" param.isAppoint != null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
" and lesson_id = #{param.lessonId}) countOngoing, " + " and blp.lesson_id = #{param.lessonId}) countNotStart, " +
"(select count(*) from b_lesson_person where " + "(select count(*) from b_lesson_person blp " +
" del_flag != 1 and flag = 1 " + " left join s_user su on blp.person_id = su.business_id " +
" and is_finish = 2 " + " where " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " + " blp.del_flag != 1 and blp.flag = 1 " +
" and lesson_id = #{param.lessonId}) countFinish" + " and su.del_flag != 1 and su.flag = 1 " +
" and blp.is_finish = 1 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
" and blp.lesson_id = #{param.lessonId}) countOngoing, " +
"(select count(*) from b_lesson_person blp " +
" left join s_user su on blp.person_id = su.business_id " +
" where " +
" blp.del_flag != 1 and blp.flag = 1 " +
" and su.del_flag != 1 and su.flag = 1 " +
" and blp.is_finish = 2 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
" and blp.lesson_id = #{param.lessonId}) countFinish" +
" </script>") " </script>")
StudentTrackingChartRspDTO studentTrackingChart(@Param("param") StudentTrackingChartDTO param); StudentTrackingChartRspDTO studentTrackingChart(@Param("param") StudentTrackingChartDTO param);
...@@ -279,6 +291,15 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -279,6 +291,15 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId} and del_flag != 1 ") @Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId} and del_flag != 1 ")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
BLessonPerson getAppointInTraining(@Param("lessonId")String lessonId ,@Param("personId")String personId ); BLessonPerson getAppointInTraining(@Param("lessonId")String lessonId ,@Param("personId")String personId );
/**
* 查询该用户在此培训中包含删除的状态
* @param lessonId
* @param personId
* @return
*/
@Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId} ")
@ResultMap(value = "BaseResultMap")
BLessonPerson getRelInBLessonPerson(@Param("lessonId")String lessonId ,@Param("personId")String personId );
@Select("<script>select * " + @Select("<script>select * " +
...@@ -303,7 +324,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -303,7 +324,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@Select("select count(0) x ,(select max_apply_person from b_lesson where business_id = #{lessonId} ) y " + @Select("select count(0) x ,(select max_apply_person from b_lesson where business_id = #{lessonId} ) y " +
"from b_lesson_person where lesson_id = #{lessonId} ") "from b_lesson_person where del_flag='0' and flag = '1' and lesson_id = #{lessonId} ")
Map<String,Object> selecTraningNum(@Param("lessonId") String lessonId); Map<String,Object> selecTraningNum(@Param("lessonId") String lessonId);
......
...@@ -591,29 +591,37 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -591,29 +591,37 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" select "+ " select "+
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" left join s_user su on blp.person_id = su.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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign is not null ) learnAllCount, " + " and blp.lesson_id = #{lessonId} and blp.train_is_sign is not null ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" left join s_user su on blp.person_id = su.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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign = '2') finishCount, " + " and blp.lesson_id = #{lessonId} and blp.train_is_sign = '2') finishCount, " +
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" left join s_user su on blp.person_id = su.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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign = '1') notFinishCount, " + " and blp.lesson_id = #{lessonId} and blp.train_is_sign = '1') notFinishCount, " +
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" left join s_user su on blp.person_id = su.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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign = '0') notStartCount " + " and blp.lesson_id = #{lessonId} and blp.train_is_sign = '0') notStartCount " +
"</script>"}) "</script>"})
...@@ -624,16 +632,19 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -624,16 +632,19 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @param lessonId * @param lessonId
* @return * @return
*/ */
@Update("<script>update b_lesson set person_number = " + @Update("<script>update b_lesson a set a.person_number = (" +
"(select count(1) from b_lesson_person where 1=1 " + "select b.bc from (select count(1) bc from b_lesson_person blp " +
" and del_flag != 1 and flag = 1 " + " left join b_lesson bl on blp.lesson_id = bl.business_id " +
" and is_finish != 0 " + " where 1=1 " +
" and lesson_id = #{lessonId})" + " and blp.del_flag != 1 and blp.flag = 1 " +
" and bl.lesson_type = #{type}" +
" <if test=\"type!=null and type != '' and type == '0'\">and blp.is_finish != 0 </if>" +
" and blp.lesson_id = #{lessonId}) as b )" +
" where business_id = #{lessonId} </script>" ) " where business_id = #{lessonId} </script>" )
int personNumberReCount(String lessonId); int personNumberReCount(@Param("lessonId") String lessonId, @Param("type") String lessonType);
/** /**
* 重新统计在学人数 * 在学人数
* @param lessonId * @param lessonId
* @return * @return
*/ */
...@@ -991,7 +1002,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -991,7 +1002,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
List<BRecommend> queryRecommendByLessonId(@Param("corpId") String corpId, @Param("lessonId")String lessonId); List<BRecommend> queryRecommendByLessonId(@Param("corpId") String corpId, @Param("lessonId")String lessonId);
@Select("<script>select bl.*, blp.business_id lessonPersonId," + @Select("<script>select distinct bl.*, " +
" blp.is_apply isApply,blp.is_appoint isAppoint,blp.train_is_sign trainIsSign,blp.sign_date signDate ," + " blp.is_apply isApply,blp.is_appoint isAppoint,blp.train_is_sign trainIsSign,blp.sign_date signDate ," +
"CONCAT( " + "CONCAT( " +
"IFNULL(CONCAT(b3.c_name,\" / \"),\"\"), " + "IFNULL(CONCAT(b3.c_name,\" / \"),\"\"), " +
...@@ -1015,7 +1026,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1015,7 +1026,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
@ResultMap(value = "TrainBaseResultMap") @ResultMap(value = "TrainBaseResultMap")
BLesson findOneMyTrain(@Param("curUser") CurUser curUser, @Param("lessonId") String lessonId); BLesson findOneMyTrain(@Param("curUser") CurUser curUser, @Param("lessonId") String lessonId);
@Select("<script>select bl.*," + @Select("<script>select distinct bl.*," +
"CONCAT( " + "CONCAT( " +
"IFNULL(CONCAT(b3.c_name,\" / \"),\"\"), " + "IFNULL(CONCAT(b3.c_name,\" / \"),\"\"), " +
"IFNULL(CONCAT(b2.c_name,\" / \"),\"\"), " + "IFNULL(CONCAT(b2.c_name,\" / \"),\"\"), " +
...@@ -1049,8 +1060,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1049,8 +1060,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
/** /**
* 分页查询我收藏 * 分页查询我收藏
*/ */
@Select("<script>select * from b_lesson bl " + @Select("<script>select bl.*,su.name lecturerName, suc.name createByName from b_lesson bl " +
"left join b_collect bc on bl.business_id = bc.lesson_id " + "left join b_collect bc on bl.business_id = bc.lesson_id " +
"left join s_user su on bl.lecturer_id = su.business_id " +
"left join s_user suc on bl.create_by = suc.business_id " +
"where 1=1 " + "where 1=1 " +
"and bl.del_flag = 0 and bl.flag = 1 " + "and bl.del_flag = 0 and bl.flag = 1 " +
"and bl.corp_id = #{curUser.corpId} " + "and bl.corp_id = #{curUser.corpId} " +
......
...@@ -21,13 +21,13 @@ public class FindListLessonDTO { ...@@ -21,13 +21,13 @@ public class FindListLessonDTO {
private String labelId; private String labelId;
@ApiModelProperty(value = "发布时间排序(1升序 0降序)",required = true) @ApiModelProperty(value = "发布时间排序(1升序 0降序)",required = true)
@NotNull
private String releaseDateSort; private String releaseDateSort;
@ApiModelProperty(value = "课程类型 0 课程 1 培训") @ApiModelProperty(value = "课程类型 0 课程 1 培训")
private String lessonType; private String lessonType;
@ApiModelProperty(value = "查询类型 0 全部 1 推荐 2在学 3收藏 4兴趣",required = true) @ApiModelProperty(value = "查询类型 0 全部 1 推荐 2在学 3收藏 4兴趣",required = true)
@NotNull
private String searchType; private String searchType;
private List<String> courseIds; private List<String> courseIds;
......
...@@ -9,8 +9,8 @@ public class StudentTrackingChartDTO { ...@@ -9,8 +9,8 @@ public class StudentTrackingChartDTO {
@ApiModelProperty(value = "课程Id",required = false) @ApiModelProperty(value = "课程Id",required = false)
private String lessonId; private String lessonId;
@ApiModelProperty(value = "课程来源(是否为指派,0自选(选修) 1指派(必修))",required = false) // @ApiModelProperty(value = "课程来源(是否为指派,0自选(选修) 1指派(必修))",required = false)
private String isAppoint; // private String isAppoint;
private String userId; private String userId;
......
...@@ -241,6 +241,10 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -241,6 +241,10 @@ public class BLesson extends IdEntity<BLesson> {
@Transient @Transient
private Date applyDate; private Date applyDate;
@ApiModelProperty(value = "讲师部门")
@Transient
private String lecturerDeptName;
public void initModel(){ public void initModel(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION()); // this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
UserUtil.setCurrentPersistOperation(this); UserUtil.setCurrentPersistOperation(this);
......
...@@ -284,4 +284,7 @@ public interface BLessonService{ ...@@ -284,4 +284,7 @@ public interface BLessonService{
*/ */
List<BLesson> queryCollectByPagination(PageUtil pageUtil, String lessonType , CurUser curUser); List<BLesson> queryCollectByPagination(PageUtil pageUtil, String lessonType , CurUser curUser);
PersistModel judgeVisibleAuthority(CurUser curUser, String lessonId);
} }
...@@ -58,6 +58,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -58,6 +58,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Override @Override
public PersistModel quit(QuitLessonDTO quitLessonDTO) { public PersistModel quit(QuitLessonDTO quitLessonDTO) {
BLessonPerson bLessonPerson = bLessonPersonRepository.selectById(quitLessonDTO.getBusinessId()); BLessonPerson bLessonPerson = bLessonPersonRepository.selectById(quitLessonDTO.getBusinessId());
BLesson bLesson = new BLesson();
bLesson.setBusinessId(quitLessonDTO.getLessonId());
bLesson = bLessonRepository.selectByPrimaryKey(bLesson);
if ("1".equals(bLessonPerson.getIsAppoint())){ if ("1".equals(bLessonPerson.getIsAppoint())){
throw new ServiceException(ResultServiceEnums.APPOINT_NOT_CLOSE); throw new ServiceException(ResultServiceEnums.APPOINT_NOT_CLOSE);
} }
...@@ -66,7 +69,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -66,7 +69,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
// int line = bLessonPersonRepository.quit(quitLessonDTO.getBusinessId()); // int line = bLessonPersonRepository.quit(quitLessonDTO.getBusinessId());
int line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson); int line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
//重新统计在学人数 //重新统计在学人数
bLessonRepository.personNumberReCount(quitLessonDTO.getLessonId()); bLessonRepository.personNumberReCount(quitLessonDTO.getLessonId(),bLesson.getLessonType());
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -92,27 +95,31 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -92,27 +95,31 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
}); });
studentTrackingDTO.setUserIdsInDepart(userIdsInDepart); studentTrackingDTO.setUserIdsInDepart(userIdsInDepart);
} }
} if (studentTrackingDTO.getUserIdsInDepart() == null || studentTrackingDTO.getUserIdsInDepart().size() < 1){
if (studentTrackingDTO.getUserIdsInDepart() == null || studentTrackingDTO.getUserIdsInDepart().size() < 1){ return new ArrayList<>();
return new ArrayList<>(); }
} }
List<StudentTrackingRspDTO> studentTrackingRspDTOs = bLessonPersonRepository.studentTrackingByPagination(studentTrackingDTO); List<StudentTrackingRspDTO> studentTrackingRspDTOs = bLessonPersonRepository.studentTrackingByPagination(studentTrackingDTO);
List<String> uids = new ArrayList<>(); List<String> uids = new ArrayList<>();
studentTrackingRspDTOs.forEach(studentTrackingRspDTO->{ if (studentTrackingRspDTOs != null && studentTrackingRspDTOs.size() > 0){
uids.add(studentTrackingRspDTO.getPersonId()); studentTrackingRspDTOs.forEach(studentTrackingRspDTO->{
}); uids.add(studentTrackingRspDTO.getPersonId());
});
}
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO(); MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(studentTrackingDTO.getCorpId()); mtUserGetsReqDTO.setCorpId(studentTrackingDTO.getCorpId());
mtUserGetsReqDTO.setIds(uids); mtUserGetsReqDTO.setIds(uids);
//遍历获取部门名 //遍历获取部门名
List<MTUserInfoRspDTO> departs = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> departs = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
studentTrackingRspDTOs.forEach(studentTrackingRspDTO -> { if (departs != null && departs.size() > 0){
departs.forEach(depart->{ studentTrackingRspDTOs.forEach(studentTrackingRspDTO -> {
if (studentTrackingRspDTO.getPersonId().equals(depart.getId())){ departs.forEach(depart->{
studentTrackingRspDTO.setDepartName(depart.getDepts().get(0).getName()); if (studentTrackingRspDTO.getPersonId().equals(depart.getId())){
} studentTrackingRspDTO.setDepartName(depart.getDepts().get(0).getName());
}
});
}); });
}); }
return studentTrackingRspDTOs; return studentTrackingRspDTOs;
} }
...@@ -182,7 +189,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -182,7 +189,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
bLessonPerson.setIsFinish("1"); bLessonPerson.setIsFinish("1");
line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson); line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
//重新统计在学人数 //重新统计在学人数
bLessonRepository.personNumberReCount(addMyLearnLessonDTO.getLessonId()); bLessonRepository.personNumberReCount(addMyLearnLessonDTO.getLessonId(),"0");
return new PersistModel(line); return new PersistModel(line);
} }
if (bLessonPersons == null || bLessonPersons.size() < 1){ //未指派 if (bLessonPersons == null || bLessonPersons.size() < 1){ //未指派
...@@ -203,7 +210,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -203,7 +210,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
bLessonPerson.setPersonId(addMyLearnLessonDTO.getUserId()); bLessonPerson.setPersonId(addMyLearnLessonDTO.getUserId());
line = bLessonPersonRepository.insertBLessonPerson(bLessonPerson); line = bLessonPersonRepository.insertBLessonPerson(bLessonPerson);
//重新统计在学人数 //重新统计在学人数
bLessonRepository.personNumberReCount(addMyLearnLessonDTO.getLessonId()); bLessonRepository.personNumberReCount(addMyLearnLessonDTO.getLessonId(),"0");
return new PersistModel(line); return new PersistModel(line);
} }
// if (bLessonPersons != null && bLessonPersons.size()>0){ // if (bLessonPersons != null && bLessonPersons.size()>0){
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap; import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.bchapter.dao.BChapterRepository;
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.bfile.dao.BTrainFileRepository; import org.rcisoft.business.bfile.dao.BTrainFileRepository;
...@@ -83,6 +84,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -83,6 +84,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired @Autowired
private BMaterialRepository bMaterialRepository; private BMaterialRepository bMaterialRepository;
@Autowired
private BChapterRepository bChapterRepository;
@Autowired @Autowired
MTCotactApiRequestClient cotactApiRequestClient; MTCotactApiRequestClient cotactApiRequestClient;
...@@ -93,6 +97,21 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -93,6 +97,21 @@ public class BLessonServiceImpl implements BLessonService {
if (bLesson == null ){ if (bLesson == null ){
throw new ServiceException(ResultServiceEnums.NOT_LESSON_ERROR); throw new ServiceException(ResultServiceEnums.NOT_LESSON_ERROR);
} }
//获取讲师部门
List<String> ids = new ArrayList<>();
ids.add(bLesson.getLecturerId());
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
mtUserInfoRspDTOList.forEach(mtUserInfoRspDTO -> {
if (mtUserInfoRspDTO.getId().equals(bLesson.getLecturerId())){
//设置部门名
bLesson.setLecturerDeptName(mtUserInfoRspDTO.getDepts().get(0).getName());
}
});
}
if ("1".equals(bLesson.getLessonType())){ if ("1".equals(bLesson.getLessonType())){
List<BTrainFile> bTrainFileList = bTrainFileRepository.queryByLessonId(bLesson.getBusinessId()); List<BTrainFile> bTrainFileList = bTrainFileRepository.queryByLessonId(bLesson.getBusinessId());
...@@ -164,7 +183,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -164,7 +183,12 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
//------------------------------ //------------------------------
return bLessonRepository.queryPersonMore(curUser, departs); return bLessonRepository.queryPersonMore(curUser, departs);
} }
...@@ -178,7 +202,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -178,7 +202,12 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
return bLessonRepository.queryRecommend(curUser, departs); return bLessonRepository.queryRecommend(curUser, departs);
} }
...@@ -192,7 +221,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -192,7 +221,12 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
//------------------------------ //------------------------------
return bLessonRepository.queryConcern(curUser, departs); return bLessonRepository.queryConcern(curUser, departs);
} }
...@@ -207,7 +241,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -207,7 +241,12 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
//------------------------------ //------------------------------
return bLessonRepository.queryInterested(curUser, departs); return bLessonRepository.queryInterested(curUser, departs);
} }
...@@ -374,7 +413,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -374,7 +413,7 @@ public class BLessonServiceImpl implements BLessonService {
} }
bTrainFileRepository.insertTrainFileList(trainFileList); bTrainFileRepository.insertTrainFileList(trainFileList);
List<BMaterial> inBMaterialList = bMaterialRepository.materialHaveUrl(trainFileList); List<BMaterial> inBMaterialList = bMaterialRepository.materialHaveUrl(trainFileList,"1");
//遍历 移除已存在的文件 将已存在的文件放进List 中 //遍历 移除已存在的文件 将已存在的文件放进List 中
if (bMaterialList!=null && bMaterialList.size()>0 && inBMaterialList != null &&inBMaterialList.size()>0){ if (bMaterialList!=null && bMaterialList.size()>0 && inBMaterialList != null &&inBMaterialList.size()>0){
List<BMaterial> pubBMaterial = new ArrayList<>(); List<BMaterial> pubBMaterial = new ArrayList<>();
...@@ -433,7 +472,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -433,7 +472,12 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(firstPageQueryDTO.getCorpId()); mtUserGetsReqDTO.setCorpId(firstPageQueryDTO.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
firstPageQueryDTO.setDeparts(departs); firstPageQueryDTO.setDeparts(departs);
List<String> courseIds = null; List<String> courseIds = null;
if (allCourse != null) { if (allCourse != null) {
...@@ -464,6 +508,13 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -464,6 +508,13 @@ public class BLessonServiceImpl implements BLessonService {
bLesson.setBusinessId(id); bLesson.setBusinessId(id);
bLesson = bLessonRepository.selectByPrimaryKey(bLesson); bLesson = bLessonRepository.selectByPrimaryKey(bLesson);
if("0".equals(bLesson.getLessonType()) && bChapterRepository.getlessonHours(id) == 0){
throw new ServiceException(ResultServiceEnums.LESSON_NO_CHAPTER);
}
if (bLesson == null){
throw new ServiceException(ResultServiceEnums.NOT_LESSON_ERROR);
}
if (!"0".equals(bLesson.getReleaseState())) { if (!"0".equals(bLesson.getReleaseState())) {
throw new ServiceException(ResultServiceEnums.STATE_NOT_RELEASE); throw new ServiceException(ResultServiceEnums.STATE_NOT_RELEASE);
} }
...@@ -705,6 +756,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -705,6 +756,7 @@ public class BLessonServiceImpl implements BLessonService {
} }
//指派课程 //指派课程
line = bLessonPersonRepository.insertList(bLessonPersonOthers); line = bLessonPersonRepository.insertList(bLessonPersonOthers);
bLessonRepository.personNumberReCount(bLesson.getBusinessId(),"0");
}else { }else {
line = 1; line = 1;
} }
...@@ -763,16 +815,18 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -763,16 +815,18 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(param.getCorpId()); mtUserGetsReqDTO.setCorpId(param.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
bLessonPersonList.forEach(bLessonPerson->{ if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
mtUserInfoRspDTOList.forEach(mtUserInfoRspDTO -> { bLessonPersonList.forEach(bLessonPerson->{
if (mtUserInfoRspDTO.getId().equals(bLessonPerson.getPersonId())){ mtUserInfoRspDTOList.forEach(mtUserInfoRspDTO -> {
//设置部门名 if (mtUserInfoRspDTO.getId().equals(bLessonPerson.getPersonId())){
bLessonPerson.setPersonName(mtUserInfoRspDTO.getName()); //设置部门名
bLessonPerson.setHeadPic(mtUserInfoRspDTO.getAvatar()); bLessonPerson.setPersonName(mtUserInfoRspDTO.getName());
bLessonPerson.setDepartName(mtUserInfoRspDTO.getDepts().get(0).getName()); bLessonPerson.setHeadPic(mtUserInfoRspDTO.getAvatar());
} bLessonPerson.setDepartName(mtUserInfoRspDTO.getDepts().get(0).getName());
}
});
}); });
}); }
} }
return bLessonPersonList; return bLessonPersonList;
...@@ -788,12 +842,17 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -788,12 +842,17 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO.setCorpId(model.getCorpId()); mtUserGetsReqDTO.setCorpId(model.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = QueryDepart.queryDepart(mtUserInfoRspDTOList); List<String> departs = new ArrayList<>();
departs.forEach(depart -> { if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
if (StringUtils.isEmpty(depart)) { departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.remove(depart); departs.removeAll(Collections.singleton(null));
} departs.removeAll(Collections.singleton(""));
}); }
// departs.forEach(depart -> {
// if (StringUtils.isEmpty(depart)) {
// departs.remove(depart);
// }
// });
//---------------------------- //----------------------------
model.setDeparts(departs); model.setDeparts(departs);
List<String> courseIds; List<String> courseIds;
...@@ -937,16 +996,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -937,16 +996,9 @@ public class BLessonServiceImpl implements BLessonService {
//step 1 查询数 x 当前报名数 y 总数 //step 1 查询数 x 当前报名数 y 总数
synchronized (this) { synchronized (this) {
// Map<String, Object> xy = bLessonPersonRepository.selecTraningNum(lessonId);
//
// int x = Integer.parseInt(String.valueOf(xy.get("x")));
// int y = Integer.parseInt(String.valueOf(xy.get("y")));
// if (y > 0 && x >= y) {
// throw new ServiceException(ResultServiceEnums.PERSON_MAX);
// }
//step2 判断该用户是否被指派该培训或已经报名 //step2 判断该用户是否被指派该培训或已经报名
person = bLessonPersonRepository.getAppointInTraining(lessonId, curUser.getUserId()); person = bLessonPersonRepository.getRelInBLessonPerson(lessonId, curUser.getUserId());
if (person != null) { if (person != null && !"1".equals(person.getDelFlag())) {
if ("1".equals(person.getIsApply())) { if ("1".equals(person.getIsApply())) {
log.info("-----------该培训已报名-------------"); log.info("-----------该培训已报名-------------");
throw new ServiceException(ResultServiceEnums.TRAIN_APPLYED); throw new ServiceException(ResultServiceEnums.TRAIN_APPLYED);
...@@ -955,22 +1007,29 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -955,22 +1007,29 @@ public class BLessonServiceImpl implements BLessonService {
person.setApplyDate(new Date()); person.setApplyDate(new Date());
person.setIsApply("1"); person.setIsApply("1");
return bLessonPersonRepository.updateLessonPersonByUserId(person); return bLessonPersonRepository.updateLessonPersonByUserId(person);
} else {
List<BLessonPerson> bLessonPersons = new ArrayList<>();
UserUtil.setCurrentPersistOperation(bLessonPerson);
bLessonPerson.setPersonId(curUser.getUserId());
bLessonPerson.setLessonId(lessonId);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setIsApply("1");
bLessonPerson.setTrainIsSign("0");
bLessonPerson.setApplyDate(new Date());
bLessonPerson.setRemarks("");
bLessonPersons.add(bLessonPerson);
//插入 用户id 、培训id、指派状态、报名状态、培训状态、报名时间 、通用字段
// int line = bLessonPersonRepository.insert(bLessonPerson);
int line = trainInsert("0",bLesson,bLessonPersons);
return line;
} }
if (person != null && "1".equals(person.getDelFlag())){
UserUtil.setCurrentMergeOperation(person);
person.setDelFlag("0");
person.setIsApply("1");
person.setApplyDate(new Date());
return bLessonPersonRepository.updateByPrimaryKeySelective(person);
}
List<BLessonPerson> bLessonPersons = new ArrayList<>();
UserUtil.setCurrentPersistOperation(bLessonPerson);
bLessonPerson.setPersonId(curUser.getUserId());
bLessonPerson.setLessonId(lessonId);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setIsApply("1");
bLessonPerson.setTrainIsSign("0");
bLessonPerson.setApplyDate(new Date());
bLessonPerson.setRemarks("");
bLessonPersons.add(bLessonPerson);
//插入 用户id 、培训id、指派状态、报名状态、培训状态、报名时间 、通用字段
// int line = bLessonPersonRepository.insert(bLessonPerson);
int line = trainInsert("0",bLesson,bLessonPersons);
return line;
} }
} }
...@@ -1032,9 +1091,25 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1032,9 +1091,25 @@ public class BLessonServiceImpl implements BLessonService {
if (bLesson == null){ if (bLesson == null){
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA); throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
} }
//获取讲师部门
List<String> ids = new ArrayList<>();
ids.add(bLesson.getLecturerId());
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
mtUserInfoRspDTOList.forEach(mtUserInfoRspDTO -> {
if (mtUserInfoRspDTO.getId().equals(bLesson.getLecturerId())){
//设置部门名
bLesson.setLecturerDeptName(mtUserInfoRspDTO.getDepts().get(0).getName());
}
});
}
//查询报名人数是否小于规定人数 //查询报名人数是否小于规定人数
int trainApplyCount = bLessonRepository.trainApplyCount(bLesson.getBusinessId()); int trainApplyCount = bLessonRepository.trainApplyCount(bLesson.getBusinessId());
if (StringUtils.isNotEmpty(bLesson.getMaxApplyPerson()) && trainApplyCount >= Integer.parseInt(bLesson.getMaxApplyPerson())){ if (StringUtils.isNotEmpty(bLesson.getMaxApplyPerson()) && !"0".equals(bLesson.getMaxApplyPerson()) && trainApplyCount >= Integer.parseInt(bLesson.getMaxApplyPerson()) ){
bLesson.setApplyIsFull("1"); bLesson.setApplyIsFull("1");
}else { }else {
bLesson.setApplyIsFull("0"); bLesson.setApplyIsFull("0");
...@@ -1059,7 +1134,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1059,7 +1134,7 @@ public class BLessonServiceImpl implements BLessonService {
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA); throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
} }
int trainApplyCount = bLessonRepository.trainApplyCount(bLesson.getBusinessId()); int trainApplyCount = bLessonRepository.trainApplyCount(bLesson.getBusinessId());
if (StringUtils.isNotEmpty(bLesson.getMaxApplyPerson()) &&trainApplyCount >= Integer.parseInt(bLesson.getMaxApplyPerson())){ if (StringUtils.isNotEmpty(bLesson.getMaxApplyPerson()) && !"0".equals(bLesson.getMaxApplyPerson()) && trainApplyCount >= Integer.parseInt(bLesson.getMaxApplyPerson()) ){
bLesson.setApplyIsFull("1"); bLesson.setApplyIsFull("1");
}else { }else {
bLesson.setApplyIsFull("0"); bLesson.setApplyIsFull("0");
...@@ -1094,6 +1169,31 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1094,6 +1169,31 @@ public class BLessonServiceImpl implements BLessonService {
return bLessonRepository.selectMyCollect(lessonType, curUser); return bLessonRepository.selectMyCollect(lessonType, curUser);
} }
@Override
public PersistModel judgeVisibleAuthority(CurUser curUser, String lessonId) {
BLesson bLesson = bLessonRepository.selectInfoById(lessonId);
if (bLesson == null){
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
}
List<String> ids = Arrays.asList(new String[]{curUser.getUserId()});
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
List<String> departs = new ArrayList<>();
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton(""));
}
int result = bLessonRepository.isInViewRange(curUser,lessonId,departs);
if (result < 1){
throw new ServiceException(ResultServiceEnums.NO_ACCESS);
}
return new PersistModel(1);
}
//遍历标签放入List中 //遍历标签放入List中
List<BLessonLabel> addLabel(BLesson model) { List<BLessonLabel> addLabel(BLesson model) {
//标签集合 //标签集合
...@@ -1197,6 +1297,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1197,6 +1297,7 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false) @Transactional(propagation = Propagation.REQUIRED, readOnly = false)
synchronized int trainInsert(String type, BLesson bLesson, List<BLessonPerson> bLessonPersons){ synchronized int trainInsert(String type, BLesson bLesson, List<BLessonPerson> bLessonPersons){
int line = 0;
if ("0".equals(type)){ if ("0".equals(type)){
Map<String, Object> xy = bLessonPersonRepository.selecTraningNum(bLesson.getBusinessId()); Map<String, Object> xy = bLessonPersonRepository.selecTraningNum(bLesson.getBusinessId());
...@@ -1205,8 +1306,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1205,8 +1306,9 @@ public class BLessonServiceImpl implements BLessonService {
if (y > 0 && x >= y) { if (y > 0 && x >= y) {
throw new ServiceException(ResultServiceEnums.PERSON_MAX); throw new ServiceException(ResultServiceEnums.PERSON_MAX);
} }
line = bLessonPersonRepository.insert(bLessonPersons.get(0));
return bLessonPersonRepository.insert(bLessonPersons.get(0)); bLessonRepository.personNumberReCount(bLesson.getBusinessId(),"1");
return line;
} }
if ("1".equals(type)){ if ("1".equals(type)){
//如果为培训的话 判断剩余学生加已有学生总数超过最大数 抛异常 //如果为培训的话 判断剩余学生加已有学生总数超过最大数 抛异常
...@@ -1214,12 +1316,14 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1214,12 +1316,14 @@ public class BLessonServiceImpl implements BLessonService {
//查找已报名总人数 //查找已报名总人数
int personNumber = bLessonRepository.personNumberCount(bLesson.getBusinessId()); int personNumber = bLessonRepository.personNumberCount(bLesson.getBusinessId());
if (Integer.parseInt(bLesson.getMaxApplyPerson()) > 0 && personNumber + bLessonPersons.size() > Integer.parseInt(bLesson.getMaxApplyPerson())){ if (Integer.parseInt(bLesson.getMaxApplyPerson()) > 0 && personNumber + bLessonPersons.size() > Integer.parseInt(bLesson.getMaxApplyPerson())){
throw new ServiceException("培训人数上限"+bLesson.getMaxApplyPerson()+",现已超出"+String.valueOf(personNumber + bLessonPersons.size()- Integer.parseInt(bLesson.getMaxApplyPerson())+"人,请重新选择")); throw new ServiceException(400,"培训人数上限"+bLesson.getMaxApplyPerson()+",现已超出"+String.valueOf(personNumber + bLessonPersons.size()- Integer.parseInt(bLesson.getMaxApplyPerson())+"人,请重新选择"));
} }
return bLessonPersonRepository.insertList(bLessonPersons); line = bLessonPersonRepository.insertList(bLessonPersons);
bLessonRepository.personNumberReCount(bLesson.getBusinessId(),"1");
return line;
} }
} }
return 0; return line;
} }
} }
...@@ -73,7 +73,7 @@ public class BMaterialController extends PaginationController<BMaterial> { ...@@ -73,7 +73,7 @@ public class BMaterialController extends PaginationController<BMaterial> {
@ApiOperation(value="1303批量删除", notes="批量删除") @ApiOperation(value="1303批量删除", notes="批量删除")
@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "删除business 用逗号隔开", required = false, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "删除business 用逗号隔开", required = false, dataType = "varchar")})
@DeleteMapping("/deleteMore") @PostMapping("/deleteMore")
public Result deleteMore(CurUser curUser,@Valid String ids, BindingResult bindingResult) { public Result deleteMore(CurUser curUser,@Valid String ids, BindingResult bindingResult) {
PersistModel data = bMaterialServiceImpl.removeMore(ids, curUser); PersistModel data = bMaterialServiceImpl.removeMore(ids, curUser);
return Result.builder(data, return Result.builder(data,
......
...@@ -73,11 +73,12 @@ public interface BMaterialRepository extends BaseMapper<BMaterial> { ...@@ -73,11 +73,12 @@ public interface BMaterialRepository extends BaseMapper<BMaterial> {
@Select("<script>select * from b_material " + @Select("<script>select * from b_material " +
" where 1=1 " + " where 1=1 " +
" and del_flag != 1 and flag = 1 " + " and del_flag != 1 and flag = 1 " +
" <if test=\"uploadType!=null and uploadType != ''\">and upload_type = #{uploadType}</if>" +
" and file_url in "+ " and file_url in "+
"<foreach item='item' collection='trainFileList' open='(' separator=',' close=')'> #{item.videoUrl} </foreach> " + "<foreach item='item' collection='trainFileList' open='(' separator=',' close=')'> #{item.videoUrl} </foreach> " +
"</script>") "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BMaterial> materialHaveUrl(@Param("trainFileList") List<BTrainFile> trainFileList); List<BMaterial> materialHaveUrl(@Param("trainFileList") List<BTrainFile> trainFileList, @Param("uploadType") String uploadType);
@Insert("<script>insert into b_material " + @Insert("<script>insert into b_material " +
...@@ -100,15 +101,25 @@ public interface BMaterialRepository extends BaseMapper<BMaterial> { ...@@ -100,15 +101,25 @@ public interface BMaterialRepository extends BaseMapper<BMaterial> {
@Update({"<script>", @Update({"<script>",
"update b_material", "update b_material",
" <set>", " <set>",
" <if test='updateBy != null'>update_by=#{updateBy},</if>", " <if test='param.updateBy != null'>update_by=#{param.updateBy},</if>",
" <if test='updateDate != null'>update_date=#{updateDate},</if>", " <if test='param.updateDate != null'>update_date=#{param.updateDate},</if>",
" <if test='delFlag != null'>del_flag=#{delFlag},</if>", " <if test='param.delFlag != null'>del_flag=#{param.delFlag},</if>",
" <if test='flag != null'>flag=#{flag},</if>", " <if test='param.flag != null'>flag=#{param.flag},</if>",
" </set>", " </set>",
"where business_id in ", "where business_id in ",
"<foreach item='item' index='index' collection='delMoreDTO.idList' open='(' separator=',' close=')'> #{item} </foreach> ", "<foreach item='item' index='index' collection='param.idList' open='(' separator=',' close=')'> #{item} </foreach> ",
"</script>"}) "</script>"})
int deleteMore(@Param("delMoreDTO")DelMoreDTO delMoreDTO); int deleteMore(@Param("param")DelMoreDTO delMoreDTO);
@Select("<script>select * from b_material " +
" where 1=1 " +
" and del_flag != 1 and flag = 1 " +
" <if test=\"uploadType!=null and uploadType != ''\">and upload_type = #{uploadType}</if>" +
" and file_url in "+
"<foreach item='item' collection='urls' open='(' separator=',' close=')'> #{item} </foreach> " +
"</script>")
@ResultMap(value = "BaseResultMap" )
List<BMaterial> selectByUrl(@Param("urls") List<String> urls, @Param("uploadType") String uploadType);
} }
...@@ -14,6 +14,8 @@ public class DelMoreDTO { ...@@ -14,6 +14,8 @@ public class DelMoreDTO {
private String delFlag; private String delFlag;
private String flag;
private List<String> idList; private List<String> idList;
} }
...@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -47,6 +48,12 @@ public class BMaterialServiceImpl implements BMaterialService { ...@@ -47,6 +48,12 @@ public class BMaterialServiceImpl implements BMaterialService {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public PersistModel save(BMaterial bMaterial){ public PersistModel save(BMaterial bMaterial){
List<String> urls = new ArrayList<>();
urls.add(bMaterial.getFileUrl());
List<BMaterial> bMaterialList = bMaterialRepository.selectByUrl(urls,"0");
if (bMaterialList != null && bMaterialList.size() > 0){
throw new ServiceException(ResultServiceEnums.SAVED_THIS_FILE);
}
//增加操作 //增加操作
UserUtil.setCurrentPersistOperation(bMaterial); UserUtil.setCurrentPersistOperation(bMaterial);
//设置上传类型为 保存 //设置上传类型为 保存
......
...@@ -15,6 +15,6 @@ public class GetSubUserIdsByDeptIdsReqDTO { ...@@ -15,6 +15,6 @@ public class GetSubUserIdsByDeptIdsReqDTO {
@ApiModelProperty(value = "部门id集合(可选)", position = 2) @ApiModelProperty(value = "部门id集合(可选)", position = 2)
@Order(3) @Order(3)
private List<Integer> deptIds; private List<Long> deptIds;
} }
...@@ -543,9 +543,10 @@ public class MTCotactApiRequestClient { ...@@ -543,9 +543,10 @@ public class MTCotactApiRequestClient {
} }
GetSubUserIdsByDeptIdsReqDTO getSubUserIdsByDeptIdsReqDTO = new GetSubUserIdsByDeptIdsReqDTO(); GetSubUserIdsByDeptIdsReqDTO getSubUserIdsByDeptIdsReqDTO = new GetSubUserIdsByDeptIdsReqDTO();
getSubUserIdsByDeptIdsReqDTO.setCorpId(Integer.parseInt(corpId)); getSubUserIdsByDeptIdsReqDTO.setCorpId(Integer.parseInt(corpId));
List<Integer> deptIdList = new ArrayList<>(); List<Long> deptIdList = new ArrayList<>();
for (String deptId : deptIdSet) { for (String deptId : deptIdSet) {
deptIdList.add(Integer.parseInt(deptId)); Long a = Long.valueOf(deptId);
deptIdList.add(a);
} }
getSubUserIdsByDeptIdsReqDTO.setDeptIds(deptIdList); getSubUserIdsByDeptIdsReqDTO.setDeptIds(deptIdList);
return contactFeignClient.getSubUserIdsByDeptIds(getSubUserIdsByDeptIdsReqDTO,zxClientType,zxAccountId).getData(); return contactFeignClient.getSubUserIdsByDeptIds(getSubUserIdsByDeptIdsReqDTO,zxClientType,zxAccountId).getData();
......
...@@ -83,9 +83,9 @@ public class MvcConfig extends WebMvcConfigurerAdapter { ...@@ -83,9 +83,9 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
e.getMessage()); e.getMessage());
log.error(message); log.error(message);
if (e instanceof ServiceException) {//业务失败的异常,如“账号或密码错误” if (e instanceof ServiceException) {//业务失败的异常,如“账号或密码错误”
result.setCode(ResultCode.FAIL).setMessage(e.getMessage()); ServiceException se = (ServiceException) e;
result.setCode(ResultCode.FAIL).setMessage(e.getMessage()).setData(Result.builder(se.getCode(),message,null));
}else { }else {
result.setCode(ResultCode.ERROR).setMessage(message); result.setCode(ResultCode.ERROR).setMessage(message);
} }
} else { } else {
......
package org.rcisoft.core.exception; package org.rcisoft.core.exception;
import lombok.Data;
import org.rcisoft.core.result.ResultExceptionEnum; import org.rcisoft.core.result.ResultExceptionEnum;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
/** /**
* Created by lcy on 17/11/24. * Created by lcy on 17/11/24.
*/ */
@Data
public class ServiceException extends RuntimeException { public class ServiceException extends RuntimeException {
private static final long serialVersionUID = 3729706443523052156L; private static final long serialVersionUID = 3729706443523052156L;
......
...@@ -31,6 +31,21 @@ public class Result { ...@@ -31,6 +31,21 @@ public class Result {
} }
/**
*
* @param code
* @param message
* @param data
* @return
*/
public static Result builder(Integer code,String message,Object data){
Result result = new Result();
result.setCode(code);
result.setMessage(message);
result.setData(data);
return result;
}
public void setErrorMessage(String message, Object data) { public void setErrorMessage(String message, Object data) {
this.code = ResultCode.FAIL.getCode(); this.code = ResultCode.FAIL.getCode();
......
...@@ -231,6 +231,9 @@ public enum ResultServiceEnums { ...@@ -231,6 +231,9 @@ public enum ResultServiceEnums {
LESSON_CLOSED(131,"该课程已关闭"), LESSON_CLOSED(131,"该课程已关闭"),
NO_ACCESS(132,"您对该课程无可见权限"), NO_ACCESS(132,"您对该课程无可见权限"),
LABEL_MORE_NUM(133,"标签超过规定个数"), LABEL_MORE_NUM(133,"标签超过规定个数"),
SAVED_THIS_FILE(134,"已保存过改资料"),
CHAPTER_ONLY_ONE(135,"当前课程仅有一节,不能被删除"),
LESSON_NO_CHAPTER(136,"当前课程暂无章节,不能被发布"),
; ;
private Integer code; private Integer code;
......
...@@ -219,7 +219,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -219,7 +219,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
" and u.del_flag !=1 " + " and u.del_flag !=1 " +
" and u.flag = 1 " + " and u.flag = 1 " +
" and r.r_status = 1 ") " and r.r_status = 1 ")
String queryAllRoleById(@Param("userId") String userId); List<String>queryAllRoleById(@Param("userId") String userId);
@Select("<script>select " + @Select("<script>select " +
" (select count(1) from " + " (select count(1) from " +
......
...@@ -246,7 +246,19 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -246,7 +246,19 @@ public class SysUserServiceImpl implements SysUserService {
@Override @Override
public String queryAllRoleById(String userId) { public String queryAllRoleById(String userId) {
return sysUserMapper.queryAllRoleById(userId); List<String> roles = sysUserMapper.queryAllRoleById(userId);
StringBuffer sb = new StringBuffer();
for(String role : roles){
sb.append(role+",");
}
String str1 = sb.toString().substring(0,sb.toString().length() - 1);
String [] strs = str1.split(",");
Set roleSet = new HashSet();
for(String s : strs){
roleSet.add(s);
}
String allRole = StringUtils.join(roleSet.toArray(), ",");
return allRole;
} }
@Override @Override
...@@ -385,13 +397,15 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -385,13 +397,15 @@ public class SysUserServiceImpl implements SysUserService {
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(curUser.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
mtUserInfoRspDTOList.forEach(mtUserInfoRspDTO -> { if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0){
if (mtUserInfoRspDTO.getId().equals(curUser.getUserId())) { mtUserInfoRspDTOList.forEach(mtUserInfoRspDTO -> {
//设置部门名 if (mtUserInfoRspDTO.getId().equals(curUser.getUserId())) {
myInfoDTO.setName(mtUserInfoRspDTO.getName()); //设置部门名
myInfoDTO.setHeadPic(mtUserInfoRspDTO.getAvatar()); myInfoDTO.setName(mtUserInfoRspDTO.getName());
} myInfoDTO.setHeadPic(mtUserInfoRspDTO.getAvatar());
}); }
});
}
myInfoDTO.setLessonCount(myInfoDTOCount.getLessonCount()); myInfoDTO.setLessonCount(myInfoDTOCount.getLessonCount());
myInfoDTO.setTrainCount(myInfoDTOCount.getTrainCount()); myInfoDTO.setTrainCount(myInfoDTOCount.getTrainCount());
myInfoDTO.setNotFinishedExam(myInfoDTOCount.getNotFinishedExam()); myInfoDTO.setNotFinishedExam(myInfoDTOCount.getNotFinishedExam());
......
...@@ -113,3 +113,6 @@ eureka: ...@@ -113,3 +113,6 @@ eureka:
fetch-registry: true fetch-registry: true
service-url: service-url:
defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka
ribbon:
ReadTimeout: 10000
ConnectTimeout: 10000
\ No newline at end of file
...@@ -104,3 +104,6 @@ eureka: ...@@ -104,3 +104,6 @@ eureka:
fetch-registry: true fetch-registry: true
service-url: service-url:
defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka
ribbon:
ReadTimeout: 10000
ConnectTimeout: 10000
\ No newline at end of file
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