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
80c254e6
Commit
80c254e6
authored
Jan 20, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数字预案分页查询接口参数修改
parent
e914a731
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
118 additions
and
33 deletions
+118
-33
PlanRule.java
...c/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
+13
-0
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+2
-2
PlanClassifyTreeController.java
...s/fas/business/controller/PlanClassifyTreeController.java
+2
-2
PlanDetailMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
+2
-2
IPlanClassifyTreeDao.java
...mos/fas/business/dao/repository/IPlanClassifyTreeDao.java
+3
-0
IPlanOperationRecordDao.java
.../fas/business/dao/repository/IPlanOperationRecordDao.java
+2
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+27
-13
PlanClassifyTreeServiceImpl.java
...as/business/service/impl/PlanClassifyTreeServiceImpl.java
+26
-11
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+1
-1
IPlanClassifyTreeService.java
.../fas/business/service/intfc/IPlanClassifyTreeService.java
+9
-1
TreeUtil.java
...ain/java/com/yeejoin/amos/fas/business/util/TreeUtil.java
+30
-0
PlanClassifyTreeVo.java
.../com/yeejoin/amos/fas/business/vo/PlanClassifyTreeVo.java
+1
-1
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
View file @
80c254e6
...
@@ -36,5 +36,17 @@ public class PlanRule extends BasicEntity {
...
@@ -36,5 +36,17 @@ public class PlanRule extends BasicEntity {
@Column
(
name
=
"is_delete"
)
@Column
(
name
=
"is_delete"
)
private
Boolean
isDelete
;
private
Boolean
isDelete
;
/**
* 是否删除
*/
@Column
(
name
=
"rule_name"
)
private
String
ruleName
;
/**
* 是否删除
*/
@Column
(
name
=
"pic_url"
)
private
String
picUrl
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
80c254e6
...
@@ -81,8 +81,8 @@ public class ContingencyPlanController extends BaseController {
...
@@ -81,8 +81,8 @@ public class ContingencyPlanController extends BaseController {
@GetMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
)
@GetMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
pageFilter
(
@RequestParam
(
value
=
"current"
)
int
current
,
public
ResponseModel
pageFilter
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"planName"
,
required
=
false
)
String
planName
,
@RequestParam
(
value
=
"planName"
,
required
=
false
)
String
planName
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
Long
[]
classifyId
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
Long
classifyId
,
@RequestParam
(
value
=
"planRange"
,
required
=
false
)
String
[]
planRange
,
@RequestParam
(
value
=
"planRange"
,
required
=
false
)
List
<
String
>
planRange
,
@RequestParam
(
value
=
"editOrgName"
,
required
=
false
)
String
editOrgName
,
@RequestParam
(
value
=
"editOrgName"
,
required
=
false
)
String
editOrgName
,
@RequestParam
(
value
=
"implementationTimeLeft"
,
required
=
false
)
Date
implementationTimeLeft
,
@RequestParam
(
value
=
"implementationTimeLeft"
,
required
=
false
)
Date
implementationTimeLeft
,
@RequestParam
(
value
=
"implementationTimeRight"
,
required
=
false
)
Date
implementationTimeRight
,
@RequestParam
(
value
=
"implementationTimeRight"
,
required
=
false
)
Date
implementationTimeRight
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanClassifyTreeController.java
View file @
80c254e6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.PlanClassifyTreeService
;
import
com.yeejoin.amos.fas.business.service.intfc.
I
PlanClassifyTreeService
;
import
com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo
;
import
com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
...
@@ -20,7 +20,7 @@ import java.util.Collection;
...
@@ -20,7 +20,7 @@ import java.util.Collection;
public
class
PlanClassifyTreeController
extends
BaseController
{
public
class
PlanClassifyTreeController
extends
BaseController
{
@Autowired
@Autowired
private
PlanClassifyTreeService
planClassifyTreeService
;
private
I
PlanClassifyTreeService
planClassifyTreeService
;
@ApiOperation
(
value
=
"创建分类"
)
@ApiOperation
(
value
=
"创建分类"
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
View file @
80c254e6
...
@@ -36,12 +36,12 @@ public interface PlanDetailMapper {
...
@@ -36,12 +36,12 @@ public interface PlanDetailMapper {
* 筛选预案获得总数
* 筛选预案获得总数
* @return
* @return
*/
*/
Integer
filterCount
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
L
ong
[]
classifyId
,
@Param
(
"planRange"
)
String
[]
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
);
Integer
filterCount
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
L
ist
<
Long
>
classifyId
,
@Param
(
"planRange"
)
List
<
String
>
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
);
/**
/**
* 筛选预案获得分页记录
* 筛选预案获得分页记录
* @return
* @return
*/
*/
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
L
ong
[]
classifyId
,
@Param
(
"planRange"
)
String
[]
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
L
ist
<
Long
>
classifyId
,
@Param
(
"planRange"
)
List
<
String
>
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanClassifyTreeDao.java
View file @
80c254e6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo
;
import
com.yeejoin.amos.fas.dao.entity.PlanClassifyTree
;
import
com.yeejoin.amos.fas.dao.entity.PlanClassifyTree
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -13,4 +14,6 @@ public interface IPlanClassifyTreeDao extends BaseDao<PlanClassifyTree, Long> {
...
@@ -13,4 +14,6 @@ public interface IPlanClassifyTreeDao extends BaseDao<PlanClassifyTree, Long> {
@Query
(
value
=
"select * from c_plan_classify_tree where parent_id = ?1"
,
nativeQuery
=
true
)
@Query
(
value
=
"select * from c_plan_classify_tree where parent_id = ?1"
,
nativeQuery
=
true
)
List
<
PlanClassifyTree
>
findByParentId
(
Long
parentId
);
List
<
PlanClassifyTree
>
findByParentId
(
Long
parentId
);
@Query
(
value
=
"select * from c_plan_classify_tree"
,
nativeQuery
=
true
)
List
<
PlanClassifyTree
>
getAll
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanOperationRecordDao.java
View file @
80c254e6
...
@@ -14,4 +14,6 @@ import org.springframework.stereotype.Repository;
...
@@ -14,4 +14,6 @@ import org.springframework.stereotype.Repository;
public
interface
IPlanOperationRecordDao
extends
BaseDao
<
PlanOperationRecord
,
Long
>
{
public
interface
IPlanOperationRecordDao
extends
BaseDao
<
PlanOperationRecord
,
Long
>
{
@Query
(
value
=
"SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
@Query
(
value
=
"SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
PlanOperationRecord
findByBatchNo
(
String
batchNo
);
PlanOperationRecord
findByBatchNo
(
String
batchNo
);
int
countByPlanId
(
Long
planId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
80c254e6
...
@@ -6,8 +6,11 @@ import com.yeejoin.amos.fas.business.dao.mapper.*;
...
@@ -6,8 +6,11 @@ import com.yeejoin.amos.fas.business.dao.mapper.*;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyPlanService
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyPlanService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanClassifyTreeService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.util.TreeUtil
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo
;
import
com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum
;
...
@@ -62,12 +65,14 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -62,12 +65,14 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
private
final
PlanRuleMapper
planRuleMapper
;
private
final
PlanRuleMapper
planRuleMapper
;
private
final
PlanDocMapper
planDocMapper
;
private
final
PlanDocMapper
planDocMapper
;
private
final
EmqKeeper
emqKeeper
;
private
final
EmqKeeper
emqKeeper
;
private
final
IPlanClassifyTreeService
planClassifyTreeService
;
@Autowired
@Autowired
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
IPlanRuleDao
planRuleDao
,
IPlanClassifyTreeDao
classifyTreeDao
,
PlanDetailMapper
planDetailMapper
,
IPlanRuleDao
planRuleDao
,
IPlanClassifyTreeDao
classifyTreeDao
,
PlanDetailMapper
planDetailMapper
,
PlanEquipmentMapper
planEquipmentMapper
,
PlanRuleMapper
planRuleMapper
,
PlanDocMapper
planDocMapper
,
PlanEquipmentMapper
planEquipmentMapper
,
PlanRuleMapper
planRuleMapper
,
PlanDocMapper
planDocMapper
,
PlanOperationRecordMapper
planOperationRecordMapper
,
EmqKeeper
emqKeeper
)
{
PlanOperationRecordMapper
planOperationRecordMapper
,
IPlanClassifyTreeService
planClassifyTreeService
,
EmqKeeper
emqKeeper
)
{
this
.
planDetailDao
=
planDetailDao
;
this
.
planDetailDao
=
planDetailDao
;
this
.
planDocDao
=
planDocDao
;
this
.
planDocDao
=
planDocDao
;
this
.
planEquipmentDao
=
planEquipmentDao
;
this
.
planEquipmentDao
=
planEquipmentDao
;
...
@@ -78,6 +83,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -78,6 +83,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
this
.
planRuleMapper
=
planRuleMapper
;
this
.
planRuleMapper
=
planRuleMapper
;
this
.
planDocMapper
=
planDocMapper
;
this
.
planDocMapper
=
planDocMapper
;
this
.
planOperationRecordMapper
=
planOperationRecordMapper
;
this
.
planOperationRecordMapper
=
planOperationRecordMapper
;
this
.
planClassifyTreeService
=
planClassifyTreeService
;
this
.
emqKeeper
=
emqKeeper
;
this
.
emqKeeper
=
emqKeeper
;
}
}
...
@@ -145,13 +151,13 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -145,13 +151,13 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
@Override
@Override
public
Page
recordListByPage
(
int
current
,
int
pageSize
,
String
planName
)
{
public
Page
recordListByPage
(
int
current
,
int
pageSize
,
String
planName
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"planName"
,
planName
);
params
.
put
(
"planName"
,
planName
);
params
.
put
(
"offset"
,
(
current
-
1
)*
pageSize
);
params
.
put
(
"offset"
,
(
current
-
1
)
*
pageSize
);
params
.
put
(
"pageSize"
,
pageSize
);
params
.
put
(
"pageSize"
,
pageSize
);
List
<
HashMap
<
String
,
Object
>>
result
=
planOperationRecordMapper
.
PlanOperationRecordListByPage
(
params
);
List
<
HashMap
<
String
,
Object
>>
result
=
planOperationRecordMapper
.
PlanOperationRecordListByPage
(
params
);
Integer
count
=
planOperationRecordMapper
.
PlanOperationRecordListByCount
(
params
);
Integer
count
=
planOperationRecordMapper
.
PlanOperationRecordListByCount
(
params
);
Page
page
=
new
Page
();
Page
page
=
new
Page
();
page
.
setRecords
(
result
);
page
.
setRecords
(
result
);
page
.
setTotal
(
count
);
page
.
setTotal
(
count
);
...
@@ -266,8 +272,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -266,8 +272,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
List
<
PlanEquipment
>
equipments
=
planEquipmentDao
.
getPlanDocsByPlanId
(
id
);
List
<
PlanEquipment
>
equipments
=
planEquipmentDao
.
getPlanDocsByPlanId
(
id
);
detailVo
.
setPlanEquipment
(
equipments
);
detailVo
.
setPlanEquipment
(
equipments
);
//
TODO-
设置执行次数
//
设置执行次数
detailVo
.
setExecutionTimes
(
0
);
detailVo
.
setExecutionTimes
(
planOperationRecordDao
.
countByPlanId
(
id
)
);
PlanClassifyTree
classifyTree
=
classifyTreeDao
.
findById
(
detailVo
.
getClassifyId
()).
orElse
(
null
);
PlanClassifyTree
classifyTree
=
classifyTreeDao
.
findById
(
detailVo
.
getClassifyId
()).
orElse
(
null
);
if
(
null
!=
classifyTree
)
{
if
(
null
!=
classifyTree
)
{
detailVo
.
setClassifyName
(
classifyTree
.
getClassifyName
());
detailVo
.
setClassifyName
(
classifyTree
.
getClassifyName
());
...
@@ -318,8 +324,16 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -318,8 +324,16 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
@Override
@Override
public
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
[]
classifyId
,
String
[]
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
)
{
public
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
classifyId
,
List
<
String
>
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
)
{
int
total
=
planDetailMapper
.
filterCount
(
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
);
List
<
Long
>
classifyIdList
=
new
ArrayList
<>();
if
(
classifyId
!=
null
)
{
Collection
<
PlanClassifyTreeVo
>
classifyTreeList
=
planClassifyTreeService
.
getAllChildIncludeMe
(
classifyId
);
if
(!
classifyTreeList
.
isEmpty
())
{
List
<
PlanClassifyTreeVo
>
allChildren
=
TreeUtil
.
getAllChildren
(
classifyTreeList
);
allChildren
.
forEach
(
e
->
classifyIdList
.
add
(
e
.
getId
()));
}
}
int
total
=
planDetailMapper
.
filterCount
(
planName
,
classifyIdList
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
);
page
.
setTotal
(
total
);
page
.
setTotal
(
total
);
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
if
(
total
==
0
)
{
if
(
total
==
0
)
{
...
@@ -329,7 +343,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -329,7 +343,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
page
.
setCurrent
(
1
);
page
.
setCurrent
(
1
);
start
=
0
;
start
=
0
;
}
}
List
<
PlanDetailVo
>
planList
=
planDetailMapper
.
filterList
(
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
,
(
int
)
start
,
(
int
)
page
.
getSize
());
List
<
PlanDetailVo
>
planList
=
planDetailMapper
.
filterList
(
planName
,
classifyId
List
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
,
(
int
)
start
,
(
int
)
page
.
getSize
());
page
.
setRecords
(
planList
);
page
.
setRecords
(
planList
);
}
}
return
page
;
return
page
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanClassifyTreeServiceImpl.java
View file @
80c254e6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.dao.repository.IPlanClassifyTreeDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPlanClassifyTreeDao
;
import
com.yeejoin.amos.fas.business.service.intfc.PlanClassifyTreeService
;
import
com.yeejoin.amos.fas.business.service.intfc.
I
PlanClassifyTreeService
;
import
com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo
;
import
com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo
;
import
com.yeejoin.amos.fas.dao.entity.PlanClassifyTree
;
import
com.yeejoin.amos.fas.dao.entity.PlanClassifyTree
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -15,13 +15,13 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...
@@ -15,13 +15,13 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
java.util.*
;
import
java.util.*
;
/**
/**
*@program: YeeAmosFireAutoSysRoot
*
@program: YeeAmosFireAutoSysRoot
*@description: 预案分类树实现类
*
@description: 预案分类树实现类
*@author: wujunkai
*
@author: wujunkai
*@create: 2021-01-14 14:59
*
@create: 2021-01-14 14:59
*/
*/
@Service
(
"PlanClassifyTreeService"
)
@Service
(
"PlanClassifyTreeService"
)
public
class
PlanClassifyTreeServiceImpl
implements
PlanClassifyTreeService
{
public
class
PlanClassifyTreeServiceImpl
implements
I
PlanClassifyTreeService
{
public
static
final
Long
ROOT
=
0L
;
public
static
final
Long
ROOT
=
0L
;
@Autowired
@Autowired
...
@@ -36,7 +36,7 @@ public class PlanClassifyTreeServiceImpl implements PlanClassifyTreeService {
...
@@ -36,7 +36,7 @@ public class PlanClassifyTreeServiceImpl implements PlanClassifyTreeService {
public
void
delete
(
String
ids
)
{
public
void
delete
(
String
ids
)
{
List
<
Long
>
seqs
=
StringUtil
.
String2LongList
(
ids
);
List
<
Long
>
seqs
=
StringUtil
.
String2LongList
(
ids
);
for
(
Long
seq
:
seqs
)
{
for
(
Long
seq
:
seqs
)
{
Optional
<
PlanClassifyTree
>
PlanClassifyTreeOpt
=
planClassifyTreeDao
.
findById
(
seq
);
Optional
<
PlanClassifyTree
>
PlanClassifyTreeOpt
=
planClassifyTreeDao
.
findById
(
seq
);
//所有子分类
//所有子分类
List
<
PlanClassifyTree
>
childGroupSequenceList
=
getChildSequenceList
(
PlanClassifyTreeOpt
.
get
());
List
<
PlanClassifyTree
>
childGroupSequenceList
=
getChildSequenceList
(
PlanClassifyTreeOpt
.
get
());
planClassifyTreeDao
.
deleteAll
(
childGroupSequenceList
);
planClassifyTreeDao
.
deleteAll
(
childGroupSequenceList
);
...
@@ -45,11 +45,11 @@ public class PlanClassifyTreeServiceImpl implements PlanClassifyTreeService {
...
@@ -45,11 +45,11 @@ public class PlanClassifyTreeServiceImpl implements PlanClassifyTreeService {
@Override
@Override
public
Collection
<
PlanClassifyTreeVo
>
getTree
()
{
public
Collection
<
PlanClassifyTreeVo
>
getTree
()
{
List
<
PlanClassifyTree
>
list
=
planClassifyTreeDao
.
findAll
();
List
<
PlanClassifyTree
>
list
=
planClassifyTreeDao
.
findAll
();
List
<
PlanClassifyTreeVo
>
voList
=
new
ArrayList
<>();
List
<
PlanClassifyTreeVo
>
voList
=
new
ArrayList
<>();
for
(
PlanClassifyTree
planClassifyTree
:
list
)
{
for
(
PlanClassifyTree
planClassifyTree
:
list
)
{
PlanClassifyTreeVo
planClassifyTreeVo
=
new
PlanClassifyTreeVo
();
PlanClassifyTreeVo
planClassifyTreeVo
=
new
PlanClassifyTreeVo
();
BeanUtils
.
copyProperties
(
planClassifyTree
,
planClassifyTreeVo
);
BeanUtils
.
copyProperties
(
planClassifyTree
,
planClassifyTreeVo
);
voList
.
add
(
planClassifyTreeVo
);
voList
.
add
(
planClassifyTreeVo
);
}
}
Map
<
Object
,
PlanClassifyTreeVo
>
map
=
Bean
.
listToMap
(
voList
,
"id"
,
PlanClassifyTree
.
class
);
Map
<
Object
,
PlanClassifyTreeVo
>
map
=
Bean
.
listToMap
(
voList
,
"id"
,
PlanClassifyTree
.
class
);
...
@@ -117,4 +117,18 @@ public class PlanClassifyTreeServiceImpl implements PlanClassifyTreeService {
...
@@ -117,4 +117,18 @@ public class PlanClassifyTreeServiceImpl implements PlanClassifyTreeService {
resList
.
add
(
currentPlanClassifyTree
);
resList
.
add
(
currentPlanClassifyTree
);
}
}
@Override
public
Collection
<
PlanClassifyTreeVo
>
getAllChildIncludeMe
(
Long
root
)
{
List
<
PlanClassifyTreeVo
>
treeDaoAll
=
Bean
.
toModels
(
planClassifyTreeDao
.
getAll
(),
PlanClassifyTreeVo
.
class
);
Collection
<
PlanClassifyTreeVo
>
treeList
=
TreeBuilder
.
bulid
(
treeDaoAll
,
root
);
if
(!
ROOT
.
equals
(
root
))
{
PlanClassifyTree
classifyTree
=
planClassifyTreeDao
.
findById
(
root
).
orElse
(
null
);
if
(
null
!=
classifyTree
)
{
PlanClassifyTreeVo
classifyTreeVo
=
Bean
.
toModel
(
classifyTree
,
new
PlanClassifyTreeVo
());
classifyTreeVo
.
setChildren
(
treeList
);
return
Arrays
.
asList
(
classifyTreeVo
);
}
}
return
treeList
;
}
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
80c254e6
...
@@ -83,7 +83,7 @@ public interface IContingencyPlanService {
...
@@ -83,7 +83,7 @@ public interface IContingencyPlanService {
* @param implementationTimeRight 实施时间右界限
* @param implementationTimeRight 实施时间右界限
* @return Page
* @return Page
*/
*/
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
[]
classifyId
,
String
[]
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
);
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
classifyId
,
List
<
String
>
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
);
/**
/**
* 查询预案使用的文档ID
* 查询预案使用的文档ID
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/PlanClassifyTreeService.java
→
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/
I
PlanClassifyTreeService.java
View file @
80c254e6
...
@@ -4,17 +4,25 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo;
...
@@ -4,17 +4,25 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo;
import
com.yeejoin.amos.fas.dao.entity.PlanClassifyTree
;
import
com.yeejoin.amos.fas.dao.entity.PlanClassifyTree
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
/**
/**
* @author wjk
* @author wjk
* @date 2021-01-14
* @date 2021-01-14
* 预案分类树
* 预案分类树
*/
*/
public
interface
PlanClassifyTreeService
{
public
interface
IPlanClassifyTreeService
{
PlanClassifyTree
save
(
PlanClassifyTree
model
);
PlanClassifyTree
save
(
PlanClassifyTree
model
);
void
delete
(
String
ids
);
void
delete
(
String
ids
);
Collection
<
PlanClassifyTreeVo
>
getTree
();
Collection
<
PlanClassifyTreeVo
>
getTree
();
/**
* 获取所有子项(包含自身)
* @param root 根节点ID
* @return
*/
Collection
<
PlanClassifyTreeVo
>
getAllChildIncludeMe
(
Long
root
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/TreeUtil.java
0 → 100644
View file @
80c254e6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
org.typroject.tyboot.core.foundation.utils.TreeNode
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
/**
* <h1><h1>
*
* @author tiantao
* @date 2020/12/7 14:23
*/
public
class
TreeUtil
{
public
static
<
T
extends
TreeNode
>
List
<
T
>
getAllChildren
(
Collection
<
T
>
trees
)
{
List
<
T
>
childrenNodes
=
new
ArrayList
<>();
if
(!
ValidationUtil
.
isEmpty
(
trees
))
{
trees
.
forEach
(
node
->{
childrenNodes
.
add
(
node
);
if
(!
ValidationUtil
.
isEmpty
(
node
.
getChildren
()))
{
childrenNodes
.
addAll
(
getAllChildren
(
node
.
getChildren
()));
}
});
}
return
childrenNodes
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/PlanClassifyTreeVo.java
View file @
80c254e6
...
@@ -33,7 +33,7 @@ public class PlanClassifyTreeVo extends PlanClassifyTree implements TreeNode<Pla
...
@@ -33,7 +33,7 @@ public class PlanClassifyTreeVo extends PlanClassifyTree implements TreeNode<Pla
@Override
@Override
public
void
setChildren
(
Collection
<
PlanClassifyTreeVo
>
collection
)
{
public
void
setChildren
(
Collection
<
PlanClassifyTreeVo
>
collection
)
{
this
.
children
=
c
hildre
n
;
this
.
children
=
c
ollectio
n
;
}
}
@Override
@Override
...
...
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