|
@@ -7,13 +7,11 @@ import com.yonge.cooleshow.biz.dal.entity.Student;
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantGroup;
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantGroup;
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
|
|
import com.yonge.cooleshow.biz.dal.mapper.TenantGroupMapper;
|
|
import com.yonge.cooleshow.biz.dal.mapper.TenantGroupMapper;
|
|
-import com.yonge.cooleshow.biz.dal.service.ImGroupMemberService;
|
|
|
|
-import com.yonge.cooleshow.biz.dal.service.ImGroupService;
|
|
|
|
-import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
|
|
|
|
import com.yonge.cooleshow.biz.dal.service.SmsCodeService;
|
|
import com.yonge.cooleshow.biz.dal.service.SmsCodeService;
|
|
import com.yonge.cooleshow.biz.dal.service.StudentService;
|
|
import com.yonge.cooleshow.biz.dal.service.StudentService;
|
|
-import com.yonge.cooleshow.biz.dal.service.TeacherService;
|
|
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysMessageService;
|
|
import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
|
|
import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
|
|
import com.yonge.cooleshow.biz.dal.wrapper.StudentWrapper;
|
|
import com.yonge.cooleshow.biz.dal.wrapper.StudentWrapper;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
@@ -31,9 +29,8 @@ 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.HashSet;
|
|
|
|
-import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@RestController
|
|
@RestController
|
|
@@ -44,9 +41,6 @@ public class OpenStudentController extends BaseController {
|
|
private StudentService studentService;
|
|
private StudentService studentService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private TeacherService teacherService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
private TenantInfoService tenantInfoService;
|
|
private TenantInfoService tenantInfoService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -56,20 +50,14 @@ public class OpenStudentController extends BaseController {
|
|
private SmsCodeService smsCodeService;
|
|
private SmsCodeService smsCodeService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private ImUserFriendService imUserFriendService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ImGroupService imGroupService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ImGroupMemberService imGroupMemberService;
|
|
|
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private TenantGroupMapper tenantGroupMapper;
|
|
private TenantGroupMapper tenantGroupMapper;
|
|
|
|
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
@ApiOperation(value = "新增/修改", notes = "传入Student,换绑时按照返回错误码5004判断,是否需要换绑,updateTenant=true表示换绑")
|
|
@ApiOperation(value = "新增/修改", notes = "传入Student,换绑时按照返回错误码5004判断,是否需要换绑,updateTenant=true表示换绑")
|
|
- public HttpResponseResult<Boolean> save(@Validated @RequestBody StudentVo.Student student) {
|
|
|
|
|
|
+ public HttpResponseResult<String> save(@Validated @RequestBody StudentVo.Student student) {
|
|
String code = student.getCode();
|
|
String code = student.getCode();
|
|
if (StringUtils.isEmpty(code)) {
|
|
if (StringUtils.isEmpty(code)) {
|
|
throw new BizException("验证码不能为空");
|
|
throw new BizException("验证码不能为空");
|
|
@@ -131,6 +119,13 @@ public class OpenStudentController extends BaseController {
|
|
studentInfo.setTenantId(tenantInfo.getId());
|
|
studentInfo.setTenantId(tenantInfo.getId());
|
|
|
|
|
|
studentService.save(studentInfo);
|
|
studentService.save(studentInfo);
|
|
- return succeed();
|
|
|
|
|
|
+
|
|
|
|
+ // 自动注册登陆验证码
|
|
|
|
+ String loginCode = "";
|
|
|
|
+ if (Optional.ofNullable(student.getLoginCode()).orElse(false)) {
|
|
|
|
+ // 生成登陆验证码
|
|
|
|
+ loginCode = sysMessageService.sendSecurityCode(MessageTypeEnum.SMS_VERIFY_CODE_LOGIN, student.getPhone());
|
|
|
|
+ }
|
|
|
|
+ return succeed(loginCode);
|
|
}
|
|
}
|
|
}
|
|
}
|