Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EL-ADMIN
Project
Project
Details
Activity
Releases
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
JiangSN
EL-ADMIN
Commits
b607ead6
Commit
b607ead6
authored
Oct 27, 2021
by
JiangSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新首页图表、增加查询访问量定时任务、修改省平台接口token判断逻辑
parent
f2d73dfe
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
311 additions
and
118 deletions
+311
-118
LineChart.vue
eladmin-web/src/views/dashboard/LineChart.vue
+10
-7
PanelGroup.vue
eladmin-web/src/views/dashboard/PanelGroup.vue
+24
-23
home.vue
eladmin-web/src/views/home.vue
+98
-56
IndexMapper.java
.../src/main/java/me/zhengjie/MybatisMapper/IndexMapper.java
+7
-1
CEGNController.java
.../src/main/java/me/zhengjie/controller/CEGNController.java
+1
-1
IndexController.java
...src/main/java/me/zhengjie/controller/IndexController.java
+24
-4
IndexService.java
...iness/src/main/java/me/zhengjie/service/IndexService.java
+34
-5
IndexServiceImpl.java
...c/main/java/me/zhengjie/serviceimpl/IndexServiceImpl.java
+41
-3
shengneiUtil.java
...business/src/main/java/me/zhengjie/util/shengneiUtil.java
+15
-9
IndexMapper.xml
...ladmin-business/src/main/resources/mapper/IndexMapper.xml
+36
-4
TimingTask.java
...main/java/me/zhengjie/modules/quartz/task/TimingTask.java
+21
-5
No files found.
eladmin-web/src/views/dashboard/LineChart.vue
View file @
b607ead6
...
@@ -61,10 +61,10 @@ export default {
...
@@ -61,10 +61,10 @@ export default {
this
.
chart
=
echarts
.
init
(
this
.
$el
,
'macarons'
)
this
.
chart
=
echarts
.
init
(
this
.
$el
,
'macarons'
)
this
.
setOptions
(
this
.
chartData
)
this
.
setOptions
(
this
.
chartData
)
},
},
setOptions
({
expectedData
,
actualD
ata
}
=
{})
{
setOptions
({
sptData
,
zjbData
,
d
ata
}
=
{})
{
this
.
chart
.
setOption
({
this
.
chart
.
setOption
({
xAxis
:
{
xAxis
:
{
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
]
,
data
:
data
,
boundaryGap
:
false
,
boundaryGap
:
false
,
axisTick
:
{
axisTick
:
{
show
:
false
show
:
false
...
@@ -90,26 +90,29 @@ export default {
...
@@ -90,26 +90,29 @@ export default {
}
}
},
},
legend
:
{
legend
:
{
data
:
[
'
expected'
,
'actual
'
]
data
:
[
'
省平台'
,
'住建部
'
]
},
},
series
:
[{
series
:
[{
name
:
'
expected
'
,
itemStyle
:
{
name
:
'
省平台
'
,
itemStyle
:
{
normal
:
{
normal
:
{
color
:
'#FF005A'
,
color
:
'#FF005A'
,
lineStyle
:
{
lineStyle
:
{
color
:
'#FF005A'
,
color
:
'#FF005A'
,
width
:
2
width
:
2
},
areaStyle
:
{
color
:
'#fedbdd'
}
}
}
}
},
},
smooth
:
true
,
smooth
:
true
,
type
:
'line'
,
type
:
'line'
,
data
:
expected
Data
,
data
:
spt
Data
,
animationDuration
:
2800
,
animationDuration
:
2800
,
animationEasing
:
'cubicInOut'
animationEasing
:
'cubicInOut'
},
},
{
{
name
:
'
actual
'
,
name
:
'
住建部
'
,
smooth
:
true
,
smooth
:
true
,
type
:
'line'
,
type
:
'line'
,
itemStyle
:
{
itemStyle
:
{
...
@@ -124,7 +127,7 @@ export default {
...
@@ -124,7 +127,7 @@ export default {
}
}
}
}
},
},
data
:
actual
Data
,
data
:
zjb
Data
,
animationDuration
:
2800
,
animationDuration
:
2800
,
animationEasing
:
'quadraticOut'
animationEasing
:
'quadraticOut'
}]
}]
...
...
eladmin-web/src/views/dashboard/PanelGroup.vue
View file @
b607ead6
<
template
>
<
template
>
<el-row
:gutter=
"40"
class=
"panel-group"
>
<el-row
:gutter=
"40"
class=
"panel-group"
>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
newVisitis
')"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
Day
')"
>
<div
class=
"card-panel-icon-wrapper icon-people"
>
<div
class=
"card-panel-icon-wrapper icon-people"
>
<svg-icon
icon-class=
"visits"
class-name=
"card-panel-icon"
/>
<svg-icon
icon-class=
"visits"
class-name=
"card-panel-icon"
/>
</div>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
<div
class=
"card-panel-text"
>
每
日访问量
省平台-当
日访问量
</div>
</div>
<count-to
:start-val=
"0"
:end-val=
"this.visit
s"
:duration=
"2600"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"this.visit
orVolume.sptDay"
:duration=
"2600"
class=
"card-panel-num"
/>
</div>
</div>
</div>
</div>
</el-col>
</el-col>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
messages
')"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
Day
')"
>
<div
class=
"card-panel-icon-wrapper icon-people"
>
<div
class=
"card-panel-icon-wrapper icon-people"
>
<svg-icon
icon-class=
"visits"
class-name=
"card-panel-icon"
/>
<svg-icon
icon-class=
"visits"
class-name=
"card-panel-icon"
/>
</div>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
<div
class=
"card-panel-text"
>
每月
访问量
住建部-当日
访问量
</div>
</div>
<count-to
:start-val=
"0"
:end-val=
"this.
totalview"
:duration=
"3000"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"this.
visitorVolume.zjbDay"
:duration=
"3200"
class=
"card-panel-num"
/>
</div>
</div>
</div>
</div>
</el-col>
</el-col>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
purchases
')"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
Month
')"
>
<div
class=
"card-panel-icon-wrapper icon-message"
>
<div
class=
"card-panel-icon-wrapper icon-message"
>
<svg-icon
icon-class=
"tree"
class-name=
"card-panel-icon"
/>
<svg-icon
icon-class=
"tree"
class-name=
"card-panel-icon"
/>
</div>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
<div
class=
"card-panel-text"
>
任务调度
省平台-当月访问量
</div>
</div>
<count-to
:start-val=
"0"
:end-val=
"
'----'"
:duration=
"3200"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
this.visitorVolume.sptMonth"
:duration=
"3000"
class=
"card-panel-num"
/>
</div>
</div>
</div>
</div>
</el-col>
</el-col>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
shoppings
')"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('
Month
')"
>
<div
class=
"card-panel-icon-wrapper icon-shopping"
>
<div
class=
"card-panel-icon-wrapper icon-shopping"
>
<svg-icon
icon-class=
"shopping"
class-name=
"card-panel-icon"
/>
<svg-icon
icon-class=
"shopping"
class-name=
"card-panel-icon"
/>
</div>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
<div
class=
"card-panel-text"
>
住建部-当月访问量
</div>
</div>
<count-to
:start-val=
"0"
:end-val=
"
'----'"
:duration=
"3600"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
this.visitorVolume.zjbMonth"
:duration=
"3600"
class=
"card-panel-num"
/>
</div>
</div>
</div>
</div>
</el-col>
</el-col>
...
@@ -60,13 +60,14 @@ import CountTo from 'vue-count-to'
...
@@ -60,13 +60,14 @@ import CountTo from 'vue-count-to'
export
default
{
export
default
{
props
:
{
props
:
{
visits
:
{
visitorVolume
:
{
type
:
String
,
type
:
Object
,
default
:
0
default
:
{
},
sptDay
:
0
,
totalview
:
{
sptMonth
:
0
,
type
:
String
,
zjbDay
:
0
,
default
:
0
zjbMonth
:
0
}
},
},
},
},
components
:
{
components
:
{
...
@@ -170,7 +171,7 @@ export default {
...
@@ -170,7 +171,7 @@ export default {
}
}
}
}
@media
(
max-width
:
550px
)
{
@media
(
max-width
:
550px
)
{
.card-panel-description
{
.card-panel-description
{
display
:
none
;
display
:
none
;
}
}
...
...
eladmin-web/src/views/home.vue
View file @
b607ead6
<
template
>
<
template
>
<div
class=
"dashboard-container"
>
<div
class=
"dashboard-container"
>
<div
class=
"dashboard-editor-container"
>
<div
class=
"dashboard-editor-container"
>
<!--
<github-corner
class=
"github-corner"
/>
-->
<panel-group
@
handleSetLineChartData=
"handleSetLineChartData"
/>
<panel-group
@
handleSetLineChartData=
"handleSetLineChartData"
:visitorVolume=
"this.visitorVolume"
/>
<a
href=
"javascript:"
style=
"font-size: 20pt;margin: auto;text-align: center;"
>
{{
this
.
name
}}
</a>
<el-row
style=
"background:#fff;padding:16px 16px 0;margin-bottom:32px;"
>
<el-row
style=
"background:#fff;padding:16px 16px 0;margin-bottom:32px;"
>
<line-chart
:chart-data=
"lineChartData"
/>
<line-chart
:chart-data=
"lineChartData"
/>
</el-row>
</el-row>
<el-row
:gutter=
"32"
>
<
!--
<
el-row
:gutter=
"32"
>
<el-col
:xs=
"24"
:sm=
"24"
:lg=
"8"
>
<el-col
:xs=
"24"
:sm=
"24"
:lg=
"8"
>
<div
class=
"chart-wrapper"
>
<div
class=
"chart-wrapper"
>
<radar-chart
/>
<radar-chart
/>
...
@@ -24,7 +23,7 @@
...
@@ -24,7 +23,7 @@
<bar-chart
/>
<bar-chart
/>
</div>
</div>
</el-col>
</el-col>
</el-row
>
</el-row>
--
>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -38,22 +37,18 @@ import PieChart from '@/components/Echarts/PieChart'
...
@@ -38,22 +37,18 @@ import PieChart from '@/components/Echarts/PieChart'
import
BarChart
from
'@/components/Echarts/BarChart'
import
BarChart
from
'@/components/Echarts/BarChart'
const
lineChartData
=
{
const
lineChartData
=
{
newVisitis
:
{
Day
:
{
expectedData
:
[
100
,
120
,
161
,
134
,
105
,
160
,
165
],
sptData
:
[],
actualData
:
[
120
,
82
,
91
,
154
,
162
,
140
,
145
]
zjbData
:
[],
},
data
:
[]
messages
:
{
expectedData
:
[
200
,
192
,
120
,
144
,
160
,
130
,
140
],
actualData
:
[
180
,
160
,
151
,
106
,
145
,
150
,
130
]
},
},
purchases
:
{
Month
:
{
expectedData
:
[
80
,
100
,
121
,
104
,
105
,
90
,
100
],
//expectedData
actualData
:
[
120
,
90
,
100
,
138
,
142
,
130
,
130
]
sptData
:
[],
//expectedData
zjbData
:
[],
data
:
[]
},
},
shoppings
:
{
expectedData
:
[
130
,
140
,
141
,
142
,
145
,
150
,
160
],
actualData
:
[
120
,
82
,
91
,
154
,
162
,
140
,
130
]
}
}
}
export
default
{
export
default
{
...
@@ -67,40 +62,87 @@ export default {
...
@@ -67,40 +62,87 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
lineChartData
:
lineChartData
.
newVisitis
name
:
'每日访问量'
,
visitorVolume
:
{
sptDay
:
0
,
sptMonth
:
0
,
zjbDay
:
0
,
zjbMonth
:
0
},
lineChartData
:
lineChartData
.
Day
}
}
},
},
methods
:
{
methods
:
{
init
()
{
this
.
getDataList
();
},
getDataList
()
{
this
.
$http
.
post
(
"api/IndexController/selectVisitsList"
).
then
(
function
(
res
)
{
for
(
const
re
of
res
.
body
.
content
)
{
switch
(
re
.
LABLE
)
{
case
"住建部当日"
:
this
.
visitorVolume
.
zjbDay
=
re
.
SL
;
break
;
case
"住建部当月"
:
this
.
visitorVolume
.
zjbMonth
=
re
.
SL
;
break
;
case
"省平台当日"
:
this
.
visitorVolume
.
sptDay
=
re
.
SL
;
break
;
default
:
this
.
visitorVolume
.
sptMonth
=
re
.
SL
;
break
;
}
}
})
this
.
$http
.
post
(
"api/IndexController/selectMyfwlList"
).
then
(
function
(
res
)
{
lineChartData
.
Month
.
data
=
[]
lineChartData
.
Month
.
sptData
=
[]
lineChartData
.
Month
.
zjbData
=
[]
for
(
const
re
of
res
.
body
.
content
)
{
lineChartData
.
Month
.
data
.
push
(
re
.
YUEFEN
)
lineChartData
.
Month
.
sptData
.
push
(
re
.
SPTYFWL
)
lineChartData
.
Month
.
zjbData
.
push
(
re
.
ZJBYFWL
)
}
})
this
.
$http
.
post
(
"api/IndexController/selectMrfwlList"
).
then
(
function
(
res
)
{
lineChartData
.
Day
.
data
=
[]
lineChartData
.
Day
.
sptData
=
[]
lineChartData
.
Day
.
zjbData
=
[]
for
(
const
re
of
res
.
body
.
content
)
{
lineChartData
.
Day
.
data
.
push
(
re
.
RIQI
)
lineChartData
.
Day
.
sptData
.
push
(
re
.
SPTRFWL
)
lineChartData
.
Day
.
zjbData
.
push
(
re
.
ZJBRFWL
)
}
})
},
handleSetLineChartData
(
type
)
{
handleSetLineChartData
(
type
)
{
type
===
"Day"
?
this
.
name
=
"每日访问量"
:
this
.
name
=
"每月访问量"
this
.
lineChartData
=
lineChartData
[
type
]
this
.
lineChartData
=
lineChartData
[
type
]
}
}
},
mounted
()
{
this
.
init
();
}
}
}
}
</
script
>
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.dashboard-editor-container
{
.dashboard-editor-container
{
padding
:
32px
;
padding
:
32px
;
background-color
:
rgb
(
240
,
242
,
245
);
background-color
:
rgb
(
240
,
242
,
245
);
position
:
relative
;
position
:
relative
;
.github-corner
{
position
:
absolute
;
top
:
0
;
border
:
0
;
right
:
0
;
}
.chart-wrapper
{
.chart-wrapper
{
background
:
#fff
;
background
:
#fff
;
padding
:
16px
16px
0
;
padding
:
16px
16px
0
;
margin-bottom
:
32px
;
margin-bottom
:
32px
;
}
}
}
}
@media
(
max-width
:
1024px
)
{
@media
(
max-width
:
1024px
)
{
.chart-wrapper
{
.chart-wrapper
{
padding
:
8px
;
padding
:
8px
;
}
}
}
}
</
style
>
</
style
>
eladmin/eladmin-business/src/main/java/me/zhengjie/MybatisMapper/IndexMapper.java
View file @
b607ead6
...
@@ -7,5 +7,11 @@ import java.util.Map;
...
@@ -7,5 +7,11 @@ import java.util.Map;
public
interface
IndexMapper
extends
BaseMapper
<
Map
>
{
public
interface
IndexMapper
extends
BaseMapper
<
Map
>
{
List
<
Map
>
selectDemo
();
List
<
Map
>
selectVisitsList
();
List
<
Map
>
selectMyfwlList
();
List
<
Map
>
selectMrfwlList
();
List
<
Map
>
insertIntoFwl
();
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/controller/CEGNController.java
View file @
b607ead6
...
@@ -17,7 +17,7 @@ import java.util.Map;
...
@@ -17,7 +17,7 @@ import java.util.Map;
* @version V1.0
* @version V1.0
* @Title: gatewayZsjJlController
* @Title: gatewayZsjJlController
* @Package el-admin
* @Package el-admin
* @Description:
TODO(调用政务外网接口控制器)
* @Description:
调用政务外网接口控制器
* @date 2021/10/11 10:53
* @date 2021/10/11 10:53
*/
*/
@RestController
@RestController
...
...
eladmin/eladmin-business/src/main/java/me/zhengjie/controller/IndexController.java
View file @
b607ead6
package
me
.
zhengjie
.
controller
;
package
me
.
zhengjie
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.service.IndexService
;
import
me.zhengjie.service.IndexService
;
...
@@ -9,12 +10,15 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -9,12 +10,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author JiangHeJia
* @author JiangHeJia
* @version V1.0
* @version V1.0
* @Title: IndexController
* @Title: IndexController
* @Package el-admin
* @Package el-admin
* @Description:
TODO(首页展示信息查询控制器)
* @Description:
首页展示信息查询控制器
* @date 2021/10/12 21:28
* @date 2021/10/12 21:28
*/
*/
@RestController
@RestController
...
@@ -27,9 +31,25 @@ public class IndexController {
...
@@ -27,9 +31,25 @@ public class IndexController {
private
IndexService
indexService
;
private
IndexService
indexService
;
@AnonymousAccess
@AnonymousAccess
@RequestMapping
(
"/selectDemo"
)
@ApiOperation
(
"接口访问量查询"
)
public
R
selectDemo
()
{
@RequestMapping
(
"/selectVisitsList"
)
return
new
R
<>(
indexService
.
selectDemo
());
public
R
selectVisitsList
()
{
List
<
Map
>
visits
=
indexService
.
selectVisitsList
();
return
new
R
<>(
visits
);
}
}
@AnonymousAccess
@ApiOperation
(
"接口月访问量图表查询"
)
@RequestMapping
(
"/selectMyfwlList"
)
public
R
selectMyfwlList
()
{
List
<
Map
>
visits
=
indexService
.
selectMyfwlList
();
return
new
R
<>(
visits
);
}
@AnonymousAccess
@ApiOperation
(
"接口日访问量图表查询"
)
@RequestMapping
(
"/selectMrfwlList"
)
public
R
selectMrfwlList
()
{
List
<
Map
>
visits
=
indexService
.
selectMrfwlList
();
return
new
R
<>(
visits
);
}
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/service/IndexService.java
View file @
b607ead6
...
@@ -2,17 +2,46 @@ package me.zhengjie.service;
...
@@ -2,17 +2,46 @@ package me.zhengjie.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@Service
/**
* @author JiangHeJia
* @version V1.0
* @Title: IndexService
* @Package el-admin
* @Description: 首页展示信息查询接口
* @date 2021/10/12 21:30
*/
public
interface
IndexService
extends
IService
<
Map
>
{
public
interface
IndexService
extends
IService
<
Map
>
{
/**
* @Title: selectVisitsList
* @Description: 接口访问量查询接口
* @date: 2021/10/27 10:38
*/
List
<
Map
>
selectVisitsList
();
/**
/**
* 领导-管理部贷款逾期情况
* @Title: selectMyfwlList
* @return
* @Description: 每月访问量展示查询接口
* @date: 2021/10/27 14:38
*/
*/
List
<
Map
>
selectDemo
();
List
<
Map
>
selectMyfwlList
();
/**
* @Title: selectMrfwlList
* @Description: 每日访问量展示查询接口
* @date: 2021/10/27 14:38
*/
List
<
Map
>
selectMrfwlList
();
/**
* @Title: insertIntoFwl
* @Description: 调用访问量存储过程接口
* @date: 2021/10/27 14:38
*/
List
<
Map
>
insertIntoFwl
();
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/serviceimpl/IndexServiceImpl.java
View file @
b607ead6
...
@@ -14,7 +14,7 @@ import java.util.Map;
...
@@ -14,7 +14,7 @@ import java.util.Map;
* @version V1.0
* @version V1.0
* @Title: IndexServiceImpl
* @Title: IndexServiceImpl
* @Package el-admin
* @Package el-admin
* @Description:
TODO()
* @Description:
首页展示信息查询接口实现类
* @date 2021/10/12 21:30
* @date 2021/10/12 21:30
*/
*/
@Service
@Service
...
@@ -23,9 +23,47 @@ public class IndexServiceImpl extends ServiceImpl<IndexMapper, Map> implements I
...
@@ -23,9 +23,47 @@ public class IndexServiceImpl extends ServiceImpl<IndexMapper, Map> implements I
@Autowired
@Autowired
private
IndexMapper
indexMapper
;
private
IndexMapper
indexMapper
;
/**
* @Title: selectVisitsList
* @Description: 接口访问量查询实现
* * @param null:
* * @return: List<Map>
* @date: 2021/10/27 10:40
*/
@Override
public
List
<
Map
>
selectVisitsList
()
{
return
indexMapper
.
selectVisitsList
();
}
/**
* @Title: selectMyfwlList
* @Description: 每月访问量展示查询实现
* * @return: List<Map>
* @date: 2021/10/27 10:40
*/
@Override
public
List
<
Map
>
selectMyfwlList
()
{
return
indexMapper
.
selectMyfwlList
();
}
/**
* @Title: selectMrfwlList
* @Description: 每日访问量展示查询实现
* * @return: List<Map>
* @date: 2021/10/27 10:40
*/
@Override
public
List
<
Map
>
selectMrfwlList
()
{
return
indexMapper
.
selectMrfwlList
();
}
/**
* @Title: selectMrfwlList
* @Description: 调用访问量存储过程接口
* * @return: List<Map>
* @date: 2021/10/27 10:40
*/
@Override
@Override
public
List
<
Map
>
selectDemo
()
{
public
List
<
Map
>
insertIntoFwl
()
{
return
indexMapper
.
selectDemo
();
return
indexMapper
.
insertIntoFwl
();
}
}
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/util/shengneiUtil.java
View file @
b607ead6
...
@@ -35,11 +35,15 @@ import java.util.*;
...
@@ -35,11 +35,15 @@ import java.util.*;
* @version V1.0
* @version V1.0
* @Title: shengneiUtil
* @Title: shengneiUtil
* @Package eladmin
* @Package eladmin
* @Description:
TODO(政务外网访问工具类)
* @Description:
政务外网访问工具类
* @date 2021/9/14 16:57
* @date 2021/9/14 16:57
*/
*/
@Log
@Log
public
class
shengneiUtil
{
public
class
shengneiUtil
{
@Autowired
static
RedisUtils
redisUtils
;
/**
/**
* httpclient
* httpclient
*
*
...
@@ -61,12 +65,9 @@ public class shengneiUtil {
...
@@ -61,12 +65,9 @@ public class shengneiUtil {
return
HttpClients
.
createDefault
();
return
HttpClients
.
createDefault
();
}
}
@Autowired
static
RedisUtils
redisUtils
;
/**
/**
* 获取token
* 获取token
*
* @return
* @return
*/
*/
public
static
void
getToken
(
CloseableHttpClient
httpClinet
)
{
public
static
void
getToken
(
CloseableHttpClient
httpClinet
)
{
...
@@ -174,11 +175,16 @@ public class shengneiUtil {
...
@@ -174,11 +175,16 @@ public class shengneiUtil {
obj
.
put
(
"format"
,
"JSON"
);
obj
.
put
(
"format"
,
"JSON"
);
obj
.
put
(
"timestamp"
,
da
);
obj
.
put
(
"timestamp"
,
da
);
log
.
info
(
"发送内容"
+
obj
);
log
.
info
(
"发送内容"
+
obj
);
//todo-sn 2021/10/11 10:30 Ash:判断token是否失效,失效重新获取token后再次发送请求;未测试
// 查询redis中是否有token,没有获取一遍。
//todo-sn 2021/10/13 15:51 Ash: 判断token是否为空,为空获取token
if
(
Objects
.
equals
(
redisUtils
.
get
(
"access_token"
),
null
))
{
if
(
Objects
.
equals
(
redisUtils
.
get
(
"access_token"
),
""
)
||
Objects
.
equals
(
redisUtils
.
get
(
"access_token"
),
null
))
{
getToken
(
httpClinet
);
}
String
doPost
=
doPost
(
url
,
obj
.
toString
(),
redisUtils
.
get
(
"access_token"
).
toString
(),
httpClinet
);
Map
resultMap
=
JSONUtil
.
toMap
(
doPost
);
// 返回状态码为400003(第三方接口查询失败)时,重新获取一遍token。
if
(
"400003"
.
equals
(
resultMap
.
get
(
"code"
)))
{
getToken
(
httpClinet
);
getToken
(
httpClinet
);
}
}
return
doPost
(
url
,
obj
.
toString
(),
redisUtils
.
get
(
"access_token"
).
toString
(),
httpClinet
)
;
return
doPost
;
}
}
}
}
eladmin/eladmin-business/src/main/resources/mapper/IndexMapper.xml
View file @
b607ead6
...
@@ -2,10 +2,42 @@
...
@@ -2,10 +2,42 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"me.zhengjie.MybatisMapper.IndexMapper"
>
<mapper
namespace=
"me.zhengjie.MybatisMapper.IndexMapper"
>
<!-- 领导-贷款逾期-->
<select
id=
"selectVisitsList"
resultType=
"java.util.Map"
>
<select
id=
"selectDemo"
resultType=
"java.util.Map"
>
<![CDATA[
<![CDATA[
select * from sjgx_sys_log
select count(x.id) SL, '省平台当日' lable
from v_sjgx_mrfwl x
where x.lable = 'SPT'
and to_char(x.RQ, 'yyyymmdd') = to_char(sysdate, 'yyyymmdd')
union
select count(x.id) SL, '省平台当月' lable
from v_sjgx_mrfwl x
where x.lable = 'spt'
and to_char(x.RQ, 'yyyymm') = to_char(sysdate, 'yyyymm')
union
select count(x.id) SL,'住建部当日' lable
from v_sjgx_mrfwl x
where x.lable = 'zjb'
and to_char(x.RQ, 'yyyymmdd') = to_char(sysdate, 'yyyymmdd')
union
select count(x.id) SL,'住建部当月' lable
from v_sjgx_mrfwl x
where x.lable = 'zjb'
and to_char(x.RQ, 'yyyymm') = to_char(sysdate, 'yyyymm')
]]>
</select>
<select
id=
"selectMyfwlList"
resultType=
"java.util.Map"
>
<![CDATA[
select * from SJGX_SYYFWLZSB
]]>
</select>
<select
id=
"selectMrfwlList"
resultType=
"java.util.Map"
>
<![CDATA[
select * from SJGX_SYRFWLZSB
]]>
</select>
<select
id=
"insertIntoFwl"
resultType=
"java.util.Map"
>
<![CDATA[
call P_SJGX_FWL()
]]>
]]>
</select>
</select>
</mapper>
</mapper>
eladmin/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/T
est
Task.java
→
eladmin/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/T
iming
Task.java
View file @
b607ead6
...
@@ -18,6 +18,7 @@ package me.zhengjie.modules.quartz.task;
...
@@ -18,6 +18,7 @@ package me.zhengjie.modules.quartz.task;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.service.IndexService
;
import
me.zhengjie.util.shengneiUtil
;
import
me.zhengjie.util.shengneiUtil
;
import
me.zhengjie.utils.RedisUtils
;
import
me.zhengjie.utils.RedisUtils
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.NameValuePair
;
...
@@ -30,17 +31,24 @@ import java.util.ArrayList;
...
@@ -30,17 +31,24 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
/**
/**
*
测试用
*
定时任务
* @author
Zheng Jie
* @author
JiangHeJia
* @date 20
19-01-08
* @date 20
21/10/27
*/
*/
@Slf4j
@Slf4j
@Component
@Component
public
class
T
est
Task
{
public
class
T
iming
Task
{
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
public
void
runToken
(){
@Autowired
private
IndexService
indexService
;
/**
* @Title: timingToken
* @Description: 定时获取省平台token
* @date: 2021/10/27 15:37
*/
public
void
timingToken
(){
CloseableHttpClient
httpClinet
=
shengneiUtil
.
createSSLClientDefault
();
CloseableHttpClient
httpClinet
=
shengneiUtil
.
createSSLClientDefault
();
List
<
NameValuePair
>
nvps
=
new
ArrayList
<
NameValuePair
>();
List
<
NameValuePair
>
nvps
=
new
ArrayList
<
NameValuePair
>();
//client_id
//client_id
...
@@ -58,4 +66,12 @@ public class TestTask {
...
@@ -58,4 +66,12 @@ public class TestTask {
log
.
info
(
"返回token为空"
);
log
.
info
(
"返回token为空"
);
}
}
}
}
/**
* @Title: timingVisitorVolume
* @Description: 定时调用更新访问量存储过程
* @date: 2021/10/27 15:37
*/
public
void
timingVisitorVolume
(){
indexService
.
insertIntoFwl
();
}
}
}
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