Commit 61830035 authored by root's avatar root

修改接口

parent c927c282
......@@ -116,7 +116,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="606 分页查询大家都在学", notes="分页查询大家都在学")
@GetMapping(value = "/queryPersonMoreByPagination")
public Result queryPersonMoreByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
public Result queryPersonMoreByPagination(CurUser curUser) {
String userId = curUser.getUserId();
bLessonService.queryPersonMoreByPagination(getPaginationUtility(),userId);
GridModel gridModel = getGridModelResponse();
......@@ -128,7 +128,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="607 分页查询企业推荐", notes="分页查询企业推荐")
@GetMapping(value = "/queryRecommendByPagination")
public Result queryRecommendByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
public Result queryRecommendByPagination(CurUser curUser) {
String userId = curUser.getUserId();
bLessonService.queryRecommendByPagination(getPaginationUtility(),userId);
GridModel gridModel = getGridModelResponse();
......@@ -237,13 +237,4 @@ public class BLessonController extends PaginationController<BLesson> {
gridModel);
}
@ApiOperation(value="616 我学习的课程总数", notes="我学习的课程总数")
@GetMapping(value = "/iLearnLessonCount")
public Result iLearnLessonCount(CurUser curUser) {
String userId = curUser.getUserId();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonPersonService.iLearnLessonCount(userId));
}
}
......@@ -2,7 +2,6 @@ package org.rcisoft.business.blesson.dao;
import org.apache.ibatis.annotations.*;
import org.rcisoft.business.blabel.entity.BLabel;
import org.rcisoft.business.blesson.dto.ILearnCountDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
import org.rcisoft.core.base.BaseMapper;
......@@ -29,6 +28,8 @@ public interface BLessonPersonRepository extends BaseMapper<BLabel> {
" and blp.person_id = #{userId} " +
" <if test= \" param.isFinish != null and param.isFinish != ''\">and blp.is_finish = #{param.isFinish} </if> " +
" <if test= \" param.lessonType !=null and param.lessonType != ''\">and bl.lesson_type = #{param.lessonType} </if> " +
// " <if test= \" param.startFlag !=null and param.startFlag != ''\">and blp.start_flag = #{param.startFlag} </if> " +
" <if test= \" param.isAppoint !=null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
" order by blp.update_date desc</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryLearnBLessons(@Param("param") ILearnLessonDTO param, @Param("userId") String userId);
......@@ -39,12 +40,5 @@ public interface BLessonPersonRepository extends BaseMapper<BLabel> {
@Update("update b_lesson_label set flag = 0 where business_id = #{id}")
int quit(String id);
@Select({"<script>",
" select " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '1') finishCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '0') notFinishCount " +
"</script>"})
ILearnCountDTO iLearnLessonCount(String userId);
}
......@@ -51,4 +51,10 @@ public class AddLessonDTO {
@ApiModelProperty(value = "标签集合,使用','分隔")
private String labels;
@ApiModelProperty(value = "可见范围(人)多人之间用','隔开")
private String viewRangePerson;
@ApiModelProperty(value = "可见范围(部门)多人之间用','隔开")
private String viewRangeDepart;
}
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@Data
public class BViewRangeSonDTO {
@ApiModelProperty(value = "主键")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String value;
@ApiModelProperty(value = "可见范围id")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String viewrangeId;
@ApiModelProperty(value = "可见类型(0:人 1:部门)")
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String type;
@ApiModelProperty(value = "人/部门id")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String targetId;
}
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.util.List;
@Data
public class FirstPageQueryDTO {
......@@ -15,4 +17,9 @@ public class FirstPageQueryDTO {
@ApiModelProperty(value = "查询参数",required = false)
private String viewParam;
private String userId;
//部门id
private List<String> departs;
}
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ILearnCountDTO {
}
......@@ -9,6 +9,7 @@ import org.hibernate.validator.constraints.Length;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Table(name = "b_lesson_label")
......@@ -18,11 +19,20 @@ import javax.persistence.Table;
public class ILearnLessonDTO {
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
@ApiModelProperty(value = "是否学完 0:未学完 1:已学完")
@ApiModelProperty(value = "是否已学完(0:未开始 1:已开始 2: 已学完)")
private String isFinish;
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
@ApiModelProperty(value = "课程类型 0 课程 1 培训")
private String lessonType;
// @ApiModelProperty(value = "是否开始学习")
// private String startFlag;
@ApiModelProperty(value = "是否为指派课程(0非必修(自选) 1必修(指派))")
private String isAppoint;
// @ApiModelProperty(value = "指派课程id")
// private String appointId;
}
......@@ -27,4 +27,7 @@ public class ILessonCountDTO {
@ApiModelProperty(value = "我未学完课程数量")
private String notFinishCount;
@ApiModelProperty(value = "我未开始课程数量")
private String notStartCount;
}
......@@ -121,5 +121,13 @@ public class BLesson extends IdEntity<BLesson> {
@ApiModelProperty(value = "分类名")
@Transient
private String courseName;
@ApiModelProperty(value = "可见范围(人)多人之间用','隔开")
@Transient
private String viewRangePerson;
@ApiModelProperty(value = "可见范围(部门)多人之间用','隔开")
@Transient
private String viewRangeDepart;
}
......@@ -36,7 +36,7 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String learnProgress;
@ApiModelProperty(value = "是否学完 0:未学完 1:已学完")
@ApiModelProperty(value = "是否已学完(0:未开始 1:已开始 2: 已学完)")
@NotBlank
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String isFinish;
......@@ -46,6 +46,19 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String isCollect;
@ApiModelProperty(value = "指派id")
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String appointId;
// @ApiModelProperty(value = "是否开始")
// @Length(min = 1,max = 1,message = "长度最小为1,最大为1")
// private String startFlag;
@ApiModelProperty(value = "是否为指派(0自选(选修) 1指派(必修))")
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String isAppoint;
@ApiModelProperty(value = "课程名称")
@Transient
private String lessonName;
......@@ -86,4 +99,6 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient
private String lessonType;
}
package org.rcisoft.business.blesson.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.rcisoft.core.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "b_viewrange")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BViewrange extends IdEntity<BViewrange> {
@ApiModelProperty(value = "课程id")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String lessonId;
@ApiModelProperty(value = "可视范围类型(0 人 1 部门 2 人和部门)")
@Length(min = 1,max = 1,message = "长度最小为1,最大为50")
private String type;
}
package org.rcisoft.business.blesson.service;
import org.rcisoft.business.blesson.dto.ILearnCountDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
import org.rcisoft.core.aop.PageUtil;
......@@ -27,10 +26,5 @@ public interface BLessonPersonService {
*/
List<BLesson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model, String userId);
/**
* 我学习的课程总数
* @param userId
* @return
*/
ILearnCountDTO iLearnLessonCount(String userId);
}
package org.rcisoft.business.blesson.service.impl;
import org.rcisoft.business.blesson.dto.ILearnCountDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dao.BLessonPersonRepository;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
......@@ -38,10 +37,6 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
return bLessonPersonRepository.queryLearnBLessons(model, userId);
}
@Override
public ILearnCountDTO iLearnLessonCount(String userId) {
return bLessonPersonRepository.iLearnLessonCount(userId);
}
}
......@@ -113,6 +113,7 @@ public class BLessonServiceImpl implements BLessonService {
BLesson model = new BLesson();
BeanUtils.copyProperties(addLessonDTO,model);
int line = 0;
//标签集合
List<BLessonLabel> bLessonLabels = new ArrayList<>();
if(model.getBusinessId()==null) {
model.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
......@@ -135,6 +136,12 @@ public class BLessonServiceImpl implements BLessonService {
model.setCollectNumber("0");
//添加课程表
line = bLessonRepository.insertSelective(model);
//添加可见范围
//添加课程标签表
if (StringUtils.isNotEmpty(model.getLabels())){
String[] labels = model.getLabels().split(",");
......@@ -189,6 +196,11 @@ public class BLessonServiceImpl implements BLessonService {
@Override
public List<BLesson> queryHomeBLessonsByPagination(PageUtil pageUtil, FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) {
List<String> departs = new ArrayList<>();
departs.add("1");
departs.add("2");
departs.add("3");
firstPageQueryDTO.setDeparts(departs);
List<String> sonCourseIds = null;
if (allCourse != null){
sonCourseIds = recursion.FindSons(firstPageQueryDTO.getCourseLevelOne(),allCourse);
......
......@@ -33,6 +33,8 @@
<result column="learn_progress" jdbcType="VARCHAR" property="learnProgress"/>
<result column="is_finish" jdbcType="VARCHAR" property="isFinish"/>
<result column="is_collect" jdbcType="VARCHAR" property="isCollect"/>
<result column="appoint_id" jdbcType="VARCHAR" property="appointId"/>
<!--<result column="start_flag" jdbcType="VARCHAR" property="startFlag"/>-->
<result column="is_appoint" jdbcType="VARCHAR" property="isAppoint"/>
</resultMap>
</mapper>
\ 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