Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
322c5b2d
Commit
322c5b2d
authored
Nov 15, 2021
by
gaoguangjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
租户ID类型修改
parent
73260440
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
19 additions
and
18 deletions
+19
-18
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+2
-2
AppController.java
...antgroup/xyqb/controller/internal/user/AppController.java
+2
-2
AppletController.java
...xyqb/controller/middleoffice/applet/AppletController.java
+1
-1
ILoginModule.java
...roup/xyqb/controller/middleoffice/login/ILoginModule.java
+1
-1
LoginModule.java
...group/xyqb/controller/middleoffice/login/LoginModule.java
+1
-1
OauthClientDetailsEntity.java
...a/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
+3
-3
LoginProperties.java
src/main/java/cn/quantgroup/xyqb/model/LoginProperties.java
+1
-1
IAppletService.java
...roup/xyqb/service/middleoffice/applet/IAppletService.java
+1
-1
AppletServiceImpl.java
...b/service/middleoffice/applet/impl/AppletServiceImpl.java
+2
-2
SessionServiceImpl.java
...ntgroup/xyqb/service/session/impl/SessionServiceImpl.java
+1
-1
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+1
-1
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+3
-2
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
322c5b2d
...
@@ -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
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/AppController.java
View file @
322c5b2d
...
@@ -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
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/applet/AppletController.java
View file @
322c5b2d
...
@@ -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不合法"
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/login/ILoginModule.java
View file @
322c5b2d
...
@@ -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
);
}
}
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/login/LoginModule.java
View file @
322c5b2d
...
@@ -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
(
"未找到此用户"
);
...
...
src/main/java/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
View file @
322c5b2d
...
@@ -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
;
}
}
...
...
src/main/java/cn/quantgroup/xyqb/model/LoginProperties.java
View file @
322c5b2d
...
@@ -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
;
}
}
src/main/java/cn/quantgroup/xyqb/service/middleoffice/applet/IAppletService.java
View file @
322c5b2d
...
@@ -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
);
}
}
src/main/java/cn/quantgroup/xyqb/service/middleoffice/applet/impl/AppletServiceImpl.java
View file @
322c5b2d
...
@@ -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
(),
...
...
src/main/java/cn/quantgroup/xyqb/service/session/impl/SessionServiceImpl.java
View file @
322c5b2d
...
@@ -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
();
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
322c5b2d
...
@@ -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
);
/**
/**
* 查询用户全量信息
* 查询用户全量信息
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
322c5b2d
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment