Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
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
Administrator
dsk-cr20g
Commits
ec30973a
Commit
ec30973a
authored
Aug 31, 2023
by
liuChang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页缓存
parent
698b5977
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
IndexService.java
...src/main/java/com/dsk/system/dskService/IndexService.java
+27
-0
No files found.
dsk-system/src/main/java/com/dsk/system/dskService/IndexService.java
View file @
ec30973a
package
com
.
dsk
.
system
.
dskService
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.extra.mail.MailUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.dsk.common.core.domain.AjaxResult
;
import
com.dsk.common.core.redis.RedisCache
;
import
com.dsk.common.utils.DateUtils
;
import
com.dsk.common.utils.DskOpenApiUtil
;
import
org.apache.commons.collections4.MapUtils
;
...
...
@@ -30,6 +34,9 @@ public class IndexService {
@Autowired
private
DskOpenApiUtil
dskOpenApiUtil
;
@Autowired
private
RedisCache
redisCache
;
public
AjaxResult
bigWinningBidsPage
(
JSONObject
object
)
{
ArrayList
recentlyBidQueryDtoList
=
object
.
getJSONArray
(
"recentlyBidQueryDto"
);
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
...
...
@@ -91,6 +98,26 @@ public class IndexService {
}
public
AjaxResult
countByCompany
(
JSONObject
object
)
{
Date
startDate
=
object
.
getDate
(
"startDate"
);
Date
endDate
=
object
.
getDate
(
"endDate"
);
long
l
=
0
;
long
i
=
0
;
if
(
startDate
!=
null
&&
endDate
!=
null
){
l
=
DateUtil
.
betweenDay
(
startDate
,
endDate
,
false
);
i
=
DateUtil
.
betweenDay
(
endDate
,
new
Date
(),
false
);
}
if
(
null
!=
object
&&
null
==
object
.
get
(
"provinceId"
)&&
null
==
object
.
get
(
"type"
)&&
l
==
3
&&
i
==
0
){
Map
<
String
,
Object
>
countByCompany
=
redisCache
.
getCacheMap
(
"index_countByCompany"
);
if
(
null
==
countByCompany
||
MapUtil
.
isEmpty
(
countByCompany
)){
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/marketAnalysis/centralEnterprse/countByCompany"
,
object
);
redisCache
.
setCacheMap
(
"index_countByCompany"
,
map
);
redisCache
.
expire
(
"index_countByCompany"
,
7200
);
return
BeanUtil
.
toBean
(
countByCompany
,
AjaxResult
.
class
);
}
else
{
log
.
info
(
"首页集团中标业绩从缓存中取"
);
return
BeanUtil
.
toBean
(
countByCompany
,
AjaxResult
.
class
);
}
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/marketAnalysis/centralEnterprse/countByCompany"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
...
...
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