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
d3043d3b
Commit
d3043d3b
authored
Jan 19, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预案接口优化
parent
812509cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
33 deletions
+33
-33
PlanRule.java
...c/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
+1
-1
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+26
-26
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+5
-5
ContingencyPlanService.java
...os/fas/business/service/intfc/ContingencyPlanService.java
+1
-1
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
View file @
d3043d3b
...
...
@@ -22,7 +22,7 @@ public class PlanRule extends BasicEntity {
* 规则ID
*/
@Column
(
name
=
"rule_id"
)
private
Lo
ng
ruleId
;
private
Stri
ng
ruleId
;
/**
* 预案ID
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
d3043d3b
...
...
@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.fas.business.service.intfc.ContingencyPlanService
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.
CommonResponseUti
l
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
Util2
;
import
com.yeejoin.amos.fas.core.util.
ResponseMode
l
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
...
...
@@ -32,14 +32,14 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"创建数字预案"
,
notes
=
"创建数字预案"
)
@PostMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
createPlan
(
@RequestBody
PlanDetailVo
planDetail
)
{
public
ResponseModel
createPlan
(
@RequestBody
PlanDetailVo
planDetail
)
{
if
(
null
==
planDetail
)
{
return
CommonResponseUtil
.
failure
(
"参数有误"
);
return
CommonResponseUtil
2
.
failure
(
"参数有误"
);
}
AgencyUserModel
curUser
=
getUserInfo
();
planDetail
.
setCreator
(
curUser
.
getUserId
());
planDetail
.
setOrgCode
(
getOrgCode
(
getSelectedOrgInfo
()));
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
createPlan
(
planDetail
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
createPlan
(
planDetail
));
}
/**
...
...
@@ -48,14 +48,14 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"修改数字预案"
,
notes
=
"修改数字预案"
)
@PutMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
editPlan
(
@RequestBody
PlanDetailVo
planDetail
)
{
public
ResponseModel
editPlan
(
@RequestBody
PlanDetailVo
planDetail
)
{
if
(
null
==
planDetail
)
{
return
CommonResponseUtil
.
failure
(
"参数有误"
);
return
CommonResponseUtil
2
.
failure
(
"参数有误"
);
}
AgencyUserModel
curUser
=
getUserInfo
();
planDetail
.
setReviser
(
curUser
.
getUserId
());
planDetail
.
setUpdateTime
(
new
Date
());
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
editPlan
(
planDetail
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
editPlan
(
planDetail
));
}
/**
...
...
@@ -64,11 +64,11 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"查看数字预案详情"
,
notes
=
"查看数字预案详情"
)
@GetMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
createPlan
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
public
ResponseModel
createPlan
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
if
(
null
==
id
)
{
return
CommonResponseUtil
.
failure
(
"参数有误"
);
return
CommonResponseUtil
2
.
failure
(
"参数有误"
);
}
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
detail
(
id
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
detail
(
id
));
}
/**
...
...
@@ -77,7 +77,7 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"数字预案分页查询"
,
notes
=
"数字预案分页查询"
)
@GetMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
pageFilter
(
@RequestParam
(
value
=
"current"
)
int
current
,
public
ResponseModel
pageFilter
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"planName"
,
required
=
false
)
String
planName
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
Long
[]
classifyId
,
@RequestParam
(
value
=
"planRange"
,
required
=
false
)
String
[]
planRange
,
...
...
@@ -89,7 +89,7 @@ public class ContingencyPlanController extends BaseController {
throw
new
YeeException
(
"分页参数有误"
);
}
Page
page
=
new
Page
(
current
,
size
);
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
pageFilter
(
page
,
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
pageFilter
(
page
,
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
));
}
/**
...
...
@@ -98,11 +98,11 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"启用预案"
,
notes
=
"启用预案"
)
@PutMapping
(
value
=
"/activate"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
activatePlan
(
@RequestBody
List
<
Long
>
idList
)
{
public
ResponseModel
activatePlan
(
@RequestBody
List
<
Long
>
idList
)
{
if
(
null
==
idList
||
idList
.
isEmpty
())
{
return
CommonResponseUtil
.
failure
(
"参数有误"
);
return
CommonResponseUtil
2
.
failure
(
"参数有误"
);
}
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
activatePlan
(
idList
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
activatePlan
(
idList
));
}
/**
...
...
@@ -111,11 +111,11 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"停用预案"
,
notes
=
"停用预案"
)
@PutMapping
(
value
=
"/deactivate"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
deactivatePlan
(
@RequestBody
List
<
Long
>
idList
)
{
public
ResponseModel
deactivatePlan
(
@RequestBody
List
<
Long
>
idList
)
{
if
(
null
==
idList
||
idList
.
isEmpty
())
{
return
CommonResponseUtil
.
failure
(
"参数有误"
);
return
CommonResponseUtil
2
.
failure
(
"参数有误"
);
}
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
deactivatePlan
(
idList
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
deactivatePlan
(
idList
));
}
...
...
@@ -125,9 +125,9 @@ public class ContingencyPlanController extends BaseController {
@Permission
@ApiOperation
(
value
=
"删除预案"
,
notes
=
"删除预案"
)
@DeleteMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
deletePlan
(
@PathVariable
(
value
=
"ids"
)
String
idStr
)
{
public
ResponseModel
deletePlan
(
@PathVariable
(
value
=
"ids"
)
String
idStr
)
{
if
(
StringUtils
.
isBlank
(
idStr
))
{
return
CommonResponseUtil
.
failure
(
"参数有误"
);
return
CommonResponseUtil
2
.
failure
(
"参数有误"
);
}
String
[]
idArr
=
idStr
.
split
(
","
);
List
<
Long
>
idList
=
new
ArrayList
();
...
...
@@ -136,20 +136,20 @@ public class ContingencyPlanController extends BaseController {
idList
.
add
(
Long
.
valueOf
(
id
.
trim
()));
}
}
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
delete
(
idList
));
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
delete
(
idList
));
}
@Permission
@ApiOperation
(
value
=
"获取数字预案绑定的资源Id"
,
notes
=
"查看数字预案详情"
)
@GetMapping
(
value
=
"/bind-source/{type}"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getPlanBindSource
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
public
ResponseModel
getPlanBindSource
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
switch
(
type
)
{
case
"doc"
:
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
getPlanUsedDocs
());
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
getPlanUsedDocs
());
case
"rule"
:
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
getPlanUsedRules
());
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
getPlanUsedRules
());
case
"equipment"
:
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
getPlanUsedEquipments
());
return
CommonResponseUtil
2
.
success
(
contingencyPlanService
.
getPlanUsedEquipments
());
default
:
throw
new
YeeException
(
"无效的类型参数"
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
d3043d3b
...
...
@@ -232,17 +232,17 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
Map
<
Long
,
Long
>
resMap
=
new
HashMap
<>(
64
);
List
<
PlanDoc
>
usedList
=
planDocDao
.
findAllByIsDelete
(
false
);
if
(!
usedList
.
isEmpty
())
{
usedList
.
forEach
(
planDoc
->
resMap
.
put
(
planDoc
.
getId
(),
planDoc
.
getPlanId
()));
usedList
.
forEach
(
planDoc
->
resMap
.
put
(
planDoc
.
get
Doc
Id
(),
planDoc
.
getPlanId
()));
}
return
resMap
;
}
@Override
public
Map
<
Lo
ng
,
Long
>
getPlanUsedRules
()
{
Map
<
Lo
ng
,
Long
>
resMap
=
new
HashMap
<>(
64
);
public
Map
<
Stri
ng
,
Long
>
getPlanUsedRules
()
{
Map
<
Stri
ng
,
Long
>
resMap
=
new
HashMap
<>(
64
);
List
<
PlanRule
>
usedList
=
planRuleDao
.
findAllByIsDelete
(
false
);
if
(!
usedList
.
isEmpty
())
{
usedList
.
forEach
(
planRule
->
resMap
.
put
(
planRule
.
getId
(),
planRule
.
getPlanId
()));
usedList
.
forEach
(
planRule
->
resMap
.
put
(
planRule
.
get
Rule
Id
(),
planRule
.
getPlanId
()));
}
return
resMap
;
}
...
...
@@ -252,7 +252,7 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
Map
<
Long
,
Long
>
resMap
=
new
HashMap
<>(
64
);
List
<
PlanEquipment
>
usedList
=
planEquipmentDao
.
findAllByIsDelete
(
false
);
if
(!
usedList
.
isEmpty
())
{
usedList
.
forEach
(
planEquipment
->
resMap
.
put
(
planEquipment
.
getId
(),
planEquipment
.
getPlanId
()));
usedList
.
forEach
(
planEquipment
->
resMap
.
put
(
planEquipment
.
get
FireEquipment
Id
(),
planEquipment
.
getPlanId
()));
}
return
resMap
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/ContingencyPlanService.java
View file @
d3043d3b
...
...
@@ -85,7 +85,7 @@ public interface ContingencyPlanService {
* 查询预案使用的规则ID
* @return
*/
Map
<
Lo
ng
,
Long
>
getPlanUsedRules
();
Map
<
Stri
ng
,
Long
>
getPlanUsedRules
();
/**
* 查询预案使用的装备ID
...
...
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