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
b2908f6a
Commit
b2908f6a
authored
Jul 07, 2022
by
xixinzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增处置步骤,处置日志
parent
531c9d59
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
255 additions
and
2 deletions
+255
-2
PlanRule.java
...c/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
+10
-0
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+14
-1
PlanOperationRecordMapper.java
...os/fas/business/dao/mapper/PlanOperationRecordMapper.java
+8
-0
IContingencyPlanInstanceRepository.java
...ss/dao/repository/IContingencyPlanInstanceRepository.java
+12
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+54
-0
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+15
-0
CommonResponseUtil.java
...va/com/yeejoin/amos/fas/core/util/CommonResponseUtil.java
+10
-1
ResponseModel.java
...in/java/com/yeejoin/amos/fas/core/util/ResponseModel.java
+110
-0
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+12
-0
PlanOperationRecordMapper.xml
...rc/main/resources/db/mapper/PlanOperationRecordMapper.xml
+10
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
View file @
b2908f6a
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
lombok.Data
;
import
javax.persistence.Column
;
...
...
@@ -48,5 +51,11 @@ public class PlanRule extends BasicEntity {
@Column
(
name
=
"pic_url"
)
private
String
picUrl
;
/**
* 当前预案步骤
*/
@Column
(
name
=
"plan_step"
)
private
String
planStep
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
b2908f6a
...
...
@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -146,5 +147,17 @@ public class PlanVisual3dController extends BaseController {
}
}
@Permission
@ApiOperation
(
value
=
"根据批次号获取预案的步骤"
,
notes
=
"根据批次号获取预案的步骤"
)
@GetMapping
(
value
=
"/plan/getPlanStep/{batchNo}"
)
public
ResponseModel
getPlanStep
(
@PathVariable
(
"batchNo"
)
String
batchNo
)
{
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
getPlanStepByBatchNo
(
batchNo
));
}
@Permission
@ApiOperation
(
value
=
"根据批次号获取预案的记录"
,
notes
=
"根据R批次号获取预案的记录"
)
@GetMapping
(
value
=
"/plan/getPlaneRecord/{batchNo}"
)
public
ResponseModel
getPlaneRecord
(
@PathVariable
(
"batchNo"
)
String
batchNo
)
{
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
getPlaneRecordByBatchNo
(
batchNo
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanOperationRecordMapper.java
View file @
b2908f6a
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
com.google.gson.JsonObject
;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -20,4 +21,11 @@ public interface PlanOperationRecordMapper {
List
<
Map
<
String
,
Object
>>
filterList
(
Map
<
String
,
Object
>
params
);
List
<
PlanOperationRecordSyncBo
>
getPlanOperationRecordSyncBoList
(
Map
<
String
,
Object
>
map
);
/**
* 根据批次号查询预案步骤
* @param batchNo 批次号
* @return 步骤
*/
String
getPlanStepByBatchNo
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyPlanInstanceRepository.java
View file @
b2908f6a
...
...
@@ -5,6 +5,7 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
/**
...
...
@@ -58,4 +59,15 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
" ORDER BY"
+
" t.create_date DESC"
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
queryForCategoryOrderByCreateDate
(
String
batch_no
,
String
recordType
);
@Query
(
value
=
"SELECT "
+
" t.content stepName, t.create_date time"
+
" FROM "
+
" contingency_plan_instance t"
+
" WHERE"
+
" t.batch_no = ?"
+
" AND t.record_type = ?"
+
" ORDER BY"
+
" t.create_date ASC"
,
nativeQuery
=
true
)
List
<
Map
<
String
,
Object
>>
queryRecord
(
String
batchNo
,
String
recordType
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
b2908f6a
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.DictMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository
;
import
com.yeejoin.amos.fas.business.dao.repository.ITextPlanDao
;
import
com.yeejoin.amos.fas.business.feign.IMaasVisualServer
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -38,6 +49,15 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired
private
DictMapper
dictMapper
;
@Autowired
PlanOperationRecordMapper
planOperationRecordMapper
;
@Autowired
IContingencyOriginalDataDao
contingencyOriginalDataDao
;
@Autowired
private
IContingencyPlanInstanceRepository
contingencyPlanInstanceRepository
;
@Override
public
List
<
TreeSubjectVo
>
getPlanTree
()
{
...
...
@@ -227,5 +247,39 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
iTextPlanDao
.
deleteById
(
id
);
}
@Override
public
ToipResponse
getPlanStepByBatchNo
(
String
batchNo
)
{
ToipResponse
toipResponse
=
new
ToipResponse
();
// 根据批次号查询预案步骤
String
planStep
=
planOperationRecordMapper
.
getPlanStepByBatchNo
(
batchNo
);
if
(
StringUtil
.
isNotEmpty
(
planStep
))
{
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
// 查询当前步骤
ContingencyOriginalData
contingencyOriginalData
=
contingencyOriginalDataDao
.
findByBatchNo
(
batchNo
);
String
step
=
contingencyOriginalData
.
getStep
();
Map
<
String
,
Object
>
msgContext
=
new
HashMap
<>(
2
);
msgContext
.
put
(
"step"
,
objects
);
msgContext
.
put
(
"currentStep"
,
step
);
toipResponse
.
setMsgType
(
"steparea"
);
toipResponse
.
setMsgContext
(
msgContext
);
toipResponse
.
setContingency
(
contingencyOriginalData
);
}
return
toipResponse
;
}
@Override
public
ToipResponse
getPlaneRecordByBatchNo
(
String
batchNo
)
{
// 根据批次号获取预案记录
List
<
Map
<
String
,
Object
>>
instancesList
=
contingencyPlanInstanceRepository
.
queryRecord
(
batchNo
,
"MESSAGE"
);
ToipResponse
toipResponse
=
new
ToipResponse
();
if
(!
ObjectUtils
.
isEmpty
(
instancesList
))
{
Map
<
String
,
Object
>
msgContext
=
new
HashMap
<>(
1
);
msgContext
.
put
(
"content"
,
instancesList
);
ContingencyOriginalData
contingencyOriginalData
=
contingencyOriginalDataDao
.
findByBatchNo
(
batchNo
);
toipResponse
.
setMsgType
(
"recordarea"
);
toipResponse
.
setMsgContext
(
msgContext
);
toipResponse
.
setContingency
(
contingencyOriginalData
);
}
return
toipResponse
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
b2908f6a
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
...
...
@@ -40,4 +41,18 @@ public interface IPlanVisual3dService {
List
<
TreeSubjectVo
>
getTextPlanBySubjectId
(
String
appId
);
void
deleteTextPlanFile
(
Long
id
);
/**
* 根据批次号获取预案步骤
* @param batchNo 批次号
* @return 预案步骤
*/
ToipResponse
getPlanStepByBatchNo
(
String
batchNo
);
/**
* 根据批次号获取预案记录
* @param batchNo 批次号
* @return 预案记录
*/
ToipResponse
getPlaneRecordByBatchNo
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/CommonResponseUtil.java
View file @
b2908f6a
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
import
org.springframework.http.HttpStatus
;
public
class
CommonResponseUtil
{
...
...
@@ -52,4 +52,13 @@ public class CommonResponseUtil
response
.
setMessage
(
message
);
return
response
;
}
public
static
ResponseModel
successNew
(
Object
obj
)
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
Constants
.
RESULT_SUCCESS
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/ResponseModel.java
0 → 100644
View file @
b2908f6a
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
import
java.io.Serializable
;
/**
*
* <pre>
* Tyrest
* File: ResponseModel.java
*
* Tyrest, Inc.
* Copyright (C): 2016
*
* Description:
* TODO
*
* Notes:
* $Id: ResponseModel.java Tyrest\magintrursh $
*
* Revision History
* <Date>, <Who>, <What>
* 2016年11月1日 magintrursh Initial.
*
* </pre>
*/
public
class
ResponseModel
<
T
>
implements
Serializable
{
/**
* Comment for <code>serialVersionUID</code>
*/
private
static
final
long
serialVersionUID
=
-
1241360949457314497L
;
private
int
status
;
private
T
result
;
private
String
traceId
;
private
String
devMessage
=
""
;
private
String
message
=
""
;
private
String
path
;
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
public
String
getDevMessage
()
{
return
devMessage
;
}
public
void
setDevMessage
(
String
devMessage
)
{
this
.
devMessage
=
devMessage
;
}
public
String
getTraceId
()
{
return
traceId
;
}
public
void
setTraceId
(
String
traceId
)
{
this
.
traceId
=
traceId
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
T
getResult
()
{
return
result
;
}
public
void
setResult
(
T
result
)
{
this
.
result
=
result
;
}
@Override
public
String
toString
()
{
return
"ResponseModel [status="
+
status
+
", result="
+
result
+
", traceId="
+
traceId
+
", message="
+
devMessage
+
"]"
;
}
}
/*
*$Log: av-env.bat,v $
*/
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
b2908f6a
...
...
@@ -726,4 +726,15 @@
MODIFY COLUMN `equipment_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '装备code' ;
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"xxz-2022-07-07-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"c_plan_rule"
columnName=
"plan_step"
/>
</not>
</preConditions>
<comment>
c_plan_rule add column plan_step
</comment>
<sql>
alter table `c_plan_rule` add column `plan_step` json DEFAULT NULL COMMENT '预案步骤';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanOperationRecordMapper.xml
View file @
b2908f6a
...
...
@@ -106,4 +106,13 @@
</if>
</where>
</select>
<select
id=
"getPlanStepByBatchNo"
resultType=
"java.lang.String"
>
SELECT
cpr.plan_step
FROM
c_plan_rule cpr
LEFT JOIN c_plan_operation_record cpor ON cpor.plan_id = cpr.plan_id
WHERE
cpor.batch_no = #{batchNo}
</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