|
@@ -1,16 +1,19 @@
|
|
|
package com.yonge.cooleshow.tenant.controller.open;
|
|
|
|
|
|
+import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantApplyRecord;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantStaff;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.SmsCodeService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.SysConfigService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TenantApplyRecordService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TenantStaffService;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
+import com.yonge.cooleshow.common.enums.UserLockFlag;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -41,6 +44,10 @@ public class OpenTenantController {
|
|
|
private SmsCodeService smsCodeService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private SysUserService sysUserService;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private TenantInfoService tenantInfoService;
|
|
|
|
|
|
@Autowired
|
|
@@ -74,6 +81,21 @@ public class OpenTenantController {
|
|
|
if (!validCode) {
|
|
|
throw new BizException("验证码错误");
|
|
|
}
|
|
|
+ // 判断当前小程序是否绑定账号
|
|
|
+ TenantStaff staff = tenantStaffService.lambdaQuery()
|
|
|
+ .eq(TenantStaff::getWxOpenid, openId)
|
|
|
+ .last("limit 1").one();
|
|
|
+ if (staff != null) {
|
|
|
+ SysUser sysUser = sysUserService.findUserById(staff.getUserId());
|
|
|
+ if (sysUser != null && !phone.equals(sysUser.getPhone())) {
|
|
|
+ throw new BizException("当前账号已绑定");
|
|
|
+ }
|
|
|
+ // 判断当前账号是否锁定
|
|
|
+ if (UserLockFlag.LOCKED.equals(staff.getStatus())) {
|
|
|
+ throw new BizException("当前账号已锁定");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
TenantStaff tenantStaff = tenantStaffService.getByPhone(phone);
|
|
|
if (tenantStaff == null) {
|
|
|
TenantApplyRecord one = tenantApplyRecordService.lambdaQuery()
|
|
@@ -87,6 +109,7 @@ public class OpenTenantController {
|
|
|
throw new BizException(5003, "请等待审核完成");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// Long tenantId = tenantStaff.getTenantId();
|
|
|
// TenantInfo tenantInfo = tenantInfoService.getById(tenantId);
|
|
|
// if(tenantInfo == null){
|