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
e3d3fb78
Commit
e3d3fb78
authored
Jan 19, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预案代码合并
parent
5022aa0f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
57 deletions
+43
-57
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+1
-1
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+0
-2
IEquipmentFireEquipmentDao.java
...s/business/dao/repository/IEquipmentFireEquipmentDao.java
+1
-1
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+38
-50
ContingencyPlanParamVo.java
.../yeejoin/amos/fas/business/vo/ContingencyPlanParamVo.java
+3
-3
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
e3d3fb78
...
...
@@ -666,7 +666,7 @@ public class ContingencyAction implements CustomerAction {
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
planOperationRecord
.
getPlanId
());
if
(
optionalPlanDetail
.
get
()!=
null
){
PlanDetail
planDetail
=
optionalPlanDetail
.
get
();
planDetail
.
setStatus
(
Integer
.
parseInt
(
ContingencyPlanStatusEnum
.
AVAILABLE
.
getCode
()
));
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
AVAILABLE
.
getCode
(
));
planDetailDao
.
save
(
planDetail
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
e3d3fb78
...
...
@@ -164,8 +164,6 @@ public class ContingencyPlanController extends BaseController {
}
}
@Autowired
private
ContingencyPlanService
contingencyPlanService
;
@ApiOperation
(
value
=
"启动"
)
@RequestMapping
(
value
=
"/start"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
start
(
@RequestBody
ContingencyPlanParamVo
vo
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IEquipmentFireEquipmentDao.java
View file @
e3d3fb78
...
...
@@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.stereotype.Repository
;
import
org.springframework.transaction.annotation.Transactional
;
@Repository
(
"iEquipmentFireEquipmentDao"
)
@Repository
public
interface
IEquipmentFireEquipmentDao
extends
BaseDao
<
EquipmentFireEquipment
,
Long
>
{
/**
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
e3d3fb78
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.ContingencyPlanService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum
;
import
com.yeejoin.amos.fas.core.enums.NumberEnum
;
import
com.yeejoin.amos.fas.core.enums.ReserveEnum
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.*
;
import
java.util.*
;
...
...
@@ -41,8 +30,7 @@ import java.util.*;
*/
@Service
public
class
ContingencyPlanServiceImpl
implements
ContingencyPlanService
{
@Autowired
private
IPlanDetailDao
planDetailDao
;
@Autowired
private
IEquipmentService
equipmentService
;
@Autowired
...
...
@@ -55,10 +43,35 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
@Qualifier
(
"iEquipmentDao"
)
@Autowired
private
IEquipmentDao
equipmentDao
;
private
final
PlanOperationRecordMapper
planOperationRecordMapper
;
private
final
IPlanDetailDao
planDetailDao
;
private
final
IPlanDocDao
planDocDao
;
private
final
IPlanEquipmentDao
planEquipmentDao
;
private
final
IPlanRuleDao
planRuleDao
;
private
final
IPlanClassifyTreeDao
classifyTreeDao
;
private
final
PlanDetailMapper
planDetailMapper
;
private
final
PlanEquipmentMapper
planEquipmentMapper
;
private
final
PlanRuleMapper
planRuleMapper
;
private
final
PlanDocMapper
planDocMapper
;
@Autowired
private
IPlanEquipmentDao
planEquipmentDao
;
@Autowired
private
PlanOperationRecordMapper
planOperationRecordMapper
;
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
IPlanRuleDao
planRuleDao
,
IPlanClassifyTreeDao
classifyTreeDao
,
PlanDetailMapper
planDetailMapper
,
PlanEquipmentMapper
planEquipmentMapper
,
PlanRuleMapper
planRuleMapper
,
PlanDocMapper
planDocMapper
,
PlanOperationRecordMapper
planOperationRecordMapper
)
{
this
.
planDetailDao
=
planDetailDao
;
this
.
planDocDao
=
planDocDao
;
this
.
planEquipmentDao
=
planEquipmentDao
;
this
.
planRuleDao
=
planRuleDao
;
this
.
classifyTreeDao
=
classifyTreeDao
;
this
.
planDetailMapper
=
planDetailMapper
;
this
.
planEquipmentMapper
=
planEquipmentMapper
;
this
.
planRuleMapper
=
planRuleMapper
;
this
.
planDocMapper
=
planDocMapper
;
this
.
planOperationRecordMapper
=
planOperationRecordMapper
;
}
@Override
public
String
planStart
(
ContingencyPlanParamVo
vo
){
ReserveEnum
reserveEnum
=
null
;
...
...
@@ -87,16 +100,16 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
planOperationRecord
.
setPlanId
(
PlanDetailOp
.
get
().
getId
());
planOperationRecord
.
setIsDelete
(
true
);
planOperationRecord
.
setStartTime
(
new
Date
());
planOperationRecord
.
setPlanPattern
(
Integer
.
parseInt
(
vo
.
getStatus
()
));
planOperationRecord
.
setPlanPattern
(
vo
.
getStatus
(
));
PlanOperationRecord
result
=
planOperationRecordDao
.
save
(
planOperationRecord
);
//预案启动
if
(
PlanDetailOp
.
get
()!=
null
){
Equipment
equipment
=
equipmentService
.
queryOne
(
PlanDetailOp
.
get
().
getId
());
//预案启动
reserveEnum
=
riskSourceService
.
startEquipReserve
(
equipment
.
getId
(),
equipment
.
getCode
(),
result
.
getId
());
if
(
ReserveEnum
.
RUN
.
getStatus
()
==
reserveEnum
.
getStatus
()
){
PlanDetail
planDetail
=
PlanDetailOp
.
get
();
planDetail
.
setStatus
(
Integer
.
parseInt
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
()
));
if
(
ReserveEnum
.
RUN
==
reserveEnum
){
PlanDetail
planDetail
=
PlanDetailOp
.
get
();
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
(
));
planDetailDao
.
save
(
planDetail
);
}
}
...
...
@@ -108,9 +121,9 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
ContingencyPlanParamVo
vo
=
null
;
List
<
EquipmentFireEquipment
>
equipmentFireEquipmentList
=
equipmentFireEquipmentDao
.
findAllByEquipmentId
(
equipmentId
);
if
(
equipmentFireEquipmentList
.
size
()>
0
){
Optional
<
Equipment
>
equipmentOptional
=
equipmentDao
.
findById
(
equipmentFireEquipmentList
.
get
(
0
).
getEquipmentId
()
);
if
(
equipment
Optional
.
get
()
!=
null
){
PlanEquipment
planEquipment
=
planEquipmentDao
.
findByFireEquipmentId
(
equipment
Optional
.
get
()
.
getId
());
Equipment
equipment
=
equipmentDao
.
findById
(
equipmentFireEquipmentList
.
get
(
0
).
getEquipmentId
()).
orElse
(
null
);
if
(
equipment
!=
null
){
PlanEquipment
planEquipment
=
planEquipmentDao
.
findByFireEquipmentId
(
equipment
.
getId
());
if
(
planEquipment
!=
null
){
vo
=
new
ContingencyPlanParamVo
();
vo
.
setPlanId
(
planEquipment
.
getPlanId
().
toString
());
...
...
@@ -138,31 +151,6 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
return
page
;
}
private
final
IPlanDetailDao
planDetailDao
;
private
final
IPlanDocDao
planDocDao
;
private
final
IPlanEquipmentDao
planEquipmentDao
;
private
final
IPlanRuleDao
planRuleDao
;
private
final
IPlanClassifyTreeDao
classifyTreeDao
;
private
final
PlanDetailMapper
planDetailMapper
;
PlanEquipmentMapper
planEquipmentMapper
;
PlanRuleMapper
planRuleMapper
;
PlanDocMapper
planDocMapper
;
@Autowired
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
IPlanRuleDao
planRuleDao
,
IPlanClassifyTreeDao
classifyTreeDao
,
PlanDetailMapper
planDetailMapper
,
PlanEquipmentMapper
planEquipmentMapper
,
PlanRuleMapper
planRuleMapper
,
PlanDocMapper
planDocMapper
)
{
this
.
planDetailDao
=
planDetailDao
;
this
.
planDocDao
=
planDocDao
;
this
.
planEquipmentDao
=
planEquipmentDao
;
this
.
planRuleDao
=
planRuleDao
;
this
.
classifyTreeDao
=
classifyTreeDao
;
this
.
planDetailMapper
=
planDetailMapper
;
this
.
planEquipmentMapper
=
planEquipmentMapper
;
this
.
planRuleMapper
=
planRuleMapper
;
this
.
planDocMapper
=
planDocMapper
;
}
@Override
public
PlanDetailVo
createPlan
(
PlanDetailVo
planDetail
)
{
PlanDoc
planDoc
=
planDetail
.
getPlanDoc
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ContingencyPlanParamVo.java
View file @
e3d3fb78
...
...
@@ -6,7 +6,7 @@ public class ContingencyPlanParamVo {
public
String
planId
;
public
String
status
;
public
Integer
status
;
public
String
getPlanId
()
{
return
planId
;
...
...
@@ -16,11 +16,11 @@ public class ContingencyPlanParamVo {
this
.
planId
=
planId
;
}
public
String
getStatus
()
{
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
...
...
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