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
a550ce2d
Commit
a550ce2d
authored
Dec 23, 2021
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、防火监督隐患bug修改
2、数据权限拦截器支持mybatis plus
parent
a2995816
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
29 deletions
+158
-29
DataAuth.java
...om/yeejoin/amos/boot/biz/common/annotations/DataAuth.java
+3
-2
PermissionInterceptor.java
...s/boot/biz/common/interceptors/PermissionInterceptor.java
+15
-5
PermissionInterceptorContext.java
...biz/common/interceptors/PermissionInterceptorContext.java
+30
-0
PermissionInterceptorContextModel.java
...ommon/interceptors/PermissionInterceptorContextModel.java
+30
-0
LatentDangerServiceImpl.java
...danger/business/service/impl/LatentDangerServiceImpl.java
+2
-1
EnumFillAop.java
...a/com/yeejoin/amos/latentdanger/core/aop/EnumFillAop.java
+21
-9
LatentDangerServiceImpl.java
...patrol/business/service/impl/LatentDangerServiceImpl.java
+57
-12
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/annotations/DataAuth.java
View file @
a550ce2d
...
@@ -9,7 +9,8 @@ import java.lang.annotation.Target;
...
@@ -9,7 +9,8 @@ import java.lang.annotation.Target;
/**
/**
* @author DELL
* @author DELL
*
*
* 注解在mapper方法上
* 注解需要数据权限过滤的mapper。
* interfacePath对应为平台菜单管理中菜单组件(全局唯一)。
*/
*/
@Target
(
ElementType
.
METHOD
)
@Target
(
ElementType
.
METHOD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
...
@@ -20,6 +21,6 @@ public @interface DataAuth {
...
@@ -20,6 +21,6 @@ public @interface DataAuth {
* 菜单组件
* 菜单组件
* @return
* @return
*/
*/
String
interfacePath
()
default
""
;
String
interfacePath
();
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptor.java
View file @
a550ce2d
...
@@ -61,30 +61,39 @@ public class PermissionInterceptor implements Interceptor {
...
@@ -61,30 +61,39 @@ public class PermissionInterceptor implements Interceptor {
MetaObject
metaObject
=
SystemMetaObject
.
forObject
(
statementHandler
);
MetaObject
metaObject
=
SystemMetaObject
.
forObject
(
statementHandler
);
MappedStatement
mappedStatement
=
(
MappedStatement
)
metaObject
.
getValue
(
"delegate.mappedStatement"
);
MappedStatement
mappedStatement
=
(
MappedStatement
)
metaObject
.
getValue
(
"delegate.mappedStatement"
);
// TODO 处理mybatis plus
String
dataAuthRule
=
PermissionInterceptorContext
.
getDataAuthRule
();
// 被拦截方法
// 被拦截方法
Method
method
=
getTargetDataAuthMethod
(
mappedStatement
);
Method
method
=
getTargetDataAuthMethod
(
mappedStatement
);
DataAuth
dataAuth
=
getTargetDataAuthAnnotation
(
mappedStatement
);
DataAuth
dataAuth
=
getTargetDataAuthAnnotation
(
mappedStatement
);
// 没有DataAuth定义注解的跳过
// 没有DataAuth定义注解的跳过及没有手动指定使用数据规则的跳过
if
(
null
==
dataAuth
)
{
if
(
null
==
dataAuth
&&
ValidationUtil
.
isEmpty
(
dataAuthRule
))
{
PermissionInterceptorContext
.
clean
();
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//
接口
地址为空返回空数据
//
数据权限
地址为空返回空数据
if
(
ValidationUtil
.
isEmpty
(
dataAuth
.
interfacePath
()))
{
if
(
ValidationUtil
.
isEmpty
(
dataAuth
.
interfacePath
())
&&
ValidationUtil
.
isEmpty
(
dataAuthRule
)
)
{
// method.getReturnType().isPrimitive() = true 是count语句
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext
.
clean
();
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
}
}
dataAuthRule
=
ValidationUtil
.
isEmpty
(
dataAuth
.
interfacePath
())
?
dataAuthRule
:
dataAuth
.
interfacePath
();
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
()
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
()
,
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
,
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ValidationUtil
.
isEmpty
(
reginParam
)
||
ValidationUtil
.
isEmpty
(
reginParam
.
getUserModel
()))
{
if
(
ValidationUtil
.
isEmpty
(
reginParam
)
||
ValidationUtil
.
isEmpty
(
reginParam
.
getUserModel
()))
{
// method.getReturnType().isPrimitive() = true 是count语句
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext
.
clean
();
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
}
}
// 用户数据权限配置信息
// 用户数据权限配置信息
Map
<
String
,
List
<
PermissionDataruleModel
>>
dataAuthorization
=
Privilege
.
permissionDataruleClient
.
queryByUser
(
reginParam
.
getUserModel
().
getUserId
(),
Map
<
String
,
List
<
PermissionDataruleModel
>>
dataAuthorization
=
Privilege
.
permissionDataruleClient
.
queryByUser
(
reginParam
.
getUserModel
().
getUserId
(),
dataAuth
.
interfacePath
()
).
getResult
();
dataAuth
Rule
).
getResult
();
// 没有数据权限直接返回空数据
// 没有数据权限直接返回空数据
if
(
ValidationUtil
.
isEmpty
(
dataAuthorization
))
{
if
(
ValidationUtil
.
isEmpty
(
dataAuthorization
))
{
PermissionInterceptorContext
.
clean
();
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
}
}
...
@@ -93,6 +102,7 @@ public class PermissionInterceptor implements Interceptor {
...
@@ -93,6 +102,7 @@ public class PermissionInterceptor implements Interceptor {
// 将权限规则拼接到原始sql
// 将权限规则拼接到原始sql
sql
=
processSelectSql
(
sql
,
dataAuthorization
,
reginParam
,
boundSql
);
sql
=
processSelectSql
(
sql
,
dataAuthorization
,
reginParam
,
boundSql
);
metaObject
.
setValue
(
"delegate.boundSql.sql"
,
sql
);
metaObject
.
setValue
(
"delegate.boundSql.sql"
,
sql
);
PermissionInterceptorContext
.
clean
();
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptorContext.java
0 → 100644
View file @
a550ce2d
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
interceptors
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
PermissionInterceptorContext
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
PermissionInterceptorContext
.
class
);
private
static
ThreadLocal
<
PermissionInterceptorContextModel
>
requestContext
=
ThreadLocal
.
withInitial
(
PermissionInterceptorContextModel:
:
new
);
private
static
PermissionInterceptorContextModel
getPermissionInterceptorContext
()
{
return
requestContext
.
get
();
}
public
static
String
getDataAuthRule
()
{
return
getPermissionInterceptorContext
().
getDataAuthRule
();
}
public
static
void
setDataAuthRule
(
String
dataAuthRule
)
{
getPermissionInterceptorContext
().
setDataAuthRule
(
dataAuthRule
);
}
public
static
void
clean
()
{
if
(
requestContext
!=
null
)
{
logger
.
info
(
"clean RestThreadLocal......Begin"
);
requestContext
.
remove
();
logger
.
info
(
"clean RestThreadLocal......Done"
);
}
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptorContextModel.java
0 → 100644
View file @
a550ce2d
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
interceptors
;
import
org.typroject.tyboot.core.foundation.context.RequestContextEntityType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
*
*/
public
class
PermissionInterceptorContextModel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
dataAuthRule
;
public
String
getDataAuthRule
()
{
return
dataAuthRule
;
}
public
void
setDataAuthRule
(
String
dataAuthRule
)
{
this
.
dataAuthRule
=
dataAuthRule
;
}
public
void
clean
()
{
this
.
dataAuthRule
=
null
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/LatentDangerServiceImpl.java
View file @
a550ce2d
...
@@ -1312,7 +1312,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -1312,7 +1312,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return
executeSubmitDto
;
return
executeSubmitDto
;
}
}
AgencyUserModel
checkLeader
=
jcsFeignClient
.
getAmosIdByUserId
(
param
.
getReformLeaderId
()).
getResult
();
AgencyUserModel
checkLeader
=
jcsFeignClient
.
getAmosIdByUserId
(
param
.
getReformLeaderId
()).
getResult
();
JSONObject
reformJson
=
new
JSONObject
();
JSONObject
reformJson
=
ValidationUtil
.
isEmpty
(
latentDanger
.
getReformJson
())
?
new
JSONObject
()
:
latentDanger
.
getReformJson
();
reformJson
.
put
(
"reformLeaderId"
,
param
.
getReformLeaderId
());
reformJson
.
put
(
"reformLeaderId"
,
param
.
getReformLeaderId
());
latentDanger
.
setReformJson
(
reformJson
);
latentDanger
.
setReformJson
(
reformJson
);
Object
result
=
workflowExecuteService
.
setTaskAssign
(
processInstanceId
,
checkLeader
.
getUserName
());
Object
result
=
workflowExecuteService
.
setTaskAssign
(
processInstanceId
,
checkLeader
.
getUserName
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/core/aop/EnumFillAop.java
View file @
a550ce2d
...
@@ -9,6 +9,8 @@ import org.aspectj.lang.JoinPoint;
...
@@ -9,6 +9,8 @@ import org.aspectj.lang.JoinPoint;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -25,6 +27,8 @@ import java.util.List;
...
@@ -25,6 +27,8 @@ import java.util.List;
@Component
@Component
public
class
EnumFillAop
{
public
class
EnumFillAop
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EnumFillAop
.
class
);
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
...
@@ -39,19 +43,27 @@ public class EnumFillAop {
...
@@ -39,19 +43,27 @@ public class EnumFillAop {
@Before
(
"fillEnum()"
)
@Before
(
"fillEnum()"
)
public
void
doBefore
(
JoinPoint
joinPoint
)
{
public
void
doBefore
(
JoinPoint
joinPoint
)
{
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
// 获取隐患等级枚举
synchronized
(
this
)
{
synchronized
(
this
)
{
// 获取隐患等级枚举
if
(
ValidationUtil
.
isEmpty
(
LatentDangerLevelEnum
.
supervisionDangerLevelEnumMap
))
{
if
(
ValidationUtil
.
isEmpty
(
LatentDangerLevelEnum
.
supervisionDangerLevelEnumMap
))
{
List
<
DictionarieValueModel
>
dicResult
=
try
{
Systemctl
.
dictionarieClient
.
dictValues
(
bizType
+
LatentDangerLevelEnum
.
dictCode
).
getResult
();
List
<
DictionarieValueModel
>
dicResult
=
dicResult
.
forEach
(
dic
->
LatentDangerLevelEnum
.
addEnumDynamic
(
dic
.
getDictDataDesc
(),
dic
.
getDictDataValue
(),
dic
.
getDictDataKey
(),
Systemctl
.
dictionarieClient
.
dictValues
(
bizType
+
LatentDangerLevelEnum
.
dictCode
).
getResult
();
""
,
dic
.
getOrderNum
()));
dicResult
.
forEach
(
dic
->
LatentDangerLevelEnum
.
addEnumDynamic
(
dic
.
getDictDataDesc
(),
dic
.
getDictDataValue
(),
dic
.
getDictDataKey
(),
""
,
dic
.
getOrderNum
()));
}
catch
(
Exception
e
)
{
logger
.
debug
(
e
.
getMessage
());
}
}
}
// 获取治理方式枚举
// 获取治理方式枚举
if
(
ValidationUtil
.
isEmpty
(
LatentDangerReformTypeEnum
.
supervisionReformTypeEnumMap
))
{
try
{
List
<
DictionarieValueModel
>
dicResult
=
if
(
ValidationUtil
.
isEmpty
(
LatentDangerReformTypeEnum
.
supervisionReformTypeEnumMap
))
{
Systemctl
.
dictionarieClient
.
dictValues
(
bizType
+
LatentDangerReformTypeEnum
.
dictCode
).
getResult
();
List
<
DictionarieValueModel
>
dicResult
=
dicResult
.
forEach
(
dic
->
LatentDangerReformTypeEnum
.
addEnumDynamic
(
dic
.
getDictDataDesc
(),
dic
.
getDictDataValue
(),
dic
.
getDictDataKey
()));
Systemctl
.
dictionarieClient
.
dictValues
(
bizType
+
LatentDangerReformTypeEnum
.
dictCode
).
getResult
();
dicResult
.
forEach
(
dic
->
LatentDangerReformTypeEnum
.
addEnumDynamic
(
dic
.
getDictDataDesc
(),
dic
.
getDictDataValue
(),
dic
.
getDictDataKey
()));
}
}
catch
(
Exception
e
)
{
logger
.
debug
(
e
.
getMessage
());
}
}
}
}
// 获取治理状态枚举
// 获取治理状态枚举
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/LatentDangerServiceImpl.java
View file @
a550ce2d
...
@@ -7,7 +7,6 @@ import com.google.common.base.Joiner;
...
@@ -7,7 +7,6 @@ import com.google.common.base.Joiner;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
import
com.google.gson.JsonObject
;
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.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl
;
...
@@ -328,7 +327,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -328,7 +327,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
riskSourceId
=
Long
.
parseLong
(
inputCheckDto
.
getRiskSourceId
());
riskSourceId
=
Long
.
parseLong
(
inputCheckDto
.
getRiskSourceId
());
}
}
LatentDangerBo
latentDangerBo
=
saveLatentDanger
(
""
,
param
.
getRemark
()
,
remark
,
userId
,
departmentId
,
LatentDangerBo
latentDangerBo
=
saveLatentDanger
(
""
,
""
,
remark
,
userId
,
departmentId
,
businessKey
,
orgCode
,
dangerName
,
levelEnum
.
getCode
(),
businessKey
,
orgCode
,
dangerName
,
levelEnum
.
getCode
(),
null
,
dangerTypeEnum
,
photoUrls
,
inputCheckDto
.
getCheckInputId
(),
riskSourceId
,
null
,
dangerTypeEnum
,
photoUrls
,
inputCheckDto
.
getCheckInputId
(),
riskSourceId
,
position
.
get
(
inputCheckDto
.
getRiskSourceId
())==
null
?
""
:
position
.
get
(
inputCheckDto
.
getRiskSourceId
()).
toString
(),
InstanceKeyEnum
.
PATROL
.
getCode
());
position
.
get
(
inputCheckDto
.
getRiskSourceId
())==
null
?
""
:
position
.
get
(
inputCheckDto
.
getRiskSourceId
()).
toString
(),
InstanceKeyEnum
.
PATROL
.
getCode
());
...
@@ -1234,7 +1233,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -1234,7 +1233,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
executeParam
.
getFlowJson
(),
executeParam
.
getDangerId
(),
role
,
executeTypeEnum
.
getName
(),
executeParam
.
getRemark
());
executeParam
.
getFlowJson
(),
executeParam
.
getDangerId
(),
role
,
executeTypeEnum
.
getName
(),
executeParam
.
getRemark
());
}
else
{
}
else
{
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
// 将
制
定的治理人保存在日志记录
// 将
指
定的治理人保存在日志记录
executeParam
.
getFlowJson
().
put
(
"governUserId"
,
governUserId
);
executeParam
.
getFlowJson
().
put
(
"governUserId"
,
governUserId
);
}
}
LatentDangerFlowRecordBo
flowRecord
=
saveFlowRecord
(
executeJson
.
getString
(
"id"
),
data
.
getString
(
"name"
),
userId
,
departmentId
,
LatentDangerFlowRecordBo
flowRecord
=
saveFlowRecord
(
executeJson
.
getString
(
"id"
),
data
.
getString
(
"name"
),
userId
,
departmentId
,
...
@@ -1243,9 +1242,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -1243,9 +1242,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
latentDangerBo
.
setDangerState
(
executeTypeEnum
.
getNextState
().
getCode
().
toString
());
latentDangerBo
.
setDangerState
(
executeTypeEnum
.
getNextState
().
getCode
().
toString
());
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患常规治理
))
{
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患常规治理
))
{
latentDangerBo
.
setReformType
(
LatentDangerReformTypeEnum
.
常规整改
.
getCode
().
toString
());
latentDangerBo
.
setReformType
(
LatentDangerReformTypeEnum
.
常规整改
.
getCode
().
toString
());
latentDangerBo
.
setReformJson
(
executeParam
.
getFlowJson
().
toJSONString
());
JSONObject
reformJsonObj
=
JSONObject
.
parseObject
(
latentDangerBo
.
getReformJson
());
if
(
ValidationUtil
.
isEmpty
(
reformJsonObj
))
{
reformJsonObj
=
executeParam
.
getFlowJson
();
}
else
{
reformJsonObj
.
putAll
(
executeParam
.
getFlowJson
());
}
latentDangerBo
.
setReformJson
(
reformJsonObj
.
toJSONString
());
latentDangerBo
.
setInferOtherThings
(
executeParam
.
getInferOtherThings
());
latentDangerBo
.
setInferOtherThings
(
executeParam
.
getInferOtherThings
());
latentDangerBo
.
setProblemDescription
(
executeParam
.
getRemark
());
latentDangerBo
.
setProblemDescription
(
ValidationUtil
.
isEmpty
(
executeParam
.
getProblemDescription
())
?
executeParam
.
getRemark
()
:
executeParam
.
getProblemDescription
());
latentDangerBo
.
setReasonAnalysis
(
executeParam
.
getReasonAnalysis
());
latentDangerBo
.
setReasonAnalysis
(
executeParam
.
getReasonAnalysis
());
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理
))
{
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理
))
{
latentDangerBo
.
setReformType
(
LatentDangerReformTypeEnum
.
延期治理
.
getCode
().
toString
());
latentDangerBo
.
setReformType
(
LatentDangerReformTypeEnum
.
延期治理
.
getCode
().
toString
());
...
@@ -1258,10 +1264,21 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -1258,10 +1264,21 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
latentDangerBo
.
setReformLimitDate
(
DateUtil
.
str2Date
(
executeParam
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
latentDangerBo
.
setReformLimitDate
(
DateUtil
.
str2Date
(
executeParam
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
latentDangerBo
.
setDangerLevel
(
executeParam
.
getDangerLevel
().
toString
());
latentDangerBo
.
setDangerLevel
(
executeParam
.
getDangerLevel
().
toString
());
JSONObject
reformJsonObject
=
JSONObject
.
parseObject
(
latentDangerBo
.
getReformJson
());
if
(
ValidationUtil
.
isEmpty
(
reformJsonObject
))
{
reformJsonObject
=
new
JSONObject
();
}
reformJsonObject
.
put
(
"governUserId"
,
governUserId
);
latentDangerBo
.
setReformJson
(
reformJsonObject
.
toJSONString
());
// 消防巡查需求:评审通过后
制
定治理人
// 消防巡查需求:评审通过后
指
定治理人
// 2.指定治理执行人
// 2.指定治理执行人
workflowExecuteService
.
setTaskAssign
(
latentDangerBo
.
getInstanceId
(),
governUserId
);
Object
result
=
workflowExecuteService
.
setTaskAssign
(
latentDangerBo
.
getInstanceId
(),
governUserId
);
if
(!(
Boolean
)
result
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"设置治理行人失败"
);
return
executeSubmitDto
;
}
}
}
}
}
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理车间部门审核通过
))
{
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理车间部门审核通过
))
{
...
@@ -1269,6 +1286,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -1269,6 +1286,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if
(
executeParam
.
getNeedCompanyVerify
()
==
0
)
{
if
(
executeParam
.
getNeedCompanyVerify
()
==
0
)
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
().
toString
());
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
().
toString
());
latentDangerBo
.
setReformLimitDate
(
latentDangerBo
.
getDelayLimitDate
());
latentDangerBo
.
setReformLimitDate
(
latentDangerBo
.
getDelayLimitDate
());
if
(!
assignGovernUser
(
latentDangerBo
,
executeSubmitDto
))
{
return
executeSubmitDto
;
}
}
else
{
// 延期治理评审通过且 需要 公司审核
}
else
{
// 延期治理评审通过且 需要 公司审核
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请待公司审核
.
getCode
().
toString
());
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请待公司审核
.
getCode
().
toString
());
LatentDangerFlowRecordBo
recordBo
=
LatentDangerFlowRecordBo
recordBo
=
...
@@ -1283,15 +1304,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -1283,15 +1304,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
||
LatentDangerExcuteTypeEnum
.
隐患延期治理公司审核拒绝
.
equals
(
executeTypeEnum
)
||
LatentDangerExcuteTypeEnum
.
隐患延期治理公司审核拒绝
.
equals
(
executeTypeEnum
)
||
LatentDangerExcuteTypeEnum
.
隐患验证拒绝
.
equals
(
executeTypeEnum
))
{
||
LatentDangerExcuteTypeEnum
.
隐患验证拒绝
.
equals
(
executeTypeEnum
))
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
待治理
.
getCode
().
toString
());
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
待治理
.
getCode
().
toString
());
// 获取第一次评审时选择的治理人
if
(!
assignGovernUser
(
latentDangerBo
,
executeSubmitDto
))
{
LatentDangerFlowRecordBo
record
=
latentDangerFlowRecordMapper
.
getByDangerIdAndActionFlag
(
latentDangerBo
.
getId
(),
"隐患评审"
);
return
executeSubmitDto
;
JSONObject
recordObj
=
JSONObject
.
parseObject
(
record
.
getFlowJson
());
if
(!
ValidationUtil
.
isEmpty
(
recordObj
.
get
(
"governUserId"
)))
{
workflowExecuteService
.
setTaskAssign
(
latentDangerBo
.
getInstanceId
(),
(
String
)
recordObj
.
get
(
"governUserId"
));
}
}
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理公司审核通过
))
{
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理公司审核通过
))
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
().
toString
());
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
().
toString
());
latentDangerBo
.
setReformLimitDate
(
latentDangerBo
.
getDelayLimitDate
());
latentDangerBo
.
setReformLimitDate
(
latentDangerBo
.
getDelayLimitDate
());
if
(!
assignGovernUser
(
latentDangerBo
,
executeSubmitDto
))
{
return
executeSubmitDto
;
}
}
/**else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理公司审核拒绝)) {
}
/**else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理公司审核拒绝)) {
// TODO 待需求确认是回到部门审核还是回到隐患治理节点
// TODO 待需求确认是回到部门审核还是回到隐患治理节点
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请待车间部门审核.getCode().toString());
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请待车间部门审核.getCode().toString());
...
@@ -1310,6 +1332,29 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
...
@@ -1310,6 +1332,29 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
return
executeSubmitDto
;
return
executeSubmitDto
;
}
}
/**
* 设置治理人到流程执行节点(平台人员用户名)
*
* @param latentDangerBo
* @param executeSubmitDto
* @return
*/
public
boolean
assignGovernUser
(
LatentDangerBo
latentDangerBo
,
DangerExecuteSubmitDto
executeSubmitDto
)
{
// 获取最后一次评审时选择的治理人
LatentDangerFlowRecordBo
record
=
latentDangerFlowRecordMapper
.
getByDangerIdAndActionFlag
(
latentDangerBo
.
getId
(),
"隐患评审"
);
JSONObject
recordObj
=
JSONObject
.
parseObject
(
record
.
getFlowJson
());
if
(!
ValidationUtil
.
isEmpty
(
recordObj
.
get
(
"governUserId"
)))
{
Object
result
=
workflowExecuteService
.
setTaskAssign
(
latentDangerBo
.
getInstanceId
(),
(
String
)
recordObj
.
get
(
"governUserId"
));
if
(!(
Boolean
)
result
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"指定治理人失败"
);
return
false
;
}
}
return
true
;
}
private
void
sendMessage
(
LatentDangerBo
latentDangerBo
,
LatentDangerExcuteTypeEnum
excuteTypeEnum
,
private
void
sendMessage
(
LatentDangerBo
latentDangerBo
,
LatentDangerExcuteTypeEnum
excuteTypeEnum
,
LatentDangerPatrolBo
patrolBo
,
String
flowTaskName
,
String
informerList
,
LatentDangerPatrolBo
patrolBo
,
String
flowTaskName
,
String
informerList
,
String
userRealName
,
String
departmentName
)
{
String
userRealName
,
String
departmentName
)
{
...
...
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