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
fb4bd5d5
Commit
fb4bd5d5
authored
May 10, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码 维保待办
parent
bc05eb7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
0 deletions
+166
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+2
-0
PlanRo.java
...ava/com/yeejoin/amos/maintenance/business/dto/PlanRo.java
+61
-0
PlanTaskServiceImpl.java
...aintenance/business/service/impl/PlanTaskServiceImpl.java
+27
-0
RulePlanService.java
...os/maintenance/business/service/impl/RulePlanService.java
+76
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
fb4bd5d5
...
@@ -787,6 +787,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -787,6 +787,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// this.updateBatchById(list);
// this.updateBatchById(list);
// /*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */8888
// /*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */8888
orgUsrMapper
.
updatelistByParentId
(
orgUsr
.
getBizOrgCode
(),
oriOrgUsr
.
getBizOrgCode
());
orgUsrMapper
.
updatelistByParentId
(
orgUsr
.
getBizOrgCode
(),
oriOrgUsr
.
getBizOrgCode
());
}
else
{
orgUsr
.
setBizOrgCode
(
oriOrgUsr
.
getBizOrgCode
());
}
}
updateById
(
orgUsr
);
updateById
(
orgUsr
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dto/PlanRo.java
0 → 100644
View file @
fb4bd5d5
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dto
;
import
com.yeejoin.amos.component.rule.Label
;
import
com.yeejoin.amos.component.rule.RuleFact
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author: xl
* @Description: 计划规则触发对象
* @Date: 2021/11/10 10:01
*/
@Data
@RuleFact
(
value
=
"维保任务"
,
project
=
"消息规则"
)
public
class
PlanRo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1070080521549842475L
;
@Label
(
"任务名称"
)
private
String
name
;
@Label
(
value
=
"检查类型名称"
)
private
String
checkTypeName
;
@Label
(
value
=
"执行方法"
)
private
String
ruleType
;
@Label
(
value
=
"执行状态"
)
private
String
excuteStateName
;
@Label
(
value
=
"推送时间"
)
private
String
sendTime
;
@Label
(
value
=
"接收人"
)
private
List
<
String
>
recivers
;
@Label
(
value
=
"发送到web标识"
)
private
Boolean
isSendWeb
;
@Label
(
value
=
"发送到app标识"
)
private
Boolean
isSendApp
;
@Label
(
"关联id"
)
private
String
relationId
;
@Label
(
"消息类型"
)
private
String
msgType
;
@Label
(
value
=
"终端标识"
)
private
String
terminal
;
@Label
(
value
=
"类别"
)
private
Integer
category
;
@Label
(
value
=
"扩展参数"
)
private
Map
<
String
,
String
>
extras
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PlanTaskServiceImpl.java
View file @
fb4bd5d5
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.base.Joiner
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper
;
...
@@ -68,6 +73,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -68,6 +73,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
IPlanTaskDetailDao
iPlanTaskDetailDao
;
IPlanTaskDetailDao
iPlanTaskDetailDao
;
@Autowired
@Autowired
InputItemMapper
inputItemMapper
;
InputItemMapper
inputItemMapper
;
@Autowired
RulePlanService
rulePlanService
;
@Override
@Override
public
Page
<
HashMap
<
String
,
Object
>>
getPlanTaskInfo
(
PlanTaskPageParam
params
)
{
public
Page
<
HashMap
<
String
,
Object
>>
getPlanTaskInfo
(
PlanTaskPageParam
params
)
{
...
@@ -430,6 +437,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -430,6 +437,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表
// 2.保存执行数据明细表
planTaskDetail
.
saveAndFlush
(
planTaskDetailInstance
);
planTaskDetail
.
saveAndFlush
(
planTaskDetailInstance
);
}
}
sendMessage
(
plan
);
// 定时任务监控
// 定时任务监控
jobService
.
planTaskAddJob
(
planTask
);
jobService
.
planTaskAddJob
(
planTask
);
}
}
...
@@ -464,6 +472,25 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -464,6 +472,25 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
}
}
public
void
sendMessage
(
Plan
plan
)
throws
Exception
{
// 查询检查对象对应防火监督负责人id
List
<
String
>
extraUserIds
=
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
();
//
log
.
info
(
String
.
format
(
"计划对象:%s"
,
JSON
.
toJSON
(
plan
)));
/* // 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.消息型计划生成, extraUserIds);*/
// NOTIFY
String
userIdString
=
plan
.
getUserId
();
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
userIdString
))
{
String
[]
userIdArr
=
userIdString
.
split
(
","
);
List
<
String
>
userIdList
=
Arrays
.
asList
(
userIdArr
);
// 规则推送消息
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
任务型计划生成
,
userIdList
);
}
}
@Override
@Override
public
List
<
PlanTask
>
getPlanTaskByRouteId
(
Long
routeId
)
{
public
List
<
PlanTask
>
getPlanTaskByRouteId
(
Long
routeId
)
{
return
planTaskMapper
.
getPlanTaskByRouteId
(
routeId
);
return
planTaskMapper
.
getPlanTaskByRouteId
(
routeId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/RulePlanService.java
0 → 100644
View file @
fb4bd5d5
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.maintenance.business.dto.PlanRo
;
import
com.yeejoin.amos.maintenance.business.feign.JCSFeignClient
;
import
com.yeejoin.amos.maintenance.business.util.DateUtil
;
import
com.yeejoin.amos.maintenance.dao.entity.Plan
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
RulePlanService
{
private
final
String
packageId
=
"消息/addMaintenance"
;
private
final
String
msgType
=
"maintenance"
;
@Autowired
private
RuleTrigger
ruleTrigger
;
@Autowired
private
JCSFeignClient
jcsFeignClient
;
public
Boolean
addPlanRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
List
<
String
>
extraUserIds
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
extraUserIds
);
//触发规则
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
return
true
;
}
private
PlanRo
buildPlanRo
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
List
<
String
>
extraUserIds
)
{
PlanRo
planRo
=
new
PlanRo
();
BeanUtils
.
copyProperties
(
plan
,
planRo
);
planRo
.
setMsgType
(
msgType
);
planRo
.
setRuleType
(
ruleType
.
getCode
());
planRo
.
setRelationId
(
String
.
valueOf
(
plan
.
getId
()));
planRo
.
setTerminal
(
ruleType
.
getTerminal
());
planRo
.
setCategory
(
ruleType
.
getCategory
());
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"planId"
,
String
.
valueOf
(
plan
.
getId
()));
if
(!
ValidationUtil
.
isEmpty
(
ruleType
.
getUrl
())){
map
.
put
(
"url"
,
ruleType
.
getUrl
());
}
if
(
RuleConstant
.
WEB
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendWeb
(
true
);
}
else
if
(
RuleConstant
.
APP
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendApp
(
true
);
}
else
if
(
RuleConstant
.
APP_WEB
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendWeb
(
true
);
planRo
.
setIsSendApp
(
true
);
}
if
(!
ValidationUtil
.
isEmpty
(
extraUserIds
))
{
List
<
String
>
finalUserIds
=
userIds
;
extraUserIds
.
forEach
(
id
->
{
if
(!
finalUserIds
.
contains
(
id
))
{
finalUserIds
.
add
(
id
);
}
});
userIds
=
finalUserIds
;
}
planRo
.
setSendTime
(
DateUtil
.
date2LongStr
(
new
Date
()));
planRo
.
setRecivers
(
userIds
);
planRo
.
setExtras
(
map
);
return
planRo
;
}
}
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