Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
587f1761
Commit
587f1761
authored
Jul 12, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:活码操作日志
parent
f2b90f1e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
31 deletions
+29
-31
LogRecordAfterServiceImpl.java
...e/service/service/impl/log/LogRecordAfterServiceImpl.java
+6
-3
LogRecordBeforeServiceImpl.java
.../service/service/impl/log/LogRecordBeforeServiceImpl.java
+0
-21
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+23
-7
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/log/LogRecordAfterServiceImpl.java
View file @
587f1761
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
.
log
;
import
com.gic.log.record.bean.GicLogRecordBean
;
import
com.gic.log.record.service.LogRecordAfterService
;
import
com.gic.log.record.util.GicLogRecordEvaluationContext
;
import
org.slf4j.Logger
;
import
org.springframework.stereotype.Service
;
...
...
@@ -13,9 +13,12 @@ public class LogRecordAfterServiceImpl extends LogRecordAfterService {
private
static
final
Logger
logger
=
getLogger
(
LogRecordAfterServiceImpl
.
class
);
@Override
public
void
deal
(
GicLogRecordBean
gicLogRecordBean
)
{
logger
.
info
(
"之后执行"
);
gicLogRecordBean
.
setEnterpriseId
(
GicLogRecordEvaluationContext
.
getAttribute
(
"enterpriseId"
,
String
.
class
));
gicLogRecordBean
.
setWxEnterpriseId
(
GicLogRecordEvaluationContext
.
getAttribute
(
"wxEnterpriseId"
,
String
.
class
));
gicLogRecordBean
.
setUserId
(
GicLogRecordEvaluationContext
.
getAttribute
(
"userId"
,
String
.
class
));
gicLogRecordBean
.
setUserName
(
GicLogRecordEvaluationContext
.
getAttribute
(
"userName"
,
String
.
class
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/log/LogRecordBeforeServiceImpl.java
deleted
100644 → 0
View file @
f2b90f1e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
.
log
;
import
com.gic.log.record.bean.GicLogRecordBean
;
import
com.gic.log.record.service.LogRecordBeforeService
;
import
org.slf4j.Logger
;
import
org.springframework.stereotype.Service
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
@Service
public
class
LogRecordBeforeServiceImpl
extends
LogRecordBeforeService
{
private
static
final
Logger
logger
=
getLogger
(
LogRecordBeforeServiceImpl
.
class
);
@Override
public
void
deal
(
GicLogRecordBean
gicLogRecordBean
)
{
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
587f1761
...
...
@@ -32,7 +32,6 @@ import com.gic.haoban.manage.service.service.hm.HmGroupService;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.haoban.manage.service.service.impl.log.LogRecordAfterServiceImpl
;
import
com.gic.haoban.manage.service.service.impl.log.LogRecordBeforeServiceImpl
;
import
com.gic.haoban.manage.service.util.QwFriendLimitCountUtil
;
import
com.gic.log.record.anno.GicLogRecord
;
import
com.gic.log.record.util.GicLogRecordCategoryEnum
;
...
...
@@ -92,7 +91,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_ADD
,
optPage
=
"活码管理-新增员工活码"
,
beforeFunc
=
LogRecordBeforeServiceImpl
.
class
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -138,10 +136,29 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
// save welcome relation
this
.
saveWelcomeRelation
(
hmQrcodeQDTO
);
}
setLoggerContext
(
hmQrcodeQDTO
.
getEnterpriseId
(),
wxEnterpriseId
,
hmQrcodeQDTO
.
getCreatorId
(),
hmQrcodeQDTO
.
getCreatorName
());
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
"【"
+
hmId
+
"-"
+
hmQrcodeQDTO
.
getName
()+
"】"
);
return
saveResult
;
}
/**
* 设置日志记录器上下文
* 日志
*
* @param enterpriseId 企业标识
* @param wxEnterpriseId wx企业标识
* @param userId 用户id
* @param userName 用户名
* @author mozhu
* @date 2022-07-12 14:20:44
*/
private
void
setLoggerContext
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
userId
,
String
userName
)
{
GicLogRecordEvaluationContext
.
putAttribute
(
"enterpriseId"
,
enterpriseId
);
GicLogRecordEvaluationContext
.
putAttribute
(
"wxEnterpriseId"
,
wxEnterpriseId
);
GicLogRecordEvaluationContext
.
putAttribute
(
"userId"
,
userId
);
GicLogRecordEvaluationContext
.
putAttribute
(
"userName"
,
userName
);
}
private
void
saveWelcomeRelation
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
welcomeRelationBo
.
setEnterpriseId
(
hmQrcodeQDTO
.
getEnterpriseId
());
...
...
@@ -156,9 +173,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@GicLogRecord
(
value
=
"修改员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_
ADD
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_
EDIT
,
optPage
=
"活码管理-修改员工活码"
,
beforeFunc
=
LogRecordBeforeServiceImpl
.
class
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -194,6 +210,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
// 更新欢迎语引用次数
this
.
updateWelcomeRelation
(
hmQrcodeQDTO
);
}
setLoggerContext
(
hmQrcodeQDTO
.
getEnterpriseId
(),
wxEnterpriseId
,
hmQrcodeQDTO
.
getModifierId
(),
hmQrcodeQDTO
.
getModifierName
());
String
logContent
=
""
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
updateResult
;
...
...
@@ -317,9 +334,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@GicLogRecord
(
value
=
"废弃员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_
ADD
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_
DEL
,
optPage
=
"活码管理-废弃员工活码"
,
beforeFunc
=
LogRecordBeforeServiceImpl
.
class
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -333,7 +349,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if
(
flag
)
{
hmQrcodeService
.
deleteById
(
hmId
);
}
setLoggerContext
(
hmQrcodeBO
.
getEnterpriseId
(),
hmQrcodeBO
.
getWxEnterpriseId
(),
hmQrcodeBO
.
getModifierId
(),
hmQrcodeBO
.
getModifierName
());
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
"【"
+
hmId
+
"-"
+
hmQrcodeBO
.
getName
()+
"】"
);
return
true
;
}
...
...
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