Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
haoban3.0
haoban-manage3.0
Commits
55e96a19
Commit
55e96a19
authored
Jun 01, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询未完成营销任务数量添加缓存
parent
a88f2d66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
23 deletions
+49
-23
NotifyController.java
...om/gic/haoban/manage/web/controller/NotifyController.java
+49
-23
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/NotifyController.java
View file @
55e96a19
...
...
@@ -24,6 +24,7 @@ import com.gic.haoban.manage.web.vo.MarketingCountVO;
import
com.gic.haoban.manage.web.vo.notify.PairValVO
;
import
com.gic.haoban.task.api.service.TelTaskApiService
;
import
com.gic.haoban.task.manage.api.service.IMarketClueTaskApiService
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -32,10 +33,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.Valid
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* Created 2021/12/16.
...
...
@@ -216,31 +214,59 @@ public class NotifyController extends WebBaseController {
logger
.
info
(
"查询是否店长:{}"
,
clerkId
);
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(
clerkDTO
!=
null
)
{
Integer
groupChatCount
,
telTaskCount
,
groupMessageCount
,
total
=
0
;
Integer
groupChatCount
=
0
,
telTaskCount
=
0
,
groupMessageCount
=
0
,
total
=
0
;
Integer
clerkType
=
clerkDTO
.
getClerkType
();
if
(
clerkType
==
1
||
clerkType
==
2
)
{
//店长维度
//社群群发
logger
.
info
(
"店长维度查询社群群发"
);
groupChatCount
=
groupChatPlanApiService
.
getTotalCount
(
enterpriseId
,
null
,
storeId
).
getResult
();
//话务群发
logger
.
info
(
"店长维度查询话务群发"
);
telTaskCount
=
telTaskApiService
.
getTotalCount
(
enterpriseId
,
null
,
storeId
).
getResult
();
//群发
logger
.
info
(
"店长维度查询群发"
);
groupMessageCount
=
iMarketClueTaskApiService
.
getTotalCount
(
enterpriseId
,
null
,
storeId
).
getResult
();
//添加redis缓存
String
cacheKey
=
"marketing_Count:"
+
storeId
;
Object
value
=
RedisUtil
.
getCache
(
cacheKey
);
if
(
null
!=
value
){
String
cache
=
String
.
valueOf
(
value
);
List
<
String
>
cacheList
=
Arrays
.
asList
(
cache
.
split
(
","
));
groupChatCount
=
Integer
.
valueOf
(
cacheList
.
get
(
0
));
telTaskCount
=
Integer
.
valueOf
(
cacheList
.
get
(
1
));
groupMessageCount
=
Integer
.
valueOf
(
cacheList
.
get
(
2
));
}
else
{
//社群群发
logger
.
info
(
"店长维度查询社群群发"
);
groupChatCount
=
groupChatPlanApiService
.
getTotalCount
(
enterpriseId
,
null
,
storeId
).
getResult
();
//话务群发
logger
.
info
(
"店长维度查询话务群发"
);
telTaskCount
=
telTaskApiService
.
getTotalCount
(
enterpriseId
,
null
,
storeId
).
getResult
();
//群发
logger
.
info
(
"店长维度查询群发"
);
groupMessageCount
=
iMarketClueTaskApiService
.
getTotalCount
(
enterpriseId
,
null
,
storeId
).
getResult
();
String
cacheValue
=
groupChatCount
+
","
+
telTaskCount
+
","
+
groupMessageCount
;
//缓存10分钟
RedisUtil
.
setCache
(
cacheKey
,
cacheValue
,
600L
);
}
total
=
groupChatCount
+
telTaskCount
+
groupMessageCount
;
}
else
{
//导购维度
//社群群发
logger
.
info
(
"导购维度查询社群群发"
);
groupChatCount
=
groupChatPlanApiService
.
getTotalCount
(
enterpriseId
,
clerkId
,
storeId
).
getResult
();
//话务群发
logger
.
info
(
"导购维度查询话务群发"
);
telTaskCount
=
telTaskApiService
.
getTotalCount
(
enterpriseId
,
clerkId
,
storeId
).
getResult
();
//群发
logger
.
info
(
"导购维度查询群发"
);
groupMessageCount
=
iMarketClueTaskApiService
.
getTotalCount
(
enterpriseId
,
clerkId
,
storeId
).
getResult
();
//添加redis缓存
String
cacheKey
=
"marketing_Count:"
+
storeId
+
":"
+
clerkId
;
Object
value
=
RedisUtil
.
getCache
(
cacheKey
);
if
(
null
!=
value
){
String
cache
=
String
.
valueOf
(
value
);
List
<
String
>
cacheList
=
Arrays
.
asList
(
cache
.
split
(
","
));
groupChatCount
=
Integer
.
valueOf
(
cacheList
.
get
(
0
));
telTaskCount
=
Integer
.
valueOf
(
cacheList
.
get
(
1
));
groupMessageCount
=
Integer
.
valueOf
(
cacheList
.
get
(
2
));
}
else
{
//社群群发
logger
.
info
(
"导购维度查询社群群发"
);
groupChatCount
=
groupChatPlanApiService
.
getTotalCount
(
enterpriseId
,
clerkId
,
storeId
).
getResult
();
//话务群发
logger
.
info
(
"导购维度查询话务群发"
);
telTaskCount
=
telTaskApiService
.
getTotalCount
(
enterpriseId
,
clerkId
,
storeId
).
getResult
();
//群发
logger
.
info
(
"导购维度查询群发"
);
groupMessageCount
=
iMarketClueTaskApiService
.
getTotalCount
(
enterpriseId
,
clerkId
,
storeId
).
getResult
();
String
cacheValue
=
groupChatCount
+
","
+
telTaskCount
+
","
+
groupMessageCount
;
//缓存10分钟
RedisUtil
.
setCache
(
cacheKey
,
cacheValue
,
600L
);
}
total
=
groupChatCount
+
telTaskCount
+
groupMessageCount
;
}
marketingCountVO
.
setGroupChatCount
(
groupChatCount
);
...
...
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