Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
bdb57240
Commit
bdb57240
authored
Aug 15, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化联调应急报告
parent
417ccdbc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
96 additions
and
17 deletions
+96
-17
PlanReport.java
...main/java/com/yeejoin/amos/fas/dao/entity/PlanReport.java
+4
-1
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+1
-0
PlanReportController.java
...in/amos/fas/business/controller/PlanReportController.java
+3
-3
PlanReportMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanReportMapper.java
+2
-0
IContingencyPlanInstanceRepository.java
...ss/dao/repository/IContingencyPlanInstanceRepository.java
+10
-1
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+5
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+5
-0
PlanReportServiceImpl.java
...amos/fas/business/service/impl/PlanReportServiceImpl.java
+38
-10
IContingencyInstance.java
...amos/fas/business/service/intfc/IContingencyInstance.java
+2
-0
PlanReportMapper.xml
...ysStart/src/main/resources/db/mapper/PlanReportMapper.xml
+24
-0
StationDrilReport.ftl
...AutoSysStart/src/main/resources/ftl/StationDrilReport.ftl
+2
-2
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanReport.java
View file @
bdb57240
...
...
@@ -2,7 +2,9 @@ package com.yeejoin.amos.fas.dao.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
...
...
@@ -10,7 +12,6 @@ import java.util.Date;
@Data
@TableName
(
"c_plan_report"
)
public
class
PlanReport
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@TableField
(
"batch_no"
)
private
String
batchNo
;
...
...
@@ -22,6 +23,8 @@ public class PlanReport extends BaseEntity {
private
String
title
;
@TableField
(
value
=
"drill_date"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
drillDate
;
@TableField
(
"address"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
bdb57240
...
...
@@ -716,6 +716,7 @@ public class ContingencyAction implements CustomerAction {
// 结束预案,更新预案信息表结束时间
contingencyInstanceInfoService
.
updateEndTimeById
(
batchNo
);
// 生成演练报告
planReportService
.
createReport
(
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanReportController.java
View file @
bdb57240
...
...
@@ -81,13 +81,13 @@ public class PlanReportController extends BaseController {
@Permission
@ApiOperation
(
value
=
"更新"
,
notes
=
"更新"
)
@PutMapping
(
value
=
"/update"
)
@PutMapping
(
value
=
"/update"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
updateReport
(
@RequestBody
PlanReport
planReport
)
{
PlanReport
report
=
iPlanReportService
.
updateReport
(
planReport
);
return
CommonResponseUtil
.
success
(
report
);
}
@Permission
@ApiOperation
(
value
=
"下载报告"
,
notes
=
"下载报告"
)
@GetMapping
(
value
=
"/download"
)
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
...
...
@@ -95,7 +95,7 @@ public class PlanReportController extends BaseController {
iPlanReportService
.
download
(
request
,
response
,
id
);
}
@Permission
@ApiOperation
(
value
=
"预览报告"
,
notes
=
"预览报告"
)
@GetMapping
(
value
=
"/preview"
)
public
CommonResponse
preview
(
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanReportMapper.java
View file @
bdb57240
...
...
@@ -21,4 +21,6 @@ public interface PlanReportMapper extends BaseMapper<PlanReport> {
PlanReport
getById
(
@Param
(
"id"
)
Long
id
);
PlanReport
getByBatchNo
(
@Param
(
"batchNo"
)
String
batchNo
);
void
updateReportById
(
PlanReport
report
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyPlanInstanceRepository.java
View file @
bdb57240
...
...
@@ -85,5 +85,14 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
@Query
(
value
=
"SELECT * FROM `contingency_plan_instance` WHERE batch_no = ?1"
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
findByBatchNo
(
String
batchNo
);
@Query
(
value
=
"SELECT "
+
" *"
+
" FROM "
+
" contingency_plan_instance t"
+
" WHERE"
+
" t.batch_no = ?"
+
" AND (t.record_type = 'MESSAGE' OR ( t.record_type = 'TASKOPERATE' AND t.runstate = true)) "
+
" ORDER BY"
+
" t.create_date ASC"
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
queryForExecuteInfo
(
String
batch_no
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
bdb57240
...
...
@@ -196,6 +196,11 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
return
categorys
;
}
public
List
<
ContingencyPlanInstance
>
queryForExecuteInfo
(
String
batchNo
)
{
List
<
ContingencyPlanInstance
>
instances
=
repository
.
queryForExecuteInfo
(
batchNo
);
return
instances
;
}
@Transactional
public
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
)
throws
Exception
{
//火灾误报
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
bdb57240
...
...
@@ -117,6 +117,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Autowired
IPlanReportService
planReportService
;
@Autowired
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
...
...
@@ -825,6 +827,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
logger
.
info
(
"预案重置失败batchNo:{}"
,
batchNo
,
e
);
e
.
printStackTrace
();
}
// 生成演练报告
planReportService
.
createReport
(
batchNo
);
});
}
...
...
@@ -846,6 +850,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
logger
.
info
(
"数据同步之消息发送. [method='{}']"
,
"activatePlan==>syncCreatedPlanDetailSyncBo==>syncCreatedPlanOperationRecordSyncBo"
,
e
);
}
}
planStepService
.
initPlanStep
();
planStepService
.
initPlanTask
();
}
catch
(
Exception
e
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanReportServiceImpl.java
View file @
bdb57240
...
...
@@ -6,15 +6,16 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanReportMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanReportService
;
import
com.yeejoin.amos.fas.business.util.MyByteArrayMultipartFile
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.util.WordTemplateUtils
;
import
com.yeejoin.amos.fas.common.enums.WordTemplateTypeEum
;
import
com.yeejoin.amos.fas.
core.util.DateUtil
;
import
com.yeejoin.amos.fas.
dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.PlanReport
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
org.apache.http.client.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.Assert
;
...
...
@@ -27,20 +28,22 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.*
;
@Service
public
class
PlanReportServiceImpl
extends
ServiceImpl
<
PlanReportMapper
,
PlanReport
>
implements
IPlanReportService
{
private
static
String
firstContent
=
""
;
@Autowired
PlanReportMapper
planReportMapper
;
@Autowired
private
IPlanOperationRecordDao
planOperationRecordDao
;
@Autowired
private
IContingencyInstance
iContingencyInstance
;
@Override
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
PlanReport
report
=
planReportMapper
.
getById
(
Long
.
valueOf
(
id
));
...
...
@@ -87,16 +90,40 @@ public class PlanReportServiceImpl extends ServiceImpl<PlanReportMapper, PlanRep
public
void
createReport
(
String
batchNo
)
{
Assert
.
notNull
(
batchNo
,
"batchNo 不能为空!"
);
PlanReport
report
=
planReportMapper
.
getByBatchNo
(
batchNo
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
List
<
ContingencyPlanInstance
>
list
=
null
;
try
{
list
=
iContingencyInstance
.
queryForExecuteInfo
(
batchNo
);
firstContent
=
list
.
get
(
0
).
getContent
();
list
.
remove
(
0
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
StringBuilder
builder
=
new
StringBuilder
();
list
.
forEach
(
instance
->
{
if
(
"MESSAGE"
.
equalsIgnoreCase
(
instance
.
getRecordType
())){
builder
.
append
(
sdf
.
format
(
instance
.
getCreateDate
())).
append
(
" "
).
append
(
instance
.
getStartUserName
())
.
append
(
":"
).
append
(
instance
.
getContent
()).
append
(
"\n"
);
}
else
{
builder
.
append
(
sdf
.
format
(
instance
.
getUpdateDate
())).
append
(
" "
).
append
(
instance
.
getStartUserName
())
.
append
(
":"
).
append
(
instance
.
getCategory
()).
append
(
"\n"
);
}
});
String
str
=
builder
.
toString
();
str
=
str
.
substring
(
0
,
str
.
length
()
-
1
);
report
.
setHandleProcess
(
str
);
}
String
url
=
preview
(
report
);
report
.
setReportUrl
(
url
);
planReportMapper
.
updateById
(
report
);
planReportMapper
.
update
Report
ById
(
report
);
}
@Override
public
PlanReport
updateReport
(
PlanReport
report
)
{
String
url
=
preview
(
report
);
report
.
setReportUrl
(
url
);
planReportMapper
.
updateById
(
report
);
planReportMapper
.
update
Report
ById
(
report
);
return
report
;
}
...
...
@@ -116,7 +143,7 @@ public class PlanReportServiceImpl extends ServiceImpl<PlanReportMapper, PlanRep
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
PlanOperationRecord
operationRecord
=
planOperationRecordDao
.
findByBatchNo
(
report
.
getBatchNo
());
SimpleDateFormat
dateStat
=
new
SimpleDateFormat
(
"HH:mm"
);
SimpleDateFormat
drillDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd
HH:mm:ss
"
);
SimpleDateFormat
drillDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 活动主题
map
.
put
(
"drill_title"
,
report
.
getTitle
());
// 演练时间
...
...
@@ -130,9 +157,10 @@ public class PlanReportServiceImpl extends ServiceImpl<PlanReportMapper, PlanRep
// 演习题目
map
.
put
(
"drill_topic"
,
report
.
getDrillTopic
());
// 处理过程
map
.
put
(
"handle_process"
,
report
.
getHandleProcess
()
);
map
.
put
(
"handle_process"
,
StringUtil
.
isNotEmpty
(
report
.
getHandleProcess
())
?
report
.
getHandleProcess
().
replaceAll
(
"\n"
,
" "
)
:
""
);
// 预案开始时间
map
.
put
(
"start_time"
,
dateStat
.
format
(
operationRecord
.
getStartTime
()));
map
.
put
(
"first_content"
,
firstContent
);
// 预案结束时间
map
.
put
(
"end_time"
,
dateStat
.
format
(
operationRecord
.
getEndTime
()));
// 演习总结
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyInstance.java
View file @
bdb57240
...
...
@@ -14,6 +14,8 @@ public interface IContingencyInstance {
List
<
ContingencyPlanInstance
>
queryForTimeLine
(
String
instanceNo
,
String
recordType
)
throws
Exception
;
List
<
ContingencyPlanInstance
>
queryForExecuteInfo
(
String
batchNo
);
void
setButtonExecuted
(
String
batchNo
,
String
contingencyPlanId
,
String
code
,
String
buttonState
,
String
user
)
throws
Exception
;
void
setButtonWait
(
String
batchNo
,
String
contingencyPlanId
,
String
buttonState
)
throws
Exception
;
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanReportMapper.xml
View file @
bdb57240
...
...
@@ -90,4 +90,27 @@
<select
id=
"getByBatchNo"
resultType=
"com.yeejoin.amos.fas.dao.entity.PlanReport"
>
select * from c_plan_report where batch_no = #{batchNo}
</select>
<update
id=
"updateReportById"
>
UPDATE
`c_plan_report`
SET `batch_no` = #{batchNo},
`report_url` = #{reportUrl},
`title` = #{title},
`create_date` = #{createDate},
`drill_date` = #{drillDate},
`address` = #{address},
`compere` = #{compere},
`attend_person` = #{attendPerson},
`drill_topic` = #{drillTopic},
`handle_process` = #{handleProcess},
`drill_summary` = #{drillSummary},
`examine_result` = #{examineResult},
`biz_org_name` = #{bizOrgName},
`biz_org_code` = #{bizOrgCode},
`drill_type` = #{drillType},
`drill_equip` = #{drillEquip},
`drill_equip_id` = #{drillEquipId}
WHERE `id` = #{id};
</update>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/ftl/StationDrilReport.ftl
View file @
bdb57240
...
...
@@ -1093,7 +1093,7 @@
<w:sz
w:val=
"28"
/>
<w:lang
w:val=
"EN-US"
w:fareast=
"ZH-CN"
/>
</w:rPr>
<w:t>
通过数字站观看起火换流变情况
</w:t>
<w:t>
${(first_content)!''}
</w:t>
</w:r>
</w:p>
<w:p>
...
...
@@ -1114,7 +1114,7 @@
<w:sz
w:val=
"28"
/>
<w:lang
w:val=
"EN-US"
w:fareast=
"ZH-CN"
/>
</w:rPr>
<w:t>
19:06 政府消防官兵到达火灾现场,运行人员和驻站消防队向政府消防队交待着火设备和现场运行设备状况后,现场指挥权移交给政府消防队。
</w:t>
<w:t>
${(handle_process)!''}
</w:t>
</w:r>
</w:p>
<w:p>
...
...
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