@@ -39,6 +39,12 @@ | |||
<artifactId>xueyi-api-tenant</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>io.github.graphql-java</groupId> | |||
<artifactId>graphql-java-annotations</artifactId> | |||
<version>21.1</version> | |||
</dependency> | |||
</dependencies> | |||
</project> |
@@ -30,4 +30,7 @@ public interface RemoteLoginService { | |||
@GetMapping("/login/inner/loginInfo/{enterpriseName}/{userName}/{password}") | |||
R<LoginUser> getLoginInfoInner(@PathVariable("enterpriseName") String enterpriseName, @PathVariable("userName") String userName, @PathVariable("password") String password, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
@GetMapping("/login/inner/loginByPhone/{phone}") | |||
R<LoginUser> getLoginInfoInnerByPhone(@PathVariable("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
} |
@@ -24,6 +24,11 @@ public class RemoteLoginFallbackFactory implements FallbackFactory<RemoteLoginSe | |||
public R<LoginUser> getLoginInfoInner(String enterpriseName, String userName, String password, String source) { | |||
return R.fail("获取登录信息失败:" + throwable.getMessage()); | |||
} | |||
@Override | |||
public R<LoginUser> getLoginInfoInnerByPhone(String phone, String source) { | |||
return R.fail("获取登录信息失败:" + throwable.getMessage()); | |||
} | |||
}; | |||
} | |||
} |
@@ -77,6 +77,7 @@ public class DmVisitRecordsPo extends TBaseEntity { | |||
public String toString(){ | |||
return new StringBuilder("VisitorId: ").append(visitorId).append(", UserId: ").append(userId).append(", VisitDate: ").append(visitDate).append(", VisitTime: ").append(visitTime).append(", Duration: ").append(duration).append(", RecordStatus: ").append(recordStatus).append(", DeptId: ").append(deptId).append(", Num: ").append(num).toString(); | |||
} |
@@ -3,6 +3,7 @@ package com.xueyi.system.api.digitalmans.domain.po; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.xueyi.common.core.annotation.Excel; | |||
import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||
import graphql.annotations.annotationTypes.GraphQLField; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
@@ -30,10 +31,12 @@ public class DmVisitorsPo extends TBaseEntity { | |||
protected Long roomId; | |||
/** 访客电话 */ | |||
@GraphQLField | |||
@Excel(name = "访客电话") | |||
protected String phone; | |||
/** 1:男;2:女 */ | |||
@GraphQLField | |||
@Excel(name = "1:男;2:女") | |||
protected Integer gender; | |||
@@ -42,10 +45,12 @@ public class DmVisitorsPo extends TBaseEntity { | |||
protected Integer age; | |||
/** 访客公司 */ | |||
@GraphQLField | |||
@Excel(name = "访客公司") | |||
protected String visitorCompany; | |||
/** 访客称呼 */ | |||
@GraphQLField | |||
@Excel(name = "访客称呼") | |||
protected String nickname; | |||
@@ -54,13 +59,16 @@ public class DmVisitorsPo extends TBaseEntity { | |||
protected Long deptId; | |||
/** 访客类型 */ | |||
@GraphQLField | |||
@Excel(name = "访客类型") | |||
protected Long type; | |||
/** 上传头像 */ | |||
@GraphQLField | |||
@Excel(name = "上传头像") | |||
protected String avatar; | |||
@GraphQLField | |||
protected Long resourceId; | |||
@@ -1,5 +1,6 @@ | |||
package com.xueyi.system.api.staff.domain.dto; | |||
import com.alibaba.fastjson2.JSONObject; | |||
import lombok.Data; | |||
/** | |||
@@ -35,6 +36,21 @@ public class DmVisitCommonDto { | |||
private String visitorBase64Img; | |||
public String toSmsJson(String code, String name, String companyName, String companyAddress, String parkInfo){ | |||
JSONObject json = new JSONObject(); | |||
json.put("code", code); | |||
json.put("nickName", this.getVisitorName()); | |||
json.put("robotName", name); | |||
json.put("dateTime", this.getVisitDate()); | |||
json.put("companyName", companyName); | |||
json.put("companyAddr", companyAddress); | |||
json.put("receiverName", this.getEmpName()); | |||
json.put("receiverPhone", this.getEmpTel()); | |||
json.put("parkInfo", parkInfo); | |||
return json.toJSONString(); | |||
} | |||
@Override | |||
public String toString() { | |||
return "DmVisitCommonDto{" + | |||
@@ -1,16 +1,13 @@ | |||
package com.xueyi.system.api.staff.domain.po; | |||
import java.util.Date; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||
import com.xueyi.common.core.annotation.Excel; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.xueyi.common.core.annotation.Excel; | |||
import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import java.io.Serial; | |||
import static com.xueyi.common.core.constant.basic.EntityConstants.NAME; | |||
import java.util.Date; | |||
/** | |||
* 人员 持久化对象 | |||
@@ -95,4 +92,6 @@ public class DmStaffPo extends TBaseEntity { | |||
@Excel(name = "入职日期") | |||
protected Date hireDate; | |||
private Long tenantId; | |||
} |
@@ -10,3 +10,4 @@ com.xueyi.system.api.log.feign.factory.RemoteLogFallbackFactory | |||
com.xueyi.system.api.meeting.feign.factory.RemoteMeetingFallbackFactory | |||
com.xueyi.system.api.resource.feign.factory.RemoteH5ConfigFallbackFactory | |||
com.xueyi.system.api.interfaces.airport.feign.factory.RemotePlaneFallbackFactory | |||
com.xueyi.system.api.sms.feign.factory.RemoteSmsFallbackFactory |
@@ -0,0 +1,16 @@ | |||
package com.xueyi.tenant.api.tenant.domain.dto; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
/** | |||
* 租户 数据传输对象 | |||
* | |||
* @author xueyi | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
public class SysStaffDto extends SysStaffPo { | |||
} |
@@ -0,0 +1,97 @@ | |||
package com.xueyi.tenant.api.tenant.domain.po; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.xueyi.common.core.annotation.Excel; | |||
import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import java.io.Serial; | |||
import java.util.Date; | |||
/** | |||
* 人员 持久化对象 | |||
* | |||
* @author xueyi | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
@TableName(value = "dm_staff") | |||
public class SysStaffPo extends TBaseEntity { | |||
@Serial | |||
private static final long serialVersionUID = 1L; | |||
/** 用户编码 */ | |||
@Excel(name = "用户编码") | |||
protected String code; | |||
/** 用户账号 */ | |||
@Excel(name = "用户账号") | |||
protected String userName; | |||
/** 用户昵称 */ | |||
@Excel(name = "用户昵称") | |||
protected String nickName; | |||
/** 用户类型(00超管用户 01普通用户) */ | |||
@Excel(name = "用户类型", readConverterExp = "0=0超管用户,0=1普通用户") | |||
protected String userType; | |||
/** 手机号码 */ | |||
@Excel(name = "手机号码") | |||
protected String phone; | |||
/** 用户邮箱 */ | |||
@Excel(name = "用户邮箱") | |||
protected String email; | |||
/** 用户性别(0男 1女 2保密) */ | |||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=保密") | |||
protected String sex; | |||
/** 头像地址 */ | |||
@Excel(name = "头像地址") | |||
protected String avatar; | |||
/** 个人简介 */ | |||
@Excel(name = "个人简介") | |||
protected String profile; | |||
/** 密码 */ | |||
@Excel(name = "密码") | |||
protected String password; | |||
/** 最后登录IP */ | |||
@Excel(name = "最后登录IP") | |||
protected String loginIp; | |||
/** 最后登录时间 */ | |||
@Excel(name = "最后登录时间") | |||
protected Date loginDate; | |||
/** 备注 */ | |||
@Excel(name = "备注") | |||
protected String remark; | |||
/** 所属组织ID */ | |||
@Excel(name = "所属组织ID") | |||
protected Long deptId; | |||
/** 所属资源ID */ | |||
@Excel(name = "所属组织ID") | |||
protected Long resourceId; | |||
/** 生日日期 */ | |||
@Excel(name = "生日日期") | |||
protected Date birthDate; | |||
/** 入职日期 */ | |||
@Excel(name = "入职日期") | |||
protected Date hireDate; | |||
private Long tenantId; | |||
} |
@@ -63,4 +63,18 @@ public class TeTenantPo extends BaseEntity { | |||
@TableField(updateStrategy = FieldStrategy.NEVER) | |||
protected String isDefault; | |||
@Override | |||
public String toString(){ | |||
return "TeTenantPo{" + | |||
"strategyId=" + strategyId + | |||
", name='" + name + '\'' + | |||
", systemName='" + systemName + '\'' + | |||
", nick='" + nick + '\'' + | |||
", logo='" + logo + '\'' + | |||
", nameFrequency=" + nameFrequency + | |||
", isLessor='" + isLessor + '\'' + | |||
", isDefault='" + isDefault + '\'' + | |||
'}'; | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
package com.xueyi.tenant.api.tenant.domain.query; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import java.io.Serial; | |||
/** | |||
* 租户 数据查询对象 | |||
* | |||
* @author xueyi | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
public class SysStaffQuery extends SysStaffPo { | |||
@Serial | |||
private static final long serialVersionUID = 1L; | |||
} |
@@ -5,6 +5,7 @@ import com.xueyi.common.core.constant.basic.SecurityConstants; | |||
import com.xueyi.common.core.constant.basic.ServiceConstants; | |||
import com.xueyi.common.core.web.result.R; | |||
import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import com.xueyi.tenant.api.tenant.domain.po.TeTenantPo; | |||
import com.xueyi.tenant.api.tenant.feign.factory.RemoteTenantFallbackFactory; | |||
import org.springframework.cloud.openfeign.FeignClient; | |||
@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestHeader; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import java.util.List; | |||
@@ -36,4 +38,11 @@ public interface RemoteTenantService { | |||
@GetMapping("/tenant/tenant_list") | |||
R<List<TeTenantDto>> tenantList(); | |||
@GetMapping("/tenant/one") | |||
R<TeTenantPo> tenant(@RequestParam ("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
@GetMapping("/tenant/staff") | |||
R<SysStaffPo> existStaff(@RequestParam ("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
} |
@@ -3,6 +3,8 @@ package com.xueyi.tenant.api.tenant.feign.factory; | |||
import com.alibaba.fastjson2.JSONObject; | |||
import com.xueyi.common.core.web.result.R; | |||
import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import com.xueyi.tenant.api.tenant.domain.po.TeTenantPo; | |||
import com.xueyi.tenant.api.tenant.feign.RemoteTenantService; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.cloud.openfeign.FallbackFactory; | |||
@@ -34,6 +36,17 @@ public class RemoteTenantFallbackFactory implements FallbackFactory<RemoteTenant | |||
public R<List<TeTenantDto>> tenantList() { | |||
return null; | |||
} | |||
@Override | |||
public R<TeTenantPo> tenant(String phone, String source) { | |||
return R.fail("获取租户失败:" + throwable.getMessage()); | |||
} | |||
@Override | |||
public R<SysStaffPo> existStaff(String phone, String source) { | |||
return R.fail("验证用户手机号失败:" + throwable.getMessage()); | |||
} | |||
}; | |||
} | |||
} |
@@ -51,6 +51,11 @@ | |||
<groupId>com.xueyi</groupId> | |||
<artifactId>xueyi-common-security</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.xueyi</groupId> | |||
<artifactId>xueyi-common-sms</artifactId> | |||
</dependency> | |||
</dependencies> | |||
@@ -1,24 +1,41 @@ | |||
package com.xueyi.auth.controller; | |||
import com.alibaba.fastjson2.JSONObject; | |||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
import com.xueyi.auth.form.LoginBody; | |||
import com.xueyi.auth.form.PhoneLoginBody; | |||
import com.xueyi.auth.form.RegisterBody; | |||
import com.xueyi.auth.service.SysLoginService; | |||
import com.xueyi.common.core.constant.basic.SecurityConstants; | |||
import com.xueyi.common.core.constant.basic.TenantConstants; | |||
import com.xueyi.common.core.utils.JwtUtil; | |||
import com.xueyi.common.core.utils.core.ObjectUtil; | |||
import com.xueyi.common.core.utils.core.StrUtil; | |||
import com.xueyi.common.core.web.result.AjaxResult; | |||
import com.xueyi.common.core.web.result.R; | |||
import com.xueyi.common.redis.service.RedisService; | |||
import com.xueyi.common.security.auth.AuthUtil; | |||
import com.xueyi.common.security.service.TokenService; | |||
import com.xueyi.common.security.utils.SecurityUtils; | |||
import com.xueyi.common.sms.configure.SmsProperties; | |||
import com.xueyi.system.api.model.LoginUser; | |||
import com.xueyi.system.api.sms.domain.vo.SmsReqEntity; | |||
import com.xueyi.system.api.sms.feign.RemoteSmsService; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import com.xueyi.tenant.api.tenant.feign.RemoteTenantService; | |||
import org.slf4j.Logger; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.data.redis.core.RedisTemplate; | |||
import org.springframework.web.bind.annotation.DeleteMapping; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.validation.Valid; | |||
import java.util.concurrent.TimeUnit; | |||
/** | |||
* token 控制 | |||
@@ -28,12 +45,36 @@ import javax.servlet.http.HttpServletRequest; | |||
@RestController | |||
public class TokenController { | |||
private final Logger log = org.slf4j.LoggerFactory.getLogger(this.getClass()); | |||
@Autowired | |||
private TokenService tokenService; | |||
@Autowired | |||
private SysLoginService sysLoginService; | |||
@Autowired | |||
private RemoteSmsService smsService; | |||
@Autowired | |||
private RemoteSmsService remoteSmsService; | |||
@Autowired | |||
private SmsProperties smsProperties; | |||
@Autowired | |||
private RedisService redisService; | |||
@Autowired | |||
private RemoteTenantService tenantService; | |||
@Autowired | |||
private RedisTemplate<String, String> redisTemplate; | |||
private final String REDIS_LOGIN_CODE_PIX = "saas:login:code:"; | |||
@PostMapping("login") | |||
public AjaxResult login(@RequestBody LoginBody form) { | |||
// 用户登录 | |||
@@ -42,6 +83,25 @@ public class TokenController { | |||
return AjaxResult.success(tokenService.createToken(userInfo)); | |||
} | |||
@PostMapping("phoneLogin") | |||
public AjaxResult loginByPhone(@Valid @RequestBody PhoneLoginBody form) { | |||
/*if (!RedisUtil.existed(REDIS_LOGIN_CODE_PIX + form.getPhone())) { | |||
return AjaxResult.error("手机号输入错误或验证码已过期"); | |||
} else { | |||
Integer code = (Integer) RedisUtil.getVal(REDIS_LOGIN_CODE_PIX + form.getPhone()); | |||
if (null != code && !form.getCode().equals(code.toString())) { | |||
return AjaxResult.error("验证码输入不正确"); | |||
} | |||
}*/ | |||
// 用户手机号验证登录 | |||
LoginUser userInfo = sysLoginService.loginByPhone(form.getPhone()); | |||
if (null == userInfo) { | |||
return AjaxResult.error("手机号不正确,清查验"); | |||
} | |||
// 获取登录token | |||
return AjaxResult.success(tokenService.createToken(userInfo)); | |||
} | |||
@DeleteMapping("logout") | |||
public AjaxResult logout(HttpServletRequest request) { | |||
String token = SecurityUtils.getToken(request); | |||
@@ -76,4 +136,35 @@ public class TokenController { | |||
sysLoginService.register(registerBody); | |||
return AjaxResult.success(); | |||
} | |||
@GetMapping("validCode") | |||
public R validCode(@RequestParam String phone) { | |||
R<SysStaffPo> staff = tenantService.existStaff(phone, SecurityConstants.INNER); | |||
if (staff.getData() == null) { | |||
return R.fail("手机号不存在,请查验"); | |||
} | |||
SmsReqEntity smsReqEntity = new SmsReqEntity(); | |||
smsReqEntity.setPhone(phone); | |||
String str = StrUtil.generateCode(); | |||
if (StringUtils.isEmpty(phone)){ | |||
return R.fail("手机号为空"); | |||
} else { | |||
if (redisService.hasKey(REDIS_LOGIN_CODE_PIX + phone)) { | |||
return R.fail("之前请求的验证码并未失效,请查看短信或稍后重试"); | |||
} else { | |||
redisTemplate.opsForValue().setIfAbsent(REDIS_LOGIN_CODE_PIX + phone, str, 5, TimeUnit.MINUTES); | |||
} | |||
smsReqEntity.setTemplate(smsProperties.getCodeTemplate()); | |||
JSONObject map = new JSONObject(); | |||
map.put("code", str); | |||
smsReqEntity.setDataMap(map.toJSONString()); | |||
log.info("发送验证码成功,手机号:{},验证码:{}, sendReq:{}", phone, str, smsReqEntity.toJson().toJSONString()); | |||
remoteSmsService.sendSms(smsReqEntity); | |||
} | |||
return R.ok("验证码发送成功,请查看短信"); | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
package com.xueyi.auth.form; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotEmpty; | |||
/** | |||
* 用户登录对象 | |||
* | |||
* @author xueyi | |||
*/ | |||
@Data | |||
public class PhoneLoginBody { | |||
@NotEmpty(message = "手机号不能为空") | |||
private String phone; | |||
private String code; | |||
} |
@@ -29,6 +29,7 @@ import org.springframework.stereotype.Component; | |||
@Component | |||
public class SysLoginService { | |||
@Autowired | |||
private RemoteLogService remoteLogService; | |||
@@ -165,4 +166,15 @@ public class SysLoginService { | |||
} | |||
remoteLogService.saveLoginInfo(loginInfo, enterpriseId, sourceName, SecurityConstants.INNER); | |||
} | |||
public LoginUser loginByPhone(String phone) { | |||
R<LoginUser> loginInfoResult = remoteLoginService.getLoginInfoInnerByPhone(phone, SecurityConstants.INNER); | |||
if (ObjectUtil.isNull(loginInfoResult.getData())) { | |||
AjaxResult.warn("手机号可能输错,请查证后重试!"); | |||
} | |||
return loginInfoResult.getData(); | |||
} | |||
} |
@@ -27,3 +27,4 @@ spring: | |||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} | |||
- application-secret-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} | |||
- application-datasource-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} | |||
- ali-sms.yml |
@@ -0,0 +1 @@ | |||
com.xueyi.common.web.entity.domain.mapper.DeviceTenantMergeMapper |
@@ -106,6 +106,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
Map<String, Object> rspMap = new HashMap<>(); | |||
rspMap.put("access_token", JwtUtil.createToken(claimsMap)); | |||
rspMap.put("expires_in", getTacitExpireTime()); | |||
rspMap.put("tenant_id", enterpriseId); | |||
return rspMap; | |||
} | |||
@@ -141,6 +142,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
return redisService.getCacheMapValue(getTokenKey(userKey), SecurityConstants.BaseSecurity.ENTERPRISE.getCode()); | |||
} | |||
} catch (Exception ignored) { | |||
System.err.println(ignored.getMessage());; | |||
} | |||
return null; | |||
} | |||
@@ -177,6 +179,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
return redisService.getCacheMapValue(getTokenKey(userKey), SecurityConstants.BaseSecurity.USER.getCode()); | |||
} | |||
} catch (Exception ignored) { | |||
System.err.println(ignored.getMessage());; | |||
} | |||
return null; | |||
} | |||
@@ -213,6 +216,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
return redisService.getCacheMapValue(getTokenKey(userKey), SecurityConstants.BaseSecurity.LOGIN_USER.getCode()); | |||
} | |||
} catch (Exception ignored) { | |||
System.err.println(ignored.getMessage());; | |||
} | |||
return null; | |||
} | |||
@@ -260,6 +264,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
return redisService.getCacheMapValue(getTokenKey(userKey), SecurityConstants.BaseSecurity.SOURCE.getCode()); | |||
} | |||
} catch (Exception ignored) { | |||
System.err.println(ignored.getMessage());; | |||
} | |||
return null; | |||
} | |||
@@ -297,6 +302,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
return redisService.getCacheMapValue(getTokenKey(userKey), SecurityConstants.BaseSecurity.EXPIRE_TIME.getCode()); | |||
} | |||
} catch (Exception ignored) { | |||
System.err.println(ignored.getMessage());; | |||
} | |||
return null; | |||
} | |||
@@ -329,7 +335,7 @@ public class BaseTokenService<User, LoginUser extends BaseLoginUser<User>> { | |||
*/ | |||
public void refreshToken(HttpServletRequest request) { | |||
String token = SecurityUtils.getToken(request); | |||
refreshToken(SecurityUtils.getToken(request)); | |||
refreshToken(token); | |||
} | |||
/** | |||
@@ -4,9 +4,6 @@ import com.xueyi.common.redis.service.RedisService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Component; | |||
import java.util.HashSet; | |||
import java.util.Set; | |||
/** | |||
* spring sms 工具类 | |||
* | |||
@@ -19,6 +16,7 @@ public class SmsService { | |||
@Autowired | |||
private RedisService redisService; | |||
/** | |||
* @Author yangkai | |||
* @Description //发送验证码,取时间戳后四位 | |||
@@ -27,7 +25,6 @@ public class SmsService { | |||
* @return | |||
**/ | |||
public String sendCode(){ | |||
Set<String> codes = new HashSet<>(); | |||
String code = ""; | |||
//确保不重复 | |||
while(true) { | |||
@@ -1,6 +1,7 @@ | |||
package com.xueyi.system.authority.controller; | |||
import com.xueyi.common.cache.utils.SourceUtil; | |||
import com.xueyi.common.core.constant.basic.SecurityConstants; | |||
import com.xueyi.common.core.context.SecurityContextHolder; | |||
import com.xueyi.common.core.utils.core.CollUtil; | |||
import com.xueyi.common.core.utils.core.ObjectUtil; | |||
@@ -14,6 +15,8 @@ import com.xueyi.system.api.model.Source; | |||
import com.xueyi.system.api.organize.domain.dto.SysEnterpriseDto; | |||
import com.xueyi.system.api.organize.domain.dto.SysUserDto; | |||
import com.xueyi.system.authority.service.ISysLoginService; | |||
import com.xueyi.tenant.api.tenant.domain.po.TeTenantPo; | |||
import com.xueyi.tenant.api.tenant.feign.RemoteTenantService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PathVariable; | |||
@@ -92,4 +95,69 @@ public class SysLoginController extends BasisController { | |||
loginUser.setRouteURL(routeMap); | |||
return R.ok(loginUser); | |||
} | |||
@Autowired | |||
RemoteTenantService tenantService; | |||
/** | |||
* 获取登录信息 | 内部调用, 手机号登录 | |||
*/ | |||
@InnerAuth | |||
@GetMapping("/inner/loginByPhone/{phone}") | |||
public R<LoginUser> getLoginInfoByMobile(@PathVariable("phone") String phone) { | |||
R<TeTenantPo> po = tenantService.tenant(phone, SecurityConstants.INNER); | |||
if (po.getData() == null) | |||
return R.fail("指定手机号不存在记录"); | |||
SysEnterpriseDto enterprise = loginService.loginByEnterpriseName(po.getData().getName()); | |||
// 不存在直接返回空数据 | 与网络调用错误区分 | |||
if (ObjectUtil.isNull(enterprise)) | |||
return R.ok(null, "企业账号不存在"); | |||
SecurityContextHolder.setEnterpriseId(enterprise.getId().toString()); | |||
SecurityContextHolder.setIsLessor(enterprise.getIsLessor()); | |||
Source source = SourceUtil.getSourceCache(enterprise.getStrategyId()); | |||
// 不存在直接返回空数据 | 与网络调用错误区分 | |||
if (ObjectUtil.isNull(source)) | |||
return R.ok(null, "数据源不存在"); | |||
SecurityContextHolder.setSourceName(source.getMaster()); | |||
LoginUser loginUser = new LoginUser(); | |||
loginUser.setEnterprise(enterprise); | |||
loginUser.setEnterpriseId(enterprise.getId()); | |||
loginUser.setEnterpriseName(enterprise.getName()); | |||
loginUser.setIsLessor(enterprise.getIsLessor()); | |||
loginUser.setSource(source); | |||
loginUser.setSourceName(source.getMaster()); | |||
SysUserDto user = loginService.loginByStaff(phone); | |||
if (ObjectUtil.isNull(user)) | |||
return R.ok(null, "用户账号不存在"); | |||
SecurityContextHolder.setUserType(user.getUserType()); | |||
// 角色权限标识 | |||
Set<String> roles = loginService.getRolePermission(user.getRoles(), user.getUserType()); | |||
// 角色Id集合 | |||
Set<Long> roleIds = CollUtil.isNotEmpty(user.getRoles()) | |||
? user.getRoles().stream().map(SysRoleDto::getId).collect(Collectors.toSet()) | |||
: new HashSet<>(); | |||
// 菜单权限标识 | |||
Set<String> permissions = loginService.getMenuPermission(roleIds, user.getUserType()); | |||
// 权限范围 | |||
DataScope dataScope = loginService.getDataScope(user.getRoles(), user); | |||
dataScope.setRoles(roles); | |||
dataScope.setRoleIds(roleIds); | |||
dataScope.setPermissions(permissions); | |||
// 路由路径集合 | |||
Map<String, String> routeMap = loginService.getMenuRouteMap(roleIds, user.getUserType()); | |||
loginUser.setUser(user); | |||
loginUser.setUserId(user.getId()); | |||
loginUser.setUserName(user.getUserName()); | |||
loginUser.setUserType(user.getUserType()); | |||
loginUser.setScope(dataScope); | |||
loginUser.setRouteURL(routeMap); | |||
return R.ok(loginUser); | |||
} | |||
} |
@@ -68,4 +68,6 @@ public interface ISysLoginService { | |||
* @return 路由路径集合 | |||
*/ | |||
Map<String, String> getMenuRouteMap(Set<Long> roleIds, String userType); | |||
SysUserDto loginByStaff(String phone); | |||
} |
@@ -1,17 +1,28 @@ | |||
package com.xueyi.system.authority.service.impl; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.xueyi.common.core.constant.basic.SqlConstants; | |||
import com.xueyi.common.core.constant.system.AuthorityConstants; | |||
import com.xueyi.common.core.utils.core.StrUtil; | |||
import com.xueyi.common.security.utils.SecurityUtils; | |||
import com.xueyi.common.web.entity.domain.SqlField; | |||
import com.xueyi.system.api.authority.domain.dto.SysRoleDto; | |||
import com.xueyi.system.api.model.DataScope; | |||
import com.xueyi.system.api.organize.domain.dto.SysDeptDto; | |||
import com.xueyi.system.api.organize.domain.dto.SysEnterpriseDto; | |||
import com.xueyi.system.api.organize.domain.dto.SysPostDto; | |||
import com.xueyi.system.api.organize.domain.dto.SysUserDto; | |||
import com.xueyi.system.api.organize.domain.model.SysUserConverter; | |||
import com.xueyi.system.api.staff.domain.po.DmStaffPo; | |||
import com.xueyi.system.authority.service.ISysLoginService; | |||
import com.xueyi.system.authority.service.ISysMenuService; | |||
import com.xueyi.system.organize.service.*; | |||
import com.xueyi.system.organize.mapper.SysUserMapper; | |||
import com.xueyi.system.organize.service.ISysDeptService; | |||
import com.xueyi.system.organize.service.ISysEnterpriseService; | |||
import com.xueyi.system.organize.service.ISysOrganizeService; | |||
import com.xueyi.system.organize.service.ISysPostService; | |||
import com.xueyi.system.organize.service.ISysUserService; | |||
import com.xueyi.system.staff.mapper.DmStaffMapper; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -44,6 +55,9 @@ public class SysLoginServiceImpl implements ISysLoginService { | |||
@Autowired | |||
ISysMenuService menuService; | |||
@Autowired | |||
DmStaffMapper dmStaffMapper; | |||
@Autowired | |||
private ISysOrganizeService organizeService; | |||
@@ -220,4 +234,21 @@ public class SysLoginServiceImpl implements ISysLoginService { | |||
? menuService.getRouteMap() | |||
: menuService.getRouteMap(roleIds); | |||
} | |||
@Autowired | |||
SysUserMapper userMapper; | |||
@Autowired | |||
SysUserConverter sysUserConverter; | |||
@Override | |||
public SysUserDto loginByStaff(String phone) { | |||
DmStaffPo po = dmStaffMapper.selectOne(Wrappers.<DmStaffPo>query().lambda().eq(DmStaffPo::getPhone, phone).last(SqlConstants.LIMIT_ONE)); | |||
if (po == null) { | |||
return null; | |||
} | |||
SqlField field = new SqlField(SqlConstants.OperateType.EQ, "tenant_id", po.getTenantId()); | |||
SysUserDto dto = sysUserConverter.mapperDto(userMapper.selectByField(field)) ; | |||
return dto; | |||
} | |||
} |
@@ -5,7 +5,6 @@ import com.alibaba.excel.ExcelWriter; | |||
import com.alibaba.excel.annotation.ExcelProperty; | |||
import com.alibaba.excel.metadata.data.WriteCellData; | |||
import com.alibaba.excel.util.BooleanUtils; | |||
import com.alibaba.excel.util.ListUtils; | |||
import com.alibaba.excel.write.handler.CellWriteHandler; | |||
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; | |||
import com.alibaba.excel.write.metadata.WriteSheet; | |||
@@ -13,7 +12,6 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; | |||
import com.alibaba.excel.write.metadata.style.WriteFont; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.xueyi.common.core.utils.core.ObjectUtil; | |||
import com.xueyi.common.core.utils.core.StrUtil; | |||
import com.xueyi.common.core.web.result.AjaxResult; | |||
import com.xueyi.common.core.web.validate.V_A; | |||
import com.xueyi.common.core.web.validate.V_E; | |||
@@ -123,38 +121,6 @@ public class DmEmpAttendanceController extends BaseController<DmEmpAttendanceQue | |||
@Autowired | |||
private SysDeptMapper deptMapper; | |||
private List<DmEmpAttendancePo> data() { | |||
List<DmEmpAttendancePo> list = ListUtils.newArrayList(); | |||
Date d = new Date(); | |||
for (int i = 0; i < 10; i++) { | |||
DmEmpAttendancePo data = new DmEmpAttendancePo(); | |||
data.setDateStr(DateUtils.formatDate(d, "YYYY-MM-dd")); | |||
data.setUserId(System.currentTimeMillis()); | |||
data.setUserName(StrUtil.generateCode()); | |||
data.setCheckInTime(new Date()); | |||
data.setCheckOutTime(new Date()); | |||
data.setWorkDuration(9288); | |||
list.add(data); | |||
} | |||
return list; | |||
} | |||
private List<List<String>> head() { | |||
List<List<String>> list = new ArrayList<List<String>>(); | |||
List<String> head0 = new ArrayList<String>(); | |||
head0.add("字符串" + System.currentTimeMillis()); | |||
List<String> head1 = new ArrayList<String>(); | |||
head1.add("数字" + System.currentTimeMillis()); | |||
List<String> head2 = new ArrayList<String>(); | |||
head2.add("日期" + System.currentTimeMillis()); | |||
list.add(head0); | |||
list.add(head1); | |||
list.add(head2); | |||
return list; | |||
} | |||
/** | |||
* 员工考勤导出 | |||
*/ | |||
@@ -174,7 +140,7 @@ public class DmEmpAttendanceController extends BaseController<DmEmpAttendanceQue | |||
Date end = null; | |||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()) { | |||
QueryWrapper<DmEmpAttendancePo> query = new QueryWrapper<DmEmpAttendancePo>(); | |||
QueryWrapper<DmEmpAttendancePo> query = new QueryWrapper<>(); | |||
if (dmEmpAttendance != null && dmEmpAttendance.getETimestamp() != null &&dmEmpAttendance.getETimestamp()>0) { | |||
start = DateUtils.parseLongToDate(dmEmpAttendance.getSTimestamp()); | |||
end = DateUtils.parseLongToDate(dmEmpAttendance.getETimestamp()); | |||
@@ -188,6 +154,14 @@ public class DmEmpAttendanceController extends BaseController<DmEmpAttendanceQue | |||
if (dmEmpAttendance != null && dmEmpAttendance.getDeptId() !=null && dmEmpAttendance.getDeptId() > 0) { | |||
query.eq("dept_id", dmEmpAttendance.getDeptId()); | |||
} | |||
if (dmEmpAttendance != null && dmEmpAttendance.getUserType() != null ) { | |||
query.eq("user_type", dmEmpAttendance.getUserType()); | |||
} | |||
if (dmEmpAttendance != null && dmEmpAttendance.getUserName() != null ) { | |||
query.like("user_name", dmEmpAttendance.getUserName()); | |||
} | |||
List<DmEmpAttendancePo> list = mapper.selectList(query); | |||
List<List<String>> re = new ArrayList<>(); | |||
if (list != null && list.size() > 0) { | |||
@@ -50,6 +50,7 @@ public class DmEmpAttendancePo extends TBaseEntity { | |||
/** 人员名 */ | |||
@ExcelProperty("人员名") | |||
protected String userName; | |||
/** 人员ID */ | |||
@@ -0,0 +1,13 @@ | |||
package com.xueyi.system.staff.graphql; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* @author yk | |||
* @description | |||
* @date 2023-12-25 19:55 | |||
*/ | |||
@Service | |||
public class VisitorGraphQLQuery { | |||
} |
@@ -4,10 +4,14 @@ import com.xueyi.system.staff.domain.dto.DmEmpAttendanceDto; | |||
import com.xueyi.system.staff.domain.query.DmEmpAttendanceQuery; | |||
import com.xueyi.common.web.entity.manager.IBaseManager; | |||
import java.util.List; | |||
/** | |||
* 员工考勤管理 数据封装层 | |||
* | |||
* @author xueyi | |||
*/ | |||
public interface IDmEmpAttendanceManager extends IBaseManager<DmEmpAttendanceQuery, DmEmpAttendanceDto> { | |||
@Override | |||
List<DmEmpAttendanceDto> selectList(DmEmpAttendanceQuery query); | |||
} |
@@ -1,6 +1,10 @@ | |||
package com.xueyi.system.staff.manager.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.xueyi.common.core.utils.core.ObjectUtil; | |||
import com.xueyi.common.web.entity.manager.impl.BaseManagerImpl; | |||
import com.xueyi.common.web.utils.DateUtils; | |||
import com.xueyi.system.staff.domain.dto.DmEmpAttendanceDto; | |||
import com.xueyi.system.staff.domain.model.DmEmpAttendanceConverter; | |||
import com.xueyi.system.staff.domain.po.DmEmpAttendancePo; | |||
@@ -9,6 +13,9 @@ import com.xueyi.system.staff.manager.IDmEmpAttendanceManager; | |||
import com.xueyi.system.staff.mapper.DmEmpAttendanceMapper; | |||
import org.springframework.stereotype.Component; | |||
import java.text.ParseException; | |||
import java.util.List; | |||
/** | |||
* 员工考勤管理 数据封装层处理 | |||
* | |||
@@ -16,4 +23,35 @@ import org.springframework.stereotype.Component; | |||
*/ | |||
@Component | |||
public class DmEmpAttendanceManager extends BaseManagerImpl<DmEmpAttendanceQuery, DmEmpAttendanceDto, DmEmpAttendancePo, DmEmpAttendanceMapper, DmEmpAttendanceConverter> implements IDmEmpAttendanceManager { | |||
@Override | |||
public List<DmEmpAttendanceDto> selectList(DmEmpAttendanceQuery query) { | |||
return super.selectList(query); | |||
} | |||
@Override | |||
protected LambdaQueryWrapper<DmEmpAttendancePo> selectListQuery(DmEmpAttendanceQuery query) { | |||
return Wrappers.<DmEmpAttendancePo>query(query).lambda() | |||
.func(i -> { | |||
if (ObjectUtil.isNotNull(query.getETimestamp()) && ObjectUtil.isNotNull(query.getSTimestamp())){ | |||
// 日期范围查询,时间戳转yyyy-MM-dd格式 | |||
try { | |||
String endTime = DateUtils.praseLongToDateString(query.getETimestamp()); | |||
String startTime = DateUtils.praseLongToDateString(query.getSTimestamp()); | |||
endTime = (endTime != null ? endTime.substring(0,10):""); | |||
startTime = (startTime != null ? startTime.substring(0,10):""); | |||
i.apply("date_str between '{0}' and '{1}'", startTime, endTime); | |||
} catch (ParseException e) { | |||
throw new RuntimeException(e); | |||
} | |||
} | |||
}) | |||
.func(i -> { | |||
if (ObjectUtil.isNotNull(query.getUserName())) { | |||
i.apply("user_name like '%{0}%'", query.getUserName()); | |||
} | |||
}); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
schema { | |||
query: Query | |||
mutation: Mutation | |||
} | |||
type Query{ | |||
} | |||
type Mutation{ | |||
} |
@@ -0,0 +1,4 @@ | |||
type R{ | |||
code: Int! | |||
msg: String | |||
} |
@@ -0,0 +1,3 @@ | |||
extend type Query{ | |||
getVisitorList() | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.xueyi.tenant.tenant.controller; | |||
import cn.hutool.core.text.CharSequenceUtil; | |||
import com.xueyi.common.core.constant.basic.BaseConstants; | |||
import com.xueyi.common.core.constant.system.OrganizeConstants; | |||
import com.xueyi.common.core.utils.core.CollUtil; | |||
@@ -16,12 +17,24 @@ import com.xueyi.common.security.annotation.RequiresPermissions; | |||
import com.xueyi.common.security.auth.Auth; | |||
import com.xueyi.common.web.entity.controller.BaseController; | |||
import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import com.xueyi.tenant.api.tenant.domain.po.TeTenantPo; | |||
import com.xueyi.tenant.api.tenant.domain.query.TeTenantQuery; | |||
import com.xueyi.tenant.tenant.domain.model.TeTenantRegister; | |||
import com.xueyi.tenant.tenant.mapper.SysStaffMapper; | |||
import com.xueyi.tenant.tenant.mapper.TeTenantMapper; | |||
import com.xueyi.tenant.tenant.service.ITeTenantService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import org.springframework.web.bind.annotation.DeleteMapping; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PathVariable; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.PutMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.io.Serializable; | |||
@@ -42,6 +55,12 @@ public class TeTenantController extends BaseController<TeTenantQuery, TeTenantDt | |||
return "租户"; | |||
} | |||
@Autowired | |||
private TeTenantMapper teTenantMapper; | |||
@Autowired | |||
private SysStaffMapper staffMapper; | |||
/** | |||
* 租户新增 | 内部调用 | |||
*/ | |||
@@ -57,6 +76,21 @@ public class TeTenantController extends BaseController<TeTenantQuery, TeTenantDt | |||
R<List<TeTenantDto>> tenantList() { | |||
return R.ok(super.baseService.selectList(new TeTenantQuery())); | |||
} | |||
@InnerAuth | |||
@GetMapping("/one") | |||
R<TeTenantPo> tenant(@RequestParam("phone") String phone) { | |||
TeTenantPo po = teTenantMapper.selectByPhone(phone); | |||
return R.ok(po); | |||
} | |||
@InnerAuth | |||
@GetMapping("/staff") | |||
R<SysStaffPo> staff(@RequestParam("phone") String phone) { | |||
SysStaffPo po = staffMapper.selectByPhone(phone); | |||
return R.ok(po); | |||
} | |||
/** | |||
* 查询租户列表 | |||
*/ | |||
@@ -170,10 +204,10 @@ public class TeTenantController extends BaseController<TeTenantQuery, TeTenantDt | |||
if (baseService.checkIsDefault(idList.get(i))) | |||
idList.remove(i); | |||
if (CollUtil.isEmpty(idList)) { | |||
warn(StrUtil.format("删除失败,默认{}不允许删除!", getNodeName())); | |||
warn(CharSequenceUtil.format("删除失败,默认{}不允许删除!", getNodeName())); | |||
} else if (idList.size() != size) { | |||
baseService.deleteByIds(idList); | |||
warn(StrUtil.format("默认{}不允许删除,其余{}删除成功!", getNodeName(), getNodeName())); | |||
warn(CharSequenceUtil.format("默认{}不允许删除,其余{}删除成功!", getNodeName(), getNodeName())); | |||
} | |||
} | |||
@@ -0,0 +1,20 @@ | |||
package com.xueyi.tenant.tenant.mapper; | |||
import com.xueyi.common.datasource.annotation.Master; | |||
import com.xueyi.common.web.annotation.TenantIgnore; | |||
import com.xueyi.common.web.entity.mapper.BaseMapper; | |||
import com.xueyi.tenant.api.tenant.domain.dto.SysStaffDto; | |||
import com.xueyi.tenant.api.tenant.domain.po.SysStaffPo; | |||
import com.xueyi.tenant.api.tenant.domain.query.SysStaffQuery; | |||
import org.apache.ibatis.annotations.Param; | |||
/** | |||
* 租户管理 数据层 | |||
* | |||
* @author xueyi | |||
*/ | |||
@Master | |||
public interface SysStaffMapper extends BaseMapper<SysStaffQuery, SysStaffDto, SysStaffPo> { | |||
@TenantIgnore(tenantLine = true) | |||
SysStaffPo selectByPhone(@Param("phone") String phone); | |||
} |
@@ -1,10 +1,12 @@ | |||
package com.xueyi.tenant.tenant.mapper; | |||
import com.xueyi.common.datasource.annotation.Master; | |||
import com.xueyi.common.web.annotation.TenantIgnore; | |||
import com.xueyi.common.web.entity.mapper.BaseMapper; | |||
import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
import com.xueyi.tenant.api.tenant.domain.po.TeTenantPo; | |||
import com.xueyi.tenant.api.tenant.domain.query.TeTenantQuery; | |||
import org.apache.ibatis.annotations.Param; | |||
/** | |||
* 租户管理 数据层 | |||
@@ -13,4 +15,6 @@ import com.xueyi.tenant.api.tenant.domain.query.TeTenantQuery; | |||
*/ | |||
@Master | |||
public interface TeTenantMapper extends BaseMapper<TeTenantQuery, TeTenantDto, TeTenantPo> { | |||
@TenantIgnore(tenantLine = true) | |||
TeTenantPo selectByPhone(@Param("phone") String phone); | |||
} |
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.xueyi.tenant.tenant.mapper.SysStaffMapper"> | |||
<select id="selectByPhone" resultType="com.xueyi.tenant.api.tenant.domain.po.SysStaffPo"> | |||
select tenant_id from dm_staff where phone = #{phone} and del_flag = 0 limit 1 | |||
</select> | |||
</mapper> |
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.xueyi.tenant.tenant.mapper.TeTenantMapper"> | |||
<select id="selectByPhone" resultType="com.xueyi.tenant.api.tenant.domain.po.TeTenantPo" parameterType="Object"> | |||
select * from te_tenant where id = (select tenant_id from dm_staff where phone = #{phone} and del_flag = 0 limit 1) | |||
</select> | |||
</mapper> |