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
91c06195
Commit
91c06195
authored
Oct 20, 2022
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
c12583ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
33 deletions
+82
-33
ContingencyInstanceInfo.java
.../yeejoin/amos/fas/dao/entity/ContingencyInstanceInfo.java
+3
-0
ContingencyPlanInstance.java
.../yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
+10
-0
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+2
-2
ContingencyInstanceInfoServiceImpl.java
...ness/service/impl/ContingencyInstanceInfoServiceImpl.java
+31
-1
ContingencyInstanceInfoMapper.xml
...ain/resources/db/mapper/ContingencyInstanceInfoMapper.xml
+36
-30
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyInstanceInfo.java
View file @
91c06195
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
...
...
@@ -42,6 +43,8 @@ public class ContingencyInstanceInfo extends Model<ContingencyInstanceInfo>{
private
String
orgCode
;
@TableField
private
String
duration
;
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
View file @
91c06195
...
...
@@ -78,6 +78,16 @@ public class ContingencyPlanInstance extends BusinessEntity{
@Column
(
name
=
"person_img"
)
private
String
personImg
;
private
String
name
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getPersonImg
()
{
return
personImg
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
91c06195
...
...
@@ -223,7 +223,7 @@ public class PlanVisual3dController extends BaseController {
}
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询
处置详情信息"
,
notes
=
"分页查询处置详情信息
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询
预案下处置动作列表"
,
notes
=
"分页查询预案下处置动作列表
"
)
@GetMapping
(
value
=
"/plan/selectDisposalActionPage"
)
public
ResponseModel
selectDisposalActionPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
...
...
@@ -243,7 +243,7 @@ public class PlanVisual3dController extends BaseController {
}
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
分页查询处置详情信息"
,
notes
=
"分页查询处置详情信息
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
查询预案下处置动作列表"
,
notes
=
"查询预案下处置动作列表
"
)
@GetMapping
(
value
=
"/plan/selectDisposalActionList"
)
public
ResponseModel
selectDisposalActionList
(
@RequestParam
(
value
=
"batchNo"
)
String
batchNo
,
@RequestParam
(
value
=
"dataType"
)
int
dataType
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceInfoServiceImpl.java
View file @
91c06195
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.core.util.DateUtil;
import
com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -21,7 +22,12 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn
@Override
public
ContingencyInstanceInfo
selectDisposalDetails
(
String
disposalId
)
{
return
contingencyInstanceInfoMapper
.
selectDisposalDetails
(
disposalId
);
ContingencyInstanceInfo
instanceInfo
=
contingencyInstanceInfoMapper
.
selectDisposalDetails
(
disposalId
);
if
(!
ObjectUtils
.
isEmpty
(
instanceInfo
.
getStartTime
())
&&
!
ObjectUtils
.
isEmpty
(
instanceInfo
.
getEndTime
())){
String
datePoorToMin
=
getDatePoorToMin
(
instanceInfo
.
getEndTime
(),
instanceInfo
.
getStartTime
());
instanceInfo
.
setDuration
(
datePoorToMin
);
}
return
instanceInfo
;
}
@Override
...
...
@@ -38,6 +44,12 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn
start
=
0
;
}
List
<
ContingencyInstanceInfo
>
infoList
=
contingencyInstanceInfoMapper
.
selectDisposalListPage
((
int
)
start
,
size
,
orgCode
);
for
(
ContingencyInstanceInfo
instanceInfo
:
infoList
)
{
if
(!
ObjectUtils
.
isEmpty
(
instanceInfo
.
getStartTime
())
&&
!
ObjectUtils
.
isEmpty
(
instanceInfo
.
getEndTime
())){
String
datePoorToMin
=
getDatePoorToMin
(
instanceInfo
.
getEndTime
(),
instanceInfo
.
getStartTime
());
instanceInfo
.
setDuration
(
datePoorToMin
);
}
}
page
.
setRecords
(
infoList
);
}
return
page
;
...
...
@@ -64,5 +76,23 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn
}
return
false
;
}
public
static
String
getDatePoorToMin
(
Date
endDate
,
Date
nowDate
)
{
long
nd
=
1000
*
24
*
60
*
60
;
long
nh
=
1000
*
60
*
60
;
long
nm
=
1000
*
60
;
long
ns
=
1000
;
// 获得两个时间的毫秒时间差异
long
diff
=
endDate
.
getTime
()
-
nowDate
.
getTime
();
// 计算差多少天
long
day
=
diff
/
nd
;
// 计算差多少小时
long
hour
=
diff
/
nh
;
// 计算差多少分钟
long
min
=
diff
%
nh
/
nm
;
// 计算差多少秒//输出结果
long
sec
=
diff
%
nd
%
nh
%
nm
/
ns
;
return
hour
+
"小时"
+
min
+
"分钟 "
+
sec
+
"秒"
;
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyInstanceInfoMapper.xml
View file @
91c06195
...
...
@@ -35,28 +35,33 @@
where is_delete = 0 and org_code = #{orgCode}
</select>
<select
id=
"selectDisposalActionPage"
resultType=
"com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance"
>
select
`id`, `record_type`, `category`, `content`, `icon`, `sort`,
`sequence_num`
,
`batch_no`, `create_date`, `create_user`,
`update_date`
,
`update_user`, `is_delete`, `tips`, IFNULL(`runstate`, 0) AS runstate,
`file_path`
select
cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.
`sequence_num`
,
cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.
`update_date`
,
cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.
`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, `start_user_id`, `person_img` from contingency_plan_instance
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<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"
>
<if
test=
"batchNo != null and batchNo != ''"
>
cpi.
batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.
record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and cpi.runstate is null
</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>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
order by cpi.`create_date`
LIMIT #{current}, #{size}
</select>
<select
id=
"selectCountDisposalActionPage"
resultType=
"java.lang.Integer"
>
...
...
@@ -69,7 +74,7 @@
and record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and runstate
= #{status}
and runstate
is null
</if>
<if
test=
"list != null and list.size() >0"
>
...
...
@@ -81,30 +86,31 @@
</select>
<select
id=
"selectDisposalActionList"
resultType=
"com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance"
>
select
`id`, `record_type`, `category`, `content`, `icon`, `sort`,
`sequence_num`
,
`batch_no`, `create_date`, `create_user`,
`update_date`
,
`update_user`, `is_delete`, `tips`, IFNULL(`runstate`, 0) AS runstate,
`file_path`
select
cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.
`sequence_num`
,
cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.
`update_date`
,
cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.
`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
,
`start_user_id`, `person_img`
from contingency_plan_instance
,
cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
<if
test=
"batchNo != null and batchNo != ''"
>
batch_no = #{batchNo}
cpi.
batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
and
cpi.
record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and
runstate = #{status}
and
cpi.runstate is null
</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},'%')
cpi.
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
order by cpi.`create_date`
</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