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
b437c0ec
Commit
b437c0ec
authored
Jan 15, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数字预案增删改查/启停用接口
parent
153973f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
PlanDetail.java
...main/java/com/yeejoin/amos/fas/dao/entity/PlanDetail.java
+2
-1
PlanDoc.java
...rc/main/java/com/yeejoin/amos/fas/dao/entity/PlanDoc.java
+3
-3
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+18
-5
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanDetail.java
View file @
b437c0ec
...
...
@@ -38,7 +38,8 @@ public class PlanDetail extends BasicEntity {
/**
* 适用范围
*/
private
String
range
;
@Column
(
name
=
"plan_range"
)
private
String
planRange
;
/**
* 编写部门
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanDoc.java
View file @
b437c0ec
...
...
@@ -22,20 +22,20 @@ public class PlanDoc extends BasicEntity {
/**
* 预案ID
*/
@Column
(
name
=
"plan_
name
"
)
@Column
(
name
=
"plan_
id
"
)
private
Long
planId
;
/**
* 文档ID
*/
@Column
(
name
=
"
plan_name
"
)
@Column
(
name
=
"
doc_id
"
)
private
Long
docId
;
/**
* 删除状态
*/
@Column
(
name
=
"
plan_nam
e"
)
@Column
(
name
=
"
is_delet
e"
)
private
Boolean
isDelete
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
b437c0ec
...
...
@@ -3,17 +3,20 @@ package com.yeejoin.amos.fas.business.service.impl;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanDetailMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.ContingencyPlanService
;
import
com.yeejoin.amos.fas.business.util.Bean
;
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.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Optional
;
/**
* @program: YeeAmosFireAutoSysRoot
...
...
@@ -61,7 +64,10 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
});
// 状态为草稿
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
DRAFT
.
getCode
());
long
planId
=
planDetailDao
.
save
(
planDetail
).
getId
();
planDetail
.
setIsDelete
(
false
);
PlanDetail
planEntity
=
new
PlanDetail
();
BeanUtils
.
copyProperties
(
planDetail
,
planEntity
);
long
planId
=
planDetailDao
.
save
(
planEntity
).
getId
();
planDetail
.
setId
(
planId
);
planDoc
.
setPlanId
(
planId
);
planDocDao
.
save
(
planDoc
);
...
...
@@ -89,7 +95,7 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
}
});
long
planId
=
planDetail
.
getId
();
PlanDetail
oldPlan
=
planDetailDao
.
getOne
(
planId
);
PlanDetail
oldPlan
=
planDetailDao
.
findById
(
planId
).
orElse
(
null
);
if
(
null
==
oldPlan
)
{
throw
new
YeeException
(
"数据不存在"
);
}
...
...
@@ -100,12 +106,18 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
}
else
{
throw
new
YeeException
(
"不可编辑的状态"
);
}
PlanDetail
planEntity
=
new
PlanDetail
();
BeanUtils
.
copyProperties
(
planDetail
,
planEntity
);
planDetailDao
.
saveAndFlush
(
planEntity
);
planDoc
.
setPlanId
(
planId
);
planDocDao
.
deleteByPlanId
(
planId
);
planDocDao
.
save
(
planDoc
);
planRule
.
setPlanId
(
planId
);
planRuleDao
.
deleteByPlanId
(
planId
);
planRuleDao
.
save
(
planRule
);
planEquipment
.
forEach
(
equipment
->
equipment
.
setPlanId
(
planId
));
planEquipmentDao
.
deleteByPlanId
(
planId
);
planEquipmentDao
.
saveAll
(
planEquipment
);
...
...
@@ -114,11 +126,12 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
@Override
public
PlanDetailVo
detail
(
Long
id
)
{
PlanDetail
detail
=
planDetailDao
.
getOne
(
id
);
PlanDetail
detail
=
planDetailDao
.
findById
(
id
).
orElse
(
null
);
if
(
null
==
detail
)
{
throw
new
YeeException
(
"数据不存在"
);
}
PlanDetailVo
detailVo
=
(
PlanDetailVo
)
detail
;
PlanDetailVo
detailVo
=
new
PlanDetailVo
();
BeanUtils
.
copyProperties
(
detail
,
detailVo
);
List
<
PlanDoc
>
docs
=
planDocDao
.
getPlanDocsByPlanId
(
id
);
if
(!
docs
.
isEmpty
())
{
detailVo
.
setPlanDoc
(
docs
.
get
(
0
));
...
...
@@ -131,7 +144,7 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
detailVo
.
setPlanEquipment
(
equipments
);
//TODO-设置执行次数
detailVo
.
setExecutionTimes
(
0
);
PlanClassifyTree
classifyTree
=
classifyTreeDao
.
getOne
(
detailVo
.
getClassifyId
()
);
PlanClassifyTree
classifyTree
=
classifyTreeDao
.
findById
(
detailVo
.
getClassifyId
()).
orElse
(
null
);
if
(
null
!=
classifyTree
)
{
detailVo
.
setClassifyName
(
classifyTree
.
getClassifyName
());
}
...
...
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