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
5b5858d3
Commit
5b5858d3
authored
Jan 28, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审批加备注字段
parent
a40b04a9
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
163 additions
and
9 deletions
+163
-9
DataSecurityAuditEnum.java
...va/com/gic/enterprise/constant/DataSecurityAuditEnum.java
+5
-1
AuditLogQO.java
...e-api/src/main/java/com/gic/enterprise/qo/AuditLogQO.java
+54
-0
AuditLogApiService.java
...n/java/com/gic/enterprise/service/AuditLogApiService.java
+7
-0
AuditLogService.java
...main/java/com/gic/enterprise/service/AuditLogService.java
+7
-0
AuditLogServiceImpl.java
.../com/gic/enterprise/service/impl/AuditLogServiceImpl.java
+9
-0
AuditLogApiServiceImpl.java
...enterprise/service/outer/impl/AuditLogApiServiceImpl.java
+33
-0
TabAuditLogMapper.xml
...e-service/src/main/resources/mapper/TabAuditLogMapper.xml
+24
-3
AuditLogController.java
...com/gic/enterprise/web/controller/AuditLogController.java
+24
-5
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/constant/DataSecurityAuditEnum.java
View file @
5b5858d3
...
...
@@ -23,7 +23,11 @@ public enum DataSecurityAuditEnum {
/**
* 超时
*/
OVER_TIME
(
3
,
"超时"
)
OVER_TIME
(
3
,
"超时"
),
/**
* 关闭
*/
CLOSE
(
4
,
"关闭"
),
;
private
Integer
code
;
private
String
msg
;
...
...
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/qo/AuditLogQO.java
View file @
5b5858d3
package
com
.
gic
.
enterprise
.
qo
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
*
...
...
@@ -29,6 +30,23 @@ public class AuditLogQO extends PageQO {
private
Integer
auditResult
;
private
String
auditReason
;
/**
* 1:我发起的 2:我收到的
*/
private
Integer
searchType
;
/**
* 当前登录人
*/
private
Integer
userId
;
private
List
<
Integer
>
auditorList
;
/**
* 是否是超管
*/
private
boolean
isAdminUser
;
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
...
...
@@ -92,4 +110,40 @@ public class AuditLogQO extends PageQO {
public
void
setAuditReason
(
String
auditReason
)
{
this
.
auditReason
=
auditReason
;
}
public
Integer
getSearchType
()
{
return
searchType
;
}
public
AuditLogQO
setSearchType
(
Integer
searchType
)
{
this
.
searchType
=
searchType
;
return
this
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
AuditLogQO
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
return
this
;
}
public
List
<
Integer
>
getAuditorList
()
{
return
auditorList
;
}
public
AuditLogQO
setAuditorList
(
List
<
Integer
>
auditorList
)
{
this
.
auditorList
=
auditorList
;
return
this
;
}
public
boolean
isAdminUser
()
{
return
isAdminUser
;
}
public
AuditLogQO
setAdminUser
(
boolean
adminUser
)
{
isAdminUser
=
adminUser
;
return
this
;
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/AuditLogApiService.java
View file @
5b5858d3
...
...
@@ -57,4 +57,11 @@ public interface AuditLogApiService {
* @throws
*/
ServiceResponse
<
Page
<
AuditLogDTO
>>
listAuditLog
(
AuditLogQO
auditLogQO
);
/**
* 关闭
* @param auditLogId
* @return
*/
ServiceResponse
<
Void
>
closeAuditLog
(
Integer
auditLogId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/AuditLogService.java
View file @
5b5858d3
...
...
@@ -64,6 +64,13 @@ public interface AuditLogService {
* @throws
*/
void
updateAudit
(
AuditLogDTO
auditLogDTO
);
/**
* 关闭
* @param auditLogId
* @return
*/
int
closeAudit
(
Integer
auditLogId
);
/**
* listAuditLog
* @Title: listAuditLog
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/AuditLogServiceImpl.java
View file @
5b5858d3
package
com
.
gic
.
enterprise
.
service
.
impl
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.constant.DataSecurityAuditEnum
;
import
com.gic.enterprise.dao.mapper.TabAuditLogMapper
;
import
com.gic.enterprise.dto.AuditLogDTO
;
import
com.gic.enterprise.entity.TabAuditLog
;
...
...
@@ -72,6 +73,14 @@ public class AuditLogServiceImpl implements AuditLogService {
}
@Override
public
int
closeAudit
(
Integer
auditLogId
)
{
TabAuditLog
auditLog
=
new
TabAuditLog
();
auditLog
.
setUpdateTime
(
new
Date
());
auditLog
.
setAuditResult
(
DataSecurityAuditEnum
.
CLOSE
.
getCode
());
return
tabAuditLogMapper
.
updateByPrimaryKeySelective
(
auditLog
);
}
@Override
public
Page
<
TabAuditLog
>
listAuditLog
(
AuditLogQO
auditLogQO
)
{
PageHelper
.
startPage
(
auditLogQO
.
getCurrentPage
(),
auditLogQO
.
getPageSize
());
return
tabAuditLogMapper
.
listAuditLog
(
auditLogQO
);
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AuditLogApiServiceImpl.java
View file @
5b5858d3
...
...
@@ -34,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -310,6 +311,21 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
@Override
public
ServiceResponse
<
Page
<
AuditLogDTO
>>
listAuditLog
(
AuditLogQO
auditLogQO
)
{
List
<
Integer
>
auditorList
=
new
ArrayList
<>();
boolean
isNeedSearchAuditor
=
!
auditLogQO
.
isAdminUser
()
&&
auditLogQO
.
getSearchType
()
!=
null
&&
auditLogQO
.
getSearchType
()
==
2
;
if
(
isNeedSearchAuditor
){
ServiceResponse
<
AuditorDTO
>
auditorDTOServiceResponse
=
auditorApiService
.
getAuditorByUserId
(
auditLogQO
.
getEnterpriseId
(),
auditLogQO
.
getUserId
());
if
(
auditorDTOServiceResponse
.
isSuccess
())
{
AuditorDTO
auditorDTO
=
auditorDTOServiceResponse
.
getResult
();
if
(
auditorDTO
!=
null
)
{
auditorList
.
add
(
auditorDTO
.
getAuditorId
());
}
}
if
(
auditLogQO
.
getUserId
()
!=
null
&&
auditorList
.
isEmpty
())
{
auditorList
.
add
(-
1
);
}
}
auditLogQO
.
setAuditorList
(
auditorList
);
com
.
github
.
pagehelper
.
Page
<
TabAuditLog
>
auditLogList
=
this
.
auditLogService
.
listAuditLog
(
auditLogQO
);
Date
currDate
=
new
Date
();
if
(
CollectionUtils
.
isNotEmpty
(
auditLogList
))
{
...
...
@@ -323,6 +339,23 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
return
EnterpriseServiceResponse
.
success
(
page
);
}
@Override
public
ServiceResponse
<
Void
>
closeAuditLog
(
Integer
auditLogId
)
{
TabAuditLog
record
=
auditLogService
.
getAuditById
(
auditLogId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"工单不存在"
);
}
boolean
isCanCloseStatus
=
DataSecurityAuditEnum
.
WAIT
.
getCode
().
equals
(
record
.
getAuditResult
());
if
(!
isCanCloseStatus
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"工单不能关闭"
);
}
int
updateNum
=
auditLogService
.
closeAudit
(
auditLogId
);
if
(
updateNum
>
0
)
{
return
ServiceResponse
.
success
();
}
return
ServiceResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
"更新失败"
);
}
private
void
sendWxMessage
(
AuditorDTO
auditorDTO
,
AuditLogDTO
auditLogDTO
)
{
TabEnterprise
enterprise
=
enterpriseService
.
getEnterpriseById
(
auditLogDTO
.
getEnterpriseId
());
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabAuditLogMapper.xml
View file @
5b5858d3
...
...
@@ -290,6 +290,7 @@
<include
refid=
"Base_Column_List"
/>
from tab_audit_log
where delete_flag = 0
and audit_type != 3
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
...
...
@@ -299,11 +300,31 @@
<if
test=
"endTime != null "
>
and apply_time
<
= #{endTime}
</if>
<if
test=
"searchType != null"
>
<if
test=
"searchType == 1"
>
and apply_user_id = #{userId}
</if>
<if
test=
"searchType == 2"
>
<if
test=
"auditorList != null and auditorList.size() > 0"
>
and auditor_id in
<foreach
collection=
"auditorList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
</if>
<if
test=
"auditResult != null"
>
<if
test=
"auditResult == 3"
>
and audit_expire_time
<
now()
</if>
<if
test=
"auditResult != 3"
>
and audit_result = #{auditResult}
</if>
</if>
<if
test=
"search != null and search != '' "
>
and ( apply_user_id like concat('%', #{search},'%')
or project_item_name like concat('%', #{search},'%')
and ( project_item_name like concat('%', #{search},'%')
or auditor_name like concat('%', #{search},'%')
or auditor_phone like concat('%', #{search},'%')
)
</if>
order by create_time desc
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/AuditLogController.java
View file @
5b5858d3
...
...
@@ -41,20 +41,29 @@ public class AuditLogController {
@RequestMapping
(
"/audit"
)
@IgnoreLogin
public
RestResponse
audit
(
@Validated
(
AuditLogQO
.
AuditView
.
class
)
AuditLogQO
auditLogQO
)
{
ServiceResponse
<
AuditLogDTO
>
auditorLogRes
=
auditLogApiService
.
getAuditLog
(
auditLogQO
.
getAuditLogId
());
if
(!
auditorLogRes
.
isSuccess
())
{
return
RestResponse
.
failure
(
auditorLogRes
.
getCode
(),
auditorLogRes
.
getMessage
());
}
AuditLogDTO
oldAuditLog
=
auditorLogRes
.
getResult
();
AuditLogDTO
auditLogDTO
=
new
AuditLogDTO
();
auditLogDTO
.
setAuditLogId
(
auditLogQO
.
getAuditLogId
());
auditLogDTO
.
setAuditResult
(
auditLogQO
.
getAuditResult
());
auditLogDTO
.
setAuditReason
(
auditLogQO
.
getAuditReason
());
UserDetail
userDetail
=
UserDetailUtils
.
getUserDetail
();
AuditorDTO
auditorDTO
;
if
(
StringUtils
.
isNotBlank
(
auditLogQO
.
getOpenid
()))
{
ServiceResponse
<
AuditorDTO
>
auditorServiceResponse
=
auditorApiService
.
getAuditorByOpenid
(
auditLogQO
.
getOpenid
());
//微信端审核
ServiceResponse
<
AuditorDTO
>
auditorServiceResponse
=
auditorApiService
.
getAuditorByOpenid
(
auditLogQO
.
getOpenid
(),
oldAuditLog
.
getEnterpriseId
());
if
(!
auditorServiceResponse
.
isSuccess
())
{
return
ResultControllerUtils
.
commonResult
(
auditorServiceResponse
);
}
auditorDTO
=
auditorServiceResponse
.
getResult
();
}
else
if
(
userDetail
!=
null
)
{
if
(
userDetail
.
getUserInfo
().
getSuperAdmin
()
==
0
)
{
//后端审核的情况,一定是关联管理员的审核员
ServiceResponse
<
AuditorDTO
>
auditorServiceResponse
=
auditorApiService
.
getAuditorByUserId
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
());
if
(!
auditorServiceResponse
.
isSuccess
())
{
return
ResultControllerUtils
.
commonResult
(
auditorServiceResponse
);
...
...
@@ -62,18 +71,22 @@ public class AuditLogController {
auditorDTO
=
auditorServiceResponse
.
getResult
();
}
else
{
auditorDTO
=
new
AuditorDTO
();
//超管没有审核员ID
auditorDTO
.
setAuditorId
(
null
);
audit
Log
DTO
.
setAuditorName
(
userDetail
.
getUserInfo
().
getUserName
());
audit
LogDTO
.
setAuditor
Phone
(
userDetail
.
getUserInfo
().
getPhoneNumber
());
audit
or
DTO
.
setAuditorName
(
userDetail
.
getUserInfo
().
getUserName
());
audit
orDTO
.
set
Phone
(
userDetail
.
getUserInfo
().
getPhoneNumber
());
}
}
else
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"参数错误"
);
}
auditLogDTO
.
setAuditorName
(
auditorDTO
.
getAuditorName
());
auditLogDTO
.
setAuditorPhone
(
auditorDTO
.
getPhone
());
auditLogDTO
.
setAuditorId
(
auditorDTO
.
getAuditorId
());
ServiceResponse
<
AuditLogDTO
>
serviceResponse
=
auditLogApiService
.
audit
(
auditLogDTO
);
if
(
serviceResponse
.
isSuccess
())
{
createLog
(
auditLogDTO
);
}
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
();
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
(),
serviceResponse
.
getResult
());
...
...
@@ -96,10 +109,16 @@ public class AuditLogController {
@RequestMapping
(
"/list-audit-log"
)
public
RestResponse
listAuditLog
(
AuditLogQO
auditLogQO
)
{
auditLogQO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
auditLogQO
.
setUserId
(
UserDetailUtils
.
getUserDetail
().
getUserId
());
ServiceResponse
<
Page
<
AuditLogDTO
>>
serviceResponse
=
this
.
auditLogApiService
.
listAuditLog
(
auditLogQO
);
return
ResultControllerUtils
.
commonResult
(
serviceResponse
);
}
@RequestMapping
(
"/list-audit-log"
)
public
RestResponse
close
(
Integer
auditLogId
)
{
return
ResultControllerUtils
.
commonResult
(
auditLogApiService
.
closeAuditLog
(
auditLogId
));
}
@RequestMapping
(
"/project-item-info"
)
public
RestResponse
projectItemInfo
(
String
projectItemCode
)
{
ServiceResponse
<
ProjectItemDTO
>
serviceResponse
=
this
.
projectItemApiService
.
getByProjectItemCode
(
projectItemCode
);
...
...
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