Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
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
base_platform_enterprise
gic-platform-enterprise
Commits
d0b237d0
Commit
d0b237d0
authored
Apr 22, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动审批
parent
84c46ab8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
26 deletions
+35
-26
AuditLogApiServiceImpl.java
...enterprise/service/outer/impl/AuditLogApiServiceImpl.java
+35
-26
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AuditLogApiServiceImpl.java
View file @
d0b237d0
...
...
@@ -95,6 +95,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
if
(
projectItem
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
auditLogDTO
.
setProjectItemId
(
projectItem
.
getProjectItemId
());
auditLogDTO
.
setProjectItemName
(
projectItem
.
getProjectItemName
());
// 判断申请人是否存在
...
...
@@ -104,21 +105,29 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
}
auditLogDTO
.
setApplyUserName
(
userServiceResponse
.
getResult
().
getUserName
());
auditLogDTO
.
setApplyUserPhone
(
userServiceResponse
.
getResult
().
getPhoneNumber
());
// 判断有没有审核员, 没有审核员就返回错误
// 如果审批项是被禁用的 直接通过
if
(
projectItem
.
getUseStatus
()
==
0
||
userServiceResponse
.
getResult
().
getSuperAdmin
()
==
1
)
{
String
extraInfo
=
auditLogDTO
.
getExtraInfo
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
extraInfo
);
jsonObject
.
put
(
"auditResult"
,
DataSecurityAuditEnum
.
PASS
.
getCode
());
String
[]
callback
=
projectItem
.
getCallbackUrl
().
split
(
GlobalInfo
.
FLAG_COMMA
);
AsyncCallbackUtils
.
callBack
(
jsonObject
,
callback
[
0
],
callback
[
1
]);
return
EnterpriseServiceResponse
.
success
();
}
// 判断有没有审核员, 没有审核员就返回错误
ServiceResponse
<
List
<
AuditorDTO
>>
auditorResponse
=
auditorApiService
.
listAuditorByProject
(
auditLogDTO
.
getProjectItemId
(),
auditLogDTO
.
getApplyUserId
(),
auditLogDTO
.
getEnterpriseId
());
List
<
AuditorDTO
>
auditorList
=
Collections
.
emptyList
();
if
(
userServiceResponse
.
getResult
().
getSuperAdmin
()
==
0
)
{
// 普通管理员需要判断是否有审核员
if
(!
auditorResponse
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
auditorResponse
.
getCode
(),
auditorResponse
.
getMessage
());
}
auditorList
=
auditorResponse
.
getResult
();
List
<
AuditorDTO
>
openidList
=
auditorList
.
stream
().
filter
(
e
->
StringUtils
.
isNotBlank
(
e
.
getOpenid
())).
collect
(
Collectors
.
toList
());
List
<
AuditorDTO
>
userIdList
=
auditorList
.
stream
().
filter
(
e
->
e
.
getUserId
()
!=
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
openidList
)
&&
CollectionUtils
.
isEmpty
(
userIdList
))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
OPERATION_FAILED
.
getCode
(),
"审核员没有绑定微信或管理员"
);
}
// 普通管理员需要判断是否有审核员
if
(!
auditorResponse
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
auditorResponse
.
getCode
(),
auditorResponse
.
getMessage
());
}
auditorList
=
auditorResponse
.
getResult
();
List
<
AuditorDTO
>
openidList
=
auditorList
.
stream
().
filter
(
e
->
StringUtils
.
isNotBlank
(
e
.
getOpenid
())).
collect
(
Collectors
.
toList
());
List
<
AuditorDTO
>
userIdList
=
auditorList
.
stream
().
filter
(
e
->
e
.
getUserId
()
!=
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
openidList
)
&&
CollectionUtils
.
isEmpty
(
userIdList
))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
OPERATION_FAILED
.
getCode
(),
"审核员没有绑定微信或管理员"
);
}
// 判断审批项是否禁用
if
(
Constants
.
DEL_STATUS
.
equals
(
projectItem
.
getUseStatus
()))
{
...
...
@@ -174,20 +183,20 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
// sendWxMessage();
}
// 如果申请人是超管 自动审批
if
(
userServiceResponse
.
getResult
().
getSuperAdmin
()
==
1
)
{
AuditLogDTO
autoAudit
=
new
AuditLogDTO
();
autoAudit
.
setEnterpriseId
(
auditLogDTO
.
getEnterpriseId
());
autoAudit
.
setApplyUserId
(
auditLogDTO
.
getApplyUserId
());
autoAudit
.
setAuditorId
(
auditLogDTO
.
getApplyUserId
());
autoAudit
.
setAuditResult
(
DataSecurityAuditEnum
.
PASS
.
getCode
());
autoAudit
.
setAuditorPhone
(
auditLogDTO
.
getApplyUserPhone
());
autoAudit
.
setAuditorName
(
auditLogDTO
.
getAuditorName
());
autoAudit
.
setAuditLogId
(
auditLogId
);
autoAudit
.
setAuditReason
(
"自动审批"
);
this
.
audit
(
autoAudit
);
}
//
// 如果申请人是超管 自动审批
//
if (userServiceResponse.getResult().getSuperAdmin() == 1) {
//
AuditLogDTO autoAudit = new AuditLogDTO();
//
autoAudit.setEnterpriseId(auditLogDTO.getEnterpriseId());
//
autoAudit.setApplyUserId(auditLogDTO.getApplyUserId());
//
autoAudit.setAuditorId(auditLogDTO.getApplyUserId());
//
autoAudit.setAuditResult(DataSecurityAuditEnum.PASS.getCode());
//
autoAudit.setAuditorPhone(auditLogDTO.getApplyUserPhone());
//
autoAudit.setAuditorName(auditLogDTO.getAuditorName());
//
autoAudit.setAuditLogId(auditLogId);
//
autoAudit.setAuditReason("自动审批");
//
this.audit(autoAudit);
//
//
}
return
EnterpriseServiceResponse
.
success
();
...
...
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