|
@@ -16,9 +16,11 @@ 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.StudentService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysConfigService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TeacherService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.StudentWrapper;
|
|
|
+import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import com.yonge.cooleshow.tenant.vo.StudentVo;
|
|
@@ -68,6 +70,9 @@ public class OpenStudentController extends BaseController {
|
|
|
@Autowired
|
|
|
private ImGroupMemberService imGroupMemberService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+
|
|
|
@PostMapping("/save")
|
|
|
@ApiOperation(value = "新增/修改", notes = "传入Student,换绑时按照返回错误码5004判断,是否需要换绑,updateTenant=true表示换绑")
|
|
|
public HttpResponseResult<Boolean> save(@Validated @RequestBody StudentVo.Student student) {
|
|
@@ -128,10 +133,25 @@ public class OpenStudentController extends BaseController {
|
|
|
log.error("学生注册,切换机构退群失败:{}", e.getMessage());
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // 更新头像
|
|
|
+ if (StringUtils.isEmpty(student.getAvatar())) {
|
|
|
+ student.setAvatar(one.getAvatar());
|
|
|
+ }
|
|
|
}
|
|
|
student.setId(studentId);
|
|
|
}
|
|
|
|
|
|
+ // 配置头像
|
|
|
+ if (StringUtils.isEmpty(student.getAvatar())) {
|
|
|
+ String avatar;
|
|
|
+ if (student.getGender().equals(1)) {
|
|
|
+ avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_BOY_AVATAR);
|
|
|
+ } else {
|
|
|
+ avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_GIRL_AVATAR);
|
|
|
+ }
|
|
|
+ student.setAvatar(avatar);
|
|
|
+ }
|
|
|
|
|
|
StudentWrapper.Student studentInfo = JSON.parseObject(JSON.toJSONString(student), StudentWrapper.Student.class);
|
|
|
studentInfo.setTenantId(tenantInfo.getId());
|