Commit 23765825 authored by zhangqingle's avatar zhangqingle

修改接口

parent 318b3b53
......@@ -116,7 +116,7 @@ public class BChapterController extends PaginationController<BChapter> {
}
@ApiOperation(value = "206 流 输出ppt转为pdf", notes = "流 输出ppt转为pdf")
@ApiOperation(value = "206 ppt转为pdf", notes = "流 输出ppt转为pdf")
@GetMapping("/getFile")
public Result getFile(CurUser curUser, @Valid String chapterId, BindingResult br) throws IOException {
String newFileUrl = bChapterService.changeFileToPdf(chapterId);
......
......@@ -310,7 +310,7 @@ public class BChapterServiceImpl implements BChapterService {
int x = bFileRepository.updateUploadFile(bFile);
// 判断 新文件 更新 课程学习进度(总进度 此章节进度)
if (StringUtils.isNotEmpty(dto.getVideoUrl()) && !(bFileOld.getVideoUrl().equals(dto.getVideoUrl())) ) {
if (StringUtils.isNotEmpty(bFileOld.getVideoUrl()) && !(bFileOld.getVideoUrl().equals(dto.getVideoUrl())) ) {
// 所有学习过此课程的 学生课程信息
List<BLessonPerson> bLessonPersonList = bLessonPersonRepository.selectByLessonId(chapterDTO.getLessonId());
BLesson bLesson = bLessonRepository.selectByPrimaryKey(chapterDTO.getLessonId());
......
package org.rcisoft.business.bcourse.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -19,14 +20,17 @@ import java.util.List;
@AllArgsConstructor
public class BCourse extends IdEntity<BCourse> {
@ApiModelProperty(value = "章节名")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String cName;
@ApiModelProperty(value = "父级id")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String pid;
private int sort;
@ApiModelProperty(value = "章节等级")
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String courseLevel;
......
......@@ -41,7 +41,7 @@ public class BFileController extends PaginationController<BFile> {
@Autowired
private Global global;
@ApiOperation(value="401 上传文件", notes="上传文件")
@ApiOperation(value="401 上传文件(弃用)", notes="上传文件(弃用)")
@ApiImplicitParams({@ApiImplicitParam(name = "type", value = "0视频 1音频 2ppt 3pdf 4附件", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "file", value = "视频文件", required = true, dataType = "MultipartFile")})
@PostMapping(value = "/upload")
......@@ -53,51 +53,5 @@ public class BFileController extends PaginationController<BFile> {
data);
}
// /**
// * 下载文件
// * @param chapterId
// * @param response
// * @return
// */
// @ApiOperation(value="下载文件", notes="下载文件")
// @ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar")
// @GetMapping(value = "/downloadFileWithoutAuth")
// public Result downloadFileWithoutAuth(String chapterId, HttpServletResponse response) throws IOException {
// BFile bFile = bFileService.queryFileUrlByChapterId(chapterId);
// BufferedInputStream bis = null;
// BufferedOutputStream bos = null;
// if(bFile.getFileUrl()!=""&&bFile.getFileUrl()!=null){
// File file=new File(global.getBASE_UPLOAD_SERVER_LOCATION()+File.separator+bFile.getFileUrl());
// if(!file.isFile()){
// throw new ServiceException(ResultServiceEnums.DOWNLOAD_ERROR);
// }
// bis = new BufferedInputStream(new FileInputStream(file));
// bos = new BufferedOutputStream(response.getOutputStream());
//
// String fileName = "";
// if(bFile.getVideoName()!=null&&!bFile.getVideoName().equals("")&&bFile.getVideoName().endsWith(".zip")){
// fileName = bFile.getVideoName();
// }else{
// fileName = file.getName();
// }
//
// response.reset();
// response.setContentType("application/octet-stream;charset=utf-8");
// response.setHeader("Content-Disposition", "attachment;filename="+ new String((fileName).getBytes(), "iso-8859-1"));
// response.setHeader("Access-Control-Allow-Origin", "*");
// IOUtils.copy(bis, bos);
// bis.close();
// bos.close();
// }else {
// throw new ServiceException(ResultServiceEnums.DOWNLOAD_ERROR);
// }
// return Result.builder(new PersistModel(1),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// "");
// }
}
......@@ -76,7 +76,7 @@ public class BLabelController extends PaginationController<BLabel> {
bLabel);
}
@ApiOperation(value="505 根据条件查询", notes="根据条件查询标签")
@ApiOperation(value="505 根据条件查询", notes="根据条件查询标签", response = BLabel.class)
@ApiImplicitParam(name = "lName", value = "(标签名)模糊查询条件", required = false, dataType = "varchar")
@GetMapping(value = "/queryBlabels")
public Result queryBlabels(CurUser curUser, @Valid String lName, BindingResult br){
......
package org.rcisoft.business.blabel.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -21,6 +22,7 @@ public class BLabel extends IdEntity<BLabel> {
/*标签名称*/
@Length(min = 0,max = 64,message = "标签名称过长")
@ApiModelProperty(value = "标签名")
private String lName;
}
......@@ -19,7 +19,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
//我学习的课程
@Select("<script> select blp.*,bl.lesson_name lessonName,bl.default_url defaultUrl,bl.person_number personNumber, " +
" bl.class_hour classHour,bl.discuss_number discussNumber ,bl.lecturer_id lecturerId, bl.lesson_type " +
" lessonType,bl.course_time courseTime " +
" lessonType,bl.course_time courseTime,bl.release_state releaseState " +
",su.name lecturerName " +
" from b_lesson_person blp " +
" left join b_lesson bl on blp.lesson_id = bl.business_id " +
......
......@@ -120,6 +120,9 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient
private String lessonType;
@ApiModelProperty(value = " 发布状态(0:待发布 1:审核中 2:已发布 3:已驳回 4:已关闭)")
@Transient
private String releaseState;
@Transient
private String corpId;
......
......@@ -111,14 +111,14 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
mtUserGetsReqDTO.setIds(uids);
//遍历获取部门名
List<MTUserInfoRspDTO> departs = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
if (departs != null && departs.size() > 0){
studentTrackingRspDTOs.forEach(studentTrackingRspDTO -> {
departs.forEach(depart->{
if (studentTrackingRspDTO.getPersonId().equals(depart.getId())){
if (studentTrackingRspDTOs != null && studentTrackingRspDTOs.size() > 0 && departs != null && departs.size() > 0){
for (StudentTrackingRspDTO studentTrackingRspDTO : studentTrackingRspDTOs) {
for (MTUserInfoRspDTO depart : departs) {
if (studentTrackingRspDTO.getPersonId().equals(depart.getId()) && depart.getDepts() != null && depart.getDepts().size() > 0){
studentTrackingRspDTO.setDepartName(depart.getDepts().get(0).getName());
}
});
});
}
}
}
return studentTrackingRspDTOs;
}
......
......@@ -533,6 +533,17 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO) {
BLesson bLessonExi = new BLesson();
bLessonExi.setBusinessId(recommendLessonDTO.getLessonId());
bLessonExi = bLessonRepository.selectByPrimaryKey(bLessonExi);
//判断课程是否存在
if (bLessonExi == null){
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
}
//判断课程是否已关闭
if ("4".equals(bLessonExi.getReleaseState())){
throw new ServiceException(ResultServiceEnums.LESSON_CLOSED);
}
if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) || StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())) {
BRecommend bRecommend = new BRecommend();
......@@ -625,9 +636,14 @@ public class BLessonServiceImpl implements BLessonService {
BLesson bLesson = new BLesson();
bLesson.setBusinessId(appointLessonDTO.getLessonId());
bLesson = bLessonRepository.selectByPrimaryKey(bLesson);
//判断课程是否存在
if (bLesson == null){
throw new ServiceException(ResultServiceEnums.LESSON_NOT_EXISTA);
}
//判断课程是否已关闭
if ("4".equals(bLesson.getReleaseState())){
throw new ServiceException(ResultServiceEnums.LESSON_CLOSED);
}
//获取部门中人员
List<String> deptList = asList(org.apache.commons.lang.StringUtils.split(appointLessonDTO.getAppointDepart(), ","));
......@@ -822,7 +838,9 @@ public class BLessonServiceImpl implements BLessonService {
//设置部门名
bLessonPerson.setPersonName(mtUserInfoRspDTO.getName());
bLessonPerson.setHeadPic(mtUserInfoRspDTO.getAvatar());
bLessonPerson.setDepartName(mtUserInfoRspDTO.getDepts().get(0).getName());
if (mtUserInfoRspDTO.getDepts() != null && mtUserInfoRspDTO.getDepts().size() > 0){
bLessonPerson.setDepartName(mtUserInfoRspDTO.getDepts().get(0).getName());
}
}
});
});
......
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