Commit e86deb9b authored by root's avatar root

修改接口

parent 2d9f745d
...@@ -78,12 +78,12 @@ public class BBannerController extends PaginationController<BBanner> { ...@@ -78,12 +78,12 @@ public class BBannerController extends PaginationController<BBanner> {
@ApiOperation(value = "104 分页获取banner", notes = "根据条件分页查询", response = BBanner.class) @ApiOperation(value = "104 分页获取banner", notes = "根据条件分页查询", response = BBanner.class)
@GetMapping(value = "/queryBBannerByPagination") @GetMapping(value = "/queryBBannerByPagination")
public Result queryBBannerByPagination(CurUser curUser, @Valid FindBannerPaginDTO param, BindingResult bindingResult) { public Result queryBBannerByPagination(CurUser curUser, @Valid FindBannerPaginDTO param, BindingResult bindingResult) {
bBannerService.queryBannerByPagination(getPaginationUtility(), param); // bBannerService.queryBanner(param);
GridModel gridModel = getGridModelResponse(); // GridModel gridModel = getGridModelResponse();
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,
gridModel); bBannerService.queryBanner(param));
} }
/* /*
......
...@@ -39,11 +39,10 @@ public interface BBannerService { ...@@ -39,11 +39,10 @@ public interface BBannerService {
/** /**
* 获取图片分页 * 获取图片分页
* @param pageUtil
* @param model * @param model
* @return * @return
*/ */
List<BBanner> queryBannerByPagination(PageUtil pageUtil, FindBannerPaginDTO model); List<BBanner> queryBanner(FindBannerPaginDTO model);
/** /**
......
...@@ -92,7 +92,7 @@ public class BBannerServiceImpl implements BBannerService { ...@@ -92,7 +92,7 @@ public class BBannerServiceImpl implements BBannerService {
} }
@Override @Override
public List<BBanner> queryBannerByPagination(PageUtil pageUtil, FindBannerPaginDTO model) { public List<BBanner> queryBanner(FindBannerPaginDTO model) {
return bBannerRepository.queryBanners(model); return bBannerRepository.queryBanners(model);
} }
......
...@@ -15,10 +15,8 @@ import org.rcisoft.common.component.Global; ...@@ -15,10 +15,8 @@ import org.rcisoft.common.component.Global;
import org.rcisoft.common.controller.PaginationController; import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.common.model.GridModel; import org.rcisoft.common.model.GridModel;
import org.rcisoft.core.constant.MessageConstant; import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result; import org.rcisoft.core.result.Result;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.sys.user.bean.CurUser; import org.rcisoft.sys.user.bean.CurUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -277,6 +275,53 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -277,6 +275,53 @@ public class BLessonController extends PaginationController<BLesson> {
businessId); businessId);
} }
@ApiOperation(value="619 线上课程学员跟踪图表", notes="线上课程学员跟踪图表")
@GetMapping(value = "/studentTrackingChart")
public Result studentTrackingChart(CurUser curUser, @Valid StudentTrackingChartDTO studentTrackingChartDTO, BindingResult bindingResult) {
StudentTrackingChartRspDTO model = bLessonPersonService.studentTrackingChart(studentTrackingChartDTO);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
model);
}
@ApiOperation(value="620 线上课程学员跟踪", notes="线上课程学员跟踪")
@GetMapping(value = "/studentTrackingByPagination")
public Result studentTrackingByPagination(CurUser curUser, @Valid StudentTrackingDTO studentTrackingDTO, BindingResult bindingResult) {
bLessonPersonService.studentTrackingByPagination(getPaginationUtility(), studentTrackingDTO);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
gridModel);
}
@ApiOperation(value="621 取消指派", notes="取消指派")
@PostMapping(value = "/cancelAppoint")
public Result cancelAppoint(CurUser curUser, @Valid CancelAppointDTO cancelAppointDTO, BindingResult bindingResult) {
PersistModel data = bLessonPersonService.cancelAppoint(cancelAppointDTO);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
cancelAppointDTO);
}
@ApiOperation(value="622 分页查询列表页推荐", notes="分页查询列表页推荐", response = BLesson.class)
@GetMapping(value = "/queryRecommendListByPagination")
public Result queryRecommendListByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(param.getCourse())){
allCourse = bCourseService.findAllCourse(curUser.getCorpId());
}
bLessonService.queryRecommendListByPagination(getPaginationUtility(),param,allCourse);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
gridModel);
}
// @ApiOperation(value="619 推荐课程", notes="根据ID推荐课程") // @ApiOperation(value="619 推荐课程", notes="根据ID推荐课程")
// @PostMapping(value = "/recommend") // @PostMapping(value = "/recommend")
// public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) { // public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) {
......
package org.rcisoft.business.blesson.dao;
import org.rcisoft.business.blesson.dto.CancelAppointDTO;
import org.rcisoft.business.blesson.entity.BAppoint;
import org.rcisoft.business.blesson.entity.BLessonPerson;
import org.rcisoft.core.base.BaseMapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created with on 2019-10-8 15:58:06.
*/
@Repository
public interface BAppointRepository extends BaseMapper<BAppoint> {
/**
* 按课程Id 查询 bAppoint
*
*/
@Select("<script>select * from b_appoint where 1=1 "
+ "and del_flag != 1 "
+ "and flag = 1 "
+ "and business_id = #{bAppointId} "
+ "</script>")
@ResultMap(value = "BaseResultMap" )
BAppoint selectById(String bAppointId);
}
...@@ -2,8 +2,8 @@ package org.rcisoft.business.blesson.dao; ...@@ -2,8 +2,8 @@ package org.rcisoft.business.blesson.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.blabel.entity.BLabel; import org.rcisoft.business.blabel.entity.BLabel;
import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.BLesson; import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
import org.rcisoft.business.blesson.entity.BLessonPerson; import org.rcisoft.business.blesson.entity.BLessonPerson;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -41,5 +41,88 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -41,5 +41,88 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@Update("update b_lesson_person set flag = 0 where business_id = #{id}") @Update("update b_lesson_person set flag = 0 where business_id = #{id}")
int quit(String id); int quit(String id);
//查询线上课程学员追踪图表
@Select("<script> select " +
"(select lesson_name from b_lesson where business_id = #{param.lessonId}) LessonTitle, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countAll, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" and is_finish = 0 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countNotStart, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" and is_finish = 1 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countOngoing, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" and is_finish = 2 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countFinish" +
" </script>")
StudentTrackingChartRspDTO studentTrackingChart(@Param("param") StudentTrackingChartDTO param);
//学员追踪
@Select("<script> select blp.business_id businessId," +
" blp.person_id personId, " +
" bl.lesson_name LessonTitle , su.name personName, " +
" blp.is_appoint isAppoint , blp.is_finish isFinish ," +
" blp.learn_progress learnProgress ,ba.create_date appointDate ," +
" blp.finish_date finishDate " +
"from b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " +
"left join s_user su on blp.person_id = su.business_id " +
// "left join b_appoint ba on ba.business_id = ifnull(blp.appoint_id,'null') " +
"left join b_appoint ba on ba.lesson_id = bl.business_id " +
"where blp.del_flag != 1 and blp.flag = 1 " +
"and bl.del_flag != 1 and bl.flag = 1 " +
"and su.del_flag != 1 and su.flag = 1 " +
"and ba.del_flag != 1 and ba.flag = 1 " +
"and bl.corp_id = #{param.corpId} "+
"and blp.corp_id = #{param.corpId} "+
"and su.corp_id = #{param.corpId} "+
"and bl.business_id = #{param.lessonId} "+
// "<if test= \" param.isAppoint != null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
"<if test= \" param.personName != null and param.personName != ''\">and su.name like CONCAT('%',#{param.personName},'%') </if> " +
"<if test= \" param.isFinish != null and param.isFinish != ''\">and blp.is_finish = #{param.isFinish} </if> " +
"<if test= \" param.appointDateSort !=null and param.appointDateSort !='' and param.appointDateSort =='0'.toString()\"> ORDER BY ba.create_date DESC </if> "+
"<if test= \" param.appointDateSort !=null and param.appointDateSort !='' and param.appointDateSort =='1'.toString()\"> ORDER BY ba.create_date ASC </if> "+
"<if test= \" param.finishDateSort !=null and param.finishDateSort !='' and param.finishDateSort =='0'.toString()\"> ORDER BY blp.finish_date DESC </if> "+
"<if test= \" param.finishDateSort !=null and param.finishDateSort !='' and param.finishDateSort =='1'.toString()\"> ORDER BY blp.finish_date ASC </if> "+
"</script>")
List<StudentTrackingRspDTO> studentTrackingByPagination(@Param("param") StudentTrackingDTO param);
/**
* 查询指派id
* @param param
* @return
*/
@Select("<script>select appoint_id from b_lesson_person where business_id = #{businessId}</script>")
String selectAppointIdById(CancelAppointDTO param);
/**
* 查询指派id
* @param param
* @return
*/
@Select("<script>select is_finish from b_lesson_person where business_id = #{businessId}</script>")
String selectIsFinish(CancelAppointDTO param);
} }
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CancelAppointDTO {
@ApiModelProperty(value = "主键Id",required = true)
private String businessId;
@ApiModelProperty(value = "课程Id",required = true)
private String lessonId;
@ApiModelProperty(value = "学员Id",required = true)
private String personId;
}
...@@ -23,5 +23,9 @@ public class LessonTrainAtBannerDTO { ...@@ -23,5 +23,9 @@ public class LessonTrainAtBannerDTO {
@Length(min = 1,max = 1,message = "长度最小为1,最大为1") @Length(min = 1,max = 1,message = "长度最小为1,最大为1")
private String lessonType; private String lessonType;
private String userId;
private String corpId;
} }
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StudentTrackingChartDTO {
@ApiModelProperty(value = "课程Id",required = false)
private String lessonId;
@ApiModelProperty(value = "课程来源(是否为指派,0自选(选修) 1指派(必修))",required = false)
private String isAppoint;
private String userId;
private String corpId;
}
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StudentTrackingChartRspDTO {
@ApiModelProperty(value = "课程标题")
private String LessonTitle;
@ApiModelProperty(value = "总数")
private String countAll;
@ApiModelProperty(value = "未开始")
private String countNotStart;
@ApiModelProperty(value = "进行中")
private String countOngoing;
@ApiModelProperty(value = "已完成")
private String countFinish;
}
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StudentTrackingDTO {
@ApiModelProperty(value = "课程Id",required = false)
private String lessonId;
// @ApiModelProperty(value = "课程来源(是否为指派,0自选(选修) 1指派(必修))",required = false)
// private String isAppoint;
@ApiModelProperty(value = "学员姓名",required = false)
private String personName;
@ApiModelProperty(value = "部门id",required = false)
private String departId;
@ApiModelProperty(value = "学习状态(0:未开始 1:已开始 2: 已学完)",required = false)
private String isFinish;
@ApiModelProperty(value = "指派时间排序(0降序 1升序)",required = false)
private String appointDateSort;
@ApiModelProperty(value = "完成时间排序(0降序 1升序)",required = false)
private String finishDateSort;
private String userId;
private String corpId;
}
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class StudentTrackingRspDTO {
@ApiModelProperty(value = "主键Id")
private String businessId;
@ApiModelProperty(value = "课程标题")
private String LessonTitle;
@ApiModelProperty(value = "学员id")
private String personId;
@ApiModelProperty(value = "学员姓名")
private String personName;
@ApiModelProperty(value = "部门名称")
private String departName;
@ApiModelProperty(value = "课程来源(是否为指派,0自选(选修) 1指派(必修))")
private String isAppoint;
@ApiModelProperty(value = "学习状态(0:未开始 1:已开始 2: 已学完")
private String isFinish;
@ApiModelProperty(value = "学习进度")
private String learnProgress;
@ApiModelProperty(value = "指派时间")
private Date appointDate;
@ApiModelProperty(value = "完成时间")
private Date finishDate;
}
package org.rcisoft.business.blesson.entity;
import lombok.*;
import org.rcisoft.core.entity.IdEntity;
import javax.persistence.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* Created with on 2019-10-8 15:58:06.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "b_appoint")
public class BAppoint extends IdEntity<BAppoint> {
private String lessonId;
private String appointerId;
private String designatedId;
}
package org.rcisoft.business.blesson.service; package org.rcisoft.business.blesson.service;
import org.rcisoft.business.blesson.dto.FindListLessonDTO; import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.dto.QuitLessonDTO;
import org.rcisoft.business.blesson.entity.BLesson; import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
...@@ -28,5 +26,25 @@ public interface BLessonPersonService { ...@@ -28,5 +26,25 @@ public interface BLessonPersonService {
*/ */
List<BLesson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model, String userId); List<BLesson> queryLearnBLessonsByPagination(PageUtil pageUtil, ILearnLessonDTO model, String userId);
/**
* 查询线上课程学员追踪图表
* @param studentTrackingChartDTO
* @return
*/
StudentTrackingChartRspDTO studentTrackingChart(StudentTrackingChartDTO studentTrackingChartDTO);
/**
* 学员追踪
* @param pageUtil
* @param studentTrackingDTO
* @return
*/
List<StudentTrackingRspDTO> studentTrackingByPagination(PageUtil pageUtil, StudentTrackingDTO studentTrackingDTO);
/**
* 取消指派
* @param cancelAppointDTO
* @return
*/
PersistModel cancelAppoint(CancelAppointDTO cancelAppointDTO);
} }
...@@ -149,4 +149,12 @@ public interface BLessonService{ ...@@ -149,4 +149,12 @@ public interface BLessonService{
* @return * @return
*/ */
List<BLesson> theLessonMangageByPagination(PageUtil pageUtil,CurUser curUser,BLesson bLesson); List<BLesson> theLessonMangageByPagination(PageUtil pageUtil,CurUser curUser,BLesson bLesson);
/**
* 分页查询列表页推荐
* @param pageUtil
* @param model
* @return
*/
List<BLesson> queryRecommendListByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse);
} }
package org.rcisoft.business.blesson.service.impl; package org.rcisoft.business.blesson.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.blesson.dao.BAppointRepository;
import org.rcisoft.business.blesson.dao.BLessonRepository; import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.dto.QuitLessonDTO; import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.BAppoint;
import org.rcisoft.business.blesson.entity.BLesson; import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dao.BLessonPersonRepository; import org.rcisoft.business.blesson.dao.BLessonPersonRepository;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
import org.rcisoft.business.blesson.entity.BLessonPerson; import org.rcisoft.business.blesson.entity.BLessonPerson;
import org.rcisoft.business.blesson.service.BLessonPersonService; import org.rcisoft.business.blesson.service.BLessonPersonService;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
...@@ -12,6 +14,7 @@ import org.rcisoft.core.exception.ServiceException; ...@@ -12,6 +14,7 @@ import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.ResultExceptionEnum; import org.rcisoft.core.result.ResultExceptionEnum;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
...@@ -34,6 +37,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -34,6 +37,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Autowired @Autowired
private BLessonPersonRepository bLessonPersonRepository; private BLessonPersonRepository bLessonPersonRepository;
@Autowired
private BAppointRepository bAppointRepository;
@Transactional(propagation = Propagation.REQUIRED, readOnly = false) @Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override @Override
...@@ -52,6 +58,61 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -52,6 +58,61 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
return bLessonPersonRepository.queryLearnBLessons(model, userId); return bLessonPersonRepository.queryLearnBLessons(model, userId);
} }
@Override
public StudentTrackingChartRspDTO studentTrackingChart(StudentTrackingChartDTO studentTrackingChartDTO) {
return bLessonPersonRepository.studentTrackingChart(studentTrackingChartDTO);
}
@Override
public List<StudentTrackingRspDTO> studentTrackingByPagination(PageUtil pageUtil, StudentTrackingDTO studentTrackingDTO) {
return bLessonPersonRepository.studentTrackingByPagination(studentTrackingDTO);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public PersistModel cancelAppoint(CancelAppointDTO cancelAppointDTO) {
String bAppointId = bLessonPersonRepository.selectAppointIdById(cancelAppointDTO);
if (StringUtils.isEmpty(bAppointId)){
throw new ServiceException(ResultExceptionEnum.APPOINT_NOT_CANCEL);
}
BAppoint bAppoint = bAppointRepository.selectById(bAppointId);
//改变bAppoint 值
String designatedIds = bAppoint.getDesignatedId();
String[] designatedIdList = designatedIds.split(",");
String designatedIdRes = "";
for (String s : designatedIdList) {
if (!s.equals(cancelAppointDTO.getPersonId())){
designatedIdRes += s + ",";
}
}
//去除最后逗号
if (designatedIdRes.length() > 0) {
designatedIdRes = designatedIdRes.substring(0, designatedIdRes.length() - 1);
}
//更新b_appoint表
UserUtil.setCurrentMergeOperation(bAppoint);
bAppoint.setDesignatedId(designatedIdRes);
bAppointRepository.updateByPrimaryKeySelective(bAppoint);
//查询是否在学习
String isFinish = bLessonPersonRepository.selectIsFinish(cancelAppointDTO);
int result = 0;
if ("0".equals(isFinish)){
//未开始执行删除
BLessonPerson bLessonPerson = new BLessonPerson();
bLessonPerson.setBusinessId(cancelAppointDTO.getBusinessId());
result = bLessonPersonRepository.logicalDelete(bLessonPerson);
}else if ("1".equals(isFinish) || "2".equals(isFinish)){
//已开始执行更新
BLessonPerson bLessonPerson = new BLessonPerson();
bLessonPerson.setBusinessId(cancelAppointDTO.getBusinessId());
UserUtil.setCurrentMergeOperation(bLessonPerson);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setAppointId("");
result = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
}
return new PersistModel(1,result);
}
} }
...@@ -303,7 +303,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -303,7 +303,7 @@ public class BLessonServiceImpl implements BLessonService {
model.setCourseIds(courseIds); model.setCourseIds(courseIds);
} }
List<BLesson> ListAllLesson = bLessonRepository.queryListAllLessonByPagination(model); List<BLesson> ListAllLesson = bLessonRepository.queryListAllLessonByPagination(model);
return null; return ListAllLesson;
} }
...@@ -377,4 +377,20 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -377,4 +377,20 @@ public class BLessonServiceImpl implements BLessonService {
List<BLesson> bLessons = bLessonRepository.selectAllManageLesson(uids,bLesson, isAdmin,corpId); List<BLesson> bLessons = bLessonRepository.selectAllManageLesson(uids,bLesson, isAdmin,corpId);
return bLessons; return bLessons;
} }
@Override
public List<BLesson> queryRecommendListByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse) {
List<String> departs = getDeparts();
model.setDeparts(departs);
List<String> courseIds;
if (allCourse != null){
//查询出所有子分类
courseIds = recursion.FindSons(model.getCourse(),allCourse);
//将一级分类放入分类集合中
courseIds.add(model.getCourse());
model.setCourseIds(courseIds);
}
List<BLesson> ListAllLesson = bLessonRepository.queryRecommendListByPagination(model);
return ListAllLesson;
}
} }
...@@ -28,7 +28,8 @@ public enum ResultExceptionEnum { ...@@ -28,7 +28,8 @@ public enum ResultExceptionEnum {
MUST_NOT_FILLED(4012,"必填未填写"), MUST_NOT_FILLED(4012,"必填未填写"),
NOT_MORE_COUNT(4013,"添加超过规定个数"), NOT_MORE_COUNT(4013,"添加超过规定个数"),
APPOINT_NOT_CLOSE(4014,"必修不能退出"), APPOINT_NOT_CLOSE(4014,"必修不能退出"),
STATE_NOT_RELEASE(4015,"该课程状态不能发布") STATE_NOT_RELEASE(4015,"该课程状态不能发布"),
APPOINT_NOT_CANCEL(4016,"该课程不能取消指派")
; ;
private Integer code; private Integer code;
......
...@@ -126,4 +126,13 @@ public class SysUserController extends PaginationController<SysUser> { ...@@ -126,4 +126,13 @@ public class SysUserController extends PaginationController<SysUser> {
menus); menus);
} }
@ApiOperation(value = "707 查询部门", notes = "查询部门")
@GetMapping("/queryDepart")
public Result queryMenu(CurUser curUser) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
userServiceImpl.queryAllDepart());
}
} }
...@@ -9,6 +9,7 @@ import org.rcisoft.sys.user.dto.QuerySysUserDTO; ...@@ -9,6 +9,7 @@ import org.rcisoft.sys.user.dto.QuerySysUserDTO;
import org.rcisoft.sys.user.entity.SysUser; import org.rcisoft.sys.user.entity.SysUser;
import java.util.List; import java.util.List;
import java.util.Map;
public interface SysUserService { public interface SysUserService {
...@@ -33,4 +34,6 @@ public interface SysUserService { ...@@ -33,4 +34,6 @@ public interface SysUserService {
List<SysMenu> queryUserMenus(CurUser user); List<SysMenu> queryUserMenus(CurUser user);
List<QueryMenuResDTO> queryMenusById(String corpId, String id, String modelId); List<QueryMenuResDTO> queryMenusById(String corpId, String id, String modelId);
Map<String,Object> queryAllDepart();
} }
package org.rcisoft.sys.user.service.impl; package org.rcisoft.sys.user.service.impl;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.rcisoft.common.component.Global; import org.rcisoft.common.component.Global;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
...@@ -21,7 +22,9 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -21,7 +22,9 @@ 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.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
...@@ -130,4 +133,57 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -130,4 +133,57 @@ public class SysUserServiceImpl implements SysUserService {
public List<QueryMenuResDTO> queryMenusById(String corpId, String id, String modelId) { public List<QueryMenuResDTO> queryMenusById(String corpId, String id, String modelId) {
return sysUserMapper.queryMenus(corpId,id,modelId); return sysUserMapper.queryMenus(corpId,id,modelId);
} }
@Override
public Map<String, Object> queryAllDepart() {
String str = "{\n" +
"\t\"courseList\": [\n" +
"\n" +
"\t\t{\n" +
"\t\t\t\"title\": \"部门1\",\n" +
"\t\t\t\"key\": \"8ae79c10-d3af-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\"children\": [{\n" +
"\t\t\t\t\t\"title\": \"部门1-1\",\n" +
"\t\t\t\t\t\"key\": \"d6e5a068-d3ce-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t\t\"children\": [{\n" +
"\t\t\t\t\t\t\t\"title\": \"部门1-1-1\",\n" +
"\t\t\t\t\t\t\t\"key\": \"ee471839-d3ce-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t\t\t\t\"children\": [],\n" +
"\t\t\t\t\t\t\t\"pid\": \"d6e5a068-d3ce-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t\t\t},\n" +
"\t\t\t\t\t\t{\n" +
"\t\t\t\t\t\t\t\"title\": \"部门1-1-2\",\n" +
"\t\t\t\t\t\t\t\"key\": \"ee4a7136-d3ce-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t\t\t\t\"children\": [],\n" +
"\t\t\t\t\t\t\t\"pid\": \"d6e5a068-d3ce-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t\t\t}\n" +
"\t\t\t\t\t],\n" +
"\t\t\t\t\t\"pid\": \"8ae79c10-d3af-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"title\": \"部门1-2\",\n" +
"\t\t\t\t\t\"key\": \"d6e910f4-d3ce-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t\t\"children\": [],\n" +
"\t\t\t\t\t\"pid\": \"8ae79c10-d3af-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\t}\n" +
"\t\t\t],\n" +
"\t\t\t\"pid\": \"00000000\",\n" +
"\t\t},\n" +
"\t\t{\n" +
"\t\t\t\"title\": \"部门2\",\n" +
"\t\t\t\"key\": \"8aea4777-d3af-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\"children\": [],\n" +
"\t\t\t\"pid\": \"00000000\",\n" +
"\t\t},\n" +
"\t\t{\n" +
"\t\t\t\"title\": \"部门3\",\n" +
"\t\t\t\"key\": \"8aed258e-d3af-11e9-8d54-b05adaca59d9\",\n" +
"\t\t\t\"children\": [],\n" +
"\t\t\t\"pid\": \"00000000\",\n" +
"\t\t}\n" +
"\t]\n" +
"}";
Map maps = (Map)JSON.parse(str);
return maps;
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.business.blesson.dao.BAppointRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.blesson.entity.BAppoint">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/>
<result column="appointer_id" jdbcType="VARCHAR" property="appointerId"/>
<result column="designated_id" jdbcType="LONGVARCHAR" property="designatedId"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</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