瀏覽代碼

检查手机是否已经是机构学生

liujc 1 年之前
父節點
當前提交
fc9237916c

+ 23 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/open/OpenClient.java

@@ -5,6 +5,7 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.MusicImgDto;
 import com.yonge.cooleshow.biz.dal.dto.search.MemberPriceSettingsSearch;
+import com.yonge.cooleshow.biz.dal.entity.Student;
 import com.yonge.cooleshow.biz.dal.entity.SysConfig;
 import com.yonge.cooleshow.biz.dal.service.ActivityPlanService;
 import com.yonge.cooleshow.biz.dal.service.AppVersionInfoService;
@@ -90,6 +91,28 @@ public class OpenClient extends BaseController {
         return HttpResponseResult.succeed(detail);
     }
 
+
+    @GetMapping("/checkPhone")
+    @ApiOperation(value = "检查手机是否已经是机构学生")
+    public HttpResponseResult<Boolean> checkPhone(String phone) {
+
+
+        // 根据手机号 判断是否已经有机构账户
+        SysUser sysUser = sysUserFeignService.queryUserByMobile(phone);
+        if (sysUser == null) {
+            return HttpResponseResult.succeed(true);
+        }
+        Student student = studentService.getById(sysUser.getId());
+        if (student == null) {
+            return HttpResponseResult.succeed(true);
+        }
+        if (student.getTenantId() ==null || student.getTenantId() == -1) {
+            return HttpResponseResult.succeed(true);
+        } else {
+            return HttpResponseResult.succeed(false);
+        }
+    }
+
     @ApiOperation(value = "绑定老师")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),