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
3952fee8
Commit
3952fee8
authored
Apr 20, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改sql
parent
4e6975f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
AuditLogApiServiceImpl.java
...enterprise/service/outer/impl/AuditLogApiServiceImpl.java
+30
-10
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AuditLogApiServiceImpl.java
View file @
3952fee8
...
...
@@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -104,17 +105,21 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
auditLogDTO
.
setApplyUserName
(
userServiceResponse
.
getResult
().
getUserName
());
auditLogDTO
.
setApplyUserPhone
(
userServiceResponse
.
getResult
().
getPhoneNumber
());
// 判断有没有审核员, 没有审核员就返回错误
ServiceResponse
<
List
<
AuditorDTO
>>
auditorResponse
=
auditorApiService
.
listAuditorByProject
(
auditLogDTO
.
getProjectItemId
(),
auditLogDTO
.
getApplyUserId
(),
auditLogDTO
.
getEnterpriseId
());
if
(!
auditorResponse
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
auditorResponse
.
getCode
(),
auditorResponse
.
getMessage
());
}
List
<
AuditorDTO
>
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
(),
"审核员没有绑定微信或管理员"
);
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
(
Constants
.
DEL_STATUS
.
equals
(
projectItem
.
getUseStatus
()))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"该审批项已被禁用"
);
...
...
@@ -169,6 +174,21 @@ 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
.
setAuditReason
(
"自动审批"
);
this
.
audit
(
autoAudit
);
}
return
EnterpriseServiceResponse
.
success
();
}
...
...
@@ -176,7 +196,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
AuditLogDTO
>
audit
(
AuditLogDTO
auditLogDTO
)
{
// 完成待办事项
todoItemApiService
.
finishTodoItem
(
auditLogDTO
.
getEnterpriseId
(),
auditLogDTO
.
getAuditorId
(),
com
.
gic
.
enterprise
.
constant
.
Constants
.
TODO_ITEM_AUDIT
,
"www.baidu.com
?auditLogId="
+
auditLogDTO
.
getAuditLogId
());
todoItemApiService
.
finishTodoItem
(
auditLogDTO
.
getEnterpriseId
(),
auditLogDTO
.
getAuditorId
(),
com
.
gic
.
enterprise
.
constant
.
Constants
.
TODO_ITEM_AUDIT
,
com
.
gic
.
enterprise
.
constant
.
Constants
.
TODO_ITEM_AUDIT_URL
+
"
?auditLogId="
+
auditLogDTO
.
getAuditLogId
());
TabAuditLog
auditLog
=
this
.
auditLogService
.
getAuditById
(
auditLogDTO
.
getAuditLogId
());
if
(
auditLog
==
null
)
{
...
...
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