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
4a49f0f9
Commit
4a49f0f9
authored
Dec 06, 2021
by
高广京
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'KF-30' into 'master'
Kf 30 See merge request
!21
parents
5630a2df
c0bc8a3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
28 deletions
+25
-28
OauthLoginInfoServiceImpl.java
...oup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
+8
-0
UserCenterServiceImpl.java
...ntgroup/xyqb/service/user/impl/UserCenterServiceImpl.java
+10
-13
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+7
-15
No files found.
src/main/java/cn/quantgroup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
View file @
4a49f0f9
...
@@ -41,6 +41,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -41,6 +41,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
@Override
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
addLoginInfo
(
User
user
,
Integer
tenantId
)
{
public
void
addLoginInfo
(
User
user
,
Integer
tenantId
)
{
log
.
info
(
"=addLoginInfo= -> user={}, tenetId={}"
,
user
,
tenantId
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
tenantId
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetailsEntity
!=
null
)
{
if
(
oauthClientDetailsEntity
!=
null
)
{
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
...
@@ -61,6 +62,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -61,6 +62,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
Integer
partitionKey
=
atomicSequencer
.
partitionKey
(
customerId
);
Integer
partitionKey
=
atomicSequencer
.
partitionKey
(
customerId
);
productLoginEntity
=
EntityBuilder
.
productLogin
(
productId
,
institutionId
,
phoneNo
,
customerId
,
customerName
,
partitionKey
,
id
);
productLoginEntity
=
EntityBuilder
.
productLogin
(
productId
,
institutionId
,
phoneNo
,
customerId
,
customerName
,
partitionKey
,
id
);
productLoginEntity
.
setExtensionAccountId
(
userId
);
productLoginEntity
.
setExtensionAccountId
(
userId
);
log
.
info
(
"=save productLoginRepository= {}"
,
productLoginEntity
);
productLoginRepository
.
save
(
productLoginEntity
);
productLoginRepository
.
save
(
productLoginEntity
);
// 根据customerId 获取uuid
// 根据customerId 获取uuid
CustomerLoginEntity
customerLoginEntity
=
customerLoginRepository
.
findFirstByCustomerId
(
productLoginEntity
.
getCustomerId
());
CustomerLoginEntity
customerLoginEntity
=
customerLoginRepository
.
findFirstByCustomerId
(
productLoginEntity
.
getCustomerId
());
...
@@ -80,6 +82,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -80,6 +82,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
customerLogin
.
setModifiedDate
(
new
Date
());
customerLogin
.
setModifiedDate
(
new
Date
());
customerLogin
.
setCreatedBy
(
""
);
customerLogin
.
setCreatedBy
(
""
);
customerLogin
.
setModifiedBy
(
""
);
customerLogin
.
setModifiedBy
(
""
);
log
.
info
(
"=save customerLoginRepository= {}"
,
customerLogin
);
customerLoginRepository
.
save
(
customerLogin
);
customerLoginRepository
.
save
(
customerLogin
);
// 添加用户信息表
// 添加用户信息表
...
@@ -93,6 +96,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -93,6 +96,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
customerInfo
.
setModifiedDate
(
new
Date
());
customerInfo
.
setModifiedDate
(
new
Date
());
customerInfo
.
setCreatedBy
(
""
);
customerInfo
.
setCreatedBy
(
""
);
customerInfo
.
setModifiedBy
(
""
);
customerInfo
.
setModifiedBy
(
""
);
log
.
info
(
"=save customerInfoRepository= {}"
,
customerInfo
);
customerInfoRepository
.
save
(
customerInfo
);
customerInfoRepository
.
save
(
customerInfo
);
}
}
...
@@ -102,6 +106,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -102,6 +106,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
@Override
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
addRegisterInfo
(
User
user
,
AppletParamEntry
appletParamEntry
)
{
public
void
addRegisterInfo
(
User
user
,
AppletParamEntry
appletParamEntry
)
{
log
.
info
(
"=addRegisterInfo= -> User={}, AppletParamEntry={}"
,
user
,
appletParamEntry
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
appletParamEntry
.
getTenantId
());
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
appletParamEntry
.
getTenantId
());
if
(
oauthClientDetailsEntity
!=
null
)
{
if
(
oauthClientDetailsEntity
!=
null
)
{
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
...
@@ -121,6 +126,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -121,6 +126,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
Integer
partitionKey
=
atomicSequencer
.
partitionKey
(
customerId
);
Integer
partitionKey
=
atomicSequencer
.
partitionKey
(
customerId
);
productLoginEntity
=
EntityBuilder
.
productLogin
(
productId
,
institutionId
,
phoneNo
,
customerId
,
customerName
,
partitionKey
,
id
);
productLoginEntity
=
EntityBuilder
.
productLogin
(
productId
,
institutionId
,
phoneNo
,
customerId
,
customerName
,
partitionKey
,
id
);
productLoginEntity
.
setExtensionAccountId
(
userId
);
productLoginEntity
.
setExtensionAccountId
(
userId
);
log
.
info
(
"=save productLoginRepository= {}"
,
productLoginEntity
);
productLoginRepository
.
save
(
productLoginEntity
);
productLoginRepository
.
save
(
productLoginEntity
);
// 根据customerId 获取uuid
// 根据customerId 获取uuid
CustomerLoginEntity
customerLoginEntity
=
customerLoginRepository
.
findFirstByCustomerId
(
productLoginEntity
.
getCustomerId
());
CustomerLoginEntity
customerLoginEntity
=
customerLoginRepository
.
findFirstByCustomerId
(
productLoginEntity
.
getCustomerId
());
...
@@ -140,6 +146,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -140,6 +146,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
customerLogin
.
setModifiedDate
(
new
Date
());
customerLogin
.
setModifiedDate
(
new
Date
());
customerLogin
.
setCreatedBy
(
""
);
customerLogin
.
setCreatedBy
(
""
);
customerLogin
.
setModifiedBy
(
""
);
customerLogin
.
setModifiedBy
(
""
);
log
.
info
(
"=save customerLoginRepository= {}"
,
customerLogin
);
customerLoginRepository
.
save
(
customerLogin
);
customerLoginRepository
.
save
(
customerLogin
);
// 添加用户信息表
// 添加用户信息表
...
@@ -164,6 +171,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -164,6 +171,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
customerInfo
.
setModifiedDate
(
new
Date
());
customerInfo
.
setModifiedDate
(
new
Date
());
customerInfo
.
setCreatedBy
(
""
);
customerInfo
.
setCreatedBy
(
""
);
customerInfo
.
setModifiedBy
(
""
);
customerInfo
.
setModifiedBy
(
""
);
log
.
info
(
"=save customerInfoRepository= {}"
,
customerInfo
);
customerInfoRepository
.
save
(
customerInfo
);
customerInfoRepository
.
save
(
customerInfo
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserCenterServiceImpl.java
View file @
4a49f0f9
...
@@ -52,20 +52,17 @@ public class UserCenterServiceImpl implements UserCenterService {
...
@@ -52,20 +52,17 @@ public class UserCenterServiceImpl implements UserCenterService {
List
<
UserAttached
>
userAttacheds
=
userAttachedRepository
.
findByUserIdIn
(
userIds
);
List
<
UserAttached
>
userAttacheds
=
userAttachedRepository
.
findByUserIdIn
(
userIds
);
if
(!
tenantId
.
equals
(
TenantUtil
.
TENANT_DEFAULT
))
{
if
(!
tenantId
.
equals
(
TenantUtil
.
TENANT_DEFAULT
))
{
if
(
userAttacheds
!=
null
)
{
if
(
userAttacheds
!=
null
)
{
//租户ID校验
List
<
User
>
users
=
userRepository
.
findByIdIn
(
userIds
);
if
(!
TenantUtil
.
validationTenantIdIsNullOrZero
(
tenantId
))
{
List
<
User
>
productUsers
=
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
List
<
User
>
users
=
userRepository
.
findByIdIn
(
userIds
);
if
(
productUsers
!=
null
)
{
List
<
User
>
productUsers
=
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
List
<
Long
>
collect
=
productUsers
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
productUsers
!=
null
)
{
userAttacheds
.
forEach
(
a
->{
List
<
Long
>
collect
=
productUsers
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
collect
.
contains
(
a
.
getUserId
()))
{
userAttacheds
.
forEach
(
a
->{
resultProductUsers
.
add
(
a
);
if
(
collect
.
contains
(
a
.
getUserId
()))
{
}
resultProductUsers
.
add
(
a
);
});
}
});
}
return
resultProductUsers
;
}
}
return
resultProductUsers
;
}
}
}
else
{
}
else
{
List
<
User
>
users
=
userRepository
.
findByIdIn
(
userIds
);
List
<
User
>
users
=
userRepository
.
findByIdIn
(
userIds
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
4a49f0f9
...
@@ -113,7 +113,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
...
@@ -113,7 +113,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
Map
<
Long
,
String
>
userIdAndPhoneMap
=
Maps
.
newHashMap
();
Map
<
Long
,
String
>
userIdAndPhoneMap
=
Maps
.
newHashMap
();
List
<
User
>
users
=
userRepository
.
findByIdIn
(
userIds
);
List
<
User
>
users
=
userRepository
.
findByIdIn
(
userIds
);
//校验租户ID
//校验租户ID
if
(!
TenantUtil
.
validationTenantIdIsNullOrZero
(
tenantId
))
{
if
(!
tenantId
.
equals
(
tenantId
))
{
users
=
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
users
=
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
}
else
{
}
else
{
users
=
tenantService
.
validationTentIdByTentId
(
users
,
tenantId
);
users
=
tenantService
.
validationTentIdByTentId
(
users
,
tenantId
);
...
@@ -390,10 +390,8 @@ public class UserServiceImpl implements IUserService, IBaseController {
...
@@ -390,10 +390,8 @@ public class UserServiceImpl implements IUserService, IBaseController {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"神策埋点出现问题"
,
e
);
log
.
info
(
"神策埋点出现问题"
,
e
);
}
}
//校验租户ID tenantId
if
(!
TenantUtil
.
validationTenantIdIsNullOrZero
(
tenantId
))
{
oauthLoginInfoService
.
addLoginInfo
(
user
,
tenantId
);
oauthLoginInfoService
.
addLoginInfo
(
user
,
tenantId
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
3
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
3
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
AuthBean
session
=
sessionService
.
createSession
(
user
,
loginProperties
);
AuthBean
session
=
sessionService
.
createSession
(
user
,
loginProperties
);
session
.
setRegister
(
register
);
session
.
setRegister
(
register
);
...
@@ -507,23 +505,17 @@ public class UserServiceImpl implements IUserService, IBaseController {
...
@@ -507,23 +505,17 @@ public class UserServiceImpl implements IUserService, IBaseController {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
User
>
users
=
userRepository
.
findByIdIn
(
collect
);
List
<
User
>
users
=
userRepository
.
findByIdIn
(
collect
);
if
(!
tenantId
.
equals
(
TenantUtil
.
TENANT_DEFAULT
))
{
if
(!
tenantId
.
equals
(
TenantUtil
.
TENANT_DEFAULT
))
{
if
(!
TenantUtil
.
validationTenantIdIsNullOrZero
(
tenantId
))
{
return
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
return
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
}
}
else
{
}
else
{
return
tenantService
.
validationTentIdByTentId
(
users
,
tenantId
);
return
tenantService
.
validationTentIdByTentId
(
users
,
tenantId
);
}
}
return
users
;
}
else
{
//不是1 就是 uuids
}
else
{
//不是1 就是 uuids
List
<
User
>
users
=
userRepository
.
findByUuidIn
(
vals
);
List
<
User
>
users
=
userRepository
.
findByUuidIn
(
vals
);
if
(!
tenantId
.
equals
(
TenantUtil
.
TENANT_DEFAULT
))
{
if
(!
tenantId
.
equals
(
TenantUtil
.
TENANT_DEFAULT
))
{
if
(!
TenantUtil
.
validationTenantIdIsNullOrZero
(
tenantId
))
{
return
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
return
tenantService
.
selectUsersByTenantId
(
users
,
tenantId
);
}
else
{
}
else
{
return
tenantService
.
validationTentIdByTentId
(
users
,
tenantId
);
return
tenantService
.
validationTentIdByTentId
(
users
,
tenantId
);
}
}
}
return
users
;
}
}
}
}
...
...
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