Merge remote-tracking branch 'origin/zcc'
This commit is contained in:
@@ -1,31 +1,50 @@
|
|||||||
package com.peanut.modules.master.controller;
|
package com.peanut.modules.master.controller;
|
||||||
|
|
||||||
import com.peanut.common.utils.R;
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合并用户
|
* 用户管理
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("masterUserMerge")
|
@RestController("masterUserManage")
|
||||||
@RequestMapping("master/userMerge")
|
@RequestMapping("master/userManage")
|
||||||
public class UserMergeController {
|
public class UserMergeController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserMergeService mergeService;
|
private UserManageService mergeService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CourseService courseService;
|
||||||
|
|
||||||
|
//数据合并
|
||||||
@RequestMapping("/userMerge")
|
@RequestMapping("/userMerge")
|
||||||
public R userMerge(@RequestBody Map<String, Object> params) {
|
public R userMerge(@RequestBody Map<String, Object> params) {
|
||||||
mergeService.userMerge(params);
|
return mergeService.userMerge(params);
|
||||||
return null;
|
}
|
||||||
|
|
||||||
|
//手动开课
|
||||||
|
@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);
|
Page getCourseListCanMedical(ParamTo param);
|
||||||
|
|
||||||
void testCourse();
|
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){
|
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.UserContribution;
|
||||||
import com.peanut.modules.common.entity.UserContributionExchange;
|
import com.peanut.modules.common.entity.UserContributionExchange;
|
||||||
import com.peanut.modules.common.entity.UserCourseBuyEntity;
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -18,8 +18,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("masterUserMergeService")
|
@Service("masterUserManageService")
|
||||||
public class UserMergeServiceImpl implements UserMergeService {
|
public class UserManageServiceImpl implements UserManageService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MyUserDao userDao;
|
private MyUserDao userDao;
|
||||||
@@ -84,7 +84,16 @@ public class UserMergeServiceImpl implements UserMergeService {
|
|||||||
}else {
|
}else {
|
||||||
return R.error("主账号未找到");
|
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