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
aeb84cb2
Commit
aeb84cb2
authored
Jun 21, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化任务功能
parent
e18f4f78
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
58 deletions
+16
-58
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+4
-52
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+1
-1
EmergencyTaskServiceImpl.java
...s/fas/business/service/impl/EmergencyTaskServiceImpl.java
+2
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+6
-2
ContingencyPlanInstanceMapper.xml
...ain/resources/db/mapper/ContingencyPlanInstanceMapper.xml
+1
-1
dbTemplate_emergency_task.xml
...rc/main/resources/db/mapper/dbTemplate_emergency_task.xml
+2
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
aeb84cb2
...
@@ -131,6 +131,9 @@ public class ContingencyAction implements CustomerAction {
...
@@ -131,6 +131,9 @@ public class ContingencyAction implements CustomerAction {
@Autowired
@Autowired
private
IPlanStepService
planStepService
;
private
IPlanStepService
planStepService
;
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Value
(
"${rocket-plan-topic}"
)
@Value
(
"${rocket-plan-topic}"
)
private
String
rocketTopic
;
private
String
rocketTopic
;
...
@@ -994,58 +997,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -994,58 +997,7 @@ public class ContingencyAction implements CustomerAction {
if
(!
StringUtils
.
isEmpty
(
instanceId
))
{
if
(!
StringUtils
.
isEmpty
(
instanceId
))
{
return
;
return
;
}
}
ContingencyPlanInstance
contingencyPlanInstance
=
new
ContingencyPlanInstance
();
emergencyTaskService
.
saveTask
(
"-2"
,
batchNo
);
contingencyPlanInstance
.
setBatchNo
(
batchNo
);
contingencyPlanInstance
.
setRecordType
(
"TASKOPERATE"
);
contingencyPlanInstance
.
setRoleCode
(
roleCode
);
contingencyPlanInstance
.
setCategory
(
taskName
);
contingencyPlanInstance
.
setCreateDate
(
new
Date
());
contingencyPlanInstance
.
setTaskSort
(
taskNum
);
contingencyPlanInstance
.
setStepCode
(
stepCode
);
contingencyPlanInstance
.
setContent
(
buttonJson
);
contingencyPlanInstanceRepository
.
save
(
contingencyPlanInstance
);
if
(
"0"
.
equals
(
stepCode
))
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
String
planStep
=
""
;
if
(
redisTemplate
.
hasKey
(
"planStep"
))
{
planStep
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planStep"
)).
toString
();
}
else
{
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"planStep"
,
objects
);
String
planTask
=
""
;
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
planTask
=
JSON
.
toJSONString
(
lists
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
result
.
put
(
"planTask"
,
taskObjects
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
result
));
}
});
}
MessageVO
messageVO
=
new
MessageVO
();
messageVO
.
setTitle
(
"应急处置事项提醒"
);
messageVO
.
setBody
(
"【"
+
taskName
+
"】"
+
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
messageVO
.
setMsgType
(
"emergencyPlan"
);
messageVO
.
setCategory
(
1
);
messageVO
.
setIsSendApp
(
true
);
messageVO
.
setIsSendWeb
(
true
);
messageVO
.
setRelationId
(
batchNo
);
planVisual3dService
.
sendMessage
(
roleCode
,
messageVO
);
}
}
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
aeb84cb2
...
@@ -259,7 +259,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -259,7 +259,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Override
@Override
public
void
afterCommit
()
{
public
void
afterCommit
()
{
equipmentHandlerService
.
executeDynamicPlan
(
batchNo
,
deviceData
,
equipment
,
equipmentSpecific
,
toke
,
operationRecord
.
getId
());
equipmentHandlerService
.
executeDynamicPlan
(
batchNo
,
deviceData
,
equipment
,
equipmentSpecific
,
toke
,
operationRecord
.
getId
());
emergencyTaskService
.
saveTask
(
"
-2
"
,
batchNo
);
emergencyTaskService
.
saveTask
(
"
0
"
,
batchNo
);
}
}
});
});
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EmergencyTaskServiceImpl.java
View file @
aeb84cb2
...
@@ -35,6 +35,7 @@ import org.springframework.data.redis.core.RedisTemplate;
...
@@ -35,6 +35,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -121,6 +122,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
...
@@ -121,6 +122,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
}
}
@Async
@Async
@Transactional
@Override
@Override
public
void
saveTask
(
String
stepCode
,
String
batchId
)
{
public
void
saveTask
(
String
stepCode
,
String
batchId
)
{
List
<
EmergencyTaskContentVo
>
list
=
emergencyTaskMapper
.
getContentList
(
stepCode
);
List
<
EmergencyTaskContentVo
>
list
=
emergencyTaskMapper
.
getContentList
(
stepCode
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
aeb84cb2
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.sun.media.jfxmedia.logging.Logger
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
...
@@ -19,6 +20,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService;
...
@@ -19,6 +20,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanStepService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanStepService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.util.DateUtils
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.*
;
...
@@ -43,6 +45,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -43,6 +45,7 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -702,6 +705,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -702,6 +705,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
@Override
public
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
,
String
userId
,
String
roleNames
)
{
public
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
,
String
userId
,
String
roleNames
)
{
long
start
=
System
.
currentTimeMillis
();
boolean
bool
=
false
;
boolean
bool
=
false
;
ResponseModel
responseModel
=
null
;
ResponseModel
responseModel
=
null
;
try
{
try
{
...
@@ -709,6 +713,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -709,6 +713,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
end
-
start
+
"......................."
);
String
img
=
""
;
String
img
=
""
;
if
(
responseModel
!=
null
&&
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
if
(
responseModel
!=
null
&&
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
String
resStr
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
String
resStr
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
...
@@ -723,8 +729,6 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -723,8 +729,6 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
,
userId
,
img
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
,
userId
,
img
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
}
if
(
bool
)
{
if
(
bool
)
{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
redisTemplate
.
delete
(
"planTask"
);
redisTemplate
.
delete
(
"planTask"
);
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyPlanInstanceMapper.xml
View file @
aeb84cb2
...
@@ -460,7 +460,7 @@
...
@@ -460,7 +460,7 @@
FROM
FROM
contingency_plan_instance
contingency_plan_instance
<where>
<where>
runstate
= false
AND record_type = 'TASKOPERATE'
runstate
IS NULL
AND record_type = 'TASKOPERATE'
<if
test=
"stepCode != null and stepCode != ''"
>
<if
test=
"stepCode != null and stepCode != ''"
>
AND step_code = #{stepCode}
AND step_code = #{stepCode}
</if>
</if>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_emergency_task.xml
View file @
aeb84cb2
...
@@ -109,11 +109,11 @@
...
@@ -109,11 +109,11 @@
FROM
FROM
c_emergency_task_content
c_emergency_task_content
<where>
<where>
<if
test=
"stepCode != null and stepCode != ''"
>
<if
test=
"stepCode != null and stepCode != ''
and stepCode != '-2'
"
>
step_code = #{stepCode}
step_code = #{stepCode}
</if>
</if>
<if
test=
"stepCode != null and stepCode != '' and stepCode == '-2'"
>
<if
test=
"stepCode != null and stepCode != '' and stepCode == '-2'"
>
step_code = -1
OR step_code = 0
step_code = -1
</if>
</if>
</where>
</where>
</select>
</select>
...
...
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