Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
16a1888e
Commit
16a1888e
authored
Nov 25, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务规则调用由消息调用改为直接调用
parent
dc9da1c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
ScheduleService.java
...boot/module/tzs/flc/biz/service/impl/ScheduleService.java
+21
-3
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/ScheduleService.java
View file @
16a1888e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -20,8 +21,11 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderInfoDto;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.CylinderInfoMapper
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.rule.Rule
;
import
com.yeejoin.amos.feign.rule.model.FactBaseModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -30,6 +34,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
/**
* @author Zhang Yingbin
...
...
@@ -187,13 +192,26 @@ public class ScheduleService {
log
.
info
(
"调用气瓶规则对象!+:{}"
,
JSON
.
toJSONString
(
warningMsgDto
));
}
String
[]
test
=
new
String
[]{};
ruleTrigger
.
publish
(
warningMsgDto
,
cylPackageId
,
new
String
[
0
]
);
this
.
rulePublish
(
warningMsgDto
,
cylPackageId
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用气瓶规则失败!:{},{}"
,
JSON
.
toJSONString
(
cylinderInfoDto
),
e
);
}
}
/**
* 调用规则公用方法
*/
public
void
rulePublish
(
WarningMsgDto
warningMsgDto
,
String
packageId
){
FactBaseModel
factBaseModel
=
new
FactBaseModel
();
factBaseModel
.
setPackageId
(
packageId
);
factBaseModel
.
setProcessIds
(
new
String
[
0
]);
HashMap
<
String
,
byte
[]>
map
=
new
HashMap
();
map
.
put
(
"com.yeejoin.amos.boot.module.tzs.api.dto.WarningMsgDto"
,
JSONObject
.
toJSONString
(
warningMsgDto
).
getBytes
());
factBaseModel
.
setFactMap
(
map
);
Rule
.
ruleClient
.
fireRule
(
factBaseModel
);
}
/**
* 气瓶规则调用
* @param sequenceCode
* @return
...
...
@@ -246,7 +264,7 @@ public class ScheduleService {
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"调用设备规则对象!+:{}"
,
JSON
.
toJSONString
(
warningMsgDto
));
}
ruleTrigger
.
publish
(
warningMsgDto
,
equPackageId
,
null
);
this
.
rulePublish
(
warningMsgDto
,
equPackageId
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用设备规则失败!:{},{}"
,
JSON
.
toJSONString
(
equScheduleDto
),
e
);
}
...
...
@@ -301,7 +319,7 @@ public class ScheduleService {
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"调用许可规则对象!+:{}"
,
JSON
.
toJSONString
(
warningMsgDto
));
}
ruleTrigger
.
publish
(
warningMsgDto
,
licPackageId
,
null
);
this
.
rulePublish
(
warningMsgDto
,
licPackageId
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用许可规则失败!:{},{}"
,
JSON
.
toJSONString
(
licScheduleDto
),
e
);
}
...
...
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