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
12a60975
Commit
12a60975
authored
Oct 18, 2022
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加预案信息相关接口
parent
dba347e7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
2 deletions
+137
-2
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+23
-0
ContingencyInstanceInfoMapper.java
...as/business/dao/mapper/ContingencyInstanceInfoMapper.java
+8
-1
IContingencyPlanInstanceRepository.java
...ss/dao/repository/IContingencyPlanInstanceRepository.java
+6
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+52
-1
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+4
-0
ContingencyInstanceInfoMapper.xml
...ain/resources/db/mapper/ContingencyInstanceInfoMapper.xml
+44
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
12a60975
...
...
@@ -14,6 +14,8 @@ import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -257,4 +260,24 @@ public class PlanVisual3dController extends BaseController {
planVisual3dService
.
replyMessage
(
user
,
dto
);
return
CommonResponseUtil
.
successNew
(
null
);
}
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询处置详情信息"
,
notes
=
"分页查询处置详情信息"
)
@GetMapping
(
value
=
"/plan/selectDisposalActionPage"
)
public
ResponseModel
selectDisposalActionPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"disposalId"
)
String
disposalId
,
@RequestParam
(
value
=
"dataType"
)
int
dataType
)
{
if
(
current
<
1
||
size
<
1
)
{
throw
new
YeeException
(
"分页参数有误"
);
}
AgencyUserModel
user
=
getUserInfo
();
List
<
RoleModel
>
roleModelList
=
new
ArrayList
<>();
for
(
Long
key
:
user
.
getOrgRoles
().
keySet
())
{
roleModelList
.
addAll
(
user
.
getOrgRoles
().
get
(
key
));
}
return
CommonResponseUtil2
.
success
(
planVisual3dService
.
selectDisposalActionPage
(
current
,
size
,
disposalId
,
roleModelList
,
dataType
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ContingencyInstanceInfoMapper.java
View file @
12a60975
...
...
@@ -2,11 +2,14 @@ package com.yeejoin.amos.fas.business.dao.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
ContingencyInstanceInfoMapper
extends
BaseMapper
<
ContingencyInstanceInfo
>
{
ContingencyInstanceInfo
selectDisposalDetails
(
@Param
(
"id"
)
String
id
);
...
...
@@ -18,4 +21,8 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
int
selectCount
(
@Param
(
"orgCode"
)
String
orgCode
);
List
<
ContingencyInstanceInfo
>
selectDisposalListPage
(
@Param
(
"current"
)
int
current
,
@Param
(
"size"
)
int
size
,
@Param
(
"orgCode"
)
String
orgCode
);
List
<
ContingencyPlanInstance
>
selectDisposalActionPage
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
int
selectCountDisposalActionPage
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyPlanInstanceRepository.java
View file @
12a60975
...
...
@@ -84,4 +84,10 @@ 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`"
+
" WHERE if(:?1 is not null or :?1 != '', record_type= ?1) "
+
" if(:?2 is not null or :?2 != '', and runstate = ?2) "
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
selectDisposalActionPage
(
String
type
,
int
status
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
12a60975
...
...
@@ -31,6 +31,7 @@ import com.yeejoin.amos.fas.dao.entity.*;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.io.IOUtils
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -81,6 +82,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired
private
ContingencyInstanceInfoMapper
contingencyInstanceInfoMapper
;
@Autowired
IContingencyPlanInstanceRepository
iContingencyPlanInstanceRepository
;
@Autowired
private
ContingencyPlanInstanceMapper
contingencyPlanInstanceMapper
;
...
...
@@ -370,7 +373,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
public
Page
<
ContingencyInstanceInfo
>
selectDisposalListPage
(
int
current
,
int
size
,
String
orgCode
)
{
Page
<
ContingencyInstanceInfo
>
page
=
new
Page
<>();
Page
<
ContingencyInstanceInfo
>
page
=
new
Page
<>(
current
,
size
);
int
total
=
contingencyInstanceInfoMapper
.
selectCount
(
orgCode
);
page
.
setTotal
(
total
);
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
...
...
@@ -464,4 +467,52 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
pushMsgParam
.
setType
(
JPushTypeEnum
.
REPLY_MESSAGE
.
getCode
());
pushFeign
.
sendMessageone
(
pushMsgParam
);
}
@Override
public
Page
<
ContingencyPlanInstance
>
selectDisposalActionPage
(
int
current
,
int
size
,
String
disposalId
,
List
<
RoleModel
>
roleModelList
,
int
dataType
)
{
List
<
String
>
roles
=
new
ArrayList
<>();
String
type
=
"OPERATE"
;
String
status
=
""
;
Page
<
ContingencyPlanInstance
>
page
=
new
Page
<>(
current
,
size
);
if
(
"1"
.
equals
(
String
.
valueOf
(
dataType
)))
{
for
(
RoleModel
roleModel
:
roleModelList
)
{
roles
.
add
(
roleModel
.
getRoleName
());
}
// 根据当前用户预案角色、未执行动作
status
=
"1"
;
}
else
if
(
"2"
.
equals
(
String
.
valueOf
(
dataType
)))
{
// 当前用户预案角色、全部动作数据
for
(
RoleModel
roleModel
:
roleModelList
)
{
roles
.
add
(
roleModel
.
getRoleName
());
}
}
// else {
// // 当前预案全部动作
//
// }
int
total
=
0
;
if
(
ObjectUtils
.
isEmpty
(
status
)){
total
=
contingencyInstanceInfoMapper
.
selectCountDisposalActionPage
(
type
,
null
,
roles
,
disposalId
);
}
else
{
total
=
contingencyInstanceInfoMapper
.
selectCountDisposalActionPage
(
type
,
status
,
roles
,
disposalId
);
}
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
if
(
total
==
0
)
{
page
.
setCurrent
(
1
);
}
else
{
if
(
total
<
start
)
{
page
.
setCurrent
(
1
);
start
=
0
;
}
List
<
ContingencyPlanInstance
>
list
=
contingencyInstanceInfoMapper
.
selectDisposalActionPage
(
type
,
status
,
roles
,
disposalId
);
page
.
setRecords
(
list
);
page
.
setTotal
(
total
);
}
return
page
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
12a60975
...
...
@@ -10,10 +10,12 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -89,6 +91,8 @@ public interface IPlanVisual3dService {
Boolean
updateDisposalDetails
(
ContingencyInstanceInfo
contingencyInstanceInfo
);
Page
<
ContingencyPlanInstance
>
selectDisposalActionPage
(
int
current
,
int
size
,
String
disposalId
,
List
<
RoleModel
>
roleModelList
,
int
dataType
);
/**
* 根据批次号获取预案的消息等记录
* @param batchNo
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyInstanceInfoMapper.xml
View file @
12a60975
...
...
@@ -34,5 +34,49 @@
select count(1) from contingency_instance_info
where is_delete = 0 and org_code = #{orgCode}
</select>
<select
id=
"selectDisposalActionPage"
resultType=
"com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance"
>
select * from contingency_plan_instance
<where>
<if
test=
"batchNo != null and batchNo != ''"
>
batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and runstate = #{status}
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
</select>
<select
id=
"selectCountDisposalActionPage"
resultType=
"java.lang.Integer"
>
select count(1) from contingency_plan_instance
<where>
<if
test=
"batchNo != null and batchNo != ''"
>
batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and runstate = #{status}
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
</select>
</mapper>
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