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
edd06982
Commit
edd06982
authored
Jun 25, 2022
by
wanghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指令流查询接口
parent
40d548b9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
0 deletions
+92
-0
InstructionsController.java
.../amos/fas/business/controller/InstructionsController.java
+40
-0
EquipmentSpecificMapper.java
...amos/fas/business/dao/mapper/EquipmentSpecificMapper.java
+6
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+24
-0
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+2
-0
dbTemplate_equipment_specific.xml
...ain/resources/db/mapper/dbTemplate_equipment_specific.xml
+20
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/InstructionsController.java
0 → 100644
View file @
edd06982
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyPlanService
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api/instructions"
)
@Api
(
tags
=
"指令流查询API"
)
public
class
InstructionsController
{
@Autowired
IContingencyPlanService
iContingencyPlanService
;
/**
* 指令流查询API
*/
@Permission
@ApiOperation
(
value
=
"指令流查询API"
,
notes
=
"指令流查询API"
)
@GetMapping
(
value
=
"/{code}"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
createPlan
(
@PathVariable
(
value
=
"code"
)
String
code
)
{
if
(
StringUtils
.
isEmpty
(
code
))
{
return
CommonResponseUtil2
.
failure
(
"参数有误"
);
}
return
CommonResponseUtil2
.
success
(
iContingencyPlanService
.
getBatchNoByCode
(
code
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/EquipmentSpecificMapper.java
View file @
edd06982
...
...
@@ -85,4 +85,10 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo>
EquipmentSpecific
getSpecificById
(
@Param
(
"id"
)
Long
id
);
Long
getIndexByIndexId
(
@Param
(
"indexId"
)
Long
indexId
);
String
getIdByCode
(
@Param
(
"code"
)
String
code
);
String
getEquipId
(
@Param
(
"id"
)
String
id
);
String
getBatchNoByEquipId
(
@Param
(
"equipId"
)
String
equipId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
edd06982
...
...
@@ -269,6 +269,30 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
return
list
;
}
@Override
public
List
<
HashMap
<
String
,
Object
>>
getBatchNoByCode
(
String
code
)
{
List
<
HashMap
<
String
,
Object
>>
list
=
new
ArrayList
<>();
String
idByCode
=
equipmentSpecificMapper
.
getIdByCode
(
code
);
if
(
StringUtils
.
isEmpty
(
idByCode
))
{
return
list
;
}
String
equipId
=
equipmentSpecificMapper
.
getEquipId
(
idByCode
);
if
(
StringUtils
.
isEmpty
(
equipId
))
{
return
list
;
}
String
batchNoByEquipId
=
equipmentSpecificMapper
.
getBatchNoByEquipId
(
equipId
);
if
(
StringUtils
.
isEmpty
(
batchNoByEquipId
))
{
return
list
;
}
List
<
ContingencyPlanInstance
>
instancesList
=
repository
.
queryForCategory
(
batchNoByEquipId
,
"MESSAGE"
);
instancesList
.
forEach
(
contingencyPlanInstance
->
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"crateDate"
,
contingencyPlanInstance
.
getCreateDate
());
map
.
put
(
"content"
,
contingencyPlanInstance
.
getContent
());
list
.
add
(
map
);
});
return
list
;
}
//启动状态校验
public
ReserveEnum
runCheck
(
ContingencyPlanParamVo
vo
)
throws
Exception
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
edd06982
...
...
@@ -129,6 +129,8 @@ public interface IContingencyPlanService {
List
<
HashMap
<
String
,
Object
>>
getRecordList
(
String
batchNo
);
List
<
HashMap
<
String
,
Object
>>
getBatchNoByCode
(
String
code
);
Page
recordListByPage
(
Page
page
,
Long
planId
,
String
planName
,
List
<
Long
>
classifyId
,
Date
startTimeLeft
,
Date
startTimeRight
,
Integer
executionType
,
Integer
planPattern
);
AtomicBoolean
planReset
();
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_equipment_specific.xml
View file @
edd06982
...
...
@@ -271,4 +271,23 @@
WHERE wesi.id=#{indexId}
limit 1
</select>
<select
id=
"getIdByCode"
resultType=
"java.lang.String"
>
select id from wl_equipment_specific where code = #{code,jdbcType=VARCHAR} limit 1
</select>
<select
id=
"getEquipId"
resultType=
"java.lang.String"
>
select equipment_id from f_equipment_fire_equipment where fire_equipment_id = #{id,jdbcType=VARCHAR} limit 1
</select>
<select
id=
"getBatchNoByEquipId"
resultType=
"java.lang.String"
>
SELECT
batch_no
FROM
c_plan_operation_record
WHERE
plan_id = ( SELECT plan_id FROM c_plan_equipment WHERE fire_equipment_id = #{equipId,jdbcType=VARCHAR} LIMIT 1 )
ORDER BY create_date DESC
LIMIT 1
</select>
</mapper>
\ No newline at end of file
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