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
d5995187
Commit
d5995187
authored
Jul 12, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:活码操作日志
parent
af5a5d1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
9 deletions
+81
-9
LogRecordAfterServiceImpl.java
...e/service/service/impl/log/LogRecordAfterServiceImpl.java
+21
-0
LogRecordBeforeServiceImpl.java
.../service/service/impl/log/LogRecordBeforeServiceImpl.java
+21
-0
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+39
-9
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/log/LogRecordAfterServiceImpl.java
0 → 100644
View file @
d5995187
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
.
log
;
import
com.gic.log.record.bean.GicLogRecordBean
;
import
com.gic.log.record.service.LogRecordAfterService
;
import
org.slf4j.Logger
;
import
org.springframework.stereotype.Service
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
@Service
public
class
LogRecordAfterServiceImpl
extends
LogRecordAfterService
{
private
static
final
Logger
logger
=
getLogger
(
LogRecordAfterServiceImpl
.
class
);
@Override
public
void
deal
(
GicLogRecordBean
gicLogRecordBean
)
{
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/log/LogRecordBeforeServiceImpl.java
0 → 100644
View file @
d5995187
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 @
d5995187
...
...
@@ -31,7 +31,13 @@ import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
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
;
import
com.gic.log.record.util.GicLogRecordEvaluationContext
;
import
com.gic.log.record.util.GicLogRecordOptTypeEnum
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO
;
import
com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO
;
...
...
@@ -81,6 +87,13 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Autowired
private
WelcomeRelationService
welcomeRelationService
;
@GicLogRecord
(
value
=
"新增员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_ADD
,
optPage
=
"活码管理-新增员工活码"
,
beforeFunc
=
LogRecordBeforeServiceImpl
.
class
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
add
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
...
...
@@ -117,31 +130,36 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmQrcodeQDTO
.
setWxConfigId
(
qywxExternalcontactResultDTO
.
getConfig_id
());
}
int
saveResult
=
hmQrcodeService
.
insert
(
hmQrcodeQDTO
);
if
(
saveResult
==
1
){
if
(
saveResult
==
1
)
{
// update group refer count
if
(
hmQrcodeQDTO
.
getHmGroupId
()
!=
null
){
if
(
hmQrcodeQDTO
.
getHmGroupId
()
!=
null
)
{
groupService
.
updateGroupRelationCount
(
hmQrcodeQDTO
.
getHmGroupId
(),
1
);
}
// save welcome relation
this
.
saveWelcomeRelation
(
hmQrcodeQDTO
);
}
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
"【"
+
hmId
+
"-"
+
hmQrcodeQDTO
.
getName
()+
"】"
);
return
saveResult
;
}
private
void
saveWelcomeRelation
(
HmQrcodeQDTO
hmQrcodeQDTO
){
private
void
saveWelcomeRelation
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
welcomeRelationBo
.
setEnterpriseId
(
hmQrcodeQDTO
.
getEnterpriseId
());
welcomeRelationBo
.
setWxEnterpriseId
(
hmQrcodeQDTO
.
getWxEnterpriseId
());
welcomeRelationBo
.
setWelcomeId
(
hmQrcodeQDTO
.
getWelcomeId
());
welcomeRelationBo
.
setReferId
(
hmQrcodeQDTO
.
getHmId
()
+
""
);
welcomeRelationBo
.
setReferId
(
hmQrcodeQDTO
.
getHmId
()
+
""
);
welcomeRelationBo
.
setReferCode
(
hmQrcodeQDTO
.
getHmCode
());
welcomeRelationBo
.
setReferName
(
hmQrcodeQDTO
.
getName
());
welcomeRelationBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
welcomeRelationService
.
saveHmWelcomeRelation
(
welcomeRelationBo
);
}
@GicLogRecord
(
value
=
"修改员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_ADD
,
optPage
=
"活码管理-修改员工活码"
,
beforeFunc
=
LogRecordBeforeServiceImpl
.
class
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
update
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
...
...
@@ -171,25 +189,28 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return
0
;
}
int
updateResult
=
hmQrcodeService
.
update
(
hmQrcodeQDTO
);
if
(
updateResult
==
1
){
if
(
updateResult
==
1
)
{
// 更新分组引用次数
// 更新欢迎语引用次数
this
.
updateWelcomeRelation
(
hmQrcodeQDTO
);
}
String
logContent
=
""
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
updateResult
;
}
/**
* 更新活码 欢迎语引用关系
*
* @param hmQrcodeQDTO
*/
private
void
updateWelcomeRelation
(
HmQrcodeQDTO
hmQrcodeQDTO
){
private
void
updateWelcomeRelation
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
welcomeRelationBo
.
setEnterpriseId
(
hmQrcodeQDTO
.
getEnterpriseId
());
welcomeRelationBo
.
setWxEnterpriseId
(
hmQrcodeQDTO
.
getWxEnterpriseId
());
welcomeRelationBo
.
setWelcomeId
(
hmQrcodeQDTO
.
getWelcomeId
());
welcomeRelationBo
.
setReferId
(
hmQrcodeQDTO
.
getHmId
()
+
""
);
welcomeRelationBo
.
setReferId
(
hmQrcodeQDTO
.
getHmId
()
+
""
);
welcomeRelationBo
.
setReferCode
(
hmQrcodeQDTO
.
getHmCode
());
welcomeRelationBo
.
setReferName
(
hmQrcodeQDTO
.
getName
());
welcomeRelationBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
...
...
@@ -294,7 +315,14 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return
EntityUtil
.
changeEntityNew
(
HmQrcodeDTO
.
class
,
hmQrcodeService
.
queryById
(
hmId
));
}
@GicLogRecord
(
value
=
"废弃员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_ADD
,
optPage
=
"活码管理-废弃员工活码"
,
beforeFunc
=
LogRecordBeforeServiceImpl
.
class
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
delById
(
Long
hmId
)
{
HmQrcodeBO
hmQrcodeBO
=
hmQrcodeService
.
queryById
(
hmId
);
if
(
hmQrcodeBO
==
null
)
{
...
...
@@ -305,6 +333,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if
(
flag
)
{
hmQrcodeService
.
deleteById
(
hmId
);
}
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