Merge remote-tracking branch 'origin/zcc'
This commit is contained in:
@@ -1,31 +1,50 @@
|
||||
package com.peanut.modules.master.controller;
|
||||
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.master.service.UserMergeService;
|
||||
import com.peanut.modules.common.entity.CourseEntity;
|
||||
import com.peanut.modules.common.entity.UserCourseBuyEntity;
|
||||
import com.peanut.modules.master.service.CourseService;
|
||||
import com.peanut.modules.master.service.UserManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 合并用户
|
||||
* 用户管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController("masterUserMerge")
|
||||
@RequestMapping("master/userMerge")
|
||||
@RestController("masterUserManage")
|
||||
@RequestMapping("master/userManage")
|
||||
public class UserMergeController {
|
||||
|
||||
@Autowired
|
||||
private UserMergeService mergeService;
|
||||
|
||||
private UserManageService mergeService;
|
||||
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
|
||||
//数据合并
|
||||
@RequestMapping("/userMerge")
|
||||
public R userMerge(@RequestBody Map<String, Object> params) {
|
||||
mergeService.userMerge(params);
|
||||
return null;
|
||||
return mergeService.userMerge(params);
|
||||
}
|
||||
|
||||
//手动开课
|
||||
@RequestMapping("/addUserCourseBuy")
|
||||
public R updateUserCourseBuy(@RequestBody UserCourseBuyEntity userCourseBuyEntity) {
|
||||
return mergeService.addUserCourseBuy(userCourseBuyEntity);
|
||||
}
|
||||
|
||||
//课程列表带下级
|
||||
@RequestMapping("/courseAndChildrenList")
|
||||
public R courseAndChildrenList(@RequestBody Map<String, Object> params) {
|
||||
List<CourseEntity> list = courseService.courseAndChildrenList(params);
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,4 +24,6 @@ public interface CourseService extends IService<CourseEntity> {
|
||||
Page getCourseListCanMedical(ParamTo param);
|
||||
|
||||
void testCourse();
|
||||
|
||||
List<CourseEntity> courseAndChildrenList(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.UserCourseBuyEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface UserManageService {
|
||||
|
||||
R userMerge(Map<String, Object> params);
|
||||
|
||||
R addUserCourseBuy(UserCourseBuyEntity userCourseBuyEntity);
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface UserMergeService {
|
||||
|
||||
R userMerge(Map<String, Object> params);
|
||||
|
||||
}
|
||||
@@ -195,6 +195,21 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CourseEntity> courseAndChildrenList(Map<String, Object> params) {
|
||||
LambdaQueryWrapper<CourseEntity> cwrapper = new LambdaQueryWrapper<>();
|
||||
cwrapper.like(CourseEntity::getTitle,params.get("title"));
|
||||
List<CourseEntity> courseList = this.list(cwrapper);
|
||||
if (courseList!=null && courseList.size() > 0){
|
||||
for (CourseEntity c : courseList) {
|
||||
LambdaQueryWrapper<CourseCatalogueEntity> catalogueWrapper = new LambdaQueryWrapper<>();
|
||||
catalogueWrapper.eq(CourseCatalogueEntity::getCourseId,c.getId());
|
||||
List<CourseCatalogueEntity> catalogueList = courseCatalogueDao.selectList(catalogueWrapper);
|
||||
c.setCourseCatalogueEntityList(catalogueList);
|
||||
}
|
||||
}
|
||||
return courseList;
|
||||
}
|
||||
|
||||
|
||||
private List<Integer> sociologyIds(Integer id){
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.UserContribution;
|
||||
import com.peanut.modules.common.entity.UserContributionExchange;
|
||||
import com.peanut.modules.common.entity.UserCourseBuyEntity;
|
||||
import com.peanut.modules.master.service.UserMergeService;
|
||||
import com.peanut.modules.master.service.UserManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -18,8 +18,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterUserMergeService")
|
||||
public class UserMergeServiceImpl implements UserMergeService {
|
||||
@Service("masterUserManageService")
|
||||
public class UserManageServiceImpl implements UserManageService {
|
||||
|
||||
@Autowired
|
||||
private MyUserDao userDao;
|
||||
@@ -84,7 +84,16 @@ public class UserMergeServiceImpl implements UserMergeService {
|
||||
}else {
|
||||
return R.error("主账号未找到");
|
||||
}
|
||||
return null;
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R addUserCourseBuy(UserCourseBuyEntity userCourseBuyEntity) {
|
||||
if (courseBuyDao.insert(userCourseBuyEntity)>0){
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("开课失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user