Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
a0bd0338
Commit
a0bd0338
authored
Oct 28, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化统计bug
parent
3aa5da0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
7 deletions
+45
-7
ExcelUtils.java
...va/com/yeejoin/amos/boot/biz/common/utils/ExcelUtils.java
+40
-1
PeasantHouseholdMapper.xml
...rc/main/resources/mapper/mysql/PeasantHouseholdMapper.xml
+2
-3
PowerStationStatisticsServiceImpl.java
...f/biz/service/impl/PowerStationStatisticsServiceImpl.java
+1
-1
PowerStationTimeStatisticsExcelVO.java
...module/hygf/biz/vo/PowerStationTimeStatisticsExcelVO.java
+2
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/ExcelUtils.java
View file @
a0bd0338
...
@@ -7,7 +7,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
...
@@ -7,7 +7,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.enmus.ExcelType
;
import
cn.afterturn.easypoi.excel.entity.enmus.ExcelType
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.usermodel.
Workbook
;
import
org.apache.poi.ss.usermodel.
*
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -69,6 +69,45 @@ public class ExcelUtils {
...
@@ -69,6 +69,45 @@ public class ExcelUtils {
/**
/**
* excel 导出
* excel 导出
*
*
* @param list 数据
* @param title 标题
* @param sheetName sheet名称
* @param pojoClass pojo类型
* @param fileName 文件名称
* @param response
*/
public
static
void
exportExcelDefaultGroundColor
(
List
<?>
list
,
String
title
,
String
sheetName
,
Class
<?>
pojoClass
,
String
fileName
,
HttpServletResponse
response
)
{
ExportParams
exportParams
=
new
ExportParams
(
title
,
sheetName
);
Workbook
workbook
=
ExcelExportUtil
.
exportExcel
(
exportParams
,
pojoClass
,
list
);
if
(
workbook
!=
null
)
{
// 设置表头样式
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
Row
headerRow
=
sheet
.
getRow
(
0
);
if
(
headerRow
!=
null
)
{
CellStyle
headerStyle
=
workbook
.
createCellStyle
();
Font
font
=
workbook
.
createFont
();
font
.
setBold
(
true
);
// 加粗
headerStyle
.
setFont
(
font
);
headerStyle
.
setFillForegroundColor
(
IndexedColors
.
SKY_BLUE
.
getIndex
());
// 背景色
headerStyle
.
setFillPattern
(
FillPatternType
.
SOLID_FOREGROUND
);
// 填充模式
// 设置居中对齐
headerStyle
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
headerStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
// 设置表头每个单元格的样式
for
(
int
i
=
0
;
i
<
headerRow
.
getPhysicalNumberOfCells
();
i
++)
{
Cell
cell
=
headerRow
.
getCell
(
i
);
if
(
cell
!=
null
)
{
cell
.
setCellStyle
(
headerStyle
);
}
}
}
downLoadExcel
(
fileName
,
response
,
workbook
);
}
}
/**
* excel 导出
*
* @param list 数据
* @param list 数据
* @param fileName 文件名称
* @param fileName 文件名称
* @param response
* @param response
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/PeasantHouseholdMapper.xml
View file @
a0bd0338
...
@@ -198,13 +198,12 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
...
@@ -198,13 +198,12 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
hpsei.real_scale,
hpsei.real_scale,
substring_index ( hph.project_address_name, '/', 1 ) AS province,
substring_index ( hph.project_address_name, '/', 1 ) AS province,
hph.regional_companies_name,
hph.regional_companies_name,
sub.real
_name AS serviceAgent
hph.developer
_name AS serviceAgent
FROM
FROM
hygf_peasant_household hph
hygf_peasant_household hph
LEFT JOIN hygf_commercial hc ON hc.survey_information_id = hph.survey_information_id
LEFT JOIN hygf_commercial hc ON hc.survey_information_id = hph.survey_information_id
LEFT JOIN hygf_work_order_power_station hwops ON hph.sequence_nbr = hwops.peasant_household_id
LEFT JOIN hygf_work_order_power_station hwops ON hph.sequence_nbr = hwops.peasant_household_id
LEFT JOIN hygf_power_station_engineering_info hpsei ON hwops.sequence_nbr = hpsei.work_order_power_station_id
LEFT JOIN hygf_power_station_engineering_info hpsei ON hwops.sequence_nbr = hpsei.work_order_power_station_id
LEFT JOIN std_user_biz sub ON sub.amos_user_id =hph.developer_user_id
<where>
<where>
<if
test=
"statisticsDto.ownersName!=null and statisticsDto.ownersName !=''"
>
<if
test=
"statisticsDto.ownersName!=null and statisticsDto.ownersName !=''"
>
and hph.owners_name like concat ('%',#{statisticsDto.ownersName},'%')
and hph.owners_name like concat ('%',#{statisticsDto.ownersName},'%')
...
@@ -216,7 +215,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
...
@@ -216,7 +215,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
and hph.regional_companies_name like concat ('%',#{statisticsDto.regionalCompaniesName},'%')
and hph.regional_companies_name like concat ('%',#{statisticsDto.regionalCompaniesName},'%')
</if>
</if>
<if
test=
"statisticsDto.serviceAgent!=null and statisticsDto.serviceAgent !=''"
>
<if
test=
"statisticsDto.serviceAgent!=null and statisticsDto.serviceAgent !=''"
>
and
sub.real
_name like concat ('%',#{statisticsDto.serviceAgent},'%')
and
hph.developer
_name like concat ('%',#{statisticsDto.serviceAgent},'%')
</if>
</if>
</where>
</where>
ORDER BY hph.rec_date DESC ,hph.sequence_nbr DESC
ORDER BY hph.rec_date DESC ,hph.sequence_nbr DESC
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PowerStationStatisticsServiceImpl.java
View file @
a0bd0338
...
@@ -302,7 +302,7 @@ public class PowerStationStatisticsServiceImpl {
...
@@ -302,7 +302,7 @@ public class PowerStationStatisticsServiceImpl {
excelVO
.
setFhbhEndTime
(
DateUtils
.
dateFormat
(
statisticsDto
.
getFhbhEndTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
excelVO
.
setFhbhEndTime
(
DateUtils
.
dateFormat
(
statisticsDto
.
getFhbhEndTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
dataList
.
add
(
excelVO
);
dataList
.
add
(
excelVO
);
}
}
ExcelUtils
.
exportExcel
(
dataList
,
null
,
"电站时间统计"
,
PowerStationTimeStatisticsExcelVO
.
class
,
"电站时间统计"
+
DateUtils
.
dateFormat
(
new
Date
(),
"YYYY-MM-dd-HH-mm"
)
+
".xlsx"
,
response
);
ExcelUtils
.
exportExcel
DefaultGroundColor
(
dataList
,
null
,
"电站时间统计"
,
PowerStationTimeStatisticsExcelVO
.
class
,
"电站时间统计"
+
DateUtils
.
dateFormat
(
new
Date
(),
"YYYY-MM-dd-HH-mm"
)
+
".xlsx"
,
response
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"导出失败,失败原因["
+
e
.
getMessage
()
+
"]"
);
throw
new
BadRequest
(
"导出失败,失败原因["
+
e
.
getMessage
()
+
"]"
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/vo/PowerStationTimeStatisticsExcelVO.java
View file @
a0bd0338
...
@@ -17,11 +17,11 @@ public class PowerStationTimeStatisticsExcelVO implements Serializable {
...
@@ -17,11 +17,11 @@ public class PowerStationTimeStatisticsExcelVO implements Serializable {
@ApiModelProperty
(
value
=
"电站名称"
)
@ApiModelProperty
(
value
=
"电站名称"
)
private
String
ownersName
;
private
String
ownersName
;
@Excel
(
name
=
"电站安装规模(
K
W)"
,
width
=
30
,
orderNum
=
"2"
)
@Excel
(
name
=
"电站安装规模(
k
W)"
,
width
=
30
,
orderNum
=
"2"
)
@ApiModelProperty
(
value
=
"电站安装规模"
)
@ApiModelProperty
(
value
=
"电站安装规模"
)
private
String
scale
;
private
String
scale
;
@Excel
(
name
=
"电站实际规模(
K
W)"
,
width
=
30
,
orderNum
=
"3"
)
@Excel
(
name
=
"电站实际规模(
k
W)"
,
width
=
30
,
orderNum
=
"3"
)
@ApiModelProperty
(
value
=
"电站实际规模"
)
@ApiModelProperty
(
value
=
"电站实际规模"
)
private
String
realScale
;
private
String
realScale
;
...
...
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