代码调整

This commit is contained in:
2023-04-18 10:54:37 +08:00
parent e2691ba8f3
commit ed3eb2e312
17 changed files with 38 additions and 905 deletions

View File

@@ -89,14 +89,6 @@
<finalName>eventboot</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.ftl</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<!--设置自己目录下的配置文件-->
<resource>
<directory>src/main/resources</directory>

View File

@@ -1,86 +0,0 @@
<#--区域统计和电压等级共用模板-->
{
title: {
text: '设备运行情况',
left:'center',
subtext:'${subtext}',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['在线', '离线',],
left: '10%',
top:'5%',
textStyle: {
color: "#666666"
},
itemWidth: 15,
itemHeight: 10,
itemGap: 25
},
grid: {
left: '3%',
right: '8%',
bottom: '5%',
top: '20%',
containLabel: true
},
xAxis: {
name: '${xname}',
nameTextStyle: {
color: '#666666',
},
type: 'category',
data: ${area}
},
yAxis: {
name: '(个)',
nameTextStyle: {
color: '#666666',
},
type: 'value',
axisLine: { show: true, lineStyle: { color: '#666666' } },
axisLabel: { color: '#666666' },
splitLine: { lineStyle: { color: ['#ccc'], type: [5, 8], dashOffset: 3 } },
},
series: [
{
name: '在线',
type: 'bar',
stack: 'account',
barWidth: 20,
label: {
show: true,
color:'purple',
verticalAlign: 'middle',
rotate: 0,
fontSize: 12,
},
color:'green',
itemStyle: {
},
data: ${onlineData}
},
{
name: '离线',
type: 'bar',
stack: 'account',
barWidth: 20,
label: {
show: true,
color:'purple',
verticalAlign: 'middle',
rotate: 0,
fontSize: 12,
},
color:'orange',
itemStyle: {
},
data: ${offlineData}
}
]
}

View File

@@ -1,103 +0,0 @@
<#--区域和电压等级统计次数共用模板-->
{
title: {
text: '暂态事件次数',
left:'center',
subtext:'${subtext}',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['暂降次数', '中断次数', '暂升次数'],
left: '7%',
top:'5%',
textStyle: {
color: "#666666"
},
itemWidth: 10,
itemHeight: 10,
itemGap: 15
},
grid: {
left: '3%',
right: '8%',
bottom: '5%',
top: '20%',
containLabel: true
},
xAxis: {
name: '${xname}',
nameTextStyle: {
color: '#666666',
},
type: 'category',
data: ${area}
},
yAxis: {
name: '(次)',
nameTextStyle: {
color: '#666666',
},
type: 'value',
axisLine: { show: true, lineStyle: { color: '#666666' } },
axisLabel: { color: '#666666' },
splitLine: { lineStyle: { color: ['#ccc'], type: [5, 8], dashOffset: 3 } },
},
series: [
{
name: '暂降次数',
type: 'bar',
stack: 'account',
barWidth: 20,
label: {
show: true,
color:'purple',
verticalAlign: 'middle',
rotate: 0,
fontSize: 12,
},
color:'#ff9966',
itemStyle: {
},
data: ${sag}
},
{
name: '中断次数',
type: 'bar',
stack: 'account',
barWidth: 20,
label: {
show: true,
color:'purple',
verticalAlign: 'middle',
rotate: 0,
fontSize: 12,
},
color:'#00dd00',
itemStyle: {
},
data: ${break}
},
{
name: '暂升次数',
type: 'bar',
stack: 'account',
barWidth: 20,
label: {
show: true,
color:'purple',
verticalAlign: 'middle',
rotate: 0,
fontSize: 12,
},
color:'#0066ff',
itemStyle: {
},
data: ${up}
},
]
}

View File

@@ -1,85 +0,0 @@
<#--ITIC曲线专用-->
{
backgroundColor: "#FFF",
title: {
text: "ITIC曲线",
x: "center",
},
grid: {
left: "4%",
right: "2%",
bottom: "10%",
},
legend: {
data: ["上限", "下限", "可容忍事件", "不可容忍事件"],
x: "left",
},
color: ["#FF8C00", "#00BFFF", "green", "red"],
xAxis: [
{
type: "log",
min: "0.001",
max: "1000",
splitLine: {
show: false,
},
name: "s",
},
],
yAxis: [
{
type: "value",
splitNumber: 10,
minInterval: 3,
name: "%"
},
],
series: [
{
name: "上限",
type: "line",
data: [
[0.001, 200],
[0.003, 140],
[0.003, 120],
[0.5, 120],
[0.5, 110],
[10, 110],
[1000, 110]
],
showSymbol: false,
tooltips: {
show: false
},
},
{
name: "下限",
type: "line",
data: [
[0.02, 0],
[0.02, 70],
[0.5, 70],
[0.5, 80],
[10, 80],
[10, 90],
[1000, 90]
],
showSymbol: false,
tooltips: {
show: false
},
},
{
name: "可容忍事件",
type: "scatter",
symbol: "circle",
data: ${point}
},
{
name: "不可容忍事件",
type: "scatter",
symbol: "circle",
data: ${pointno}
}
]
}

View File

@@ -1,61 +0,0 @@
<#--F47曲线图专用模板-->
{
backgroundColor: "#fff",
title: {
text: "SEMI F47曲线",
x: "center",
},
grid: {
left: "4%",
right: "5%",
bottom: "10%",
},
legend: {
data: ["边界线", "可容忍事件", "不可容忍事件"],
x: "left",
},
color: ["yellow", "green", "red"],
xAxis: [
{
type: "log",
min: "0.001",
max: "1000",
splitLine: {
show: false,
},
name: "s",
},
],
yAxis: [
{
type: "value",
max: ${zdz} + 20,
splitNumber: 10,
minInterval: 0.1,
name: "%",
},
],
series: [
{
name: "边界线",
type: "line",
data: ${bjx},
showSymbol: false,
tooltips: {
show: false,
},
},
{
name: "可容忍事件",
type: "scatter",
symbol: "circle",
data: ${point}
},
{
name: "不可容忍事件",
type: "scatter",
symbol: "circle",
data: ${pointno}
}
]
}

View File

@@ -1,93 +0,0 @@
<#--暂降幅值的概率分布函数专用模板-->
{
backgroundColor: "#fff",
title: {
text: "暂降幅值的概率分布函数",
x: "center"
},
grid: {
left: "10%",
right: "10%",
bottom: "15%"
},
toolbox: {
show: true,
feature: {
restore: { show: true },
saveAsImage: { show: true },
},
},
tooltip: {
trigger: "axis",
formatter: "暂降幅值: {b0}<br />概率分布: {c0}%",
},
legend: {
show: true,
left: 10,
data: ["概率分布", "占比"],
},
calculable: true,
xAxis: [
{
type: "category",
boundaryGap: false,
name: "暂降幅值",
nameLocation: "center",
nameGap: 20,
nameTextStyle: {
fontSize: 15,
},
data: [
"0",
"10%",
"20%",
"30%",
"40%",
"50%",
"60%",
"70%",
"80%",
"90%",
],
},
],
yAxis: [
{
type: "value",
name: "概率分布",
nameLocation: "center",
nameGap: 40,
nameTextStyle: {
fontSize: 15,
},
axisLabel: {
formatter: "{value} %",
},
},
{
type: "value",
name: "占比",
nameLocation: "center",
nameGap: 40,
nameTextStyle: {
fontSize: 15,
},
axisLabel: {
formatter: "{value} %",
},
},
],
series: [
{
name: "概率分布",
type: "line",
data: ${eventValue},
},
{
name: "占比",
type: "bar",
data: ${pereventValue},
barWidth: 30
}
]
}

View File

@@ -1,71 +0,0 @@
<#--持续时间的概率分布函数专用模板-->
{
backgroundColor: "#fff",
title: {
text: "持续时间的概率分布函数",
x: "center",
},
legend: {
show: true,
left: 10,
data: ["概率分布", "占比"],
},
calculable: true,
grid: {
left: "10%",
right: "10%",
bottom: "15%"
},
xAxis: [
{
type: "category",
boundaryGap: false,
name: "暂降持续时间(s)",
nameLocation: "center",
nameGap: 20,
nameTextStyle: {
fontSize: 15,
},
data: ["0.01", "0.1", "0.25", "0.5", "1", "3", "20", "60", "180"],
},
],
yAxis: [
{
type: "value",
name: "概率分布",
nameLocation: "center",
nameGap: 40,
nameTextStyle: {
fontSize: 15,
},
axisLabel: {
formatter: "{value} %",
},
},
{
type: "value",
name: "占比",
nameLocation: "center",
nameGap: 40,
nameTextStyle: {
fontSize: 15,
},
axisLabel: {
formatter: "{value} %",
},
},
],
series: [
{
name: "概率分布",
type: "line",
data: ${sisttime},
},
{
name: "占比",
type: "bar",
data: ${persisttime},
barWidth: 30,
}
]
}

View File

@@ -1,58 +0,0 @@
<#--月份统计专用模板-->
{
backgroundColor: "#fff",
title: {
text: "${text}",
x: "center",
},
color: ["#FF8C00"],
legend: {
data: ["暂降次数"],
x: "left",
},
grid: {
left: "3%",
bottom: "3%",
right: "7%",
containLabel: true,
},
xAxis: [
{
type: "category",
data: ${months},
name: "${xname}",
splitLine: {
show: false,
},
axisLabel: {
show: true,
interval: 0,
},
},
],
yAxis: [
{
type: "value",
name: "次",
},
],
series: [
{
name: "暂降次数",
type: "bar",
barMaxWidth: 45,
itemStyle: {
normal: {
label: {
show: true,
textStyle: {
label: { show: true, position: "top" },
color: "#8B008B",
},
},
},
},
data: ${handle},
}
]
}

View File

@@ -1,49 +0,0 @@
<#--类型专用模板-->
{
backgroundColor: '#fff',
animation: false,
title: {
text: '暂降类型',
x: 'center',
},
legend: {
orient: 'vertical',
left: 'left',
data: ${typeArray}
},
series: [
{
name: '暂降类型',
type: 'pie',
radius: '70%',
center: ['50%', '60%'],
label: {
normal: {
show: false
},
emphasis: {
show: true
}
},
lableLine: {
normal: {
show: false
},
emphasis: {
show: true
}
},
data: [<#list valueArray as a>
{value:${a.times?c},
name:'${a.type}'},
</#list>],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}

View File

@@ -1,49 +0,0 @@
<#--暂降原因专用模板-->
{
backgroundColor: '#fff',
animation: false,
title: {
text: '暂降原因',
x: 'center'
},
legend: {
orient: 'vertical',
left: 'left',
data: ${typeArray}
},
series: [
{
name: '暂降原因',
type: 'pie',
radius: '70%',
center: ['50%', '53%'],
label: {
normal: {
show: false
},
emphasis: {
show: true
}
},
lableLine: {
normal: {
show: false
},
emphasis: {
show: true
}
},
data: [<#list valueArray as a>
{value:${a.times?c},
name:'${a.reason}'},
</#list>],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}

View File

@@ -1,66 +0,0 @@
{
backgroundColor: "#FFF",
title: {
text: '电压等级',
x: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
var tips = "";
tips += params[0].name ;
for (var i = 0; i < params.length; i++) {
tips += params[i].seriesName + ":" + params[i].value ;
}
return tips;
}
},
color: ['orange'],
legend: {
data: ['暂降次数'],
selectedMode: false,
x: 'left'
},
grid: {
left: '3%',
right: '12%',
bottom: '6%',
containLabel: true
},
xAxis: [{
type: 'category',
data: ${xvalue},
splitLine: {
show: false
},
name: '电压等级\n(监测点数)',
axisLabel: {
interval: 0,
show: true,
fontSize:10
}
}],
yAxis: [{
type: 'value',
name: '(次)'
}],
series: [{
name: '暂降次数',
type: 'bar',
itemStyle: {
normal: {
label: {
show: true,
textStyle: {
color: 'purple'
}
}
}
},
data: ${yvalue},
barMaxWidth: 45
}]
}

View File

@@ -1,68 +0,0 @@
{
backgroundColor: '#FFF',
title: {
text: '区域统计',
x: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
var tips = "";
tips += params[0].name ;
for (var i = 0; i < params.length; i++) {
tips += params[i].seriesName + ":" + params[i].value ;
}
return tips;
}
},
color: ['orange'],
grid: {
left: '1%',
right: '7%',
bottom: '8%',
containLabel: true
},
legend: {
data: ['暂降次数'],
selectedMode: false,
x: 'left'
},
xAxis: [{
type: 'category',
data: ${xvalue},
splitLine: {
show: false
},
name: '地区\n(监测点数)',
axisLabel: {
interval: 0,
show: true,
rotate:0,
fontSize:10
}
}],
yAxis: [{
type: 'value',
name: '(次)'
}],
series: [{
name: '暂降次数',
type: 'bar',
itemStyle: {
normal: {
label: {
show: true,
textStyle: {
color: 'purple'
}
}
}
},
data: ${yvalue},
barMaxWidth: 45
}],
}

View File

@@ -1,12 +0,0 @@
{
animation:false,
xAxis: {},
yAxis: {},
series: [
{
symbolSize: 2,
data: ${bdata},
type: 'scatter'
}
]
}

View File

@@ -1,76 +0,0 @@
{
backgroundColor: "#FFF",
title: {
text: ${test},
x: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
var tips = "";
tips += params[0].name ;
for (var i = 0; i < params.length; i++) {
tips += params[i].seriesName + ":" + params[i].value;
}
return tips;
}
},
grid: {
left: '3%',
bottom: '6%',
containLabel: true
},
legend: {
data: ['未关联暂降次数', '已关联处理事件'],
x: 'left'
},
xAxis: [{
type: 'category',
data:${xvalue},
name: ${test},
splitLine: {
show: false
},
axisLabel: {
show: true,
interval: 0,
fontSize:10
}
}],
yAxis: [{
type: 'value',
name: '次'
}],
series: [{
name: '未关联暂降次数',
type: 'bar',
stack: '事件总数',
barMaxWidth: 45,
itemStyle: {
normal: {
color: 'orange',
barBorderColor: 'orange',
barBorderWidth: 2,
barBorderRadius: 0
}
},
data: ${yvalue1}
}, {
name: '已关联处理事件',
type: 'bar',
stack: '事件总数',
barMaxWidth: 45,
itemStyle: {
normal: {
color: "#ccc",
barBorderColor: '#ccc',
barBorderWidth: 2,
barBorderRadius: 0
}
},
data: ${yvalue2}
}]
}

View File

@@ -25,16 +25,6 @@ public class FreemarkerUtil {
public String generateString(String templateFileName, String templateDirectory, Map<String, Object> datas)
throws IOException, TemplateException {
// Configuration configuration = new Configuration(Configuration.VERSION_2_3_0);
// // 设置默认编码
// configuration.setDefaultEncoding("UTF-8");
//
// // 设置模板所在文件夹
// path = java.net.URLDecoder.decode(path, "utf-8");
// System.out.println("路径为:" + path);
// System.out.println("templateDirectory" + templateDirectory);
// configuration.setDirectoryForTemplateLoading(new File(path + templateDirectory));
// 生成模板对象
Template template = freeMarkerConfigurer.getConfiguration().getTemplate(templateFileName);