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
a13be602
Commit
a13be602
authored
Nov 12, 2021
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)增加检查项完成调用规则
parent
720151cb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
123 deletions
+5
-123
RuleTypeEnum.java
...m/yeejoin/amos/supervision/common/enums/RuleTypeEnum.java
+2
-1
CheckServiceImpl.java
...s/supervision/business/service/impl/CheckServiceImpl.java
+3
-9
AsyncTask.java
...va/com/yeejoin/amos/supervision/core/async/AsyncTask.java
+0
-83
RemoteSecurityService.java
...yeejoin/amos/supervision/feign/RemoteSecurityService.java
+0
-30
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-supervision-api/src/main/java/com/yeejoin/amos/supervision/common/enums/RuleTypeEnum.java
View file @
a13be602
...
@@ -13,7 +13,8 @@ public enum RuleTypeEnum {
...
@@ -13,7 +13,8 @@ public enum RuleTypeEnum {
// 防火监督
// 防火监督
计划提交
(
"计划提交"
,
"addPlan"
),
计划提交
(
"计划提交"
,
"addPlan"
),
计划审核
(
"计划审核"
,
"planAudit"
),
计划审核
(
"计划审核"
,
"planAudit"
),
计划生成
(
"计划生成"
,
"addPlanTask"
);
计划生成
(
"计划生成"
,
"addPlanTask"
),
计划完成
(
"计划完成"
,
"planCompleted"
);
/**
/**
* 名称,描述
* 名称,描述
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckServiceImpl.java
View file @
a13be602
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
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.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
...
@@ -9,7 +8,6 @@ import com.google.common.collect.Lists;
...
@@ -9,7 +8,6 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
@@ -31,7 +29,6 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
...
@@ -31,7 +29,6 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import
com.yeejoin.amos.supervision.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.supervision.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.supervision.business.vo.CheckVo
;
import
com.yeejoin.amos.supervision.business.vo.CheckVo
;
import
com.yeejoin.amos.supervision.common.enums.*
;
import
com.yeejoin.amos.supervision.common.enums.*
;
import
com.yeejoin.amos.supervision.core.async.AsyncTask
;
import
com.yeejoin.amos.supervision.core.common.dto.DangerDto
;
import
com.yeejoin.amos.supervision.core.common.dto.DangerDto
;
import
com.yeejoin.amos.supervision.core.common.request.CommonPageable
;
import
com.yeejoin.amos.supervision.core.common.request.CommonPageable
;
import
com.yeejoin.amos.supervision.core.common.response.*
;
import
com.yeejoin.amos.supervision.core.common.response.*
;
...
@@ -50,13 +47,10 @@ import org.springframework.data.domain.Page;
...
@@ -50,13 +47,10 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.transaction.Transactional
;
import
javax.transaction.Transactional
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -106,7 +100,7 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -106,7 +100,7 @@ public class CheckServiceImpl implements ICheckService {
private
IPlanService
planService
;
private
IPlanService
planService
;
@Autowired
@Autowired
private
AsyncTask
asyncTask
;
private
RulePlanService
rulePlanService
;
@Autowired
@Autowired
DangerFeignClient
DangerFeignClient
;
DangerFeignClient
DangerFeignClient
;
...
@@ -1578,9 +1572,9 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1578,9 +1572,9 @@ public class CheckServiceImpl implements ICheckService {
recordParam
.
getPlanTaskId
(),
mtUserSeq
,
userName
,
size
,
planTaskStatus
);
recordParam
.
getPlanTaskId
(),
mtUserSeq
,
userName
,
size
,
planTaskStatus
);
Plan
plan
=
planService
.
queryPlanById
(
planTask
.
getPlanId
());
Plan
plan
=
planService
.
queryPlanById
(
planTask
.
getPlanId
());
// 计划完成,
发
送消息
// 计划完成,
规则推
送消息
if
(
PlanStatusEnum
.
COMPLETED
.
getValue
()
==
plan
.
getStatus
()){
if
(
PlanStatusEnum
.
COMPLETED
.
getValue
()
==
plan
.
getStatus
()){
asyncTask
.
sendPlanMsgToLeadPeople
(
RequestContext
.
cloneRequestContext
(),
plan
);
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划完成
.
getCode
()
);
}
}
// p_plan_task_detail更新隐患个数
// p_plan_task_detail更新隐患个数
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/core/async/AsyncTask.java
View file @
a13be602
...
@@ -306,89 +306,6 @@ public class AsyncTask {
...
@@ -306,89 +306,6 @@ public class AsyncTask {
}
}
}
}
/**
* 提交计划任务消息
* @param requestContextModel
* @param plan
* @param userIds 发送用户id集合
* @param isSendWeb 发送web标识
* @param isSendApp 发送app标识
*/
@Async
public
void
sendAddPlanMsg
(
RequestContextModel
requestContextModel
,
Plan
plan
,
List
<
String
>
userIds
,
boolean
isSendWeb
,
boolean
isSendApp
){
MessageModel
model
=
new
MessageModel
();
model
.
setTitle
(
plan
.
getName
());
String
body
=
String
.
format
(
"计划名称:%s;检查类型:%s;推送时间:%s"
,
plan
.
getName
(),
plan
.
getCheckTypeName
(),
DateUtil
.
date2LongStr
(
new
Date
()));
model
.
setBody
(
body
);
try
{
model
.
setIsSendWeb
(
isSendWeb
);
model
.
setIsSendApp
(
isSendApp
);
model
.
setMsgType
(
msgType
);
model
.
setRelationId
(
String
.
valueOf
(
plan
.
getId
()));
model
.
setRecivers
(
userIds
);
remoteSecurityService
.
addMessage
(
requestContextModel
,
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 发送消息至检查组长
* @param plan
*/
@Async
public
void
sendPlanMsgToLeadPeople
(
RequestContextModel
requestContextModel
,
Plan
plan
){
MessageModel
model
=
new
MessageModel
();
model
.
setTitle
(
plan
.
getName
());
String
body
=
String
.
format
(
"计划名称:%s;检查类型:%s;推送时间:%s"
,
plan
.
getName
(),
plan
.
getCheckTypeName
(),
DateUtil
.
date2LongStr
(
new
Date
()));
model
.
setBody
(
body
);
String
leadPeopleIds
=
plan
.
getLeadPeopleIds
();
if
(!
ValidationUtil
.
isEmpty
(
plan
.
getUserId
())
&&
!
leadPeopleIds
.
contains
(
plan
.
getUserId
())){
leadPeopleIds
+=
","
+
plan
.
getUserId
();
}
try
{
List
<
String
>
recivers
=
remoteSecurityService
.
getAmosIdListByUserIds
(
requestContextModel
,
leadPeopleIds
);
model
.
setIsSendWeb
(
true
);
model
.
setIsSendApp
(
true
);
model
.
setMsgType
(
msgType
);
model
.
setRelationId
(
String
.
valueOf
(
plan
.
getId
()));
model
.
setRecivers
(
recivers
);
remoteSecurityService
.
addMessage
(
requestContextModel
,
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 发送消息至检查组员
* @param plan
*/
@Async
public
void
sendPlanMsg
(
RequestContextModel
requestContextModel
,
Plan
plan
){
MessageModel
model
=
new
MessageModel
();
model
.
setTitle
(
plan
.
getName
());
String
body
=
String
.
format
(
"计划名称:%s;检查类型:%s;推送时间:%s"
,
plan
.
getName
(),
plan
.
getCheckTypeName
(),
DateUtil
.
date2LongStr
(
new
Date
()));
model
.
setBody
(
body
);
String
leadPeopleIds
=
plan
.
getLeadPeopleIds
();
if
(!
ValidationUtil
.
isEmpty
(
plan
.
getUserId
())
&&
!
leadPeopleIds
.
contains
(
plan
.
getUserId
())){
leadPeopleIds
+=
","
+
plan
.
getUserId
();
}
try
{
List
<
String
>
recivers
=
remoteSecurityService
.
getAmosIdListByUserIds
(
requestContextModel
,
leadPeopleIds
);
model
.
setIsSendApp
(
true
);
model
.
setIsSendWeb
(
true
);
model
.
setMsgType
(
msgType
);
model
.
setRelationId
(
String
.
valueOf
(
plan
.
getId
()));
model
.
setRecivers
(
recivers
);
remoteSecurityService
.
addMessage
(
requestContextModel
,
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
Set
<
String
>
userIdFilter
(
Set
<
String
>
sendUserIds
,
String
msgType
)
{
private
Set
<
String
>
userIdFilter
(
Set
<
String
>
sendUserIds
,
String
msgType
)
{
Set
<
String
>
afterFilterUserIds
=
Sets
.
newHashSet
();
Set
<
String
>
afterFilterUserIds
=
Sets
.
newHashSet
();
if
(
CollectionUtils
.
isEmpty
(
sendUserIds
))
{
if
(
CollectionUtils
.
isEmpty
(
sendUserIds
))
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/feign/RemoteSecurityService.java
View file @
a13be602
...
@@ -752,36 +752,6 @@ public class RemoteSecurityService {
...
@@ -752,36 +752,6 @@ public class RemoteSecurityService {
return
handleArray
(
feignClientResult
,
DepartmentModel
.
class
);
return
handleArray
(
feignClientResult
,
DepartmentModel
.
class
);
}
}
/**
* 平台消息-添加
*/
public
void
addMessage
(
RequestContextModel
requestContextModel
,
MessageModel
model
){
RequestContext
.
setToken
(
requestContextModel
.
getToken
());
RequestContext
.
setProduct
(
requestContextModel
.
getProduct
());
RequestContext
.
setAppKey
(
requestContextModel
.
getAppKey
());
try
{
FeignClientResult
<
MessageModel
>
messageModelFeignClientResult
=
Systemctl
.
messageClient
.
create
(
model
);
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
}
/**
* 机场用户id批量获取平台用户id
*/
public
List
<
String
>
getAmosIdListByUserIds
(
RequestContextModel
requestContextModel
,
String
orgUserIds
){
RequestContext
.
setToken
(
requestContextModel
.
getToken
());
RequestContext
.
setProduct
(
requestContextModel
.
getProduct
());
RequestContext
.
setAppKey
(
requestContextModel
.
getAppKey
());
List
<
String
>
userNames
=
new
ArrayList
<>();
try
{
userNames
=
(
List
<
String
>)
jcsFeignClient
.
getAmosIdListByUserIds
(
orgUserIds
).
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
userNames
;
}
private
<
T
>
List
<
T
>
handleArray
(
FeignClientResult
feignClientResult
,
Class
<
T
>
t
)
{
private
<
T
>
List
<
T
>
handleArray
(
FeignClientResult
feignClientResult
,
Class
<
T
>
t
)
{
List
<
T
>
list
=
new
ArrayList
<>();
List
<
T
>
list
=
new
ArrayList
<>();
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getStatus
()
==
200
)
{
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getStatus
()
==
200
)
{
...
...
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