Commit 322c5b2d authored by gaoguangjing's avatar gaoguangjing

租户ID类型修改

parent 73260440
...@@ -161,7 +161,7 @@ public class UserController implements IBaseController { ...@@ -161,7 +161,7 @@ public class UserController implements IBaseController {
@RequestParam(required = false) Long btRegisterChannelId, @RequestParam(required = false) Long btRegisterChannelId,
@RequestParam(required = false) String dimension, @RequestParam(required = false) String dimension,
@RequestParam(name = "click_id", required = false) String clickId, @RequestParam(name = "click_id", required = false) String clickId,
@RequestParam(required = false, defaultValue = "defualt") String tenantId, @RequestParam(required = false) Integer tenantId,
HttpServletRequest request) { HttpServletRequest request) {
log.info("login/fastV1 -> channelId:{},ZappChennel:{},createdFrom:{},key:{},btRegisterChannelId:{},dimension:{},clickId:{}", channelId, appChannel, createdFrom, key, btRegisterChannelId, dimension, clickId); log.info("login/fastV1 -> channelId:{},ZappChennel:{},createdFrom:{},key:{},btRegisterChannelId:{},dimension:{},clickId:{}", channelId, appChannel, createdFrom, key, btRegisterChannelId, dimension, clickId);
return loginFast(channelId, appChannel, createdFrom, key, btRegisterChannelId, dimension, clickId, tenantId, request); return loginFast(channelId, appChannel, createdFrom, key, btRegisterChannelId, dimension, clickId, tenantId, request);
...@@ -181,7 +181,7 @@ public class UserController implements IBaseController { ...@@ -181,7 +181,7 @@ public class UserController implements IBaseController {
@RequestParam(required = false) Long btRegisterChannelId, @RequestParam(required = false) Long btRegisterChannelId,
@RequestParam(required = false) String dimension, @RequestParam(required = false) String dimension,
@RequestParam(name = "click_id", required = false) String clickId, @RequestParam(name = "click_id", required = false) String clickId,
@RequestParam(required = false, defaultValue = "defualt") String tenantId, @RequestParam(required = false) Integer tenantId,
HttpServletRequest request) { HttpServletRequest request) {
Map<String, JsonResult> validMap = getHeaderParam(request); Map<String, JsonResult> validMap = getHeaderParam(request);
log.info("login/fast -> channelId:{},appChannel:{},createdFrom:{},btRegisterChannelId:{},key:{},dimension:{},clickId:{}", channelId, appChannel, createdFrom, btRegisterChannelId, key, dimension, clickId); log.info("login/fast -> channelId:{},appChannel:{},createdFrom:{},btRegisterChannelId:{},key:{},dimension:{},clickId:{}", channelId, appChannel, createdFrom, btRegisterChannelId, key, dimension, clickId);
......
...@@ -303,7 +303,7 @@ public class AppController implements IBaseController { ...@@ -303,7 +303,7 @@ public class AppController implements IBaseController {
@RequestParam(required = false, defaultValue = "1") Long registerFrom, @RequestParam(required = false, defaultValue = "1") Long registerFrom,
@RequestParam(required = false, defaultValue = "1") Long channelId, @RequestParam(required = false, defaultValue = "1") Long channelId,
@RequestParam(required = false, defaultValue = "") String appChannel, @RequestParam(required = false, defaultValue = "") String appChannel,
@RequestParam(required = false, defaultValue = "defualt") String tenantId, @RequestParam(required = false) Integer tenantId,
HttpServletRequest request) { HttpServletRequest request) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) { if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult(USER_ERROR_OR_PASSWORD_ERROR, null); return JsonResult.buildErrorStateResult(USER_ERROR_OR_PASSWORD_ERROR, null);
...@@ -317,7 +317,7 @@ public class AppController implements IBaseController { ...@@ -317,7 +317,7 @@ public class AppController implements IBaseController {
return JsonResult.buildErrorStateResult("登录失败", null); return JsonResult.buildErrorStateResult("登录失败", null);
} }
//校验租户ID tenantId //校验租户ID tenantId
if (!TenantUtil.TENANT_DEFAULT.equals(tenantId)) { if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && TenantUtil.TENANT_DEFAULT != tenantId) {
oauthLoginInfoService.addLoginInfo(user, tenantId); oauthLoginInfoService.addLoginInfo(user, tenantId);
} }
LoginProperties loginProperties = new LoginProperties("", 4, channelId, registerFrom, appChannel, null, "", tenantId); LoginProperties loginProperties = new LoginProperties("", 4, channelId, registerFrom, appChannel, null, "", tenantId);
......
...@@ -68,7 +68,7 @@ public class AppletController { ...@@ -68,7 +68,7 @@ public class AppletController {
*/ */
@Validated @Validated
@PostMapping("/login") @PostMapping("/login")
public JsonResult login(@RequestParam String appName, @RequestParam String openId, @RequestParam(required = false, defaultValue = "defualt") String tenantId, String utmSource) { public JsonResult login(@RequestParam String appName, @RequestParam String openId, @RequestParam(required = false) Integer tenantId, String utmSource) {
if (!containsAppName(appName)) { if (!containsAppName(appName)) {
throw new DataException("appName不合法"); throw new DataException("appName不合法");
} }
......
...@@ -11,5 +11,5 @@ public interface ILoginModule { ...@@ -11,5 +11,5 @@ public interface ILoginModule {
Boolean modifyPwd(VerifyTypeEnum type, String phoneNo, String password, String verify); Boolean modifyPwd(VerifyTypeEnum type, String phoneNo, String password, String verify);
LoginVo loginByUserId(Long channelId, String appChannel, Long userId, String tenantId); LoginVo loginByUserId(Long channelId, String appChannel, Long userId, Integer tenantId);
} }
...@@ -83,7 +83,7 @@ public class LoginModule implements ILoginModule { ...@@ -83,7 +83,7 @@ public class LoginModule implements ILoginModule {
} }
@Override @Override
public LoginVo loginByUserId(Long channelId, String appChannel, Long userId, String tenantId) { public LoginVo loginByUserId(Long channelId, String appChannel, Long userId, Integer tenantId) {
User user = userService.findById(userId); User user = userService.findById(userId);
if(null == user){ if(null == user){
throw new DataException("未找到此用户"); throw new DataException("未找到此用户");
......
...@@ -28,7 +28,7 @@ public class OauthClientDetailsEntity extends OptimisticEntity implements Serial ...@@ -28,7 +28,7 @@ public class OauthClientDetailsEntity extends OptimisticEntity implements Serial
@Id @Id
@Column(name = "CLIENT_ID", nullable = false) @Column(name = "CLIENT_ID", nullable = false)
private Long clientId; private Integer clientId;
@Column(name = "INSTITUTION_ID", nullable = false, length = 4) @Column(name = "INSTITUTION_ID", nullable = false, length = 4)
private String institutionId; private String institutionId;
...@@ -76,11 +76,11 @@ public class OauthClientDetailsEntity extends OptimisticEntity implements Serial ...@@ -76,11 +76,11 @@ public class OauthClientDetailsEntity extends OptimisticEntity implements Serial
private String smsRegisterTemplate; private String smsRegisterTemplate;
public Long getClientId() { public Integer getClientId() {
return clientId; return clientId;
} }
public void setClientId(Long clientId) { public void setClientId(Integer clientId) {
this.clientId = clientId; this.clientId = clientId;
} }
......
...@@ -36,5 +36,5 @@ public class LoginProperties { ...@@ -36,5 +36,5 @@ public class LoginProperties {
private Long merchantId = 1L; private Long merchantId = 1L;
private String merchantName = ""; private String merchantName = "";
//租户ID //租户ID
private String tenantId = "defualt"; private Integer tenantId;
} }
...@@ -12,5 +12,5 @@ import cn.quantgroup.xyqb.entity.middleoffice.AppletParamEntry; ...@@ -12,5 +12,5 @@ import cn.quantgroup.xyqb.entity.middleoffice.AppletParamEntry;
*/ */
public interface IAppletService { public interface IAppletService {
Long relevance(AppletParamEntry appletParamEntry); Long relevance(AppletParamEntry appletParamEntry);
LoginVo login(String appName, String openId, String tenantId, String utmSource); LoginVo login(String appName, String openId, Integer tenantId, String utmSource);
} }
...@@ -86,7 +86,7 @@ public class AppletServiceImpl implements IAppletService { ...@@ -86,7 +86,7 @@ public class AppletServiceImpl implements IAppletService {
} }
@Override @Override
public LoginVo login(String appName, String openId, String tenantId, String utmSource) { public LoginVo login(String appName, String openId, Integer tenantId, String utmSource) {
WechatUserInfo wechatUserInfo = iWeChatUserRepository.findByOpenIdAndAppName(openId, appName); WechatUserInfo wechatUserInfo = iWeChatUserRepository.findByOpenIdAndAppName(openId, appName);
if (null == wechatUserInfo) { if (null == wechatUserInfo) {
log.warn("未找到此用户,appName:{} ,openId:{}", appName, openId); log.warn("未找到此用户,appName:{} ,openId:{}", appName, openId);
...@@ -103,7 +103,7 @@ public class AppletServiceImpl implements IAppletService { ...@@ -103,7 +103,7 @@ public class AppletServiceImpl implements IAppletService {
throw new AppletException("未找到此用户","0401"); throw new AppletException("未找到此用户","0401");
} }
//校验租户ID tenantId //校验租户ID tenantId
if (!TenantUtil.TENANT_DEFAULT.equals(tenantId)) { if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && TenantUtil.TENANT_DEFAULT != tenantId) {
iOauthLoginInfoService.addLoginInfo(user, tenantId); iOauthLoginInfoService.addLoginInfo(user, tenantId);
} }
LoginVo loginVo = loginModule.loginByUserId(user.getRegisteredFrom(), LoginVo loginVo = loginModule.loginByUserId(user.getRegisteredFrom(),
......
...@@ -104,7 +104,7 @@ public class SessionServiceImpl implements ISessionService { ...@@ -104,7 +104,7 @@ public class SessionServiceImpl implements ISessionService {
* @return redisKey. 用来标识这个渠道的用户 Session 是否存在 * @return redisKey. 用来标识这个渠道的用户 Session 是否存在
*/ */
private String generateLoginPropertiesKey(Long userId, LoginProperties properties) { private String generateLoginPropertiesKey(Long userId, LoginProperties properties) {
if (properties.getTenantId() == null || TenantUtil.TENANT_DEFAULT.equals(properties.getTenantId())) { if (properties.getTenantId() == null || properties.getTenantId() == 0 || TenantUtil.TENANT_DEFAULT == properties.getTenantId()) {
return Constants.Session.USER_SESSION_ID_CACHE + ":" + userId + ":" + properties.getMerchantName() + ":" + properties.getCreatedFrom(); return Constants.Session.USER_SESSION_ID_CACHE + ":" + userId + ":" + properties.getMerchantName() + ":" + properties.getCreatedFrom();
}else { }else {
return Constants.Session.USER_SESSION_ID_CACHE + ":" + userId + ":" + properties.getMerchantName() + ":" + properties.getCreatedFrom() + ":" + properties.getTenantId(); return Constants.Session.USER_SESSION_ID_CACHE + ":" + userId + ":" + properties.getMerchantName() + ":" + properties.getCreatedFrom() + ":" + properties.getTenantId();
......
...@@ -80,7 +80,7 @@ public interface IUserService { ...@@ -80,7 +80,7 @@ public interface IUserService {
JsonResult loginFast(Long channelId, String appChannel, Long createdFrom, Long btRegisterChannelId, JsonResult loginFast(Long channelId, String appChannel, Long createdFrom, Long btRegisterChannelId,
String dimension, String clickId, HttpServletRequest request, Merchant merchant, String dimension, String clickId, HttpServletRequest request, Merchant merchant,
String phoneNo, String tenantId); String phoneNo, Integer tenantId);
/** /**
* 查询用户全量信息 * 查询用户全量信息
......
...@@ -334,7 +334,7 @@ public class UserServiceImpl implements IUserService, IBaseController { ...@@ -334,7 +334,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
@Override @Override
@RedisLock(prefix = "lock:login:fast:", key = "#this[8]") @RedisLock(prefix = "lock:login:fast:", key = "#this[8]")
public JsonResult loginFast(Long channelId, String appChannel, Long createdFrom, Long btRegisterChannelId, public JsonResult loginFast(Long channelId, String appChannel, Long createdFrom, Long btRegisterChannelId,
String dimension, String clickId, HttpServletRequest request, Merchant merchant, String phoneNo, String tenantId) { String dimension, String clickId, HttpServletRequest request, Merchant merchant, String phoneNo, Integer tenantId) {
Boolean register = false; Boolean register = false;
User user = findByPhoneWithCache(phoneNo); User user = findByPhoneWithCache(phoneNo);
if (user != null && !user.getEnable()) { if (user != null && !user.getEnable()) {
...@@ -389,7 +389,8 @@ public class UserServiceImpl implements IUserService, IBaseController { ...@@ -389,7 +389,8 @@ public class UserServiceImpl implements IUserService, IBaseController {
} catch (Exception e) { } catch (Exception e) {
log.info("神策埋点出现问题", e); log.info("神策埋点出现问题", e);
} }
if (!TenantUtil.TENANT_DEFAULT.equals(tenantId)) { //校验租户ID tenantId
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && TenantUtil.TENANT_DEFAULT != tenantId) {
oauthLoginInfoService.addLoginInfo(user, tenantId); oauthLoginInfoService.addLoginInfo(user, tenantId);
} }
LoginProperties loginProperties = new LoginProperties("", 3, channelId, createdFrom, appChannel, merchant.getId(), merchant.getName(), null); LoginProperties loginProperties = new LoginProperties("", 3, channelId, createdFrom, appChannel, merchant.getId(), merchant.getName(), null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment