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
9b7f907d
Commit
9b7f907d
authored
Nov 15, 2021
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
相关接口改造
parent
b5d25191
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
149851 additions
and
130 deletions
+149851
-130
InnerController.java
...tgroup/xyqb/controller/internal/user/InnerController.java
+54
-53
OauthClientDetailsController.java
...er/internal/user/center/OauthClientDetailsController.java
+19
-20
OauthClientDetailsEntity.java
...a/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
+3
-3
SmsTemplateEntity.java
...ain/java/cn/quantgroup/xyqb/entity/SmsTemplateEntity.java
+98
-0
ICustomerInfoRepository.java
...n/quantgroup/xyqb/repository/ICustomerInfoRepository.java
+1
-1
IOauthClientDetailsRepository.java
...tgroup/xyqb/repository/IOauthClientDetailsRepository.java
+2
-2
IProductLoginRepository.java
...n/quantgroup/xyqb/repository/IProductLoginRepository.java
+3
-6
ISmsTemplateRepository.java
...cn/quantgroup/xyqb/repository/ISmsTemplateRepository.java
+15
-0
ICustomerInfoService.java
...cn/quantgroup/xyqb/service/user/ICustomerInfoService.java
+10
-0
ICustomerLoginService.java
...n/quantgroup/xyqb/service/user/ICustomerLoginService.java
+10
-0
IOauthClientDetailsService.java
...ntgroup/xyqb/service/user/IOauthClientDetailsService.java
+1
-4
IOauthLoginInfoService.java
.../quantgroup/xyqb/service/user/IOauthLoginInfoService.java
+1
-4
IProductLoginService.java
...cn/quantgroup/xyqb/service/user/IProductLoginService.java
+10
-0
ISmsService.java
...ain/java/cn/quantgroup/xyqb/service/user/ISmsService.java
+59
-0
ITenantService.java
.../java/cn/quantgroup/xyqb/service/user/ITenantService.java
+14
-0
CustomerInfoServiceImpl.java
...group/xyqb/service/user/impl/CustomerInfoServiceImpl.java
+27
-0
CustomerLoginServiceImpl.java
...roup/xyqb/service/user/impl/CustomerLoginServiceImpl.java
+27
-0
OauthClientDetailsServiceImpl.java
...xyqb/service/user/impl/OauthClientDetailsServiceImpl.java
+1
-31
OauthLoginInfoServiceImpl.java
...oup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
+1
-6
ProductLoginServiceImpl.java
...group/xyqb/service/user/impl/ProductLoginServiceImpl.java
+27
-0
TenantServiceImpl.java
.../quantgroup/xyqb/service/user/impl/TenantServiceImpl.java
+68
-0
GcodeUtils.java
src/main/java/cn/quantgroup/xyqb/util/GcodeUtils.java
+24
-0
xyqb-user2.2021-11-14-0.log
xyqb-user2.2021-11-14-0.log
+149376
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/InnerController.java
View file @
9b7f907d
...
@@ -2,47 +2,18 @@ package cn.quantgroup.xyqb.controller.internal.user;
...
@@ -2,47 +2,18 @@ package cn.quantgroup.xyqb.controller.internal.user;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.user.enums.BizType
;
import
cn.quantgroup.user.enums.*
;
import
cn.quantgroup.user.enums.EducationEnum
;
import
cn.quantgroup.user.enums.IncomeEnum
;
import
cn.quantgroup.user.enums.IncomeRangeEnum
;
import
cn.quantgroup.user.enums.MaritalStatus
;
import
cn.quantgroup.user.enums.OccupationEnum
;
import
cn.quantgroup.user.enums.Relation
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.aspect.accessable.IpValidator
;
import
cn.quantgroup.xyqb.aspect.accessable.IpValidator
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.controller.internal.user.resp.UserFullResp
;
import
cn.quantgroup.xyqb.controller.internal.user.resp.UserFullResp
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.*
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
cn.quantgroup.xyqb.entity.Merchant
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.UserBtRegister
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.entity.UserExtInfo
;
import
cn.quantgroup.xyqb.entity.UserSpouse
;
import
cn.quantgroup.xyqb.entity.WechatUserInfo
;
import
cn.quantgroup.xyqb.event.DisableActiveEvent
;
import
cn.quantgroup.xyqb.event.DisableActiveEvent
;
import
cn.quantgroup.xyqb.event.UserDetailUpdateEvent
;
import
cn.quantgroup.xyqb.event.UserExtInfoSaveEvent
;
import
cn.quantgroup.xyqb.event.UserExtInfoSaveEvent
;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.model.AddressRet
;
import
cn.quantgroup.xyqb.model.ContactInfo
;
import
cn.quantgroup.xyqb.model.ContactRet
;
import
cn.quantgroup.xyqb.model.Gender
;
import
cn.quantgroup.xyqb.model.Gender
;
import
cn.quantgroup.xyqb.model.IdCardInfo
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.model.Tuple
;
import
cn.quantgroup.xyqb.model.UserAssociation
;
import
cn.quantgroup.xyqb.model.UserAssociationModel
;
import
cn.quantgroup.xyqb.model.UserDetailRet
;
import
cn.quantgroup.xyqb.model.UserExtInfoRet
;
import
cn.quantgroup.xyqb.model.UserFullInfo
;
import
cn.quantgroup.xyqb.model.UserInfo
;
import
cn.quantgroup.xyqb.model.UserRet
;
import
cn.quantgroup.xyqb.model.UserSpouseRet
;
import
cn.quantgroup.xyqb.model.UserStatistics
;
import
cn.quantgroup.xyqb.service.api.IUserApiService
;
import
cn.quantgroup.xyqb.service.api.IUserApiService
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.merchant.IMerchantService
;
import
cn.quantgroup.xyqb.service.merchant.IMerchantService
;
...
@@ -52,14 +23,9 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
...
@@ -52,14 +23,9 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.util.AesUtil
;
import
cn.quantgroup.xyqb.util.*
;
import
cn.quantgroup.xyqb.util.IpUtil
;
import
cn.quantgroup.xyqb.util.MqUtils
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
cn.quantgroup.xyqb.util.encrypt.Md5Util
;
import
cn.quantgroup.xyqb.util.encrypt.Md5Util
;
import
cn.quantgroup.xyqb.validator.ChineseName
;
import
cn.quantgroup.xyqb.validator.ChineseName
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
...
@@ -76,7 +42,6 @@ import org.apache.commons.lang3.math.NumberUtils;
...
@@ -76,7 +42,6 @@ import org.apache.commons.lang3.math.NumberUtils;
import
org.apache.http.HttpStatus
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.messaging.handler.annotation.Header
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -85,14 +50,8 @@ import javax.annotation.Resource;
...
@@ -85,14 +50,8 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Min
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -138,6 +97,11 @@ public class InnerController implements IBaseController {
...
@@ -138,6 +97,11 @@ public class InnerController implements IBaseController {
@Resource
@Resource
private
CleanDataService
cleanDataService
;
private
CleanDataService
cleanDataService
;
@Autowired
private
ITenantService
tenantService
;
private
static
final
String
RESET_PWD_TOKEN
=
"ecf75c1f-2ccb-4661-8e4b-2874c0f45a2b"
;
private
static
final
String
RESET_PWD_TOKEN
=
"ecf75c1f-2ccb-4661-8e4b-2874c0f45a2b"
;
private
static
final
String
MODIFY_CONTACT_TOKEN
=
"@qwsdedad131323213w!"
;
private
static
final
String
MODIFY_CONTACT_TOKEN
=
"@qwsdedad131323213w!"
;
...
@@ -169,12 +133,18 @@ public class InnerController implements IBaseController {
...
@@ -169,12 +133,18 @@ 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
)
{
public
JsonResult
findByPhoneNo
(
String
phoneNo
,
String
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
);
}
}
if
(
tenantId
!=
null
)
{
// userId 查询对应productLogin 获取手机号和customerId
user
=
tenantService
.
getTenantUser
(
user
,
tenantId
);
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
}
UserRet
userRet
=
new
UserRet
(
user
);
UserRet
userRet
=
new
UserRet
(
user
);
return
JsonResult
.
buildSuccessResult
(
""
,
userRet
);
return
JsonResult
.
buildSuccessResult
(
""
,
userRet
);
}
}
...
@@ -184,11 +154,19 @@ public class InnerController implements IBaseController {
...
@@ -184,11 +154,19 @@ 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
)
{
public
JsonResult
findByUuid
(
String
uuid
,
String
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
);
}
}
if
(
tenantId
!=
null
)
{
// userId 查询对应productLogin 获取手机号和customerId
user
=
tenantService
.
getTenantUser
(
user
,
tenantId
);
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
}
UserRet
userRet
=
new
UserRet
(
user
);
UserRet
userRet
=
new
UserRet
(
user
);
return
JsonResult
.
buildSuccessResult
(
""
,
userRet
);
return
JsonResult
.
buildSuccessResult
(
""
,
userRet
);
}
}
...
@@ -415,7 +393,7 @@ public class InnerController implements IBaseController {
...
@@ -415,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
)
{
public
JsonResult
findUserDetailByUserId
(
Long
userId
,
String
tenantId
)
{
UserDetail
userDetail
=
null
;
UserDetail
userDetail
=
null
;
// 增加容错性,防备DB中存在的脏数据触发异常
// 增加容错性,防备DB中存在的脏数据触发异常
if
(
userId
!=
null
&&
userId
>
0
)
{
if
(
userId
!=
null
&&
userId
>
0
)
{
...
@@ -424,6 +402,13 @@ public class InnerController implements IBaseController {
...
@@ -424,6 +402,13 @@ public class InnerController implements IBaseController {
if
(
Objects
.
isNull
(
userDetail
))
{
if
(
Objects
.
isNull
(
userDetail
))
{
return
JsonResult
.
buildErrorStateResult
(
"该用户无实名信息"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"该用户无实名信息"
,
null
);
}
}
if
(
tenantId
!=
null
)
{
userDetail
=
tenantService
.
getTenantUserDetail
(
userDetail
,
tenantId
);
if
(
userDetail
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"该用户详情信息不存在"
,
null
);
}
}
return
JsonResult
.
buildSuccessResult
(
"用户实名信息"
,
UserDetailRet
.
getUserDetail
(
userDetail
));
return
JsonResult
.
buildSuccessResult
(
"用户实名信息"
,
UserDetailRet
.
getUserDetail
(
userDetail
));
}
}
...
@@ -432,11 +417,19 @@ public class InnerController implements IBaseController {
...
@@ -432,11 +417,19 @@ 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
)
{
public
JsonResult
findUserByUserId
(
Long
userId
,
String
tenantId
)
{
User
user
=
userService
.
findById
(
userId
);
User
user
=
userService
.
findById
(
userId
);
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
if
(
tenantId
!=
null
)
{
// userId 查询对应productLogin 获取手机号和customerId
user
=
tenantService
.
getTenantUser
(
user
,
tenantId
);
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
}
return
JsonResult
.
buildSuccessResult
(
null
,
new
UserRet
(
user
));
return
JsonResult
.
buildSuccessResult
(
null
,
new
UserRet
(
user
));
}
}
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
}
...
@@ -445,11 +438,19 @@ public class InnerController implements IBaseController {
...
@@ -445,11 +438,19 @@ 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
)
{
public
JsonResult
findUserDetailByPhone
(
String
phoneNo
,
String
tenantId
)
{
UserDetail
userDetail
=
userDetailService
.
findSlaveByPhoneNo
(
phoneNo
);
UserDetail
userDetail
=
null
;
userDetail
=
userDetailService
.
findSlaveByPhoneNo
(
phoneNo
);
if
(
userDetail
!=
null
)
{
if
(
userDetail
!=
null
)
{
if
(
tenantId
!=
null
)
{
userDetail
=
tenantService
.
getTenantUserDetail
(
userDetail
,
tenantId
);
if
(
userDetail
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"该用户详情信息不存在"
,
null
);
}
}
return
JsonResult
.
buildSuccessResult
(
null
,
UserDetailRet
.
getUserDetail
(
userDetail
));
return
JsonResult
.
buildSuccessResult
(
null
,
UserDetailRet
.
getUserDetail
(
userDetail
));
}
}
return
JsonResult
.
buildErrorStateResult
(
"该用户详情信息不存在"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"该用户详情信息不存在"
,
null
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/center/OauthClientDetailsController.java
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
controller
.
internal
.
user
.
center
;
package
cn
.
quantgroup
.
xyqb
.
controller
.
internal
.
user
.
center
;
import
cn.quantgroup.user.enums.*
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator
;
import
cn.quantgroup.xyqb.aspect.lock.RedisLock
;
import
cn.quantgroup.xyqb.entity.*
;
import
cn.quantgroup.xyqb.event.UserExtInfoSaveEvent
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.quantgroup.xyqb.service.user.IOauthLoginInfoService
;
import
com.alibaba.fastjson.TypeReference
;
import
cn.quantgroup.xyqb.service.user.ISmsService
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Created by 11 on 2017/3/22.
* Created by 11 on 2017/3/22.
...
@@ -35,14 +25,17 @@ public class OauthClientDetailsController {
...
@@ -35,14 +25,17 @@ public class OauthClientDetailsController {
@Autowired
@Autowired
private
IOauthLoginInfoService
oauthLoginInfoService
;
private
IOauthLoginInfoService
oauthLoginInfoService
;
@Autowired
private
ISmsService
smsService
;
@PostMapping
(
"/getOauthClient"
)
@PostMapping
(
"/getOauthClient"
)
public
JsonResult
getOauthClient
(
Lo
ng
clientId
)
{
public
JsonResult
getOauthClient
(
Stri
ng
clientId
)
{
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsService
.
findFirstByClientId
(
clientId
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsService
.
findFirstByClientId
(
clientId
);
return
JsonResult
.
buildSuccessResultGeneric
(
oauthClientDetailsEntity
);
return
JsonResult
.
buildSuccessResultGeneric
(
oauthClientDetailsEntity
);
}
}
@PostMapping
(
"/addLoginInfo"
)
@PostMapping
(
"/addLoginInfo"
)
public
JsonResult
addLoginInfo
(
Lo
ng
tenantId
,
String
phoneNo
)
{
public
JsonResult
addLoginInfo
(
Stri
ng
tenantId
,
String
phoneNo
)
{
User
user
=
new
User
();
User
user
=
new
User
();
user
.
setPhoneNo
(
phoneNo
);
user
.
setPhoneNo
(
phoneNo
);
user
.
setId
(
new
Long
(
"111111"
));
user
.
setId
(
new
Long
(
"111111"
));
...
@@ -50,4 +43,10 @@ public class OauthClientDetailsController {
...
@@ -50,4 +43,10 @@ public class OauthClientDetailsController {
return
JsonResult
.
buildSuccessResultGeneric
(
"12"
);
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 @
9b7f907d
...
@@ -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
lo
ng
clientId
;
private
Stri
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
lo
ng
getClientId
()
{
public
Stri
ng
getClientId
()
{
return
clientId
;
return
clientId
;
}
}
public
void
setClientId
(
lo
ng
clientId
)
{
public
void
setClientId
(
Stri
ng
clientId
)
{
this
.
clientId
=
clientId
;
this
.
clientId
=
clientId
;
}
}
...
...
src/main/java/cn/quantgroup/xyqb/entity/SmsTemplateEntity.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
entity
;
import
cn.quantgroup.xyqb.entity.baseEntity.OptimisticEntity
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
* Created with IntelliJ IDEA.
*
* @author: Li JianHua
* @Date: 2021/9/23
* @Time: 11:02
* Description: No Description
*/
@Entity
@Table
(
name
=
"sms_template"
)
public
class
SmsTemplateEntity
extends
OptimisticEntity
implements
Serializable
{
private
final
static
String
CLASS_NAME
=
SmsTemplateEntity
.
class
.
getSimpleName
();
private
static
final
long
serialVersionUID
=
-
190846609680723652L
;
@Id
@Column
(
name
=
"ID"
,
nullable
=
false
)
private
long
id
;
@Column
(
name
=
"CLIENT_ID"
,
nullable
=
false
)
private
long
clientId
;
@Column
(
name
=
"TYPE"
,
nullable
=
false
,
updatable
=
false
,
length
=
11
)
private
String
type
;
@Column
(
name
=
"MERCHANT_ID"
,
nullable
=
false
,
updatable
=
false
,
length
=
11
)
private
String
merchantId
;
@Column
(
name
=
"CONTENT_ID"
,
nullable
=
false
,
updatable
=
false
,
length
=
11
)
private
String
contentId
;
@Column
(
name
=
"CONTENT"
,
nullable
=
false
,
updatable
=
false
)
private
String
content
;
@Override
public
String
getPersistentKey
()
{
return
null
;
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
long
getClientId
()
{
return
clientId
;
}
public
void
setClientId
(
long
clientId
)
{
this
.
clientId
=
clientId
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getMerchantId
()
{
return
merchantId
;
}
public
void
setMerchantId
(
String
merchantId
)
{
this
.
merchantId
=
merchantId
;
}
public
String
getContentId
()
{
return
contentId
;
}
public
void
setContentId
(
String
contentId
)
{
this
.
contentId
=
contentId
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
}
src/main/java/cn/quantgroup/xyqb/repository/ICustomerInfoRepository.java
View file @
9b7f907d
...
@@ -9,5 +9,5 @@ import org.springframework.stereotype.Repository;
...
@@ -9,5 +9,5 @@ import org.springframework.stereotype.Repository;
*/
*/
@Repository
@Repository
public
interface
ICustomerInfoRepository
extends
JpaRepository
<
CustomerInfoEntity
,
Long
>
{
public
interface
ICustomerInfoRepository
extends
JpaRepository
<
CustomerInfoEntity
,
Long
>
{
CustomerInfoEntity
findByCustomerId
(
Long
customerId
);
}
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/repository/IOauthClientDetailsRepository.java
View file @
9b7f907d
...
@@ -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
,
Lo
ng
>
{
public
interface
IOauthClientDetailsRepository
extends
JpaRepository
<
OauthClientDetailsEntity
,
Stri
ng
>
{
OauthClientDetailsEntity
findFirstByClientId
(
Lo
ng
clientID
);
OauthClientDetailsEntity
findFirstByClientId
(
Stri
ng
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/repository/IProductLoginRepository.java
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
repository
;
package
cn
.
quantgroup
.
xyqb
.
repository
;
import
cn.quantgroup.xyqb.entity.ProductLoginEntity
;
import
cn.quantgroup.xyqb.entity.ProductLoginEntity
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
import
javax.transaction.Transactional
;
/**
/**
...
@@ -20,4 +15,6 @@ public interface IProductLoginRepository extends JpaRepository<ProductLoginEntit
...
@@ -20,4 +15,6 @@ public interface IProductLoginRepository extends JpaRepository<ProductLoginEntit
ProductLoginEntity
findFirstByInstitutionIdAndProductIdAndPhoneNo
(
String
institutionId
,
String
productId
,
String
phoneNo
);
ProductLoginEntity
findFirstByInstitutionIdAndProductIdAndPhoneNo
(
String
institutionId
,
String
productId
,
String
phoneNo
);
ProductLoginEntity
findFirstByPhoneNo
(
String
phoneNo
);
ProductLoginEntity
findFirstByPhoneNo
(
String
phoneNo
);
ProductLoginEntity
findByInstitutionIdAndProductIdAndExtensionAccountId
(
String
institutionId
,
String
productId
,
Long
userId
);
}
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/repository/ISmsTemplateRepository.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
repository
;
import
cn.quantgroup.xyqb.entity.SmsTemplateEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
import
java.util.Optional
;
/**
* Created by hechao on 2020/2/17.
*/
@Repository
public
interface
ISmsTemplateRepository
extends
JpaRepository
<
SmsTemplateEntity
,
Long
>
{
Optional
<
SmsTemplateEntity
>
findFirstByClientIdAndType
(
Long
clientId
,
String
type
);
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/service/user/ICustomerInfoService.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.CustomerInfoEntity
;
/**
* Created by 11 on 2016/12/29.
*/
public
interface
ICustomerInfoService
{
CustomerInfoEntity
findSlaveByCustomerId
(
Long
customerId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/ICustomerLoginService.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.CustomerLoginEntity
;
/**
* Created by 11 on 2016/12/29.
*/
public
interface
ICustomerLoginService
{
CustomerLoginEntity
findSlaveByCustomerId
(
Long
customerId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/IOauthClientDetailsService.java
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
java.util.List
;
/**
/**
* Created by Miraculous on 2017/1/3.
* Created by Miraculous on 2017/1/3.
*/
*/
public
interface
IOauthClientDetailsService
{
public
interface
IOauthClientDetailsService
{
OauthClientDetailsEntity
findFirstByClientId
(
Lo
ng
clientId
);
OauthClientDetailsEntity
findFirstByClientId
(
Stri
ng
clientId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/IOauthLoginInfoService.java
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.User
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
/**
/**
* 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
,
Lo
ng
tenantId
);
void
addLoginInfo
(
User
user
,
Stri
ng
tenantId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/IProductLoginService.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.ProductLoginEntity
;
/**
* Created by 11 on 2016/12/29.
*/
public
interface
IProductLoginService
{
ProductLoginEntity
findSlaveByPloginInfo
(
String
institutionId
,
String
productId
,
Long
userId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/ISmsService.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.SmsTemplateEntity
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.repository.ISmsTemplateRepository
;
import
cn.quantgroup.xyqb.util.GcodeUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
javax.inject.Inject
;
import
java.util.*
;
/**
* Created by hechao on 2020/2/17.
*/
@Slf4j
@Service
public
class
ISmsService
{
@Inject
private
ISmsTemplateRepository
smsTemplateRepository
;
public
String
sendSms
(
Long
clientId
,
String
type
,
String
phoneNo
)
{
JsonResult
res
=
new
JsonResult
();
String
code
=
null
;
try
{
Optional
<
SmsTemplateEntity
>
optional
=
smsTemplateRepository
.
findFirstByClientIdAndType
(
clientId
,
type
);
if
(!
optional
.
isPresent
())
{
log
.
error
(
"没有指定的模板"
);
return
code
;
}
SmsTemplateEntity
smsTemplateEntity
=
optional
.
orElse
(
new
SmsTemplateEntity
());
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
user
=
new
HashMap
<>();
List
<
String
>
contentArgs
=
new
ArrayList
<>();
code
=
GcodeUtils
.
generatedcode
(
5
);
contentArgs
.
add
(
code
);
user
.
put
(
"merchantId"
,
smsTemplateEntity
.
getMerchantId
());
user
.
put
(
"phoneNo"
,
phoneNo
);
user
.
put
(
"contentId"
,
smsTemplateEntity
.
getContentId
());
user
.
put
(
"contentArgs"
,
contentArgs
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
postForEntity
(
"https://msgapi-qa.liangkebang.net/middle_office/send/message/quick"
,
user
,
String
.
class
);
//提交的body内容为user对象,请求的返回的body类型为String
int
statusCode
=
responseEntity
.
getStatusCodeValue
();
String
bodyCode
=
JSONObject
.
parseObject
(
responseEntity
.
getBody
(),
HashMap
.
class
).
get
(
"code"
).
toString
();
if
(
200
!=
statusCode
||
!
"0"
.
equals
(
bodyCode
))
{
log
.
error
(
"验证码发送失败"
);
return
null
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"发送验证码异常---{}"
,
e
.
getMessage
());
}
return
code
;
}
}
src/main/java/cn/quantgroup/xyqb/service/user/ITenantService.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
/**
* Created by 11 on 2016/12/29.
*/
public
interface
ITenantService
{
User
getTenantUser
(
User
user
,
String
tenantId
);
UserDetail
getTenantUserDetail
(
UserDetail
userDetail
,
String
tenantId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/CustomerInfoServiceImpl.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.xyqb.entity.CustomerInfoEntity
;
import
cn.quantgroup.xyqb.repository.ICustomerInfoRepository
;
import
cn.quantgroup.xyqb.service.user.ICustomerInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* Created by 11 on 2016/12/29.
*/
@Slf4j
@Service
public
class
CustomerInfoServiceImpl
implements
ICustomerInfoService
{
@Autowired
private
ICustomerInfoRepository
customerInfoRepository
;
@Override
@TargetDataSource
(
type
=
DSType
.
SLAVE
)
//查询从库
public
CustomerInfoEntity
findSlaveByCustomerId
(
Long
customerId
)
{
CustomerInfoEntity
customerInfo
=
customerInfoRepository
.
findByCustomerId
(
customerId
);
return
customerInfo
;
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/CustomerLoginServiceImpl.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.xyqb.entity.CustomerLoginEntity
;
import
cn.quantgroup.xyqb.repository.ICustomerLoginRepository
;
import
cn.quantgroup.xyqb.service.user.ICustomerLoginService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* Created by 11 on 2016/12/29.
*/
@Slf4j
@Service
public
class
CustomerLoginServiceImpl
implements
ICustomerLoginService
{
@Autowired
private
ICustomerLoginRepository
customerLoginRepository
;
@Override
@TargetDataSource
(
type
=
DSType
.
SLAVE
)
//查询从库
public
CustomerLoginEntity
findSlaveByCustomerId
(
Long
customerId
)
{
CustomerLoginEntity
customerLogin
=
customerLoginRepository
.
findFirstByCustomerId
(
customerId
);
return
customerLogin
;
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/OauthClientDetailsServiceImpl.java
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.event.UserDetailUpdateEvent
;
import
cn.quantgroup.xyqb.model.Gender
;
import
cn.quantgroup.xyqb.model.IdCardInfo
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository
;
import
cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository
;
import
cn.quantgroup.xyqb.repository.IUserDetailRepository
;
import
cn.quantgroup.xyqb.repository.IUserRepository
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
cn.quantgroup.xyqb.util.AddressFilter
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Predicate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
/**
/**
* Created by 11 on 2016/12/29.
* Created by 11 on 2016/12/29.
*/
*/
...
@@ -48,7 +18,7 @@ public class OauthClientDetailsServiceImpl implements IOauthClientDetailsService
...
@@ -48,7 +18,7 @@ public class OauthClientDetailsServiceImpl implements IOauthClientDetailsService
@Override
@Override
public
OauthClientDetailsEntity
findFirstByClientId
(
Lo
ng
clientId
)
{
public
OauthClientDetailsEntity
findFirstByClientId
(
Stri
ng
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 @
9b7f907d
...
@@ -5,21 +5,16 @@ import cn.quantgroup.xyqb.repository.ICustomerInfoRepository;
...
@@ -5,21 +5,16 @@ import cn.quantgroup.xyqb.repository.ICustomerInfoRepository;
import
cn.quantgroup.xyqb.repository.ICustomerLoginRepository
;
import
cn.quantgroup.xyqb.repository.ICustomerLoginRepository
;
import
cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository
;
import
cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository
;
import
cn.quantgroup.xyqb.repository.IProductLoginRepository
;
import
cn.quantgroup.xyqb.repository.IProductLoginRepository
;
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.util.AtomicSequencer
;
import
cn.quantgroup.xyqb.util.AtomicSequencer
;
import
cn.quantgroup.xyqb.util.RandomSequencer
;
import
cn.quantgroup.xyqb.util.RandomSequencer
;
import
com.sun.media.sound.AutoConnectSequencer
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDate
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.UUID
;
/**
/**
* Created by 11 on 2016/12/29.
* Created by 11 on 2016/12/29.
...
@@ -44,7 +39,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
...
@@ -44,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
,
Lo
ng
tenantId
)
{
public
void
addLoginInfo
(
User
user
,
Stri
ng
tenantId
)
{
System
.
out
.
println
(
atomicSequencer
.
nextId
());
System
.
out
.
println
(
atomicSequencer
.
nextId
());
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
tenantId
);
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
tenantId
);
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/ProductLoginServiceImpl.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.xyqb.entity.ProductLoginEntity
;
import
cn.quantgroup.xyqb.repository.IProductLoginRepository
;
import
cn.quantgroup.xyqb.service.user.IProductLoginService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* Created by 11 on 2016/12/29.
*/
@Slf4j
@Service
public
class
ProductLoginServiceImpl
implements
IProductLoginService
{
@Autowired
private
IProductLoginRepository
productLoginRepository
;
@Override
@TargetDataSource
(
type
=
DSType
.
SLAVE
)
//查询从库
public
ProductLoginEntity
findSlaveByPloginInfo
(
String
institutionId
,
String
productId
,
Long
userId
)
{
ProductLoginEntity
productLogin
=
productLoginRepository
.
findByInstitutionIdAndProductIdAndExtensionAccountId
(
institutionId
,
productId
,
userId
);
return
productLogin
;
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/TenantServiceImpl.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.xyqb.entity.*
;
import
cn.quantgroup.xyqb.service.user.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* Created by 11 on 2016/12/29.
*/
@Slf4j
@Service
public
class
TenantServiceImpl
implements
ITenantService
{
@Autowired
private
IProductLoginService
productLoginService
;
@Autowired
private
ICustomerInfoService
customerInfoService
;
@Autowired
private
IOauthClientDetailsService
oauthClientDetailsService
;
@Override
public
User
getTenantUser
(
User
user
,
String
tenantId
)
{
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetails
!=
null
)
{
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
user
.
getId
());
if
(
productLogin
!=
null
)
{
if
(!
user
.
getPhoneNo
().
equals
(
productLogin
.
getPhoneNo
()))
{
return
null
;
}
user
.
setPassword
(
productLogin
.
getPassword
());
return
user
;
}
}
return
null
;
}
@Override
public
UserDetail
getTenantUserDetail
(
UserDetail
userDetail
,
String
tenantId
)
{
OauthClientDetailsEntity
oauthClientDetails
=
oauthClientDetailsService
.
findFirstByClientId
(
tenantId
);
if
(
oauthClientDetails
!=
null
)
{
ProductLoginEntity
productLogin
=
productLoginService
.
findSlaveByPloginInfo
(
oauthClientDetails
.
getInstitutionId
(),
oauthClientDetails
.
getProductId
(),
userDetail
.
getUserId
());
if
(
productLogin
!=
null
)
{
if
(!
userDetail
.
getPhoneNo
().
equals
(
productLogin
.
getPhoneNo
()))
{
return
null
;
}
CustomerInfoEntity
customerInfo
=
customerInfoService
.
findSlaveByCustomerId
(
productLogin
.
getCustomerId
());
if
(
customerInfo
==
null
)
{
return
null
;
}
UserDetail
tenantUserDetail
=
new
UserDetail
();
tenantUserDetail
.
setUserId
(
userDetail
.
getUserId
());
tenantUserDetail
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
tenantUserDetail
.
setIdNo
(
customerInfo
.
getIdCardNo
());
tenantUserDetail
.
setName
(
customerInfo
.
getName
());
tenantUserDetail
.
setCreatedAt
(
userDetail
.
getCreatedAt
());
tenantUserDetail
.
setUpdatedAt
(
userDetail
.
getUpdatedAt
());
return
tenantUserDetail
;
}
}
return
null
;
}
}
src/main/java/cn/quantgroup/xyqb/util/GcodeUtils.java
0 → 100644
View file @
9b7f907d
package
cn
.
quantgroup
.
xyqb
.
util
;
/**
* Created with IntelliJ IDEA.
*
* @author: Li JianHua
* @Date: 2021/10/13
* @Time: 16:53
* Description: No Description
*/
public
class
GcodeUtils
{
/**
* 生成?位的数字类型的短信验证码
*
* @param count
* @return
*/
public
static
String
generatedcode
(
int
count
)
{
String
code
=
String
.
valueOf
((
int
)((
Math
.
random
()*
9
+
1
)*
Math
.
pow
(
10
,
count
-
1
)));
return
code
;
}
}
xyqb-user2.2021-11-14-0.log
0 → 100644
View file @
9b7f907d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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