Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
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
QG
customer-service
Commits
1d332f44
Commit
1d332f44
authored
Jun 06, 2024
by
yajun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
防止重复下载
parent
5449a841
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
ThirdWorkOrderServiceImpl.java
...roup/customer/service/impl/ThirdWorkOrderServiceImpl.java
+11
-0
No files found.
src/main/java/cn/quantgroup/customer/service/impl/ThirdWorkOrderServiceImpl.java
View file @
1d332f44
...
@@ -29,6 +29,7 @@ import java.util.Map;
...
@@ -29,6 +29,7 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
import
javax.persistence.Query
;
...
@@ -39,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -39,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.InputStreamResource
;
import
org.springframework.core.io.InputStreamResource
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -66,6 +68,9 @@ public class ThirdWorkOrderServiceImpl implements IThirdWorkOrderService {
...
@@ -66,6 +68,9 @@ public class ThirdWorkOrderServiceImpl implements IThirdWorkOrderService {
@Value
(
"${customer.transaction.mail.from}"
)
@Value
(
"${customer.transaction.mail.from}"
)
private
String
from
;
private
String
from
;
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
2
);
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
2
);
private
static
int
pageSize
=
500
;
private
static
int
pageSize
=
500
;
...
@@ -216,6 +221,12 @@ public class ThirdWorkOrderServiceImpl implements IThirdWorkOrderService {
...
@@ -216,6 +221,12 @@ public class ThirdWorkOrderServiceImpl implements IThirdWorkOrderService {
if
(
StringUtils
.
isBlank
(
account
)){
if
(
StringUtils
.
isBlank
(
account
)){
return
JsonResult
.
buildErrorStateResult
(
"账号名为空"
);
return
JsonResult
.
buildErrorStateResult
(
"账号名为空"
);
}
}
String
key
=
"export_"
+
account
;
String
value
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
key
);
if
(
StringUtils
.
isNotBlank
(
value
)){
return
JsonResult
.
buildErrorStateResult
(
"系统导出处理中,请勿重复下载"
);
}
redisTemplate
.
opsForValue
().
set
(
key
,
"lock"
,
1
,
TimeUnit
.
MINUTES
);
executorService
.
execute
(()->{
executorService
.
execute
(()->{
doExportBusiness
(
param
,
account
,
tenantId
);
doExportBusiness
(
param
,
account
,
tenantId
);
});
});
...
...
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