Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
88ca41bf
Commit
88ca41bf
authored
Dec 06, 2019
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异步操作 使用cglib 代理
parent
0c27a4d3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
18 deletions
+71
-18
Bootstrap.java
src/main/java/cn/quantgroup/cashloanflowboss/Bootstrap.java
+1
-1
LoginServiceImpl.java
.../cashloanflowboss/api/login/service/LoginServiceImpl.java
+2
-1
OrderServiceImpl.java
.../cashloanflowboss/api/order/service/OrderServiceImpl.java
+2
-1
UserController.java
.../cashloanflowboss/api/user/controller/UserController.java
+4
-4
UserServiceImpl.java
...up/cashloanflowboss/api/user/service/UserServiceImpl.java
+3
-3
MyAsyncExecutor.java
...tgroup/cashloanflowboss/core/asyncer/MyAsyncExecutor.java
+47
-0
JolyneServiceImpl.java
...tgroup/cashloanflowboss/spi/jolyne/JolyneServiceImpl.java
+5
-4
XyqbUserServiceImpl.java
...ashloanflowboss/spi/user/service/XyqbUserServiceImpl.java
+7
-4
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/Bootstrap.java
View file @
88ca41bf
...
@@ -15,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -15,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
@EnableFeignClients
@EnableFeignClients
@EnableAsync
@EnableAsync
(
proxyTargetClass
=
true
)
public
class
Bootstrap
{
public
class
Bootstrap
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/login/service/LoginServiceImpl.java
View file @
88ca41bf
...
@@ -4,6 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.login.model.Principal;
...
@@ -4,6 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.login.model.Principal;
import
cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus
;
import
cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.User
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.User
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserInfo
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserService
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserServiceImpl
;
import
cn.quantgroup.cashloanflowboss.api.user.service.UserServiceImpl
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationDictionary
;
...
@@ -28,7 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
...
@@ -28,7 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
public
class
LoginServiceImpl
implements
LoginService
{
public
class
LoginServiceImpl
implements
LoginService
{
@Autowired
@Autowired
private
UserService
Impl
userService
;
private
UserService
userService
;
@Autowired
@Autowired
private
HttpServletRequest
request
;
private
HttpServletRequest
request
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/order/service/OrderServiceImpl.java
View file @
88ca41bf
...
@@ -107,6 +107,7 @@ public class OrderServiceImpl implements OrderService{
...
@@ -107,6 +107,7 @@ public class OrderServiceImpl implements OrderService{
private
static
final
String
auth
=
"dXNlcj14dWV6aiZwYXNzd29yZD0xMjMxMjNxd2Vxd2U%3D"
;
private
static
final
String
auth
=
"dXNlcj14dWV6aiZwYXNzd29yZD0xMjMxMjNxd2Vxd2U%3D"
;
private
static
final
int
CONSCONT_STATUS
=
2
;
@Override
@Override
...
@@ -316,7 +317,7 @@ public class OrderServiceImpl implements OrderService{
...
@@ -316,7 +317,7 @@ public class OrderServiceImpl implements OrderService{
// 更新合同状态
// 更新合同状态
Contract
conscont
=
xyqbCenterService
.
findContractByUserId
(
orderMapping
.
getQgUserId
());
Contract
conscont
=
xyqbCenterService
.
findContractByUserId
(
orderMapping
.
getQgUserId
());
if
(
conscont
!=
null
)
{
if
(
conscont
!=
null
)
{
if
(
conscont
.
getGenerateStatus
()
!=
2
)
{
if
(
conscont
.
getGenerateStatus
()
!=
CONSCONT_STATUS
)
{
log
.
info
(
"secondAudit,合同状态不对,channelOrderNumber="
.
concat
(
channelOrderNumber
));
log
.
info
(
"secondAudit,合同状态不对,channelOrderNumber="
.
concat
(
channelOrderNumber
));
// 修改合同状态
// 修改合同状态
ArrayList
<
String
>
updateContract
=
Lists
.
newArrayList
();
ArrayList
<
String
>
updateContract
=
Lists
.
newArrayList
();
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/user/controller/UserController.java
View file @
88ca41bf
...
@@ -130,8 +130,8 @@ public class UserController {
...
@@ -130,8 +130,8 @@ public class UserController {
@PutMapping
(
"/order/clean"
)
@PutMapping
(
"/order/clean"
)
@Security
(
authorityId
=
"User.Order.cleanUserOrder"
)
@Security
(
authorityId
=
"User.Order.cleanUserOrder"
)
public
Result
<
Boolean
>
cleanUserOrder
(
@RequestParam
@Valid
@NotEmpty
(
message
=
"无效的用户手机号"
)
String
mobile
)
{
public
Result
<
Boolean
>
cleanUserOrder
(
@RequestParam
@Valid
@NotEmpty
(
message
=
"无效的用户手机号"
)
String
mobile
)
{
Tuple
<
Boolean
,
String
>
result
=
userService
.
cleanUserActiveOrder
(
mobile
);
userService
.
cleanUserActiveOrder
(
mobile
);
return
Result
.
buildSuccess
(
result
.
getKey
(),
result
.
getValue
()
);
return
Result
.
buildSuccess
(
true
,
"异步请求成功"
);
}
}
/**
/**
...
@@ -143,8 +143,8 @@ public class UserController {
...
@@ -143,8 +143,8 @@ public class UserController {
@PutMapping
(
"/info/clean"
)
@PutMapping
(
"/info/clean"
)
@Security
(
authorityId
=
"User.Order.cleanUserInfo"
)
@Security
(
authorityId
=
"User.Order.cleanUserInfo"
)
public
Boolean
deleteByUserId
(
@RequestParam
@Valid
@NotEmpty
(
message
=
"无效的用户手机号"
)
String
mobile
)
{
public
Boolean
deleteByUserId
(
@RequestParam
@Valid
@NotEmpty
(
message
=
"无效的用户手机号"
)
String
mobile
)
{
Tuple
<
Boolean
,
String
>
result
=
this
.
xyqbUserService
.
deleteByUserId
(
mobile
);
this
.
xyqbUserService
.
deleteByUserId
(
mobile
);
return
result
.
getKey
()
;
return
true
;
}
}
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserServiceImpl.java
View file @
88ca41bf
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
service
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
user
.
service
;
import
cn.quantgroup.cashloanflowboss.api.login.model.Principal
;
import
cn.quantgroup.cashloanflowboss.api.login.model.Principal
;
import
cn.quantgroup.cashloanflowboss.api.optlog.model.OptEnumName
;
import
cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus
;
import
cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.User
;
import
cn.quantgroup.cashloanflowboss.api.user.entity.User
;
import
cn.quantgroup.cashloanflowboss.api.user.model.QueryUserListModel
;
import
cn.quantgroup.cashloanflowboss.api.user.model.QueryUserListModel
;
...
@@ -9,7 +8,6 @@ import cn.quantgroup.cashloanflowboss.api.user.model.UserDetailInfo;
...
@@ -9,7 +8,6 @@ import cn.quantgroup.cashloanflowboss.api.user.model.UserDetailInfo;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserInfoModel
;
import
cn.quantgroup.cashloanflowboss.api.user.model.UserInfoModel
;
import
cn.quantgroup.cashloanflowboss.api.user.repository.UserRepository
;
import
cn.quantgroup.cashloanflowboss.api.user.repository.UserRepository
;
import
cn.quantgroup.cashloanflowboss.core.Application
;
import
cn.quantgroup.cashloanflowboss.core.Application
;
import
cn.quantgroup.cashloanflowboss.core.annotation.opt.OperationAnno
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.asserts.Assert
;
import
cn.quantgroup.cashloanflowboss.core.base.Tuple
;
import
cn.quantgroup.cashloanflowboss.core.base.Tuple
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
...
@@ -23,6 +21,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -23,6 +21,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
...
@@ -191,7 +190,8 @@ public class UserServiceImpl implements UserService{
...
@@ -191,7 +190,8 @@ public class UserServiceImpl implements UserService{
return
userRepository
.
save
(
user1
);
return
userRepository
.
save
(
user1
);
}
}
@OperationAnno
(
channelNo
=
"#this[0]"
,
opt
=
OptEnumName
.
USER_ORDER_CLEAN
,
succSPEL
=
"#this.key"
,
optDetailSPEL
=
"#this.value"
)
@Async
(
"commonAsyncExecutor"
)
//@OperationAnno(channelNo = "#this[0]", opt = OptEnumName.USER_ORDER_CLEAN, succSPEL = "#this.key", optDetailSPEL = "#this.value")
@Override
@Override
public
Tuple
<
Boolean
,
String
>
cleanUserActiveOrder
(
String
mobile
)
{
public
Tuple
<
Boolean
,
String
>
cleanUserActiveOrder
(
String
mobile
)
{
XUser
user
=
xyqbUserService
.
findUserByPhoneNo
(
mobile
);
XUser
user
=
xyqbUserService
.
findUserByPhoneNo
(
mobile
);
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/asyncer/MyAsyncExecutor.java
0 → 100644
View file @
88ca41bf
package
cn
.
quantgroup
.
cashloanflowboss
.
core
.
asyncer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Component
;
import
java.util.concurrent.Executor
;
/**
* function:
* date: 2019/12/6
*
* @author: suntao
*/
@Component
public
class
MyAsyncExecutor
{
@Bean
(
name
=
"commonAsyncExecutor"
)
public
Executor
commonAsyncExecutor
()
{
return
generateThreadPoolTaskExecutor
(
10
,
30
,
100
,
true
,
30
,
true
,
"commonAsyncExecutor-"
);
}
/**
* 生成线程池
* @param corePoolSize
* @param maxPoolSize
* @param queueCapacity
* @param waitForCompleteOnShutdown
* @param prefix
* @return
*/
private
ThreadPoolTaskExecutor
generateThreadPoolTaskExecutor
(
int
corePoolSize
,
int
maxPoolSize
,
int
queueCapacity
,
boolean
waitForCompleteOnShutdown
,
int
keepAliveSeconds
,
boolean
allowCoreThreadTimeOut
,
String
prefix
)
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
corePoolSize
);
executor
.
setMaxPoolSize
(
maxPoolSize
);
executor
.
setQueueCapacity
(
queueCapacity
);
executor
.
setKeepAliveSeconds
(
keepAliveSeconds
);
executor
.
setAllowCoreThreadTimeOut
(
allowCoreThreadTimeOut
);
executor
.
setWaitForTasksToCompleteOnShutdown
(
waitForCompleteOnShutdown
);
executor
.
setThreadNamePrefix
(
prefix
);
executor
.
initialize
();
return
executor
;
}
}
src/main/java/cn/quantgroup/cashloanflowboss/spi/jolyne/JolyneServiceImpl.java
View file @
88ca41bf
...
@@ -31,6 +31,7 @@ public class JolyneServiceImpl implements JolyneService {
...
@@ -31,6 +31,7 @@ public class JolyneServiceImpl implements JolyneService {
@Override
@Override
public
String
executeSQL
(
JolyneDB
jolyneDB
,
String
jsonData
)
{
public
String
executeSQL
(
JolyneDB
jolyneDB
,
String
jsonData
)
{
return
jolyneCenter
.
executeSQL
(
jolyneDB
.
getDbName
(),
jsonData
);
return
jolyneCenter
.
executeSQL
(
jolyneDB
.
getDbName
(),
jsonData
);
...
@@ -42,7 +43,7 @@ public class JolyneServiceImpl implements JolyneService {
...
@@ -42,7 +43,7 @@ public class JolyneServiceImpl implements JolyneService {
jolyneCenter
.
reloadJob
(
jobName
);
jolyneCenter
.
reloadJob
(
jobName
);
}
}
@Async
@Async
(
"commonAsyncExecutor"
)
@Override
@Override
public
String
delayUpdateWaitingXyqbSql
(
Long
loanId
,
Long
delayTime
)
{
public
String
delayUpdateWaitingXyqbSql
(
Long
loanId
,
Long
delayTime
)
{
...
@@ -56,7 +57,7 @@ public class JolyneServiceImpl implements JolyneService {
...
@@ -56,7 +57,7 @@ public class JolyneServiceImpl implements JolyneService {
try
{
try
{
Thread
.
sleep
(
delayTime
);
Thread
.
sleep
(
delayTime
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"Thread.sleep error"
);
}
}
loanApplicationHistory
=
xyqbCenterService
.
findLoanApplicationHistoryById
(
loanId
);
loanApplicationHistory
=
xyqbCenterService
.
findLoanApplicationHistoryById
(
loanId
);
...
@@ -80,7 +81,7 @@ public class JolyneServiceImpl implements JolyneService {
...
@@ -80,7 +81,7 @@ public class JolyneServiceImpl implements JolyneService {
try
{
try
{
Thread
.
sleep
(
200
);
Thread
.
sleep
(
200
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"Thread.sleep error"
);
}
}
reloadJob
(
"cn.qg.clotho.job.FetchDataLoanJob"
);
reloadJob
(
"cn.qg.clotho.job.FetchDataLoanJob"
);
...
@@ -88,7 +89,7 @@ public class JolyneServiceImpl implements JolyneService {
...
@@ -88,7 +89,7 @@ public class JolyneServiceImpl implements JolyneService {
try
{
try
{
Thread
.
sleep
(
200
);
Thread
.
sleep
(
200
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"Thread.sleep error"
);
}
}
reloadJob
(
"cn.qg.clotho.job.LoanDataJob"
);
reloadJob
(
"cn.qg.clotho.job.LoanDataJob"
);
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/user/service/XyqbUserServiceImpl.java
View file @
88ca41bf
...
@@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory;
...
@@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.*
;
...
@@ -130,8 +131,10 @@ public class XyqbUserServiceImpl implements XyqbUserService {
...
@@ -130,8 +131,10 @@ public class XyqbUserServiceImpl implements XyqbUserService {
}
}
@OperationAnno
(
channelNo
=
"#this[0]"
,
opt
=
OptEnumName
.
USER_INFO_CLEAN
,
succSPEL
=
"#this.key"
,
optDetailSPEL
=
"#this.value"
)
//@OperationAnno(channelNo = "#this[0]", opt = OptEnumName.USER_INFO_CLEAN, succSPEL = "#this.key", optDetailSPEL = "#this.value")
@Override
public
Tuple
<
Boolean
,
String
>
deleteByUserId
(
String
phoneNo
)
{
@Async
(
"commonAsyncExecutor"
)
@Override
public
Tuple
<
Boolean
,
String
>
deleteByUserId
(
String
phoneNo
)
{
try
{
try
{
UserSysResult
<
XUser
>
xUser
=
userSysService
.
getService
().
findUserByPhoneNo
(
phoneNo
);
UserSysResult
<
XUser
>
xUser
=
userSysService
.
getService
().
findUserByPhoneNo
(
phoneNo
);
if
(
xUser
==
null
||
xUser
.
getData
()
==
null
)
{
if
(
xUser
==
null
||
xUser
.
getData
()
==
null
)
{
...
@@ -156,8 +159,8 @@ public class XyqbUserServiceImpl implements XyqbUserService {
...
@@ -156,8 +159,8 @@ public class XyqbUserServiceImpl implements XyqbUserService {
if
(
userKeys
!=
null
){
if
(
userKeys
!=
null
){
redisTemplate
.
delete
(
userKeys
);
redisTemplate
.
delete
(
userKeys
);
}
}
String
token
_k
ey
=
"userid-sessionvalue:cache::"
+
userId
+
":xyqb"
;
String
token
K
ey
=
"userid-sessionvalue:cache::"
+
userId
+
":xyqb"
;
String
token
=
redisTemplate
.
opsForValue
().
get
(
token
_k
ey
);
String
token
=
redisTemplate
.
opsForValue
().
get
(
token
K
ey
);
if
(
token
!=
null
&&
redisTemplate
.
keys
(
token
)!=
null
){
if
(
token
!=
null
&&
redisTemplate
.
keys
(
token
)!=
null
){
Set
<
String
>
tokenKeys
=
redisTemplate
.
keys
(
token
);
Set
<
String
>
tokenKeys
=
redisTemplate
.
keys
(
token
);
redisTemplate
.
delete
(
tokenKeys
);
redisTemplate
.
delete
(
tokenKeys
);
...
...
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