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
3b2b28b6
Commit
3b2b28b6
authored
Jul 12, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 操作日志
parent
ebb361fc
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
10 deletions
+39
-10
TabHaobanHmGroupSettingMapper.xml
...ain/resources/mapper/hm/TabHaobanHmGroupSettingMapper.xml
+1
-1
TabHaobanHmQrcodeMapper.xml
.../src/main/resources/mapper/hm/TabHaobanHmQrcodeMapper.xml
+1
-1
HmPageServiceTest.java
haoban-manage3-service/src/test/java/HmPageServiceTest.java
+1
-2
HmGroupController.java
...ic/haoban/manage/web/controller/hm/HmGroupController.java
+17
-2
HmPageController.java
...gic/haoban/manage/web/controller/hm/HmPageController.java
+19
-4
No files found.
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmGroupSettingMapper.xml
View file @
3b2b28b6
...
...
@@ -185,7 +185,7 @@
from tab_haoban_hm_group_setting
<where>
<if
test=
"groupName != null and groupName != ''"
>
group_name
= #{groupName}
group_name
like concat('%', #{groupName}, '%')
</if>
<if
test=
"status != null"
>
and `status` = #{status}
...
...
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmQrcodeMapper.xml
View file @
3b2b28b6
...
...
@@ -329,7 +329,7 @@
from tab_haoban_hm_qrcode
where status_flag != 0
and enterprise_id = #{enterpriseId}
<if
test=
"groupIds != null"
>
<if
test=
"groupIds != null
and groupIds.size > 0
"
>
and hm_group_id IN
<foreach
collection=
"groupIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
...
...
haoban-manage3-service/src/test/java/HmPageServiceTest.java
View file @
3b2b28b6
...
...
@@ -47,9 +47,8 @@ public class HmPageServiceTest {
@Test
public
void
queryPageList
(){
HmPageRelationQDTO
pageRelationQDTO
=
new
HmPageRelationQDTO
();
pageRelationQDTO
.
setPageId
(
4184
87207246970883
L
);
pageRelationQDTO
.
setPageId
(
4184
60224953786370
L
);
pageRelationQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
pageRelationQDTO
.
setSearchText
(
"LJ01419636016144465921"
);
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
pageServiceResponse
=
pageService
.
queryPageRelation
(
pageRelationQDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmGroupController.java
View file @
3b2b28b6
...
...
@@ -3,17 +3,20 @@ package com.gic.haoban.manage.web.controller.hm;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.PageResult2
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupQueryDTO
;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.web.controller.WebBaseController
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.qo.hm.HmGroupQO
;
import
com.gic.haoban.manage.web.vo.hm.HmGroupSettingVO
;
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
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -35,6 +38,8 @@ public class HmGroupController extends WebBaseController {
@Autowired
private
HmGroupApiService
groupApiService
;
@GicLogRecord
(
value
=
"${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
TEST_OPT
,
optPage
=
"员工活码"
,
userFunc
=
LogRecordUserServiceImpl
.
class
)
@RequestMapping
(
path
=
"/save"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
<?>
saveHmGroupSetting
(
@Valid
HmGroupSettingVO
hmGroupSettingVO
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
...
...
@@ -47,8 +52,10 @@ public class HmGroupController extends WebBaseController {
ServiceResponse
<
Long
>
serviceResponse
=
groupApiService
.
saveOrUpdateHmGroupSetting
(
hmGroupDTO
);
if
(
serviceResponse
.
isSuccess
()){
String
logContent
=
"新增分组【"
+
hmGroupDTO
.
getGroupName
()
+
"】"
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
GicLogRecordEvaluationContext
.
noWriteLog
();
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
@@ -67,6 +74,8 @@ public class HmGroupController extends WebBaseController {
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
@GicLogRecord
(
value
=
"${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
TEST_OPT
,
optPage
=
"员工活码"
,
userFunc
=
LogRecordUserServiceImpl
.
class
)
@RequestMapping
(
path
=
"/edit"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
<?>
editHmGroupSetting
(
@Valid
HmGroupSettingVO
hmGroupSettingVO
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
...
...
@@ -84,11 +93,15 @@ public class HmGroupController extends WebBaseController {
if
(
serviceResponse
.
isSuccess
()){
String
oldGroupName
=
Optional
.
ofNullable
(
queryGroupDetail
.
getResult
()).
map
(
HmGroupDTO:
:
getGroupName
).
orElse
(
""
);
String
logContent
=
"修改分组【"
+
hmGroupDTO
.
getGroupName
()
+
"】:分组名称「 "
+
oldGroupName
+
"」变更为「 "
+
hmGroupDTO
.
getGroupName
()
+
"」"
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
GicLogRecordEvaluationContext
.
noWriteLog
();
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
@GicLogRecord
(
value
=
"${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
TEST_OPT
,
optPage
=
"员工活码"
,
userFunc
=
LogRecordUserServiceImpl
.
class
)
@RequestMapping
(
path
=
"/delete"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
<?>
deleteHmGroupSetting
(
HmGroupSettingVO
hmGroupSettingVO
){
if
(
hmGroupSettingVO
.
getGroupId
()
==
null
){
...
...
@@ -104,8 +117,10 @@ public class HmGroupController extends WebBaseController {
ServiceResponse
<
Boolean
>
serviceResponse
=
groupApiService
.
deleteGroupSetting
(
hmGroupDTO
);
if
(
serviceResponse
.
isSuccess
()){
String
logContent
=
"删除分组【"
+
queryGroupDetail
.
getResult
().
getGroupName
()+
"】"
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
GicLogRecordEvaluationContext
.
noWriteLog
();
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmPageController.java
View file @
3b2b28b6
...
...
@@ -3,20 +3,22 @@ package com.gic.haoban.manage.web.controller.hm;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.PageResult2
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.hm.HmPageDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageRelationDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmPageQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmPageRelationQDTO
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.qo.hm.HmPageListQO
;
import
com.gic.haoban.manage.web.qo.hm.HmPageSettingReq
;
import
com.gic.haoban.manage.web.vo.hm.PageRelationVO
;
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
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -39,6 +41,8 @@ public class HmPageController {
@Autowired
private
HmPageApiService
pageApiService
;
@GicLogRecord
(
value
=
"${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
TEST_OPT
,
optPage
=
"引流链接-落地页模板-新建模板"
,
userFunc
=
LogRecordUserServiceImpl
.
class
)
@RequestMapping
(
path
=
"/page/save"
)
public
RestResponse
<?>
savePage
(
@Valid
HmPageSettingReq
pageSettingReq
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
...
...
@@ -57,13 +61,16 @@ public class HmPageController {
ServiceResponse
<
Long
>
serviceResponse
=
pageApiService
.
saveOrUpdateHmPage
(
pageDTO
);
if
(
serviceResponse
.
isSuccess
()){
String
logContent
=
"新增落地页模板【MB01"
+
serviceResponse
.
getResult
()+
"-"
+
pageSettingReq
.
getPageName
()
+
"】"
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
GicLogRecordEvaluationContext
.
putAttribute
(
"saved"
,
Boolean
.
FALSE
);
GicLogRecordEvaluationContext
.
noWriteLog
(
);
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
@GicLogRecord
(
value
=
"${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
TEST_OPT
,
optPage
=
"引流链接-落地页模板-编辑模板"
,
userFunc
=
LogRecordUserServiceImpl
.
class
)
@RequestMapping
(
path
=
"/page/edit"
)
public
RestResponse
<?>
editPage
(
@Valid
HmPageSettingReq
pageSettingReq
){
...
...
@@ -90,8 +97,10 @@ public class HmPageController {
ServiceResponse
<
Long
>
serviceResponse
=
pageApiService
.
saveOrUpdateHmPage
(
pageDTO
);
if
(
serviceResponse
.
isSuccess
()){
String
logContent
=
this
.
buildEditPageContent
(
pageDTO
,
queryPageDetail
.
getResult
());
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
GicLogRecordEvaluationContext
.
noWriteLog
();
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
@@ -152,6 +161,8 @@ public class HmPageController {
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
@GicLogRecord
(
value
=
"${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
TEST_OPT
,
optPage
=
"引流链接-落地页模板"
,
userFunc
=
LogRecordUserServiceImpl
.
class
)
@RequestMapping
(
path
=
"/page/delete"
)
public
RestResponse
<?>
deletePage
(
Long
pageId
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
...
...
@@ -164,9 +175,10 @@ public class HmPageController {
ServiceResponse
<
Boolean
>
serviceResponse
=
pageApiService
.
deleteHmPage
(
hmPageDTO
);
if
(
serviceResponse
.
isSuccess
()){
String
logContent
=
"删除落地页模板【"
+
queryPageDetail
.
getResult
().
getPageTitle
()
+
"-"
+
queryPageDetail
.
getResult
().
getPageName
()+
"】"
;
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
logContent
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
GicLogRecordEvaluationContext
.
noWriteLog
();
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
@@ -178,11 +190,14 @@ public class HmPageController {
@RequestMapping
(
path
=
"/page/relation"
)
public
RestResponse
<?>
queryPageRelationList
(
PageRelationVO
pageRelationVO
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
HmPageRelationQDTO
pageRelationQueryDTO
=
new
HmPageRelationQDTO
();
pageRelationQueryDTO
.
setPageNum
(
pageRelationVO
.
getPageNum
());
pageRelationQueryDTO
.
setPageSize
(
pageRelationVO
.
getPageSize
());
pageRelationQueryDTO
.
setSearchText
(
pageRelationVO
.
getSearchContent
());
pageRelationQueryDTO
.
setPageId
(
pageRelationVO
.
getPageId
());
pageRelationQueryDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
pageRelationQueryDTO
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
serviceResponse
=
pageApiService
.
queryPageRelation
(
pageRelationQueryDTO
);
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
...
...
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