Commit 67a16a3f authored by 王淑君's avatar 王淑君

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

# Conflicts:
#	src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
parents 112a92d4 2cbf362f
...@@ -160,6 +160,18 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -160,6 +160,18 @@ public class BChapterController extends PaginationController<BChapter> {
newFileUrl); newFileUrl);
} }
@ApiOperation(value = "207 预览文件", notes = "(预览时传)", response = QueryChapterListResDTO.class)
@GetMapping("/getFileAtView")
public Result getFileAtView(CurUser curUser, @RequestParam BFile file, BindingResult br,HttpServletRequest request , HttpServletResponse response) throws IOException {
String newFileUrl = bChapterService.changeFileToPdfAtView(file);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
newFileUrl);
}
// //
// @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态") // @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态")
// @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"), // @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"),
......
...@@ -22,4 +22,6 @@ public class ChapterDTO { ...@@ -22,4 +22,6 @@ public class ChapterDTO {
@ApiModelProperty(value = "等级,1:章 2:节") @ApiModelProperty(value = "等级,1:章 2:节")
private Byte chapterLevel; private Byte chapterLevel;
private String isTest;
} }
...@@ -83,6 +83,13 @@ public interface BChapterService{ ...@@ -83,6 +83,13 @@ public interface BChapterService{
*/ */
String changeFileToPdf(String chapterId); String changeFileToPdf(String chapterId);
/**
* 文件转换
* @param bFile
* @return
*/
String changeFileToPdfAtView(BFile bFile);
/** /**
* 打分 * 打分
* @param scoreInfoDTOS * @param scoreInfoDTOS
......
...@@ -17,28 +17,28 @@ public interface BCourseRepository extends BaseMapper<BCourse> { ...@@ -17,28 +17,28 @@ public interface BCourseRepository extends BaseMapper<BCourse> {
@Select("<script>SELECT * FROM b_course where del_flag != 1 and flag = 1 and course_level = 1 " + @Select("<script>SELECT * FROM b_course where del_flag != 1 and flag = 1 and course_level = 1 " +
"and corp_id = #{corpId}" + " and corp_id = #{corpId} " +
"<if test=\"cName!=null and cName != ''\"> and c_name like CONCAT('%',#{cName},'%') </if>" + "<if test=\"cName!=null and cName != ''\"> and c_name like CONCAT('%',#{cName},'%') </if>" +
"ORDER BY sort</script>") "ORDER BY sort</script>")
@ResultMap(value = "ChildListResultMap") @ResultMap(value = "ChildListResultMap")
List<QueryCourseResDTO> queryCourses(Map<String, Object> param); List<QueryCourseResDTO> queryCourses(Map<String, Object> param);
@Select("select *from b_course where del_flag != 1 and pid = #{pid} ORDER BY sort") @Select("select *from b_course where del_flag != 1 and pid = #{pid} ORDER BY sort ")
@ResultMap(value = "ChildListResultMap") @ResultMap(value = "ChildListResultMap")
List<QueryCourseResDTO> queryCoursesByPid(String parentId); List<QueryCourseResDTO> queryCoursesByPid(String parentId);
@Select("SELECT * from b_course WHERE del_flag='0' AND flag='1'" + @Select("SELECT * from b_course WHERE del_flag != 1 AND flag = 1 " +
"and corp_id = #{corpId}" + " and corp_id = #{corpId} " +
"AND c_name=#{cName}") " AND c_name=#{cName} ")
List<BCourse> selectOneByName(@Param("cName") String id, @Param("corpId") String corpId); List<BCourse> selectOneByName(@Param("cName") String id, @Param("corpId") String corpId);
// @Update("UPDATE b_course SET del_flag='1' WHERE business_id = #{businessId}") // @Update("UPDATE b_course SET del_flag='1' WHERE business_id = #{businessId}")
@Update("<script>" + @Update("<script>" +
"<foreach collection=\"courseIds\" item=\"item\" separator=\";\">" + "<foreach collection=\"courseIds\" item=\"item\" separator=\";\">" +
"UPDATE b_course SET del_flag='1' WHERE business_id = #{item}" + "UPDATE b_course SET del_flag = '1' WHERE business_id = #{item}" +
"</foreach>" + "</foreach>" +
"</script>") "</script>")
int removeCourse(@Param("courseIds") List<String> courseIds); int removeCourse(@Param("courseIds") List<String> courseIds);
...@@ -48,22 +48,22 @@ public interface BCourseRepository extends BaseMapper<BCourse> { ...@@ -48,22 +48,22 @@ public interface BCourseRepository extends BaseMapper<BCourse> {
@Select("select DISTINCT course_level from b_course where business_id = #{pid} " + @Select("select DISTINCT course_level from b_course where business_id = #{pid} " +
"and corp_id = #{corpId}" "and corp_id = #{corpId} "
) )
int queryParentLevel(@Param("pid") String pid, @Param("corpId") String corpId); int queryParentLevel(@Param("pid") String pid, @Param("corpId") String corpId);
@Select("select * from b_course where course_level = 1 and del_flag != '1' and flag ='1' " + @Select("select * from b_course where course_level = 1 and del_flag != '1' and flag ='1' " +
"and corp_id = #{corpId}" + " and corp_id = #{corpId} " +
"ORDER BY sort limit #{num}") " ORDER BY sort limit #{num}")
@ResultMap(value = "BaseResultMapDTO") @ResultMap(value = "BaseResultMapDTO")
List<QueryCourseResDTO> queryFirstLevel(@Param("corpId") String corpId,@Param("num") int num); List<QueryCourseResDTO> queryFirstLevel(@Param("corpId") String corpId,@Param("num") int num);
@Select("select DISTINCT IFNULL((" + @Select("select DISTINCT IFNULL((" +
"select max(sort) from b_course where pid = #{pid} " + "select max(sort) from b_course where pid = #{pid} " +
"and corp_id = #{corpId}" + " and corp_id = #{corpId} " +
"and del_flag = 0 and flag = 1),0)+1 as sort") "and del_flag = 0 and flag = 1),0)+1 as sort")
int getSort(@Param("pid") String pid,@Param("corpId") String corpId); int getSort(@Param("pid") String pid,@Param("corpId") String corpId);
...@@ -77,7 +77,7 @@ public interface BCourseRepository extends BaseMapper<BCourse> { ...@@ -77,7 +77,7 @@ public interface BCourseRepository extends BaseMapper<BCourse> {
"and corp_id = #{corpId} " + "and corp_id = #{corpId} " +
"and flag ='1'") "and flag ='1' ")
@ResultMap(value = "AllCourseResultMap") @ResultMap(value = "AllCourseResultMap")
List<AllCourseDTO> findAllCourse(@Param("corpId") String corpId); List<AllCourseDTO> findAllCourse(@Param("corpId") String corpId);
......
...@@ -92,7 +92,7 @@ public class BCourseServiceImpl implements BCourseService { ...@@ -92,7 +92,7 @@ public class BCourseServiceImpl implements BCourseService {
List<AllCourseDTO> allCourse = null; List<AllCourseDTO> allCourse = null;
if (org.apache.commons.lang3.StringUtils.isNotEmpty(id)) { if (StringUtils.isNotEmpty(id)) {
allCourse = this.findAllCourse(corpId); allCourse = this.findAllCourse(corpId);
} }
List<String> courseIds = null; List<String> courseIds = null;
...@@ -113,7 +113,7 @@ public class BCourseServiceImpl implements BCourseService { ...@@ -113,7 +113,7 @@ public class BCourseServiceImpl implements BCourseService {
throw new ServiceException(ResultServiceEnums.NAME_IS_EXISTS); throw new ServiceException(ResultServiceEnums.NAME_IS_EXISTS);
} }
UserUtil.setCurrentMergeOperation(bCourse); UserUtil.setCurrentMergeOperation(bCourse);
return new PersistModel(bCourseRepository.updateByPrimaryKeySelective(bCourse), MessageConstant.MESSAGE_ALERT_SUCCESS); return new PersistModel(bCourseRepository.updateCourse(bCourse), MessageConstant.MESSAGE_ALERT_SUCCESS);
} }
@Override @Override
......
...@@ -32,10 +32,10 @@ public interface BTrainFileRepository extends BaseMapper<BTrainFile> { ...@@ -32,10 +32,10 @@ public interface BTrainFileRepository extends BaseMapper<BTrainFile> {
@Select("<script>select * from b_train_file where 1=1 " @Select("<script>select * from b_train_file where 1=1 "
+ "and del_flag != 1 " + "and del_flag != 1 "
+ "and flag = 1 " + "and flag = 1 "
+ "and lessonId = #{lessonId} " + "and lesson_id = #{lessonId} "
+ "</script>") + "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BTrainFile> queryByLessonId(String lessonId); List<BTrainFile> queryByLessonId(@Param("lessonId") String lessonId);
@Insert("<script>INSERT INTO b_train_file " + @Insert("<script>INSERT INTO b_train_file " +
......
package org.rcisoft.business.bfile.entity; package org.rcisoft.business.bfile.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -23,32 +24,38 @@ public class BFile extends IdEntity<BFile> { ...@@ -23,32 +24,38 @@ public class BFile extends IdEntity<BFile> {
private static final long serialVersionUID = 5501554322621964535L; private static final long serialVersionUID = 5501554322621964535L;
/*视频名称*/ /*视频名称*/
@Length(min = 1,max = 256,message = "长度最小为1,最大为200") // @Length(min = 1,max = 256,message = "长度最小为1,最大为200")
@NotBlank // @NotBlank
@ApiModelProperty(value = "文件名(预览时传)")
private String fileName; private String fileName;
/*视频地址*/ /*视频地址*/
@Length(min = 1,max = 256,message = "长度最小为1,最大为200") // @Length(min = 1,max = 256,message = "长度最小为1,最大为200")
@NotBlank // @NotBlank
@ApiModelProperty(value = "地址(预览时传)")
private String videoUrl; private String videoUrl;
/*0视频 1音频 2ppt 3pdf 4附件*/ /*0视频 1音频 2ppt 3pdf 4附件*/
@ApiModelProperty(value = "类型(预览时传)")
private String type; private String type;
@Length(min = 1,max = 256,message = "长度最小为1,最大为200") // @Length(min = 1,max = 256,message = "长度最小为1,最大为200")
@NotBlank // @NotBlank
private String fileUrl; private String fileUrl;
@Length(min = 1,max = 64,message = "长度最小为1,最大为50") // @Length(min = 1,max = 64,message = "长度最小为1,最大为50")
@NotBlank // @NotBlank
@ApiModelProperty(value = "课程ID(预览时传)")
private String lessonId;//课程ID private String lessonId;//课程ID
@Length(min = 1,max = 64,message = "长度最小为1,最大为50") // @Length(min = 1,max = 64,message = "长度最小为1,最大为50")
@NotBlank // @NotBlank
@ApiModelProperty(value = "节ID")
private String chapterId;//节ID private String chapterId;//节ID
//文件大小 //文件大小
@Length(min = 1,max = 15,message = "长度最小为1,最大为15") // @Length(min = 1,max = 15,message = "长度最小为1,最大为15")
@ApiModelProperty(value = "文件大小")
private String fileSize; private String fileSize;
} }
......
...@@ -100,7 +100,7 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -100,7 +100,7 @@ public class BLessonController extends PaginationController<BLesson> {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.selectOne(businessId)); bLessonService.selectOne(curUser,businessId));
} }
/** /**
...@@ -503,6 +503,23 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -503,6 +503,23 @@ public class BLessonController extends PaginationController<BLesson> {
bLessonService.iTrainCount(userId)); bLessonService.iTrainCount(userId));
} }
/**
* @author: zhangqingle
* @param
* @return
*/
@ApiOperation(value="629 培训学员总数(已报名 已到场 未到场)", notes="培训学员总数(已报名 已到场 未到场)")
@GetMapping(value = "/trainPersonCount")
public Result trainPersonCount(CurUser curUser,String lessonId ,BindingResult bindingResult ) {
String userId = curUser.getUserId();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.trainPersonCount(lessonId));
}
// /** // /**
// * @author: zhangqingle // * @author: zhangqingle
// * @param // * @param
...@@ -519,4 +536,15 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -519,4 +536,15 @@ public class BLessonController extends PaginationController<BLesson> {
// lessonId); // lessonId);
// } // }
@ApiOperation(value="631 报名培训", notes="报名培训")
@ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar")
@GetMapping(value = "/toTraining")
public Result toTraining(CurUser curUser,String lessonId) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.toTraining(curUser,lessonId));
}
} }
...@@ -245,4 +245,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -245,4 +245,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"and business_id = #{businessId}</script>") "and business_id = #{businessId}</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
BLessonPerson selectById(String businessId); BLessonPerson selectById(String businessId);
@Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId}")
BLessonPerson getAppointInTraining(@Param("lessonId")String lessonId ,@Param("personId")String personId );
} }
...@@ -494,28 +494,28 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -494,28 +494,28 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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 bl.lesson_type = 0 " + " and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish is not null ) learnAllCount, " + " and blp.person_id = #{userId} and blp.is_finish 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 " +
" 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 bl.lesson_type = 0 " + " and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish = '2') finishCount, " + " and blp.person_id = #{userId} and blp.is_finish = '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 " +
" 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 bl.lesson_type = 0 " + " and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish = '1') notFinishCount, " + " and blp.person_id = #{userId} and blp.is_finish = '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 " +
" 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 bl.lesson_type = 0 " + " and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish = '0') notStartCount " + " and blp.person_id = #{userId} and blp.is_finish = '0') notStartCount " +
"</script>"}) "</script>"})
ILessonCountDTO iLessonCount(String userId); ILessonCountDTO iLessonCount(String userId);
...@@ -543,31 +543,68 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -543,31 +543,68 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign is not null ) learnAllCount, " + " and blp.person_id = #{userId} 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 " +
" 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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign = '2') finishCount, " + " and blp.person_id = #{userId} 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 " +
" 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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign = '1') notFinishCount, " + " and blp.person_id = #{userId} 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 " +
" 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 bl.lesson_type = 1 " + " and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign = '0') notStartCount " + " and blp.person_id = #{userId} and blp.train_is_sign = '0') notStartCount " +
"</script>"}) "</script>"})
ILessonCountDTO iTrainCount(String userId); ILessonCountDTO iTrainCount(String userId);
/**
* 查询我教学和我学习培训数量
* @param lessonId
* @return
*/
@Select({"<script>",
" select "+
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign is not null ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign = '2') finishCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign = '1') notFinishCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.lesson_id = #{lessonId} and blp.train_is_sign = '0') notStartCount " +
"</script>"})
ILessonCountDTO trainPersonCount(String lessonId);
/** /**
* 重新统计在学人数 * 重新统计在学人数
* @param lessonId * @param lessonId
...@@ -902,6 +939,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -902,6 +939,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"</foreach>" + "</foreach>" +
"</if> " + "</if> " +
"<if test=\"bLesson.lessonName!=null and bLesson.lessonName!=''\">AND les.lesson_name like '%${bLesson.lessonName}%' </if>" + "<if test=\"bLesson.lessonName!=null and bLesson.lessonName!=''\">AND les.lesson_name like '%${bLesson.lessonName}%' </if>" +
"<if test=\"bLesson.lessonType!=null and bLesson.lessonType!=''\">AND les.lesson_type = #{bLesson.lessonType} </if>" +
"<if test=\"bLesson.lecturerId!=null and bLesson.lecturerId!=''\">AND u1.name like '%${bLesson.lecturerId}%' </if>" + "<if test=\"bLesson.lecturerId!=null and bLesson.lecturerId!=''\">AND u1.name like '%${bLesson.lecturerId}%' </if>" +
"<if test=\"bLesson.releaseState!=null and bLesson.releaseState!=''\">AND les.release_state = #{bLesson.releaseState} </if>" + "<if test=\"bLesson.releaseState!=null and bLesson.releaseState!=''\">AND les.release_state = #{bLesson.releaseState} </if>" +
" order by les.release_date desc </script>") " order by les.release_date desc </script>")
......
...@@ -90,7 +90,7 @@ public interface BRecommendRepository extends BaseMapper<BRecommend> { ...@@ -90,7 +90,7 @@ public interface BRecommendRepository extends BaseMapper<BRecommend> {
" and brs.type = '1' "+ " and brs.type = '1' "+
" <if test=\"departs != null and departs.size() > 0 \"> " + " <if test=\"departs != null and departs.size() > 0 \"> " +
" and brs.target_id in " + " and brs.target_id in " +
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item.departId} </foreach> " + " <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item.id} </foreach> " +
" </if> " + " </if> " +
" and br.lesson_id = #{lessonId}</script>") " and br.lesson_id = #{lessonId}</script>")
......
package org.rcisoft.business.blesson.dao; package org.rcisoft.business.blesson.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.blesson.dto.BViewRangeSonDTO;
import org.rcisoft.business.blesson.entity.BViewrangeSon; import org.rcisoft.business.blesson.entity.BViewrangeSon;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.rcisoft.business.blesson.entity.BViewrange; import org.rcisoft.business.blesson.entity.BViewrange;
...@@ -34,7 +35,7 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> { ...@@ -34,7 +35,7 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
" <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='lesson_id != null'>lesson_id=#{lessonId},</if> ", " <if test='lessonId != null'>lesson_id=#{lessonId},</if> ",
" <if test='type != null'>type=#{type},</if> ", " <if test='type != null'>type=#{type},</if> ",
" <if test='corp_id != null'>corp_id=#{corp_id},</if> ", " <if test='corp_id != null'>corp_id=#{corp_id},</if> ",
" </set>", " </set>",
...@@ -51,5 +52,35 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> { ...@@ -51,5 +52,35 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
"(#{item.businessId},#{item.viewrangeId},#{item.type},#{item.targetId})" + "(#{item.businessId},#{item.viewrangeId},#{item.type},#{item.targetId})" +
"</foreach></script>") "</foreach></script>")
int insertBViewrangeSons(List<BViewrangeSon> bViewrangeSons); int insertBViewrangeSons(List<BViewrangeSon> bViewrangeSons);
@Select("<script>select bvs.viewrange_id viewrangeId,bvs.type type,bvs.target_id targetId from b_viewrange_son bvs left join b_viewrange bv on bvs.viewrange_id = bv.business_id " +
" where 1=1 "+
" and bv.del_flag != 1 and bv.flag = 1 "+
" and bv.lesson_id = #{lessonId} "+
" and bvs.type = 1 "+
" and bv.corp_id = #{corpId} "+
"</script>")
List<BViewRangeSonDTO> selectDepartByLessonId(@Param("corpId") String corpId,@Param("lessonId")String lessonId);
@Select("<script>select bvs.viewrange_id viewrangeId,bvs.type type,bvs.target_id targetId,su.name targetName from b_viewrange_son bvs " +
" left join b_viewrange bv on bvs.viewrange_id = bv.business_id " +
" left join s_user su on bvs.target_id = su.business_id " +
" and su.del_flag != 1 and su.flag = 1 "+
" and su.corp_id = #{corpId} "+
" where 1=1 "+
" and bv.del_flag != 1 and bv.flag = 1 "+
" and bv.lesson_id = #{lessonId} "+
" and bvs.type = 0 "+
" and bv.corp_id = #{corpId} "+
"</script>")
List<BViewRangeSonDTO> selectPersonByLessonId(@Param("corpId") String corpId,@Param("lessonId")String lessonId);
} }
...@@ -7,21 +7,20 @@ import org.hibernate.validator.constraints.Length; ...@@ -7,21 +7,20 @@ import org.hibernate.validator.constraints.Length;
@Data @Data
public class BViewRangeSonDTO { public class BViewRangeSonDTO {
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String value; private String value;
@ApiModelProperty(value = "可见范围id") @ApiModelProperty(value = "可见范围id")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String viewrangeId; private String viewrangeId;
@ApiModelProperty(value = "可见类型(0:人 1:部门)") @ApiModelProperty(value = "可见类型(0:人 1:部门)")
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String type; private String type;
@ApiModelProperty(value = "人/部门id") @ApiModelProperty(value = "人/部门id")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String targetId; private String targetId;
@ApiModelProperty(value = "人/部门名")
private String targetName;
} }
...@@ -18,16 +18,16 @@ public class ILessonCountDTO { ...@@ -18,16 +18,16 @@ public class ILessonCountDTO {
@ApiModelProperty(value = "我发布已关闭课程(我教学已关闭培训)数量") @ApiModelProperty(value = "我发布已关闭课程(我教学已关闭培训)数量")
private String closedCount; private String closedCount;
@ApiModelProperty(value = "我学习全部课程数量(我报名全部培训数量)") @ApiModelProperty(value = "我学习全部课程数量(我报名全部培训数量)(该培训已报名数量)")
private String learnAllCount; private String learnAllCount;
@ApiModelProperty(value = "我学完课程数量(我报名已参加培训数量)") @ApiModelProperty(value = "我学完课程数量(我报名已参加培训数量)(该培训已参加数量)")
private String finishCount; private String finishCount;
@ApiModelProperty(value = "我未学完课程数量(我报名缺勤培训数量)") @ApiModelProperty(value = "我未学完课程数量(我报名缺勤培训数量)(该培训缺勤数量)")
private String notFinishCount; private String notFinishCount;
@ApiModelProperty(value = "我未开始课程数量(我报名待参加培训数量") @ApiModelProperty(value = "我未开始课程数量(我报名待参加培训数量) (该培训待参加数量)")
private String notStartCount; private String notStartCount;
} }
...@@ -7,6 +7,7 @@ import lombok.NoArgsConstructor; ...@@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.rcisoft.business.bfile.entity.BTrainFile; import org.rcisoft.business.bfile.entity.BTrainFile;
import org.rcisoft.business.blabel.dto.QueryLabelResDTO; import org.rcisoft.business.blabel.dto.QueryLabelResDTO;
import org.rcisoft.business.blesson.dto.BViewRangeSonDTO;
import org.rcisoft.common.component.Global; import org.rcisoft.common.component.Global;
import org.rcisoft.core.entity.IdEntity; import org.rcisoft.core.entity.IdEntity;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
...@@ -170,10 +171,18 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -170,10 +171,18 @@ public class BLesson extends IdEntity<BLesson> {
@Transient @Transient
private String viewRangePerson; private String viewRangePerson;
@ApiModelProperty(value = "可见范围(人)返回集合")
@Transient
private List<BViewRangeSonDTO> viewRangePersonList;
@ApiModelProperty(value = "可见范围(部门)多人之间用','隔开") @ApiModelProperty(value = "可见范围(部门)多人之间用','隔开")
@Transient @Transient
private String viewRangeDepart; private String viewRangeDepart;
@ApiModelProperty(value = "可见范围(部门)返回集合")
@Transient
private List<BViewRangeSonDTO> viewRangeDepartList;
public void initModel(){ public void initModel(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION()); // this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
......
...@@ -20,7 +20,7 @@ public interface BLessonService{ ...@@ -20,7 +20,7 @@ public interface BLessonService{
* @param businessId * @param businessId
* @return * @return
*/ */
BLesson selectOne(String businessId); BLesson selectOne(CurUser curUser,String businessId);
/** /**
* 根据bLesson对象查询 * 根据bLesson对象查询
...@@ -170,6 +170,14 @@ public interface BLessonService{ ...@@ -170,6 +170,14 @@ public interface BLessonService{
*/ */
ILessonCountDTO iTrainCount(String userId); ILessonCountDTO iTrainCount(String userId);
/**
* 课程学员总数
* @author: zhangqingle
* @param lessonId
* @return
*/
ILessonCountDTO trainPersonCount(String lessonId);
/** /**
* 分页查询列表页全部 * 分页查询列表页全部
* @author: zhangqingle * @author: zhangqingle
...@@ -212,4 +220,10 @@ public interface BLessonService{ ...@@ -212,4 +220,10 @@ public interface BLessonService{
*/ */
PersistModel addCollect(CurUser curUser,String lessonId); PersistModel addCollect(CurUser curUser,String lessonId);
/**
* 报名培训
* @return
*/
int toTraining(CurUser curUser,String lessonId);
} }
...@@ -14,6 +14,7 @@ import org.rcisoft.common.util.feignDto.*; ...@@ -14,6 +14,7 @@ import org.rcisoft.common.util.feignDto.*;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.result.Ret; import org.rcisoft.core.result.Ret;
import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
......
...@@ -7,6 +7,7 @@ import org.aspectj.lang.Signature; ...@@ -7,6 +7,7 @@ import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.rcisoft.business.bdictionary.entity.BDictionary;
import org.rcisoft.common.model.MenuMap; import org.rcisoft.common.model.MenuMap;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.result.ResultExceptionEnum; import org.rcisoft.core.result.ResultExceptionEnum;
...@@ -102,6 +103,31 @@ public class CurUserAspect { ...@@ -102,6 +103,31 @@ public class CurUserAspect {
int line = userServiceImpl.synchronizedUsers(curUser.getCorpId()); int line = userServiceImpl.synchronizedUsers(curUser.getCorpId());
//插入tm_admin_role、s_role_menu、s_r_user_role表 //插入tm_admin_role、s_role_menu、s_r_user_role表
int userRoleResult = sysRoleService.addAdminRoleMenuUser(initAddAdminDTO,roleMenuDTOs,userRoleDTO); int userRoleResult = sysRoleService.addAdminRoleMenuUser(initAddAdminDTO,roleMenuDTOs,userRoleDTO);
// 初始化数据字典表
List<BDictionary> dictionaryList = new ArrayList<>();
BDictionary bDictionary1 = new BDictionary();
bDictionary1.setName("关注人数");
bDictionary1.setType("GZRS");
bDictionary1.setValue("5");
UserUtil.setCurrentPersistOperation(bDictionary1);
BDictionary bDictionary2 = new BDictionary();
bDictionary2.setName("在学人数");
bDictionary2.setType("ZXRS");
bDictionary2.setValue("7");
UserUtil.setCurrentPersistOperation(bDictionary2);
BDictionary bDictionary3 = new BDictionary();
bDictionary3.setName("总裁读书会");
bDictionary3.setType("DSH");
bDictionary3.setValue("www.baidu.com");
UserUtil.setCurrentPersistOperation(bDictionary3);
dictionaryList.add(bDictionary1);
dictionaryList.add(bDictionary2);
dictionaryList.add(bDictionary3);
sysRoleService.initDictionary(dictionaryList);
log.info("--------------------初始化完成--------------------"); log.info("--------------------初始化完成--------------------");
} }
} }
......
...@@ -220,6 +220,7 @@ public enum ResultServiceEnums { ...@@ -220,6 +220,7 @@ public enum ResultServiceEnums {
NOT_RECOMMEND(118,"该课程未推荐"), NOT_RECOMMEND(118,"该课程未推荐"),
NO_DATA(119,"该数据不存在"), NO_DATA(119,"该数据不存在"),
CHANGE_FILE_ERROR(120,"文件转换失败"), CHANGE_FILE_ERROR(120,"文件转换失败"),
NOT_LESSON_ERROR(121,"该课程不存在"),
; ;
......
...@@ -90,19 +90,23 @@ public class OfficeToPdf { ...@@ -90,19 +90,23 @@ public class OfficeToPdf {
if (!inputFile.exists()) { if (!inputFile.exists()) {
return -1;// 找不到源文件, 则返回-1 return -1;// 找不到源文件, 则返回-1
} }
log.debug("----------ZH------------");
// 如果目标路径不存在, 则新建该路径 // 如果目标路径不存在, 则新建该路径
File outputFile = new File(destFile); File outputFile = new File(destFile);
if (!outputFile.getParentFile().exists()) { if (!outputFile.getParentFile().exists()) {
outputFile.getParentFile().mkdirs(); outputFile.getParentFile().mkdirs();
} }
log.debug("----------ZH------------");
// connect to an OpenOffice.org instance running on port 8100 // connect to an OpenOffice.org instance running on port 8100
connection = new SocketOpenOfficeConnection( connection = new SocketOpenOfficeConnection(
global.getLibreofficeIp(), global.getLibreofficePort()); global.getLibreofficeIp(), global.getLibreofficePort());
connection.connect(); connection.connect();
// convert // convert
log.debug("----------ZH------------");
DocumentConverter converter = new OpenOfficeDocumentConverter( DocumentConverter converter = new OpenOfficeDocumentConverter(
connection); connection);
DocumentFormatRegistry factory = new BasicDocumentFormatRegistry(); DocumentFormatRegistry factory = new BasicDocumentFormatRegistry();
log.debug("----------ZH------------");
DocumentFormat inputDocumentFormat = factory DocumentFormat inputDocumentFormat = factory
.getFormatByFileExtension(FileUtil.getFilePostfix(sourceFile)); .getFormatByFileExtension(FileUtil.getFilePostfix(sourceFile));
DocumentFormat outputDocumentFormat = factory DocumentFormat outputDocumentFormat = factory
...@@ -120,7 +124,7 @@ public class OfficeToPdf { ...@@ -120,7 +124,7 @@ public class OfficeToPdf {
if(connection!=null) { if(connection!=null) {
connection.disconnect(); connection.disconnect();
}else{ }else{
throw new ServiceException(ResultServiceEnums.UPLOAD_ERROR); throw new ServiceException(ResultServiceEnums.CHANGE_FILE_ERROR);
} }
} }
return 1; return 1;
......
...@@ -2,6 +2,7 @@ package org.rcisoft.sys.role.service; ...@@ -2,6 +2,7 @@ package org.rcisoft.sys.role.service;
import org.rcisoft.business.bdictionary.entity.BDictionary;
import org.rcisoft.business.blesson.dto.RoleTypeDepartDTO; import org.rcisoft.business.blesson.dto.RoleTypeDepartDTO;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
...@@ -85,4 +86,6 @@ public interface SysRoleService { ...@@ -85,4 +86,6 @@ public interface SysRoleService {
List<RoleTypeDepartDTO> queryRoleTypeByUserId(CurUser curUser); List<RoleTypeDepartDTO> queryRoleTypeByUserId(CurUser curUser);
int initDictionary(List<BDictionary> list);
} }
...@@ -2,6 +2,7 @@ package org.rcisoft.sys.role.service.impl; ...@@ -2,6 +2,7 @@ package org.rcisoft.sys.role.service.impl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.bdictionary.entity.BDictionary;
import org.rcisoft.business.blesson.dto.RoleTypeDepartDTO; import org.rcisoft.business.blesson.dto.RoleTypeDepartDTO;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
...@@ -187,4 +188,9 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -187,4 +188,9 @@ public class SysRoleServiceImpl implements SysRoleService {
public List<RoleTypeDepartDTO> queryRoleTypeByUserId(CurUser curUser) { public List<RoleTypeDepartDTO> queryRoleTypeByUserId(CurUser curUser) {
return sysUserMapper.queryRoleTypeByUserId(curUser.getUserId()); return sysUserMapper.queryRoleTypeByUserId(curUser.getUserId());
} }
@Override
public int initDictionary(List<BDictionary> list) {
return sysUserMapper.initDictionary(list);
}
} }
...@@ -2,6 +2,7 @@ package org.rcisoft.sys.user.dao; ...@@ -2,6 +2,7 @@ package org.rcisoft.sys.user.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.bdictionary.entity.BDictionary;
import org.rcisoft.business.blesson.dto.RoleTypeDepartDTO; import org.rcisoft.business.blesson.dto.RoleTypeDepartDTO;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.rcisoft.sys.user.bean.CurUser; import org.rcisoft.sys.user.bean.CurUser;
...@@ -24,7 +25,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -24,7 +25,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id " + "LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id " +
"LEFT JOIN tm_admin_role AS sr ON sr.r_id = ru.role_id " + "LEFT JOIN tm_admin_role AS sr ON sr.r_id = ru.role_id " +
"WHERE su.del_flag = 0 " + "WHERE su.del_flag = 0 " +
"and sr.r_status != 0 " +
"and su.corp_id = #{corpId} " + "and su.corp_id = #{corpId} " +
...@@ -237,4 +237,15 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -237,4 +237,15 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"</script>") "</script>")
MyInfoDTO queryMyLessonCount(CurUser curUser); MyInfoDTO queryMyLessonCount(CurUser curUser);
/**
* 初始化多条数据到Bdictionary表
* @param list
* @return
*/
@Insert("<script> INSERT INTO b_dictionary " +
"(BUSINESS_ID,PID,TYPE,NAME,VALUE,CREATE_BY,CREATE_DATE,UPDATE_BY,UPDATE_DATE,DEL_FLAG,FLAG,REMARKS,corp_id) VALUES" +
"<foreach collection=\"list\" item=\"item\" separator=\",\">" +
"(#{item.businessId},#{item.pid},#{item.type},#{item.name},#{item.value},#{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate},#{item.delFlag},#{item.flag},#{item.remarks},#{item.corpId})"+
"</foreach> </script>")
int initDictionary(List<BDictionary> list);
} }
...@@ -89,7 +89,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -89,7 +89,7 @@ public class SysUserServiceImpl implements SysUserService {
} }
} }
//部门不为空时 部门条件过滤 //部门不为空时 部门条件过滤
if (dto.getDept() != null || !"".equals(dto.getDept())) { if (dto.getDept() != null ) {
List<SysUser> usersForDept = new ArrayList<>(); List<SysUser> usersForDept = new ArrayList<>();
for (SysUser user : users) { for (SysUser user : users) {
if (user.getDepart().equals(dto.getDept())) { if (user.getDepart().equals(dto.getDept())) {
......
...@@ -74,7 +74,7 @@ global: ...@@ -74,7 +74,7 @@ global:
licPath: /lk/license.lic licPath: /lk/license.lic
pubPath: /lk/publicCerts.store pubPath: /lk/publicCerts.store
path: path:
base_upload_server_location: /working/resource/eduServer/ base_upload_server_location: /working/eduServer/
return_upload_server_location: http://192.168.5.201:18080/eduServer/ return_upload_server_location: http://192.168.5.201:18080/eduServer/
course_location: course course_location: course
lesson_location: lesson lesson_location: lesson
...@@ -93,7 +93,7 @@ global: ...@@ -93,7 +93,7 @@ global:
cut_pdf_num: 30 cut_pdf_num: 30
libreoffice: libreoffice:
ip: mt_office ip: mt_libre
port: 8997 port: 8997
mt: mt:
api: http://192.168.5.201/api/ api: http://192.168.5.201/api/
......
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