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
f731acde
Commit
f731acde
authored
Nov 29, 2021
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消防监督报告bug修改
parent
1afe21cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
15 deletions
+22
-15
CheckReportDangerDto.java
...mos/supervision/core/common/dto/CheckReportDangerDto.java
+3
-0
CheckReportController.java
...upervision/business/controller/CheckReportController.java
+2
-2
CheckReportServiceImpl.java
...rvision/business/service/impl/CheckReportServiceImpl.java
+16
-12
ICheckReportService.java
...pervision/business/service/intfc/ICheckReportService.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-supervision-api/src/main/java/com/yeejoin/amos/supervision/core/common/dto/CheckReportDangerDto.java
View file @
f731acde
...
...
@@ -16,6 +16,9 @@ public class CheckReportDangerDto implements Serializable {
String
companyName
;
@ApiModelProperty
(
value
=
"隐患id"
)
String
id
;
@ApiModelProperty
(
value
=
"隐患id"
)
String
dangerId
;
@ApiModelProperty
(
value
=
"存在问题"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/CheckReportController.java
View file @
f731acde
...
...
@@ -95,7 +95,7 @@ public class CheckReportController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取检查报告文档"
,
notes
=
"获取检查报告文档"
)
@GetMapping
(
value
=
"/docx/{id}"
)
public
ResponseModel
getCheckReportDocx
(
HttpServletResponse
response
,
@PathVariable
(
name
=
"id"
)
String
reportId
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iCheckReportService
.
getCheckReportDocx
(
response
,
reportId
)
);
public
void
getCheckReportDocx
(
HttpServletResponse
response
,
@PathVariable
(
name
=
"id"
)
String
reportId
)
throws
Exception
{
iCheckReportService
.
getCheckReportDocx
(
response
,
reportId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckReportServiceImpl.java
View file @
f731acde
...
...
@@ -231,8 +231,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
// 复查已整改隐患
List
<
CheckReportDangerDto
>
reviewReformedList
=
result
.
get
(
"reviewReformedList"
);
Set
<
String
>
reviewDangerIdSet
=
Sets
.
newHashSet
();
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewDangerList
,
CheckReportDangerDto:
:
get
Danger
Id
));
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewReformedList
,
CheckReportDangerDto:
:
get
Danger
Id
));
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewDangerList
,
CheckReportDangerDto:
:
getId
));
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewReformedList
,
CheckReportDangerDto:
:
getId
));
// 保存本次复查隐患id
checkReport
.
setReviewDangerIds
(
Joiner
.
on
(
","
).
join
(
reviewDangerIdSet
));
// List<CheckReportDangerDto> reviewReformingList = result.get("reviewReformingList");
...
...
@@ -290,7 +290,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
}
@Override
public
Object
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
ParseException
,
UnsupportedEncodingException
{
public
void
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
ParseException
,
UnsupportedEncodingException
{
CheckReportDto
report
=
this
.
getDetailById
(
reportId
);
report
.
setReportDate
(
getCheckReportDateStr
(
report
));
report
.
setNowDate
(
DateUtils
.
dateFormat
(
new
Date
(),
DateUtils
.
CHN_DATE_PATTERN
));
...
...
@@ -305,7 +306,7 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
configureBuilder
.
setElMode
(
ELMode
.
SPEL_MODE
).
bind
(
"checkDangerList"
,
checkDangerTablePolicy
).
bind
(
"reviewDangerList"
,
reviewDangerTablePolicy
).
build
();
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
checkReportTemplatePath
,
configureBuilder
.
build
()).
render
(
report
);
response
.
setContentType
(
"application/msword"
);
response
.
setHeader
(
"Content-
d
isposition"
,
response
.
setHeader
(
"Content-
D
isposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"utf-8"
));
OutputStream
out
=
null
;
BufferedOutputStream
bos
=
null
;
...
...
@@ -328,7 +329,6 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
}
}
}
return
null
;
}
private
String
getCheckReportDateStr
(
CheckReportDto
checkReportDto
)
throws
ParseException
{
...
...
@@ -394,23 +394,24 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
report
.
getCompanyName
(),
report
.
getDangerName
(),
report
.
getDangerStateName
(),
report
.
getCompanyId
());
checkDangerList
.
add
(
rowRenderData
);
}));
generateTableData
(
table
,
checkDangerList
);
// companyId字段在RowRenderData中下标(0开始,companyName:1,dangerName:2,dangerStateName:3,companyId:4)
generateTableData
(
table
,
checkDangerList
,
4
);
}
}
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
)
{
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
,
int
bizIndex
)
{
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
// 表格渲染和列表数据下标相反,需要翻转一下列表
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
table
.
removeRow
(
dangerListDataStartRow
);
int
lastRow
=
dangerListDataStartRow
;
String
sameCompanyId
=
dangerList
.
get
(
0
).
getCellDatas
().
get
(
4
).
getRenderData
().
getText
();
dangerList
.
get
(
0
).
getCellDatas
().
get
(
bizIndex
).
getRenderData
().
getText
();
List
<
Map
<
String
,
Integer
>>
mergeRowMapList
=
Lists
.
newArrayList
();
// 循环插入行
int
listLength
=
dangerList
.
size
();
for
(
int
i
=
0
;
i
<
listLength
;
i
++)
{
String
companyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
4
).
getRenderData
().
getText
();
String
companyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
bizIndex
).
getRenderData
().
getText
();
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setText
(
String
.
valueOf
(
listLength
-
i
));
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
Style
style
=
new
Style
();
...
...
@@ -419,10 +420,12 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
cellRenderData
.
getRenderData
().
setStyle
(
style
);
});
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
IntStream
.
range
(
0
,
4
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
// 生成表格字段个数 (不包含companyId字段)
int
cellLength
=
reverseList
.
get
(
i
).
getCellDatas
().
size
()
-
1
;
IntStream
.
range
(
0
,
cellLength
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
if
(!
sameCompanyId
.
equals
(
companyId
))
{
sameCompanyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
4
).
getRenderData
().
getText
();
sameCompanyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
bizIndex
).
getRenderData
().
getText
();
Map
<
String
,
Integer
>
mergeRowMap
=
Maps
.
newHashMap
();
mergeRowMap
.
put
(
"fromRow"
,
lastRow
);
mergeRowMap
.
put
(
"toRow"
,
i
+
dangerListDataStartRow
-
1
);
...
...
@@ -464,7 +467,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
report
.
getRemark
(),
report
.
getCompanyId
());
reviewDangerList
.
add
(
rowRenderData
);
}));
generateTableData
(
table
,
reviewDangerList
);
// companyId字段在RowRenderData中下标(0开始,companyName:1,dangerName:2,dangerStateName:3,remark:4,companyId:5)
generateTableData
(
table
,
reviewDangerList
,
5
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/ICheckReportService.java
View file @
f731acde
...
...
@@ -38,5 +38,5 @@ public interface ICheckReportService {
* @param reportId
* @return
*/
Object
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
Exception
;
void
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
Exception
;
}
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