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
73260440
Commit
73260440
authored
Nov 15, 2021
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改租户类型
parent
97834f89
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
21 additions
and
44 deletions
+21
-44
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+1
-1
InnerController.java
...tgroup/xyqb/controller/internal/user/InnerController.java
+5
-5
OauthClientDetailsController.java
...er/internal/user/center/OauthClientDetailsController.java
+0
-23
OauthClientDetailsEntity.java
...a/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
+3
-3
IOauthClientDetailsRepository.java
...tgroup/xyqb/repository/IOauthClientDetailsRepository.java
+2
-2
IOauthClientDetailsService.java
...ntgroup/xyqb/service/user/IOauthClientDetailsService.java
+1
-1
IOauthLoginInfoService.java
.../quantgroup/xyqb/service/user/IOauthLoginInfoService.java
+1
-1
ITenantService.java
.../java/cn/quantgroup/xyqb/service/user/ITenantService.java
+3
-3
OauthClientDetailsServiceImpl.java
...xyqb/service/user/impl/OauthClientDetailsServiceImpl.java
+1
-1
OauthLoginInfoServiceImpl.java
...oup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
+1
-1
TenantServiceImpl.java
.../quantgroup/xyqb/service/user/impl/TenantServiceImpl.java
+3
-3
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
73260440
...
@@ -482,7 +482,7 @@ public class UserController implements IBaseController {
...
@@ -482,7 +482,7 @@ public class UserController implements IBaseController {
brief
.
setSex
(
Optional
.
ofNullable
(
userDetail
.
getGender
()).
orElse
(
cn
.
quantgroup
.
xyqb
.
model
.
Gender
.
UNKNOWN
).
ordinal
()
+
""
);
brief
.
setSex
(
Optional
.
ofNullable
(
userDetail
.
getGender
()).
orElse
(
cn
.
quantgroup
.
xyqb
.
model
.
Gender
.
UNKNOWN
).
ordinal
()
+
""
);
brief
.
setPhoneNo
(
userDetail
.
getPhoneNo
().
substring
(
0
,
3
)
+
"****"
+
userDetail
.
getPhoneNo
().
substring
(
7
,
11
));
brief
.
setPhoneNo
(
userDetail
.
getPhoneNo
().
substring
(
0
,
3
)
+
"****"
+
userDetail
.
getPhoneNo
().
substring
(
7
,
11
));
}
}
String
tenantId
=
getCurrentTenantIdRedis
(
);
Integer
tenantId
=
Integer
.
parseInt
(
getCurrentTenantIdRedis
()
);
if
(
tenantId
!=
null
)
{
if
(
tenantId
!=
null
)
{
brief
=
tenantService
.
getTenantCustomerInfo
(
userDetail
,
tenantId
);
brief
=
tenantService
.
getTenantCustomerInfo
(
userDetail
,
tenantId
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/InnerController.java
View file @
73260440
...
@@ -133,7 +133,7 @@ public class InnerController implements IBaseController {
...
@@ -133,7 +133,7 @@ public class InnerController implements IBaseController {
*/
*/
@RequestMapping
(
"/user/search/phoneNo"
)
@RequestMapping
(
"/user/search/phoneNo"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据手机号查询用户信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据手机号查询用户信息"
)
public
JsonResult
findByPhoneNo
(
String
phoneNo
,
String
tenantId
)
{
public
JsonResult
findByPhoneNo
(
String
phoneNo
,
Integer
tenantId
)
{
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
...
@@ -154,7 +154,7 @@ public class InnerController implements IBaseController {
...
@@ -154,7 +154,7 @@ public class InnerController implements IBaseController {
*/
*/
@RequestMapping
(
"/user/search/uuid"
)
@RequestMapping
(
"/user/search/uuid"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据UUID查询用户信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据UUID查询用户信息"
)
public
JsonResult
findByUuid
(
String
uuid
,
String
tenantId
)
{
public
JsonResult
findByUuid
Info
(
String
uuid
,
Integer
tenantId
)
{
User
user
=
userService
.
findByUuidWithCache
(
uuid
);
User
user
=
userService
.
findByUuidWithCache
(
uuid
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
...
@@ -393,7 +393,7 @@ public class InnerController implements IBaseController {
...
@@ -393,7 +393,7 @@ public class InnerController implements IBaseController {
*/
*/
@RequestMapping
(
"/user_detail/search/userId"
)
@RequestMapping
(
"/user_detail/search/userId"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询用户详情"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询用户详情"
)
public
JsonResult
findUserDetailByUserId
(
Long
userId
,
String
tenantId
)
{
public
JsonResult
findUserDetailByUserId
(
Long
userId
,
Integer
tenantId
)
{
UserDetail
userDetail
=
null
;
UserDetail
userDetail
=
null
;
// 增加容错性,防备DB中存在的脏数据触发异常
// 增加容错性,防备DB中存在的脏数据触发异常
if
(
userId
!=
null
&&
userId
>
0
)
{
if
(
userId
!=
null
&&
userId
>
0
)
{
...
@@ -417,7 +417,7 @@ public class InnerController implements IBaseController {
...
@@ -417,7 +417,7 @@ public class InnerController implements IBaseController {
*/
*/
@RequestMapping
(
"/user/search/userId"
)
@RequestMapping
(
"/user/search/userId"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询用户基本信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询用户基本信息"
)
public
JsonResult
findUserByUserId
(
Long
userId
,
String
tenantId
)
{
public
JsonResult
findUserByUserId
(
Long
userId
,
Integer
tenantId
)
{
User
user
=
userService
.
findById
(
userId
);
User
user
=
userService
.
findById
(
userId
);
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
if
(
tenantId
!=
null
)
{
if
(
tenantId
!=
null
)
{
...
@@ -438,7 +438,7 @@ public class InnerController implements IBaseController {
...
@@ -438,7 +438,7 @@ public class InnerController implements IBaseController {
*/
*/
@RequestMapping
(
"/user_detail/search/phone"
)
@RequestMapping
(
"/user_detail/search/phone"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询用户详情"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询用户详情"
)
public
JsonResult
findUserDetailByPhone
(
String
phoneNo
,
String
tenantId
)
{
public
JsonResult
findUserDetailByPhone
(
String
phoneNo
,
Integer
tenantId
)
{
UserDetail
userDetail
=
null
;
UserDetail
userDetail
=
null
;
userDetail
=
userDetailService
.
findSlaveByPhoneNo
(
phoneNo
);
userDetail
=
userDetailService
.
findSlaveByPhoneNo
(
phoneNo
);
if
(
userDetail
!=
null
)
{
if
(
userDetail
!=
null
)
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/center/OauthClientDetailsController.java
View file @
73260440
package
cn
.
quantgroup
.
xyqb
.
controller
.
internal
.
user
.
center
;
package
cn
.
quantgroup
.
xyqb
.
controller
.
internal
.
user
.
center
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
cn.quantgroup.xyqb.service.user.IOauthLoginInfoService
;
import
cn.quantgroup.xyqb.service.user.IOauthLoginInfoService
;
import
cn.quantgroup.xyqb.service.user.ISmsService
;
import
cn.quantgroup.xyqb.service.user.ISmsService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -28,25 +24,6 @@ public class OauthClientDetailsController {
...
@@ -28,25 +24,6 @@ public class OauthClientDetailsController {
@Autowired
@Autowired
private
ISmsService
smsService
;
private
ISmsService
smsService
;
@PostMapping
(
"/getOauthClient"
)
public
JsonResult
getOauthClient
(
String
clientId
)
{
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsService
.
findFirstByClientId
(
clientId
);
return
JsonResult
.
buildSuccessResultGeneric
(
oauthClientDetailsEntity
);
}
@PostMapping
(
"/addLoginInfo"
)
public
JsonResult
addLoginInfo
(
String
tenantId
,
String
phoneNo
)
{
User
user
=
new
User
();
user
.
setPhoneNo
(
phoneNo
);
user
.
setId
(
new
Long
(
"111111"
));
oauthLoginInfoService
.
addLoginInfo
(
user
,
tenantId
);
return
JsonResult
.
buildSuccessResultGeneric
(
"12"
);
}
@PostMapping
(
"/sendSms"
)
public
JsonResult
sendSms
(
Long
tenantId
,
String
phoneNo
)
{
String
code
=
smsService
.
sendSms
(
tenantId
,
"login"
,
phoneNo
);
return
JsonResult
.
buildSuccessResultGeneric
(
code
);
}
}
}
src/main/java/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
View file @
73260440
...
@@ -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
Stri
ng
clientId
;
private
Lo
ng
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
Stri
ng
getClientId
()
{
public
Lo
ng
getClientId
()
{
return
clientId
;
return
clientId
;
}
}
public
void
setClientId
(
Stri
ng
clientId
)
{
public
void
setClientId
(
Lo
ng
clientId
)
{
this
.
clientId
=
clientId
;
this
.
clientId
=
clientId
;
}
}
...
...
src/main/java/cn/quantgroup/xyqb/repository/IOauthClientDetailsRepository.java
View file @
73260440
...
@@ -9,8 +9,8 @@ import org.springframework.stereotype.Repository;
...
@@ -9,8 +9,8 @@ import org.springframework.stereotype.Repository;
* Created by hechao on 2020/2/17.
* Created by hechao on 2020/2/17.
*/
*/
@Repository
@Repository
public
interface
IOauthClientDetailsRepository
extends
JpaRepository
<
OauthClientDetailsEntity
,
Stri
ng
>
{
public
interface
IOauthClientDetailsRepository
extends
JpaRepository
<
OauthClientDetailsEntity
,
Lo
ng
>
{
OauthClientDetailsEntity
findFirstByClientId
(
String
clientID
);
OauthClientDetailsEntity
findFirstByClientId
(
Integer
clientID
);
OauthClientDetailsEntity
findFirstByInstitutionIdAndProductId
(
String
institutionId
,
String
productId
);
OauthClientDetailsEntity
findFirstByInstitutionIdAndProductId
(
String
institutionId
,
String
productId
);
}
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/service/user/IOauthClientDetailsService.java
View file @
73260440
...
@@ -7,5 +7,5 @@ import cn.quantgroup.xyqb.entity.OauthClientDetailsEntity;
...
@@ -7,5 +7,5 @@ import cn.quantgroup.xyqb.entity.OauthClientDetailsEntity;
*/
*/
public
interface
IOauthClientDetailsService
{
public
interface
IOauthClientDetailsService
{
OauthClientDetailsEntity
findFirstByClientId
(
String
clientId
);
OauthClientDetailsEntity
findFirstByClientId
(
Integer
clientId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/IOauthLoginInfoService.java
View file @
73260440
...
@@ -6,5 +6,5 @@ import cn.quantgroup.xyqb.entity.User;
...
@@ -6,5 +6,5 @@ import cn.quantgroup.xyqb.entity.User;
* Created by Li Jianhua on 2017/1/3.
* Created by Li Jianhua on 2017/1/3.
*/
*/
public
interface
IOauthLoginInfoService
{
public
interface
IOauthLoginInfoService
{
void
addLoginInfo
(
User
user
,
String
tenantId
);
void
addLoginInfo
(
User
user
,
Integer
tenantId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/ITenantService.java
View file @
73260440
...
@@ -9,9 +9,9 @@ import cn.quantgroup.xyqb.model.UserBrief;
...
@@ -9,9 +9,9 @@ import cn.quantgroup.xyqb.model.UserBrief;
*/
*/
public
interface
ITenantService
{
public
interface
ITenantService
{
User
getTenantUser
(
User
user
,
String
tenantId
);
User
getTenantUser
(
User
user
,
Integer
tenantId
);
UserDetail
getTenantUserDetail
(
UserDetail
userDetail
,
String
tenantId
);
UserDetail
getTenantUserDetail
(
UserDetail
userDetail
,
Integer
tenantId
);
UserBrief
getTenantCustomerInfo
(
UserDetail
userDetail
,
String
tenantId
);
UserBrief
getTenantCustomerInfo
(
UserDetail
userDetail
,
Integer
tenantId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/OauthClientDetailsServiceImpl.java
View file @
73260440
...
@@ -18,7 +18,7 @@ public class OauthClientDetailsServiceImpl implements IOauthClientDetailsService
...
@@ -18,7 +18,7 @@ public class OauthClientDetailsServiceImpl implements IOauthClientDetailsService
@Override
@Override
public
OauthClientDetailsEntity
findFirstByClientId
(
String
clientId
)
{
public
OauthClientDetailsEntity
findFirstByClientId
(
Integer
clientId
)
{
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
clientId
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
clientId
);
return
oauthClientDetailsEntity
;
return
oauthClientDetailsEntity
;
}
}
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
View file @
73260440
...
@@ -39,7 +39,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -39,7 +39,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
@Override
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
addLoginInfo
(
User
user
,
String
tenantId
)
{
public
void
addLoginInfo
(
User
user
,
Integer
tenantId
)
{
System
.
out
.
println
(
atomicSequencer
.
nextId
());
System
.
out
.
println
(
atomicSequencer
.
nextId
());
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
tenantId
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetailsEntity
!=
null
)
{
if
(
oauthClientDetailsEntity
!=
null
)
{
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/TenantServiceImpl.java
View file @
73260440
...
@@ -29,7 +29,7 @@ public class TenantServiceImpl implements ITenantService {
...
@@ -29,7 +29,7 @@ public class TenantServiceImpl implements ITenantService {
private
IOauthClientDetailsService
oauthClientDetailsService
;
private
IOauthClientDetailsService
oauthClientDetailsService
;
@Override
@Override
public
User
getTenantUser
(
User
user
,
String
tenantId
)
{
public
User
getTenantUser
(
User
user
,
Integer
tenantId
)
{
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetails
!=
null
)
{
if
(
oauthClientDetails
!=
null
)
{
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
user
.
getId
());
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
user
.
getId
());
...
@@ -45,7 +45,7 @@ public class TenantServiceImpl implements ITenantService {
...
@@ -45,7 +45,7 @@ public class TenantServiceImpl implements ITenantService {
}
}
@Override
@Override
public
UserDetail
getTenantUserDetail
(
UserDetail
userDetail
,
String
tenantId
)
{
public
UserDetail
getTenantUserDetail
(
UserDetail
userDetail
,
Integer
tenantId
)
{
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetails
!=
null
)
{
if
(
oauthClientDetails
!=
null
)
{
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
userDetail
.
getUserId
());
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
userDetail
.
getUserId
());
...
@@ -73,7 +73,7 @@ public class TenantServiceImpl implements ITenantService {
...
@@ -73,7 +73,7 @@ public class TenantServiceImpl implements ITenantService {
}
}
@Override
@Override
public
UserBrief
getTenantCustomerInfo
(
UserDetail
userDetail
,
String
tenantId
)
{
public
UserBrief
getTenantCustomerInfo
(
UserDetail
userDetail
,
Integer
tenantId
)
{
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetails
!=
null
)
{
if
(
oauthClientDetails
!=
null
)
{
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
userDetail
.
getUserId
());
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
userDetail
.
getUserId
());
...
...
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