Commit 11d1cd87 authored by luzhuang's avatar luzhuang

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

parents 647a82d3 475e349c
......@@ -62,7 +62,7 @@ public interface BBannerRepository extends BaseMapper<BBanner> {
*/
@Select("<script>select count(1) from b_banner where " +
" del_flag = 0 and flag = 1 " +
" and corp_id = corpId " +
" and corp_id = #{corpId} " +
"</script>")
int selectCountBanner(AddOrUpdateDTO param);
......
......@@ -115,7 +115,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="606 分页查询大家都在学", notes="分页查询大家都在学", response = BLesson.class)
@GetMapping(value = "/queryPersonMoreByPagination")
public Result queryPersonMoreByPagination(CurUser curUser) {
public Result queryPersonMoreByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryPersonMoreByPagination(getPaginationUtility(),curUser);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......@@ -126,7 +126,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="607 分页查询企业推荐", notes="分页查询企业推荐", response = BLesson.class)
@GetMapping(value = "/queryRecommendByPagination")
public Result queryRecommendByPagination(CurUser curUser) {
public Result queryRecommendByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryRecommendByPagination(getPaginationUtility(),curUser);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......@@ -149,7 +149,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="609 分页查询可能感兴趣", notes="分页查询可能感兴趣", response = BLesson.class)
@GetMapping(value = "/queryInterestedByPagination")
public Result queryInterestedByPagination(CurUser curUser) {
public Result queryInterestedByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryInterestedByPagination(getPaginationUtility(),curUser);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......@@ -198,7 +198,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="613 我的课程总数(学习和发布)", notes="我的课程总数")
@GetMapping(value = "/iLessonCount")
public Result ILessonCountDTO(CurUser curUser) {
public Result ILessonCountDTO(CurUser curUser, BindingResult bindingResult ) {
String userId = curUser.getUserId();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -307,44 +307,8 @@ public class BLessonController extends PaginationController<BLesson> {
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="623 分页查询列表页在学", notes="分页查询列表页推荐", response = BLesson.class)
// @GetMapping(value = "/queryLearnListByPagination")
// public Result queryLearnListByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
// bLessonService.queryLearnListByPagination(getPaginationUtility(),param);
// GridModel gridModel = getGridModelResponse();
// return Result.builder(new PersistModel(1),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// gridModel);
// }
//
// @ApiOperation(value="624 分页查询列表页收藏", notes="分页查询列表页收藏", response = BLesson.class)
// @GetMapping(value = "/queryCollectListByPagination")
// public Result queryCollectListByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
// bLessonService.queryCollectListByPagination(getPaginationUtility(),param);
// 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="622 推荐课程", notes="根据ID推荐课程")
// @PostMapping(value = "/recommend")
// public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) {
// PersistModel data = bLessonService.recommendBLesson(curUser,recommendLessonDTO);
......
......@@ -44,36 +44,28 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
//查询线上课程学员追踪图表
@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);
......@@ -95,7 +87,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"and ba.del_flag != 1 and ba.flag = 1 " +
"and bl.corp_id = #{param.corpId} "+
"and blp.corp_id = #{param.corpId} "+
// "and blp.corp_id = #{param.corpId} "+
"and su.corp_id = #{param.corpId} "+
"and bl.business_id = #{param.lessonId} "+
......
......@@ -20,6 +20,7 @@ import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.ResultExceptionEnum;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.IdGen;
import org.rcisoft.core.util.UserUtil;
import org.rcisoft.sys.user.bean.CurUser;
......@@ -169,8 +170,10 @@ public class BLessonServiceImpl implements BLessonService {
bViewrangeRepository.updateByLessonId(bViewrange);
//删除可见范围子表
bViewrangeRepository.deleteViewrangeSon(bViewrange);
//获取所有可见人员和部门
List<BViewrangeSon> bViewrangeSons = new ArrayList<>();
//model.getViewRangePerson()不为空 新建bViewrangeSon对象放入bViewrangeSons中 type:0人员 1部门
if (StringUtils.isNotEmpty(model.getViewRangePerson())){
String[] viewRangePerson = model.getViewRangePerson().split(",");
......@@ -258,8 +261,9 @@ public class BLessonServiceImpl implements BLessonService {
@Override
public PersistModel recommendBLesson(CurUser curUser, RecommendLessonDTO recommendLessonDTO) {
////
//
// if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) || StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// BLesson bLesson = new BLesson();
// BViewrange bViewrange = setBViewrangeInfo(model);
// //插入可见范围表
// bViewrangeRepository.insertSelective(bViewrange);
......@@ -317,6 +321,9 @@ public class BLessonServiceImpl implements BLessonService {
case "3":
ListAllLesson = bLessonRepository.queryCollectListByPagination(model);
break;
case "4":
ListAllLesson = bLessonRepository.queryInterestedListByPagination(model);
break;
default:
throw new ServiceException(ResultExceptionEnum.INVALID_PARAMETER_VALUE);
}
......@@ -370,6 +377,23 @@ public class BLessonServiceImpl implements BLessonService {
}
return bViewrange;
}
// //设置BRecommend信息
// BRecommend setBRecommendInfo(RecommendLessonDTO model){
// BViewrange bViewrange = new BViewrange();
// UserUtil.setCurrentPersistOperation(bViewrange);
// //设置课程id
// bViewrange.setLessonId(model.getBusinessId());
//
// //设置可见范围类型(0仅人 1仅部门 2人和部门)
// if (StringUtils.isNotEmpty(model.getViewRangePerson()) && StringUtils.isEmpty(model.getViewRangeDepart())){
// bViewrange.setType("0");
// }else if (StringUtils.isEmpty(model.getViewRangePerson()) && StringUtils.isNotEmpty(model.getViewRangeDepart())){
// bViewrange.setType("1");
// }else if (StringUtils.isNotEmpty(model.getViewRangePerson()) && StringUtils.isNotEmpty(model.getViewRangeDepart())){
// bViewrange.setType("2");
// }
// return bViewrange;
// }
@Override
public List<BLesson> theLessonMangageByPagination(PageUtil pageUtil, CurUser curUser, BLesson bLesson) {
......@@ -396,34 +420,4 @@ public class BLessonServiceImpl implements BLessonService {
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;
// }
//
//
// @Override
// public List<BLesson> queryLearnListByPagination(PageUtil pageUtil, FindListLessonDTO model) {
//
// List<BLesson> ListAllLesson = bLessonRepository.queryLearnListByPagination(model);
// return ListAllLesson;
// }
//
// @Override
// public List<BLesson> queryCollectListByPagination(PageUtil pageUtil, FindListLessonDTO model) {
//
// List<BLesson> ListAllLesson = bLessonRepository.queryCollectListByPagination(model);
// return ListAllLesson;
// }
}
......@@ -33,7 +33,6 @@ import java.util.List;
*/
@Slf4j
@Aspect
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public class CurUserAspect {
@Autowired
private SysRoleService sysRoleService;
......@@ -41,7 +40,6 @@ public class CurUserAspect {
* 获取当前登陆人
* @param joinPoint
*/
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Before("execution(* org.rcisoft..*.controller.*.*(..))")
public void beforeInsert(JoinPoint joinPoint) {
if (joinPoint.getArgs().length < 2)
......@@ -70,7 +68,8 @@ public class CurUserAspect {
if (countAdmin==0){
//随机生成角色Id
String rId = IdGen.uuid();
log.info("----------该企业正在初始化----------");
log.info("--------------------该企业正在初始化--------------------");
//初始化角色(新加公司超级管理员)
InitAddAdminDTO initAddAdminDTO = new InitAddAdminDTO();
initAddAdminDTO.setRId(rId);
initAddAdminDTO.setRName("超级管理员");
......@@ -80,26 +79,24 @@ public class CurUserAspect {
initAddAdminDTO.setType("1");
initAddAdminDTO.setCorpId(curUser.getCorpId());
initAddAdminDTO.setRType("0");
//插入tm_admin_role表
int tmAdminRoleResult = sysRoleService.addAdminRole(initAddAdminDTO);
//设置s_role_menu表插入参数值
List<String> menuIds = new ArrayList<String>(MenuMap.menuMap.values());
//插入s_role_menu表
List<RoleMenuDTO> roleMenuDTOS = new ArrayList<>();
List<RoleMenuDTO> roleMenuDTOs = new ArrayList<>();
menuIds.forEach(menuId->{
RoleMenuDTO roleMenuDTO = new RoleMenuDTO();
roleMenuDTO.setBusinessId(IdGen.uuid());
roleMenuDTO.setRoleId(rId);
roleMenuDTO.setMenuId(IdGen.uuid());
roleMenuDTOS.add(roleMenuDTO);
roleMenuDTOs.add(roleMenuDTO);
});
int roleMenuResult = sysRoleService.addRoleMenu(roleMenuDTOS);
//插入s_r_user_role表
//设置s_r_user_role表插入参数值
UserRoleDTO userRoleDTO = new UserRoleDTO();
userRoleDTO.setBusinessId(IdGen.uuid());
userRoleDTO.setRoleId(rId);
userRoleDTO.setUserId(curUser.getUserId());
int userRoleResult = sysRoleService.addUserRole(userRoleDTO);
log.info("----------初始化完成----------");
//插入tm_admin_role、s_role_menu、s_r_user_role表
int userRoleResult = sysRoleService.addAdminRoleMenuUser(initAddAdminDTO,roleMenuDTOs,userRoleDTO);
log.info("--------------------初始化完成--------------------");
}
}
......
......@@ -77,10 +77,6 @@ public interface SysRoleService {
int queryAdminInCorp(String corpId);
int addAdminRole(InitAddAdminDTO initAddAdminDTO);
int addRoleMenu(List<RoleMenuDTO> roleMenuDTOS);
int addUserRole(UserRoleDTO userRoleDTO);
int addAdminRoleMenuUser(InitAddAdminDTO initAddAdminDTO,List<RoleMenuDTO> roleMenuDTOs,UserRoleDTO userRoleDTO);
}
......@@ -168,19 +168,10 @@ public class SysRoleServiceImpl implements SysRoleService {
}
@Override
public int addAdminRole(InitAddAdminDTO initAddAdminDTO) {
return sysRoleRepository.addAdminRole(initAddAdminDTO);
}
@Override
public int addRoleMenu(List<RoleMenuDTO> roleMenuDTOS) {
return sysRoleRepository.addRoleMenu(roleMenuDTOS);
}
@Override
public int addUserRole(UserRoleDTO userRoleDTO) {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
public int addAdminRoleMenuUser(InitAddAdminDTO initAddAdminDTO,List<RoleMenuDTO> roleMenuDTOs,UserRoleDTO userRoleDTO) {
sysRoleRepository.addAdminRole(initAddAdminDTO);
sysRoleRepository.addRoleMenu(roleMenuDTOs);
return sysRoleRepository.addUserRole(userRoleDTO);
}
}
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