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
56e8a06b
Commit
56e8a06b
authored
May 05, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_dl_plan6' of
http://39.98.45.134:8090/moa/amos-boot-biz
into develop_dl_plan6
parents
95eb629a
a10da251
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
176 additions
and
14 deletions
+176
-14
AnalysisReportLogDto.java
.../yeejoin/equipmanage/common/dto/AnalysisReportLogDto.java
+17
-0
FirePatrolReportController.java
...in/equipmanage/controller/FirePatrolReportController.java
+12
-4
AnalysisReportLogMapper.java
...m/yeejoin/equipmanage/mapper/AnalysisReportLogMapper.java
+9
-0
IFirePatrolReportService.java
...yeejoin/equipmanage/service/IFirePatrolReportService.java
+9
-0
FilePatrolReportServiceImpl.java
...equipmanage/service/impl/FilePatrolReportServiceImpl.java
+62
-9
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+1
-1
wl-3.0.1.xml
...ot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
+40
-0
AnalysisReportLogMapper.xml
...uip/src/main/resources/mapper/AnalysisReportLogMapper.xml
+26
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/dto/AnalysisReportLogDto.java
0 → 100644
View file @
56e8a06b
package
com
.
yeejoin
.
equipmanage
.
common
.
dto
;
import
com.yeejoin.equipmanage.common.entity.AnalysisReportLog
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
AnalysisReportLogDto
extends
AnalysisReportLog
{
private
static
final
long
serialVersionUID
=
214456306850625504L
;
@ApiModelProperty
(
value
=
"主键"
)
String
reportName
;
@ApiModelProperty
(
value
=
"主键"
)
String
stationName
;
@ApiModelProperty
(
value
=
"主键"
)
String
reportTypeName
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FirePatrolReportController.java
View file @
56e8a06b
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.propertyeditors.CustomDateEditor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.ServletRequestDataBinder
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.InitBinder
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.service.IFirePatrolReportService
;
import
io.swagger.annotations.Api
;
...
...
@@ -47,4 +46,13 @@ public class FirePatrolReportController {
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
)
{
iFirePatrolReportService
.
download
(
request
,
response
,
code
,
startDate
,
endDate
);
}
@ApiOperation
(
value
=
"所有站查询列表"
,
notes
=
"所有站查询列表"
)
@GetMapping
(
value
=
"/all-page"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
,
needAuth
=
false
)
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
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
)
{
return
iFirePatrolReportService
.
allPage
(
page
,
reportType
,
startDate
,
endDate
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/AnalysisReportLogMapper.java
View file @
56e8a06b
package
com
.
yeejoin
.
equipmanage
.
mapper
;
import
java.util.Date
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.common.entity.AnalysisReportLog
;
/**
...
...
@@ -11,4 +18,6 @@ import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
*/
public
interface
AnalysisReportLogMapper
extends
BaseMapper
<
AnalysisReportLog
>
{
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
@Param
(
"analysisReportLog"
)
AnalysisReportLog
analysisReportLog
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFirePatrolReportService.java
View file @
56e8a06b
...
...
@@ -5,7 +5,16 @@ import java.util.Date;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.common.entity.AnalysisReportLog
;
public
interface
IFirePatrolReportService
{
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
);
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FilePatrolReportServiceImpl.java
View file @
56e8a06b
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.awt.Color
;
import
java.awt.Font
;
import
java.awt.RenderingHints
;
import
java.awt.image.BufferedImage
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -19,19 +21,32 @@ import javax.servlet.http.HttpServletResponse;
import
org.jfree.chart.ChartFactory
;
import
org.jfree.chart.ChartUtilities
;
import
org.jfree.chart.JFreeChart
;
import
org.jfree.chart.StandardChartTheme
;
import
org.jfree.chart.labels.StandardPieSectionLabelGenerator
;
import
org.jfree.chart.plot.PiePlot
;
import
org.jfree.data.general.DefaultPieDataset
;
import
org.jfree.ui.RectangleEdge
;
import
org.jfree.ui.RectangleInsets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.core.util.StrUtil
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.common.entity.AnalysisReportLog
;
import
com.yeejoin.equipmanage.common.enums.WordTemplateTypeEum
;
import
com.yeejoin.equipmanage.common.exception.CommonException
;
import
com.yeejoin.equipmanage.common.utils.WordTemplateUtils
;
import
com.yeejoin.equipmanage.mapper.AnalysisReportLogMapper
;
import
com.yeejoin.equipmanage.service.IFirePatrolReportService
;
@Service
public
class
FilePatrolReportServiceImpl
implements
IFirePatrolReportService
{
@Autowired
AnalysisReportLogMapper
analysisReportLogMapper
;
@Override
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
)
{
...
...
@@ -100,13 +115,13 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
DefaultPieDataset
pds
=
new
DefaultPieDataset
();
pds
.
setValue
(
"合格"
,
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
);
// 设备巡查饼图
DefaultPieDataset
pds2
=
new
DefaultPieDataset
();
pds
.
setValue
(
"已查询设备"
,
checked_equipment_count
);
pds
.
setValue
(
"漏查设备"
,
unchecked_equipment_count
);
String
equip_pie_chart
=
getChartString
(
pds2
);
pds
2
.
setValue
(
"已查询设备"
,
checked_equipment_count
);
pds
2
.
setValue
(
"漏查设备"
,
unchecked_equipment_count
);
String
equip_pie_chart
=
getChartString
(
pds2
,
"设备巡查占比"
);
map
.
put
(
"equip_pie_chart"
,
equip_pie_chart
);
// 业务主题
map
.
put
(
"business_title"
,
"消防巡查"
);
...
...
@@ -140,22 +155,51 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
}
/**
* 生成主题
*
* @param fontName 字体名称(默认为宋体)
* @return
*/
public
static
StandardChartTheme
createChartTheme
(
String
fontName
)
{
StandardChartTheme
theme
=
new
StandardChartTheme
(
"unicode"
)
{
public
void
apply
(
JFreeChart
chart
)
{
chart
.
getRenderingHints
().
put
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_OFF
);
super
.
apply
(
chart
);
}
};
fontName
=
StrUtil
.
isBlank
(
fontName
)
?
"宋体"
:
fontName
;
theme
.
setExtraLargeFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
20
));
theme
.
setLargeFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
14
));
theme
.
setRegularFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
12
));
theme
.
setSmallFont
(
new
Font
(
fontName
,
Font
.
PLAIN
,
10
));
return
theme
;
}
/**
* 获取饼图base64字符串
* @param pds
* @return
*/
private
String
getChartString
(
DefaultPieDataset
pds
)
{
JFreeChart
chart
=
ChartFactory
.
createPieChart
(
"测试"
,
pds
,
false
,
false
,
true
);
private
String
getChartString
(
DefaultPieDataset
pds
,
String
title
)
{
//设置主题 要不会乱码
ChartFactory
.
setChartTheme
(
createChartTheme
(
"微软雅黑"
));
JFreeChart
chart
=
ChartFactory
.
createPieChart
(
title
,
pds
,
true
,
false
,
true
);
chart
.
getLegend
().
setPosition
(
RectangleEdge
.
BOTTOM
);
RectangleInsets
padding
=
new
RectangleInsets
(
20
,
20
,
20
,
20
);
chart
.
setPadding
(
padding
);
// 如果不使用Font,中文将显示不出来
Font
font
=
new
Font
(
"
宋体"
,
Font
.
BOLD
,
12
);
Font
font
=
new
Font
(
"
微软雅黑"
,
Font
.
BOLD
,
16
);
// 设置图片标题的字体
chart
.
getTitle
().
setFont
(
font
);
// 得到图块,准备设置标签的字体
PiePlot
plot
=
(
PiePlot
)
chart
.
getPlot
();
// 设置标签字体
plot
.
setLabelFont
(
font
);
plot
.
setStartAngle
(
new
Float
(
3.14f
/
2
f
));
//plot.setSectionPaint((Comparable) Color.BLUE,Color.RED); // 考虑自定义设置颜色——我不会
plot
.
setStartAngle
(
180
);
plot
.
setSectionPaint
(
pds
.
getKey
(
0
),
Color
.
RED
);
plot
.
setSectionPaint
(
pds
.
getKey
(
1
),
Color
.
BLUE
);
// 设置plot的前景色透明度
plot
.
setForegroundAlpha
(
0.7f
);
// 设置plot的背景色透明度
...
...
@@ -173,4 +217,13 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
String
base64
=
Base64
.
getEncoder
().
encodeToString
(
bytes
);
return
base64
;
}
@Override
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
)
{
AnalysisReportLog
analysisReportLog
=
new
AnalysisReportLog
();
analysisReportLog
.
setStartDate
(
startDate
);
analysisReportLog
.
setEndDate
(
endDate
);
analysisReportLog
.
setReportType
(
reportType
);
return
analysisReportLogMapper
.
allPage
(
page
,
analysisReportLog
);
}
}
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
56e8a06b
...
...
@@ -40,7 +40,7 @@ spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
spring.redis.expire.time
=
300
00
## emqx
emqx.clean-session
=
true
...
...
amos-boot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
View file @
56e8a06b
...
...
@@ -2823,4 +2823,43 @@
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000347, 'inwhichBuild', '所在建筑', 'String', 132828674824, 'eq', b'0', 'r_tank', 2581805, '2022-04-18 11:29:34');
</sql>
</changeSet>
<changeSet
author=
"wujiang"
id=
"2022-05-05-1"
runAlways=
"true"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"cb_org_usr"
/>
</not>
</preConditions>
<comment>
add cb_org_usr
</comment>
<sql>
CREATE TABLE `cb_org_usr` (
`sequence_nbr` bigint(32) NOT NULL,
`biz_org_name` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '机构/部门名称',
`biz_org_code` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '机构编码',
`amos_org_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'amos中公司/部门ID',
`amos_org_code` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'amos中公司/部门编码',
`biz_org_type` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '机构类型(部门:DEPARTMENT,单位:COMPANY,人员:PERSON)',
`build_name` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '所属建筑名称',
`build_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '所属建筑ID',
`parent_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '归属机构/部门/人员',
`org_expand_attr1` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展属性1',
`org_expand_attr2` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展属性2',
`org_expand_attr3` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展属性3',
`org_expand_attr4` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展属性4',
`org_expand_attr5` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`org_expand_attr6` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`org_expand_attr7` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`org_expand_attr8` varchar(104) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`rec_user_name` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '更新人',
`rec_user_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '更新人ID',
`rec_date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已被删除(0:未背删除,1:已删除)',
`parent_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '归属机构/部门/人员名称',
`code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '唯一编号 : 临时用',
`pcz_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '测试字段 稍后删除',
`pcz_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '测试字段 稍后删除',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='机构/部门/人员表';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/AnalysisReportLogMapper.xml
View file @
56e8a06b
...
...
@@ -2,4 +2,30 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.equipmanage.mapper.AnalysisReportLogMapper"
>
<select
id=
"allPage"
resultType=
"com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto"
>
SELECT
*,
'消防巡查报表' AS reportName,
cb_org_usr.biz_org_name AS stationName,
(CASE wl_analysis_report_log.report_type
WHEN 0 THEN '日报表'
WHEN 1 THEN '周报表'
ELSE '月报表'
END) reportTypeName
FROM
wl_analysis_report_log,cb_org_usr
<where>
cb_org_usr.biz_org_type = 'COMPANY' AND parent_id IS NOT NULL
<if
test=
"analysisReportLog.reportType != null and analysisReportLog.reportType != ''"
>
AND wl_analysis_report_log.report_type = #{analysisReportLog.reportType}
</if>
<if
test=
"analysisReportLog.startDate != null"
>
AND DATE_FORMAT(wl_analysis_report_log.start_date, '%Y-%m-%d')
>
= DATE_FORMAT(#{analysisReportLog.startDate}, '%Y-%m-%d')
</if>
<if
test=
"analysisReportLog.endDate != null"
>
AND DATE_FORMAT(wl_analysis_report_log.end_date, '%Y-%m-%d')
<
= DATE_FORMAT(#{analysisReportLog.endDate}, '%Y-%m-%d')
</if>
</where>
</select>
</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