Commit 57c0092f authored by zhangqingle's avatar zhangqingle

修改接口、添加新接口

parent 14fbc593
......@@ -377,7 +377,7 @@ public class BLessonController extends PaginationController<BLesson> {
* @param
* @return
*/
@ApiOperation(value="620 线上课程学员跟踪", notes="线上课程学员跟踪")
@ApiOperation(value="620 线上课程学员跟踪", notes="线上课程学员跟踪" ,response = StudentTrackingRspDTO.class)
@GetMapping(value = "/studentTrackingByPagination")
public Result studentTrackingByPagination(CurUser curUser, @Valid StudentTrackingDTO studentTrackingDTO, BindingResult bindingResult) {
bLessonPersonService.studentTrackingByPagination(getPaginationUtility(), studentTrackingDTO);
......@@ -424,7 +424,7 @@ public class BLessonController extends PaginationController<BLesson> {
* @param
* @return
*/
@ApiOperation(value="623 根据课程Id 查询该课程推荐范围", notes="根据课程id 查询课程推荐范围(人和部门)", response = BLesson.class)
@ApiOperation(value="623 根据课程Id 查询该课程推荐范围", notes="根据课程id 查询课程推荐范围(人和部门)", response = FindLessonRecommendRspDTO.class)
@GetMapping(value = "/queryRecommendByLessonId")
public Result queryRecommendByLessonId(CurUser curUser, @Valid FindLessonRecommendDTO param, BindingResult bindingResult) {
return Result.builder(new PersistModel(1),
......@@ -453,4 +453,20 @@ public class BLessonController extends PaginationController<BLesson> {
addMyLearnLessonDTO);
}
/**
* @author: zhangqingle
* @param
* @return
*/
@ApiOperation(value="626 删除推荐", notes="删除推荐")
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PostMapping(value = "/deleteRecommend")
public Result deleteRecommend(CurUser curUser, @Valid String lessonId, BindingResult bindingResult) {
PersistModel data = bLessonService.deleteRecommend(lessonId);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
lessonId);
}
}
......@@ -61,7 +61,7 @@ public interface BRecommendRepository extends BaseMapper<BRecommend> {
int insertBRecommendSons(List<BRecommendSon> bRecommendSons);
@Select("<script>select brs.business_id businessId, brs.type type, brs.target_id targetId, su.name targetName " +
@Select("<script>select brs.business_id businessId, brs.type type, brs.target_id targetId, su.name targetName,su.account_id accountId " +
" from b_recommend_son brs left join b_recommend br on brs.recommend_id = br.business_id " +
" left join b_lesson bl on br.lesson_id = bl.business_id " +
" left join s_user su on brs.target_id = su.business_id " +
......
......@@ -2,6 +2,7 @@ package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.rcisoft.common.util.feignDto.DeptGetRspDTO;
import java.util.List;
......@@ -14,7 +15,7 @@ public class FindLessonRecommendDTO {
@ApiModelProperty(value = "课程Id",required = true)
private String lessonId;
private List<LessonRecommendDepartDTO> departs;
private List<DeptGetRspDTO> departs;
private String userId;
......
......@@ -19,4 +19,7 @@ public class FindLessonRecommendRspDTO {
@ApiModelProperty(value = "被推荐 人/部门名")
private String targetName;
@ApiModelProperty(value = "被推荐 人/部门accountId")
private String accountId;
}
......@@ -181,4 +181,12 @@ public interface BLessonService{
*/
List<BLesson> theLessonMangageByPagination(PageUtil pageUtil,CurUser curUser,BLesson bLesson);
/**
* 分页查询列表页全部
* @author: zhangqingle
* @param lessonId
* @return
*/
PersistModel deleteRecommend(String lessonId);
}
......@@ -10,6 +10,7 @@ import org.rcisoft.business.blesson.entity.*;
import org.rcisoft.business.blesson.service.BLessonService;
import org.rcisoft.business.blesson.util.recursion;
import org.rcisoft.business.blesson.dao.BViewrangeRepository;
import org.rcisoft.common.util.feignDto.DeptGetRspDTO;
import org.rcisoft.common.util.feignDto.MTUserGetsReqDTO;
import org.rcisoft.common.util.feignDto.MTUserInfoRspDTO;
import org.rcisoft.common.util.outClient.MTCotactApiRequestClient;
......@@ -357,13 +358,10 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<FindLessonRecommendRspDTO> queryRecommendByLessonId(FindLessonRecommendDTO param) {
//按部门名模糊查询部门id(list)------
List<LessonRecommendDepartDTO> departs = new ArrayList<>();
departs.add(new LessonRecommendDepartDTO("1","111"));
departs.add(new LessonRecommendDepartDTO("2","222"));
departs.add(new LessonRecommendDepartDTO("3","333"));
//-------------------------------
if (StringUtils.isEmpty(param.getViewParam())){
param.setViewParam("");
}
List<DeptGetRspDTO> departs = cotactApiRequestClient.deptListDeptInfoByName(param.getCorpId(),param.getViewParam());
//查询结果放入DTO中
param.setDeparts(departs);
//查询该课程推荐的所有人
......@@ -371,14 +369,16 @@ public class BLessonServiceImpl implements BLessonService {
List<FindLessonRecommendRspDTO> findLessonDepartRecommend = bRecommendRepository.queryRecommendDepartByLessonId(param);
for (LessonRecommendDepartDTO depart : departs) {
for (FindLessonRecommendRspDTO findLessonRecommendRspDTO : findLessonDepartRecommend) {
if ( depart.equals(findLessonRecommendRspDTO.getTargetId())){
findLessonRecommendRspDTO.setTargetName(depart.getDepartName());
if (departs != null && departs.size() > 0 && findLessonDepartRecommend != null && findLessonDepartRecommend.size() > 0){
for (DeptGetRspDTO depart : departs) {
for (FindLessonRecommendRspDTO findLessonRecommendRspDTO : findLessonDepartRecommend) {
if ( depart.getId().equals(findLessonRecommendRspDTO.getTargetId())){
findLessonRecommendRspDTO.setTargetName(depart.getName());
}
}
}
findLessonPersonRecommend.addAll(findLessonDepartRecommend);
}
findLessonPersonRecommend.addAll(findLessonDepartRecommend);
return findLessonPersonRecommend;
}
......@@ -535,6 +535,24 @@ public class BLessonServiceImpl implements BLessonService {
return bLessons;
}
@Override
public PersistModel deleteRecommend(String lessonId) {
List<String> recommendIds = bRecommendRepository.selectIdByLessonId(lessonId);
if (recommendIds == null || recommendIds.size()<1){
throw new ServiceException(ResultExceptionEnum.NOT_RECOMMEND);
}
//修改推荐表
BRecommend bRecommend = new BRecommend();
bRecommend.setLessonId(lessonId);
UserUtil.setCurrentMergeOperation(bRecommend);
bRecommend.setBusinessId(recommendIds.get(0));
bRecommend.setDelFlag("1");
int line = bRecommendRepository.updateByPrimaryKeySelective(bRecommend);
//删除推荐子表内容
return new PersistModel(line);
}
//遍历标签放入List中
List<BLessonLabel> addLabel(BLesson model){
//标签集合
......
......@@ -194,4 +194,13 @@ public interface ContactFeignClient {
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId);
/**
* 通过名称模糊搜索部门列表
*/
@RequestMapping(value = "/dept/list_dept_info_by_name",method = RequestMethod.GET)
Ret<List<DeptGetRspDTO>> deptListDeptInfoByName(@RequestParam("corpId") String corpId,
@RequestParam("name") String name,
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId);
}
......@@ -476,6 +476,11 @@ public class MTCotactApiRequestClient {
return contactFeignClient.getUserByDeptIds(getUserByDeptIdReqDTO,zxClientType,zxAccountId).getData();
}
public List<DeptGetRspDTO> deptListDeptInfoByName(String corpId,String name){
return contactFeignClient.deptListDeptInfoByName(corpId,name,zxClientType,zxAccountId).getData();
}
/**
* 刷新token
* @param refreshToken
......
......@@ -30,7 +30,8 @@ public enum ResultExceptionEnum {
APPOINT_NOT_CLOSE(4014,"必修不能退出"),
STATE_NOT_RELEASE(4015,"该课程状态不能发布"),
APPOINT_NOT_CANCEL(4016,"该课程不能取消指派"),
INVALID_PARAMETER_VALUE(4017,"参数值无效")
INVALID_PARAMETER_VALUE(4017,"参数值无效"),
NOT_RECOMMEND(4018,"该课程未推荐")
;
private Integer code;
......
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