Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
e31b3402
Commit
e31b3402
authored
May 06, 2022
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导出文档接口
parent
56e8a06b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
137 additions
and
59 deletions
+137
-59
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+1
-1
AnalysisReportLogDto.java
.../yeejoin/equipmanage/common/dto/AnalysisReportLogDto.java
+8
-6
AnalysisReportLog.java
.../yeejoin/equipmanage/common/entity/AnalysisReportLog.java
+1
-1
FirePatrolReportController.java
...in/equipmanage/controller/FirePatrolReportController.java
+21
-4
IFirePatrolReportService.java
...yeejoin/equipmanage/service/IFirePatrolReportService.java
+2
-2
FilePatrolReportServiceImpl.java
...equipmanage/service/impl/FilePatrolReportServiceImpl.java
+99
-43
FirePatrolReport.ftl
...-system-equip/src/main/resources/ftl/FirePatrolReport.ftl
+2
-2
AnalysisReportLogMapper.xml
...uip/src/main/resources/mapper/AnalysisReportLogMapper.xml
+3
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
e31b3402
...
@@ -79,7 +79,7 @@ public class ControllerAop {
...
@@ -79,7 +79,7 @@ public class ControllerAop {
// 不需要添加请求头的接口
// 不需要添加请求头的接口
String
[]
url
=
new
String
[]{
"/api/user/save/curCompany"
,
"/jcs/command/lookHtmlText"
,
String
[]
url
=
new
String
[]{
"/api/user/save/curCompany"
,
"/jcs/command/lookHtmlText"
,
"/jcs/common/duty-person/findByDutyAreaId"
,
"/tzs/wechatBack"
,
"/tzs/elevator/getElevatorInfo"
,
"/jcs/common/duty-person/findByDutyAreaId"
,
"/tzs/wechatBack"
,
"/tzs/elevator/getElevatorInfo"
,
"/openapi/bizToken/applyToken"
};
"/openapi/bizToken/applyToken"
,
"/fire-patrol-report/download"
,
"/fire-patrol-report/allPage"
};
// 获取请求路径
// 获取请求路径
for
(
String
uri
:
url
)
{
for
(
String
uri
:
url
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/dto/AnalysisReportLogDto.java
View file @
e31b3402
...
@@ -8,10 +8,12 @@ import lombok.Data;
...
@@ -8,10 +8,12 @@ import lombok.Data;
public
class
AnalysisReportLogDto
extends
AnalysisReportLog
{
public
class
AnalysisReportLogDto
extends
AnalysisReportLog
{
private
static
final
long
serialVersionUID
=
214456306850625504L
;
private
static
final
long
serialVersionUID
=
214456306850625504L
;
@ApiModelProperty
(
value
=
"主键"
)
@ApiModelProperty
(
value
=
"换流站编码"
)
String
reportName
;
private
String
stationCode
;
@ApiModelProperty
(
value
=
"主键"
)
@ApiModelProperty
(
value
=
"报告名称"
)
String
stationName
;
private
String
reportName
;
@ApiModelProperty
(
value
=
"主键"
)
@ApiModelProperty
(
value
=
"换流站名称"
)
String
reportTypeName
;
private
String
stationName
;
@ApiModelProperty
(
value
=
"报告类型名称"
)
private
String
reportTypeName
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/AnalysisReportLog.java
View file @
e31b3402
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity;
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity;
import
java.util.Date
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.annotation.FillCommonUserField
;
import
com.yeejoin.amos.boot.biz.common.annotation.FillCommonUserField
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
...
@@ -46,5 +47,4 @@ public class AnalysisReportLog extends BaseEntity {
...
@@ -46,5 +47,4 @@ public class AnalysisReportLog extends BaseEntity {
@ApiModelProperty
(
value
=
"结束时间"
)
@ApiModelProperty
(
value
=
"结束时间"
)
private
Date
endDate
;
private
Date
endDate
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FirePatrolReportController.java
View file @
e31b3402
package
com
.
yeejoin
.
equipmanage
.
controller
;
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -17,6 +19,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...
@@ -17,6 +19,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.common.entity.AnalysisReportLog
;
import
com.yeejoin.equipmanage.service.IFirePatrolReportService
;
import
com.yeejoin.equipmanage.service.IFirePatrolReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -48,11 +51,25 @@ public class FirePatrolReportController {
...
@@ -48,11 +51,25 @@ public class FirePatrolReportController {
}
}
@ApiOperation
(
value
=
"所有站查询列表"
,
notes
=
"所有站查询列表"
)
@ApiOperation
(
value
=
"所有站查询列表"
,
notes
=
"所有站查询列表"
)
@GetMapping
(
value
=
"/all
-p
age"
)
@GetMapping
(
value
=
"/all
P
age"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
,
needAuth
=
false
)
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
page
,
@RequestParam
Integer
reportType
,
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
page
,
@RequestParam
Integer
reportType
,
@ApiParam
(
value
=
"开始日期"
,
required
=
false
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
startDate
,
@ApiParam
(
value
=
"开始日期"
,
required
=
false
)
@RequestParam
(
required
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
startDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
false
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
)
{
@ApiParam
(
value
=
"结束日期"
,
required
=
false
)
@RequestParam
(
required
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
,
return
iFirePatrolReportService
.
allPage
(
page
,
reportType
,
startDate
,
endDate
);
@ApiParam
(
value
=
"换流站编码"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
stationCode
)
{
return
iFirePatrolReportService
.
allPage
(
page
,
reportType
,
startDate
,
endDate
,
stationCode
);
}
}
// /**
// * 分页接口
// */
// @ApiOperation(httpMethod = "GET", value = "单站查询列表", notes = "单站查询列表")
// @GetMapping(value = "/listPage")
// @TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false)
// public IPage<AnalysisReportLog> listPage(Page page, @RequestParam Integer reportType,
// @ApiParam(value = "开始日期", required = false) @RequestParam @DateTimeFormat(pattern="yyyy-MM-dd")Date startDate,
// @ApiParam(value = "结束日期", required = false) @RequestParam @DateTimeFormat(pattern="yyyy-MM-dd")Date endDate,
// @RequestParam String stationCode) throws ParseException {
// return iFirePatrolReportService.listPage(page,reportType, startDate, endDate,stationCode);
// }
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFirePatrolReportService.java
View file @
e31b3402
...
@@ -14,7 +14,7 @@ public interface IFirePatrolReportService {
...
@@ -14,7 +14,7 @@ public interface IFirePatrolReportService {
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
);
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
);
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
);
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
,
String
stationCode
);
//IPage<AnalysisReportLogDto> listPage(Page<AnalysisReportLogDto> page, Integer reportType,Date startDate,Date endDate,String stationCode);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FilePatrolReportServiceImpl.java
View file @
e31b3402
...
@@ -2,9 +2,18 @@ package com.yeejoin.equipmanage.service.impl;
...
@@ -2,9 +2,18 @@ package com.yeejoin.equipmanage.service.impl;
import
java.awt.Color
;
import
java.awt.Color
;
import
java.awt.Font
;
import
java.awt.Font
;
import
java.awt.Paint
;
import
java.awt.PaintContext
;
import
java.awt.Rectangle
;
import
java.awt.RenderingHints
;
import
java.awt.RenderingHints
;
import
java.awt.Stroke
;
import
java.awt.font.TextAttribute
;
import
java.awt.geom.AffineTransform
;
import
java.awt.geom.Rectangle2D
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.ColorModel
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.AttributedString
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
...
@@ -17,14 +26,19 @@ import java.util.Map;
...
@@ -17,14 +26,19 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.swing.border.StrokeBorder
;
import
org.jfree.chart.ChartFactory
;
import
org.jfree.chart.ChartFactory
;
import
org.jfree.chart.ChartUtilities
;
import
org.jfree.chart.ChartUtilities
;
import
org.jfree.chart.JFreeChart
;
import
org.jfree.chart.JFreeChart
;
import
org.jfree.chart.StandardChartTheme
;
import
org.jfree.chart.StandardChartTheme
;
import
org.jfree.chart.StrokeMap
;
import
org.jfree.chart.labels.PieSectionLabelGenerator
;
import
org.jfree.chart.labels.StandardPieSectionLabelGenerator
;
import
org.jfree.chart.labels.StandardPieSectionLabelGenerator
;
import
org.jfree.chart.plot.PiePlot
;
import
org.jfree.chart.plot.PiePlot
;
import
org.jfree.chart.title.LegendTitle
;
import
org.jfree.data.general.DefaultPieDataset
;
import
org.jfree.data.general.DefaultPieDataset
;
import
org.jfree.data.general.PieDataset
;
import
org.jfree.ui.RectangleEdge
;
import
org.jfree.ui.RectangleEdge
;
import
org.jfree.ui.RectangleInsets
;
import
org.jfree.ui.RectangleInsets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -46,7 +60,7 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
...
@@ -46,7 +60,7 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
@Autowired
@Autowired
AnalysisReportLogMapper
analysisReportLogMapper
;
AnalysisReportLogMapper
analysisReportLogMapper
;
@Override
@Override
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
)
{
Date
endDate
)
{
...
@@ -115,31 +129,31 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
...
@@ -115,31 +129,31 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
DefaultPieDataset
pds
=
new
DefaultPieDataset
();
DefaultPieDataset
pds
=
new
DefaultPieDataset
();
pds
.
setValue
(
"合格"
,
qualified
);
pds
.
setValue
(
"合格"
,
qualified
);
pds
.
setValue
(
"不合格"
,
no_qualified
);
pds
.
setValue
(
"不合格"
,
no_qualified
);
String
qualified_pie_chart
=
getChartString
(
pds
,
"合格情况占比"
);
String
qualified_pie_chart
=
getChartString
(
pds
,
"合格情况占比"
);
map
.
put
(
"qualified_pie_chart"
,
qualified_pie_chart
);
map
.
put
(
"qualified_pie_chart"
,
qualified_pie_chart
);
// 设备巡查饼图
// 设备巡查饼图
DefaultPieDataset
pds2
=
new
DefaultPieDataset
();
DefaultPieDataset
pds2
=
new
DefaultPieDataset
();
pds2
.
setValue
(
"已查询设备"
,
checked_equipment_count
);
pds2
.
setValue
(
"已查询设备"
,
checked_equipment_count
);
pds2
.
setValue
(
"漏查设备"
,
unchecked_equipment_count
);
pds2
.
setValue
(
"漏查设备"
,
unchecked_equipment_count
);
String
equip_pie_chart
=
getChartString
(
pds2
,
"设备巡查占比"
);
String
equip_pie_chart
=
getChartString
(
pds2
,
"设备巡查占比"
);
map
.
put
(
"equip_pie_chart"
,
equip_pie_chart
);
map
.
put
(
"equip_pie_chart"
,
equip_pie_chart
);
// 业务主题
// 业务主题
map
.
put
(
"business_title"
,
"消防巡查"
);
map
.
put
(
"business_title"
,
"消防巡查"
);
// 缺陷清单
// 缺陷清单
List
<
Map
<
String
,
Object
>>
defect_list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
defect_list
=
new
ArrayList
<>();
Map
<
String
,
Object
>
defectMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
defectMap
=
new
HashMap
<>();
defectMap
.
put
(
"defect_location"
,
"主控楼一层"
);
defectMap
.
put
(
"defect_location"
,
"主控楼一层"
);
defectMap
.
put
(
"defect_description"
,
"仅有一条疏散通道,存在重大火灾隐患,不满足规范要求。"
);
defectMap
.
put
(
"defect_description"
,
"仅有一条疏散通道,存在重大火灾隐患,不满足规范要求。"
);
defectMap
.
put
(
"rectified_progress"
,
"待评审"
);
defectMap
.
put
(
"rectified_progress"
,
"待评审"
);
defectMap
.
put
(
"remark"
,
"无法整改"
);
defectMap
.
put
(
"remark"
,
"无法整改"
);
defect_list
.
add
(
defectMap
);
defect_list
.
add
(
defectMap
);
Map
<
String
,
Object
>
defectMap2
=
new
HashMap
<>();
Map
<
String
,
Object
>
defectMap2
=
new
HashMap
<>();
defectMap2
.
put
(
"defect_location"
,
"主控楼一层"
);
defectMap2
.
put
(
"defect_location"
,
"主控楼一层"
);
defectMap2
.
put
(
"defect_description"
,
"防火卷帘门故障;11个水泵接合器存在问题;"
);
defectMap2
.
put
(
"defect_description"
,
"防火卷帘门故障;11个水泵接合器存在问题;"
);
defectMap2
.
put
(
"rectified_progress"
,
"待治理"
);
defectMap2
.
put
(
"rectified_progress"
,
"待治理"
);
defectMap2
.
put
(
"remark"
,
"防火卷帘已完成维修,水泵接合器未整改"
);
defectMap2
.
put
(
"remark"
,
"防火卷帘已完成维修,水泵接合器未整改"
);
defect_list
.
add
(
defectMap2
);
defect_list
.
add
(
defectMap2
);
Map
<
String
,
Object
>
defectMap3
=
new
HashMap
<>();
Map
<
String
,
Object
>
defectMap3
=
new
HashMap
<>();
defectMap3
.
put
(
"defect_location"
,
"主控楼一层库房区域"
);
defectMap3
.
put
(
"defect_location"
,
"主控楼一层库房区域"
);
defectMap3
.
put
(
"defect_description"
,
"将办公用房作为库房使用,使用性质与原设计不符,耐火等级和相应消防设施不满足规范要求。"
);
defectMap3
.
put
(
"defect_description"
,
"将办公用房作为库房使用,使用性质与原设计不符,耐火等级和相应消防设施不满足规范要求。"
);
defectMap3
.
put
(
"rectified_progress"
,
"治理完毕"
);
defectMap3
.
put
(
"rectified_progress"
,
"治理完毕"
);
...
@@ -154,60 +168,88 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
...
@@ -154,60 +168,88 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
}
}
}
}
/**
/**
* 生成主题
* 生成主题
*
*
* @param fontName 字体名称(默认为宋体)
* @param fontName 字体名称(默认为宋体)
* @return
* @return
*/
*/
public
static
StandardChartTheme
createChartTheme
(
String
fontName
)
{
public
static
StandardChartTheme
createChartTheme
(
String
fontName
)
{
StandardChartTheme
theme
=
new
StandardChartTheme
(
"unicode"
)
{
StandardChartTheme
theme
=
new
StandardChartTheme
(
"unicode"
)
{
public
void
apply
(
JFreeChart
chart
)
{
public
void
apply
(
JFreeChart
chart
)
{
chart
.
getRenderingHints
().
put
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
chart
.
getRenderingHints
().
put
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_OFF
);
RenderingHints
.
VALUE_TEXT_ANTIALIAS_OFF
);
super
.
apply
(
chart
);
super
.
apply
(
chart
);
}
}
};
};
fontName
=
StrUtil
.
isBlank
(
fontName
)
?
"宋体"
:
fontName
;
fontName
=
StrUtil
.
isBlank
(
fontName
)
?
"宋体"
:
fontName
;
theme
.
setExtraLargeFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
20
));
theme
.
setExtraLargeFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
20
));
theme
.
setLargeFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
14
));
theme
.
setLargeFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
14
));
theme
.
setRegularFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
12
));
theme
.
setRegularFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
12
));
theme
.
setSmallFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
10
));
theme
.
setSmallFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
10
));
return
theme
;
return
theme
;
}
}
/**
/**
* 获取饼图base64字符串
* 获取饼图base64字符串
*
* @param pds
* @param pds
* @return
* @return
*/
*/
private
String
getChartString
(
DefaultPieDataset
pds
,
String
title
)
{
private
String
getChartString
(
DefaultPieDataset
pds
,
String
title
)
{
//设置主题 要不会乱码
//
设置主题 要不会乱码
ChartFactory
.
setChartTheme
(
createChartTheme
(
"微软雅黑"
));
ChartFactory
.
setChartTheme
(
createChartTheme
(
"微软雅黑"
));
JFreeChart
chart
=
ChartFactory
.
createPieChart
(
title
,
pds
,
true
,
false
,
true
);
JFreeChart
chart
=
ChartFactory
.
createPieChart
(
title
,
pds
,
true
,
false
,
true
);
chart
.
getLegend
().
setPosition
(
RectangleEdge
.
BOTTOM
);
// 设置图例
RectangleInsets
padding
=
new
RectangleInsets
(
20
,
20
,
20
,
20
);
LegendTitle
legend
=
chart
.
getLegend
();
legend
.
setPosition
(
RectangleEdge
.
BOTTOM
);
// 设置图例边框
legend
.
setBorder
(
0
,
0
,
0
,
0
);
legend
.
setItemFont
(
new
Font
(
"微软雅黑"
,
Font
.
PLAIN
,
16
));
// 设置最外层边框
chart
.
setBorderVisible
(
false
);
RectangleInsets
padding
=
new
RectangleInsets
(
40
,
40
,
40
,
40
);
chart
.
setPadding
(
padding
);
chart
.
setPadding
(
padding
);
// 如果不使用Font,中文将显示不出来
// 如果不使用Font,中文将显示不出来
Font
font
=
new
Font
(
"微软雅黑"
,
Font
.
BOLD
,
16
);
// 设置图片标题的字体
// 设置图片标题的字体
chart
.
getTitle
().
setFont
(
font
);
chart
.
getTitle
().
setFont
(
new
Font
(
"微软雅黑"
,
Font
.
BOLD
,
24
)
);
// 得到图块,准备设置标签的字体
// 得到图块,准备设置标签的字体
PiePlot
plot
=
(
PiePlot
)
chart
.
getPlot
();
PiePlot
plot
=
(
PiePlot
)
chart
.
getPlot
();
// 设置标签字体
// 设置饼图阴影
plot
.
setLabelFont
(
font
);
plot
.
setShadowPaint
(
Color
.
WHITE
);
plot
.
setStartAngle
(
180
);
plot
.
setAutoPopulateSectionOutlinePaint
(
true
);
plot
.
setSectionPaint
(
pds
.
getKey
(
0
),
Color
.
RED
);
// 设置饼图边框
plot
.
setSectionPaint
(
pds
.
getKey
(
1
),
Color
.
BLUE
);
plot
.
setOutlineVisible
(
false
);
// 设置饼图一定是正圆
plot
.
setCircular
(
true
);
// 设置起始角度
plot
.
setStartAngle
(
90
);
// 设置饼图颜色
plot
.
setSectionPaint
(
pds
.
getKey
(
0
),
Color
.
RED
);
plot
.
setSectionPaint
(
pds
.
getKey
(
1
),
Color
.
BLUE
);
// 设置饼图边框颜色
// 设置plot的前景色透明度
// 设置plot的前景色透明度
plot
.
setForegroundAlpha
(
0.7f
);
plot
.
setForegroundAlpha
(
0.7f
);
// 设置plot的背景色透明度
// 设置plot的背景色透明度
plot
.
setBackgroundAlpha
(
0.0f
);
plot
.
setBackgroundAlpha
(
0.0f
);
// 设置标签字体
plot
.
setLabelFont
(
new
Font
(
"微软雅黑"
,
Font
.
PLAIN
,
16
));
// 设置分类标签字体颜色
// plot.setLabelPaint(Color.RED);
//plot.setLabelLinkPaint(Color.RED);
// 设置分类标签背景颜色
plot
.
setLabelBackgroundPaint
(
Color
.
WHITE
);
// 设置分类标签边框颜色
plot
.
setLabelOutlinePaint
(
Color
.
WHITE
);
plot
.
setLabelShadowPaint
(
Color
.
WHITE
);
// 设置标签生成器(默认{0})
// 设置标签生成器(默认{0})
// {0}:key {1}:value {2}:百分比 {3}:sum
// {0}:key {1}:value {2}:百分比 {3}:sum
plot
.
setLabelGenerator
(
new
StandardPieSectionLabelGenerator
(
"{0}\n{2}"
));
StandardPieSectionLabelGenerator
labelGenerator
=
new
StandardPieSectionLabelGenerator
(
"{0}\n{2}"
);
BufferedImage
image
=
chart
.
createBufferedImage
(
800
,
600
);
plot
.
setLabelGenerator
(
labelGenerator
);
BufferedImage
image
=
chart
.
createBufferedImage
(
600
,
350
);
byte
[]
bytes
=
null
;
byte
[]
bytes
=
null
;
try
{
try
{
bytes
=
ChartUtilities
.
encodeAsPNG
(
image
);
bytes
=
ChartUtilities
.
encodeAsPNG
(
image
);
...
@@ -218,12 +260,26 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
...
@@ -218,12 +260,26 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
return
base64
;
return
base64
;
}
}
@Override
@Override
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
)
{
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
AnalysisReportLog
analysisReportLog
=
new
AnalysisReportLog
();
Date
endDate
,
String
stationCode
)
{
AnalysisReportLogDto
analysisReportLog
=
new
AnalysisReportLogDto
();
analysisReportLog
.
setStartDate
(
startDate
);
analysisReportLog
.
setStartDate
(
startDate
);
analysisReportLog
.
setEndDate
(
endDate
);
analysisReportLog
.
setEndDate
(
endDate
);
analysisReportLog
.
setReportType
(
reportType
);
analysisReportLog
.
setReportType
(
reportType
);
analysisReportLog
.
setStationCode
(
stationCode
);
return
analysisReportLogMapper
.
allPage
(
page
,
analysisReportLog
);
return
analysisReportLogMapper
.
allPage
(
page
,
analysisReportLog
);
}
}
// @Override
// public IPage<AnalysisReportLogDto> listPage(Page<AnalysisReportLogDto> page, Integer reportType, Date startDate,
// Date endDate,String stationCode) {
// AnalysisReportLogDto analysisReportLog = new AnalysisReportLogDto();
// analysisReportLog.setReportType(reportType);
// analysisReportLog.setStationCode(stationCode);
// analysisReportLog.setEndDate(startDate);
// analysisReportLog.setStartDate(endDate);
// return analysisReportLogMapper.allPage(page, analysisReportLog);
// }
}
}
amos-boot-system-equip/src/main/resources/ftl/FirePatrolReport.ftl
View file @
e31b3402
...
@@ -3705,7 +3705,7 @@
...
@@ -3705,7 +3705,7 @@
<w:pict>
<w:pict>
<w:binData
w:name=
"wordml://1.png"
>
${(qualified_pie_chart)!''}
<w:binData
w:name=
"wordml://1.png"
>
${(qualified_pie_chart)!''}
</w:binData>
</w:binData>
<v:shape
id=
"_x0000_s1027"
o:spt=
"75"
alt=
""
type=
"#_x0000_t75"
style=
"height:2
55.7pt;width:416.4
5pt;"
filled=
"f"
o:preferrelative=
"t"
stroked=
"f"
coordsize=
"21600,21600"
>
<v:shape
id=
"_x0000_s1027"
o:spt=
"75"
alt=
""
type=
"#_x0000_t75"
style=
"height:2
40pt;width:414.9
5pt;"
filled=
"f"
o:preferrelative=
"t"
stroked=
"f"
coordsize=
"21600,21600"
>
<v:path/>
<v:path/>
<v:fill
on=
"f"
focussize=
"0,0"
/>
<v:fill
on=
"f"
focussize=
"0,0"
/>
<v:stroke
on=
"f"
/>
<v:stroke
on=
"f"
/>
...
@@ -3728,7 +3728,7 @@
...
@@ -3728,7 +3728,7 @@
<w:pict>
<w:pict>
<w:binData
w:name=
"wordml://2.png"
>
${(equip_pie_chart)!''}
<w:binData
w:name=
"wordml://2.png"
>
${(equip_pie_chart)!''}
</w:binData>
</w:binData>
<v:shape
id=
"_x0000_s1028"
o:spt=
"75"
alt=
""
type=
"#_x0000_t75"
style=
"height:2
36.7
pt;width:414.95pt;"
filled=
"f"
o:preferrelative=
"t"
stroked=
"f"
coordsize=
"21600,21600"
>
<v:shape
id=
"_x0000_s1028"
o:spt=
"75"
alt=
""
type=
"#_x0000_t75"
style=
"height:2
40
pt;width:414.95pt;"
filled=
"f"
o:preferrelative=
"t"
stroked=
"f"
coordsize=
"21600,21600"
>
<v:path/>
<v:path/>
<v:fill
on=
"f"
focussize=
"0,0"
/>
<v:fill
on=
"f"
focussize=
"0,0"
/>
<v:stroke
on=
"f"
/>
<v:stroke
on=
"f"
/>
...
...
amos-boot-system-equip/src/main/resources/mapper/AnalysisReportLogMapper.xml
View file @
e31b3402
...
@@ -26,6 +26,9 @@
...
@@ -26,6 +26,9 @@
<if
test=
"analysisReportLog.endDate != null"
>
<if
test=
"analysisReportLog.endDate != null"
>
AND DATE_FORMAT(wl_analysis_report_log.end_date, '%Y-%m-%d')
<
= DATE_FORMAT(#{analysisReportLog.endDate}, '%Y-%m-%d')
AND DATE_FORMAT(wl_analysis_report_log.end_date, '%Y-%m-%d')
<
= DATE_FORMAT(#{analysisReportLog.endDate}, '%Y-%m-%d')
</if>
</if>
<if
test=
"analysisReportLog.stationCode != null"
>
AND cb_org_usr.biz_org_code = #{analysisReportLog.stationCode}
</if>
</where>
</where>
</select>
</select>
</mapper>
</mapper>
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