|
@@ -36,6 +36,7 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询用户详情
|
|
* 查询用户详情
|
|
|
|
+ *
|
|
* @param phone
|
|
* @param phone
|
|
* @param clazzId
|
|
* @param clazzId
|
|
* @return
|
|
* @return
|
|
@@ -44,27 +45,27 @@ public class UserController extends BaseController {
|
|
// @ApiOperation(value = "根据乐团编号、用户手机,查询用户详情")
|
|
// @ApiOperation(value = "根据乐团编号、用户手机,查询用户详情")
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "用户手机", required = true, dataType = "String"),
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "用户手机", required = true, dataType = "String"),
|
|
// @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
// @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
- public Object getUserDetailByPhone(String phone,Integer clazzId,Integer cityId){
|
|
|
|
- if(StringUtils.isEmpty(phone) || clazzId == null || cityId == null){
|
|
|
|
|
|
+ public Object getUserDetailByPhone(String phone, Integer clazzId, Integer cityId) {
|
|
|
|
+ if (StringUtils.isEmpty(phone) || clazzId == null || cityId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
ApplyInfo userByPhone = applyInfoService.findUserByPhone(phone, null);
|
|
ApplyInfo userByPhone = applyInfoService.findUserByPhone(phone, null);
|
|
-
|
|
|
|
- if(userByPhone == null && applyInfoService.mecUserIsExist(phone)){
|
|
|
|
|
|
+
|
|
|
|
+ if (userByPhone == null && applyInfoService.mecUserIsExist(phone)) {
|
|
return failed(Constants.PARAM_EXIST_ERROR_MSG);
|
|
return failed(Constants.PARAM_EXIST_ERROR_MSG);
|
|
}
|
|
}
|
|
- if(userByPhone != null && !userByPhone.getClassId().equals(clazzId)){//如果改用户存在其他团中
|
|
|
|
- return failed(Constants.PARAM_EXIST_ERROR_MSG);
|
|
|
|
|
|
+ if (userByPhone != null && !userByPhone.getClassId().equals(clazzId)) {//如果改用户存在其他团中
|
|
|
|
+ return failed(Constants.PARAM_EXIST_ERROR_MSG);
|
|
}
|
|
}
|
|
School school = schoolService.get(clazzId);
|
|
School school = schoolService.get(clazzId);
|
|
- if(school != null){
|
|
|
|
- if(school.getCityId() == null){
|
|
|
|
|
|
+ if (school != null) {
|
|
|
|
+ if (school.getCityId() == null) {
|
|
school.setCityId(cityId);
|
|
school.setCityId(cityId);
|
|
school.setUpdateTime(new Date());
|
|
school.setUpdateTime(new Date());
|
|
schoolService.update(school);
|
|
schoolService.update(school);
|
|
}
|
|
}
|
|
- if(userByPhone != null){
|
|
|
|
|
|
+ if (userByPhone != null) {
|
|
userByPhone.setPushStatus(school.getStatus());
|
|
userByPhone.setPushStatus(school.getStatus());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -73,30 +74,31 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 用户报名
|
|
* 用户报名
|
|
|
|
+ *
|
|
* @param applyInfo
|
|
* @param applyInfo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "学生报名乐团")
|
|
// @ApiOperation(value = "学生报名乐团")
|
|
@PostMapping("/userApply")
|
|
@PostMapping("/userApply")
|
|
- public Object userApply(ApplyInfo applyInfo){
|
|
|
|
- if(applyInfo != null){
|
|
|
|
|
|
+ public Object userApply(ApplyInfo applyInfo) {
|
|
|
|
+ if (applyInfo != null) {
|
|
try {
|
|
try {
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
applyInfo.setCreateTime(date);
|
|
applyInfo.setCreateTime(date);
|
|
applyInfo.setUpdateTime(date);
|
|
applyInfo.setUpdateTime(date);
|
|
applyInfoService.insert(applyInfo);
|
|
applyInfoService.insert(applyInfo);
|
|
School school = schoolService.get(applyInfo.getClassId());
|
|
School school = schoolService.get(applyInfo.getClassId());
|
|
- if(school == null){
|
|
|
|
|
|
+ if (school == null) {
|
|
return failed("乐团数据不存在");
|
|
return failed("乐团数据不存在");
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
school.setSchoolId(applyInfo.getSchoolId());
|
|
school.setSchoolId(applyInfo.getSchoolId());
|
|
school.setUpdateTime(date);
|
|
school.setUpdateTime(date);
|
|
schoolService.update(school);
|
|
schoolService.update(school);
|
|
}
|
|
}
|
|
return succeed(applyInfo.getId());
|
|
return succeed(applyInfo.getId());
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- if(e instanceof DuplicateKeyException){
|
|
|
|
|
|
+ if (e instanceof DuplicateKeyException) {
|
|
return failed("该用户已存在");
|
|
return failed("该用户已存在");
|
|
}
|
|
}
|
|
return failed("报名失败");
|
|
return failed("报名失败");
|
|
@@ -107,6 +109,7 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据乐团id获取乐团详情,查询乐团状态也通过该接口
|
|
* 根据乐团id获取乐团详情,查询乐团状态也通过该接口
|
|
|
|
+ *
|
|
* @param clazzId
|
|
* @param clazzId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -114,8 +117,8 @@ public class UserController extends BaseController {
|
|
@PostMapping("/getClassDetail")
|
|
@PostMapping("/getClassDetail")
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer"),
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer"),
|
|
// @ApiImplicitParam(name = "schoolId", value = "学校编号", required = true, dataType = "Integer")})
|
|
// @ApiImplicitParam(name = "schoolId", value = "学校编号", required = true, dataType = "Integer")})
|
|
- public Object getSchoolDetail(Integer schoolId){
|
|
|
|
- if(schoolId == null){
|
|
|
|
|
|
+ public Object getSchoolDetail(Integer schoolId) {
|
|
|
|
+ if (schoolId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
return succeed(orderService.getSchoolDetail(schoolId));
|
|
return succeed(orderService.getSchoolDetail(schoolId));
|
|
@@ -123,13 +126,14 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据学生编号获取乐团注册页面数据
|
|
* 根据学生编号获取乐团注册页面数据
|
|
|
|
+ *
|
|
* @param stuId
|
|
* @param stuId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "根据学生编号获取乐团注册页面数据")
|
|
// @ApiOperation(value = "根据学生编号获取乐团注册页面数据")
|
|
@PostMapping("/getUserRegisterViewDetail")
|
|
@PostMapping("/getUserRegisterViewDetail")
|
|
- public Object getUserRegisterViewDetail(Integer stuId){
|
|
|
|
- if(stuId == null){
|
|
|
|
|
|
+ public Object getUserRegisterViewDetail(Integer stuId) {
|
|
|
|
+ if (stuId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
return succeed(applyInfoService.getUserRegisterViewDetail(stuId));
|
|
return succeed(applyInfoService.getUserRegisterViewDetail(stuId));
|
|
@@ -146,40 +150,41 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取乐团课程组列表
|
|
* 获取乐团课程组列表
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/getCourses")
|
|
@PostMapping("/getCourses")
|
|
// @ApiOperation(value = "根据乐团编号,获取乐团课程组列表")
|
|
// @ApiOperation(value = "根据乐团编号,获取乐团课程组列表")
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
- public Object getCourses(Integer clazzId){
|
|
|
|
- if(clazzId == null){
|
|
|
|
|
|
+ public Object getCourses(Integer clazzId) {
|
|
|
|
+ if (clazzId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
return succeed(courseGroupInfoService.getCourses(clazzId));
|
|
return succeed(courseGroupInfoService.getCourses(clazzId));
|
|
}
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "获取所有乐团列表")
|
|
|
|
|
|
+ // @ApiOperation(value = "获取所有乐团列表")
|
|
@PostMapping("/getMusicTeams")
|
|
@PostMapping("/getMusicTeams")
|
|
- public Object getMusicTeams(MusicTeamsPageInfo pageInfo){
|
|
|
|
|
|
+ public Object getMusicTeams(MusicTeamsPageInfo pageInfo) {
|
|
return succeed(schoolService.queryPage(pageInfo));
|
|
return succeed(schoolService.queryPage(pageInfo));
|
|
}
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "根据乐团编号,获取学员列表")
|
|
|
|
|
|
+ // @ApiOperation(value = "根据乐团编号,获取学员列表")
|
|
@PostMapping("/getMusicTeamStu")
|
|
@PostMapping("/getMusicTeamStu")
|
|
- public Object getMusicTeamStu(StudentsQueryInfo queryInfo){
|
|
|
|
|
|
+ public Object getMusicTeamStu(StudentsQueryInfo queryInfo) {
|
|
return succeed(applyInfoService.queryUserPage(queryInfo));
|
|
return succeed(applyInfoService.queryUserPage(queryInfo));
|
|
}
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "获取所有分部列表")
|
|
|
|
|
|
+ // @ApiOperation(value = "获取所有分部列表")
|
|
@GetMapping("/getBranches")
|
|
@GetMapping("/getBranches")
|
|
- public Object getBranches(){
|
|
|
|
|
|
+ public Object getBranches() {
|
|
return succeed(applyInfoService.getBranches());
|
|
return succeed(applyInfoService.getBranches());
|
|
}
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "获取学校详情")
|
|
|
|
|
|
+ // @ApiOperation(value = "获取学校详情")
|
|
@GetMapping("/getSchool")
|
|
@GetMapping("/getSchool")
|
|
- public Object getSchool(Integer schoolId){
|
|
|
|
- if(schoolId == null){
|
|
|
|
|
|
+ public Object getSchool(Integer schoolId) {
|
|
|
|
+ if (schoolId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
return succeed(applyInfoService.get(schoolId));
|
|
return succeed(applyInfoService.get(schoolId));
|
|
@@ -197,11 +202,12 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改乐团信息
|
|
* 修改乐团信息
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "修改乐团信息")
|
|
// @ApiOperation(value = "修改乐团信息")
|
|
@PostMapping("/updateClass")
|
|
@PostMapping("/updateClass")
|
|
- public Object updateClass(School school){
|
|
|
|
|
|
+ public Object updateClass(School school) {
|
|
school.setUpdateTime(new Date());
|
|
school.setUpdateTime(new Date());
|
|
schoolService.update(school);
|
|
schoolService.update(school);
|
|
return succeed();
|
|
return succeed();
|
|
@@ -209,26 +215,28 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 开启乐团缴费功能
|
|
* 开启乐团缴费功能
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "开启乐团缴费功能")
|
|
// @ApiOperation(value = "开启乐团缴费功能")
|
|
@PostMapping("/openClassPay")
|
|
@PostMapping("/openClassPay")
|
|
- public Object openClassPay(Integer id,String smsMsg, int type){//1是线上 2 线下
|
|
|
|
- if(id == null || (type==2 &&StringUtils.isEmpty(smsMsg))){
|
|
|
|
|
|
+ public Object openClassPay(Integer id, String smsMsg, int type, int isSingle) {//1是线上 2 线下
|
|
|
|
+ if (id == null || (isSingle > 1 || isSingle < 0) || (type == 2 && StringUtils.isEmpty(smsMsg))) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
- schoolService.openClassPay(id,smsMsg,type);
|
|
|
|
|
|
+ schoolService.openClassPay(id, smsMsg, type, isSingle);
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改学生信息
|
|
* 修改学生信息
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "修改学生信息")
|
|
// @ApiOperation(value = "修改学生信息")
|
|
@PostMapping("/updateUser")
|
|
@PostMapping("/updateUser")
|
|
- public Object updateUser(@ModelAttribute ApplyInfo applyInfo){
|
|
|
|
|
|
+ public Object updateUser(@ModelAttribute ApplyInfo applyInfo) {
|
|
applyInfo.setUpdateTime(new Date());
|
|
applyInfo.setUpdateTime(new Date());
|
|
applyInfoService.update(applyInfo);
|
|
applyInfoService.update(applyInfo);
|
|
return succeed("修改成功");
|
|
return succeed("修改成功");
|
|
@@ -236,37 +244,38 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改学生信息
|
|
* 修改学生信息
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "批量调剂学员专业")
|
|
// @ApiOperation(value = "批量调剂学员专业")
|
|
@PostMapping("/updateUserSub")
|
|
@PostMapping("/updateUserSub")
|
|
- public Object updateUserSub(String userId,Integer subId,Integer courseId){
|
|
|
|
- if(StringUtils.isEmpty(userId) || subId == null || courseId == null){
|
|
|
|
|
|
+ public Object updateUserSub(String userId, Integer subId, Integer courseId) {
|
|
|
|
+ if (StringUtils.isEmpty(userId) || subId == null || courseId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
- applyInfoService.updateUserSub(userId,subId,courseId);
|
|
|
|
|
|
+ applyInfoService.updateUserSub(userId, subId, courseId);
|
|
return succeed("修改成功");
|
|
return succeed("修改成功");
|
|
}
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "学员课程班查询,本接口用于查询指定学员报名的课程班(小课或乐团)列表")
|
|
|
|
|
|
+ // @ApiOperation(value = "学员课程班查询,本接口用于查询指定学员报名的课程班(小课或乐团)列表")
|
|
@PostMapping("/queryUserCourse")
|
|
@PostMapping("/queryUserCourse")
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer")})
|
|
// @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer")})
|
|
- public Object queryUserCourse(Integer userId){
|
|
|
|
- if(userId == null){
|
|
|
|
|
|
+ public Object queryUserCourse(Integer userId) {
|
|
|
|
+ if (userId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
List<Branch> branches = applyInfoService.getBranches();
|
|
List<Branch> branches = applyInfoService.getBranches();
|
|
MecUser mecUser = applyInfoService.findMecUser(userId);
|
|
MecUser mecUser = applyInfoService.findMecUser(userId);
|
|
- Map<String,Object> resultMap = new HashMap<>(2);
|
|
|
|
- if(branches != null && branches.size() > 0 && mecUser != null){
|
|
|
|
- for (Branch branch:branches) {
|
|
|
|
- if(branch.getBranchId().equals(mecUser.getBranchId())){
|
|
|
|
- resultMap.put("memo",branch.getMemo());
|
|
|
|
|
|
+ Map<String, Object> resultMap = new HashMap<>(2);
|
|
|
|
+ if (branches != null && branches.size() > 0 && mecUser != null) {
|
|
|
|
+ for (Branch branch : branches) {
|
|
|
|
+ if (branch.getBranchId().equals(mecUser.getBranchId())) {
|
|
|
|
+ resultMap.put("memo", branch.getMemo());
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- resultMap.put("courses",applyInfoService.queryUserCourse(userId));
|
|
|
|
|
|
+ resultMap.put("courses", applyInfoService.queryUserCourse(userId));
|
|
return succeed(resultMap);
|
|
return succeed(resultMap);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -282,46 +291,49 @@ public class UserController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询mec用户信息
|
|
* 查询mec用户信息
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/findMecUser")
|
|
@PostMapping("/findMecUser")
|
|
- public Object findMecUser(Integer userId){
|
|
|
|
- if(userId == null){
|
|
|
|
|
|
+ public Object findMecUser(Integer userId) {
|
|
|
|
+ if (userId == null) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
return succeed(applyInfoService.findMecUser(userId));
|
|
return succeed(applyInfoService.findMecUser(userId));
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/mecUserIsExist")
|
|
@PostMapping("/mecUserIsExist")
|
|
- public Object mecUserIsExist(String phone){
|
|
|
|
|
|
+ public Object mecUserIsExist(String phone) {
|
|
return succeed(applyInfoService.mecUserIsExist(phone));
|
|
return succeed(applyInfoService.mecUserIsExist(phone));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 发送短信验证码
|
|
* 发送短信验证码
|
|
|
|
+ *
|
|
* @param mobile
|
|
* @param mobile
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/sendSmsCode")
|
|
@GetMapping("/sendSmsCode")
|
|
public Object sendLoginVerifyCode(String mobile, HttpSession session) {
|
|
public Object sendLoginVerifyCode(String mobile, HttpSession session) {
|
|
- if(StringUtils.isEmpty(mobile)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(mobile)) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
- applyInfoService.sendValidCode(mobile,session);
|
|
|
|
|
|
+ applyInfoService.sendValidCode(mobile, session);
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 验证短信验证码
|
|
* 验证短信验证码
|
|
|
|
+ *
|
|
* @param smsCode
|
|
* @param smsCode
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/verifySmsCode")
|
|
@PostMapping("/verifySmsCode")
|
|
- public Object verifySmsCode(String mobile,String smsCode,HttpSession session) {
|
|
|
|
- if(StringUtils.isEmpty(smsCode)){
|
|
|
|
|
|
+ public Object verifySmsCode(String mobile, String smsCode, HttpSession session) {
|
|
|
|
+ if (StringUtils.isEmpty(smsCode)) {
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
return failed(Constants.PARAM_VERIFY_ERROR_MSG);
|
|
}
|
|
}
|
|
- if(applyInfoService.verifySmsCode(mobile,smsCode,session)){
|
|
|
|
|
|
+ if (applyInfoService.verifySmsCode(mobile, smsCode, session)) {
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
return failed("验证失败");
|
|
return failed("验证失败");
|