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
b7734300
Commit
b7734300
authored
Jul 11, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
c86d2555
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
23 deletions
+39
-23
HmLinkController.java
...gic/haoban/manage/web/controller/hm/HmLinkController.java
+39
-23
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmLinkController.java
View file @
b7734300
...
...
@@ -54,7 +54,7 @@ import com.gic.web.common.utils.SessionContextUtils;
public
class
HmLinkController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
HmLinkController
.
class
);
@Autowired
private
HmLinkApiService
hmLinkApiService
;
@Autowired
...
...
@@ -75,12 +75,12 @@ public class HmLinkController {
dto
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
dto
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
ServiceResponse
<
String
>
resp
=
this
.
hmLinkApiService
.
save
(
dto
);
//
if (resp.isSuccess()) {
String
logContent
=
"新增引流链接【"
+
resp
.
getResult
()
+
"-"
+
dto
.
getName
()
+
"】"
;
logger
.
info
(
logContent
);
GicLogRecordEvaluationContext
.
putAttribute
(
"logValue"
,
logContent
);
GicLogRecordEvaluationContext
.
putOptTargetId
(
AuthWebRequestUtil
.
getLoginUser
().
getClerkId
());
// }
//
if (resp.isSuccess()) {
String
logContent
=
"新增引流链接【"
+
resp
.
getResult
()
+
"-"
+
dto
.
getName
()
+
"】"
;
logger
.
info
(
logContent
);
GicLogRecordEvaluationContext
.
putAttribute
(
"logValue"
,
logContent
);
GicLogRecordEvaluationContext
.
putOptTargetId
(
AuthWebRequestUtil
.
getLoginUser
().
getClerkId
());
// }
return
RestResponse
.
successResult
();
}
...
...
@@ -110,18 +110,25 @@ public class HmLinkController {
String
enterpriseId
=
newDTO
.
getEnterpriseId
();
StringBuilder
sb
=
new
StringBuilder
(
"编辑引流活码"
).
append
(
"【"
).
append
(
oldDTO
.
getLinkCode
()).
append
(
"-"
)
.
append
(
oldDTO
.
getName
()).
append
(
"】:"
);
comp
(
wxEnterpriseId
,
enterpriseId
,
"链接名称"
,
oldDTO
.
getName
(),
newDTO
.
getName
(),
sb
,
0
);
comp
(
wxEnterpriseId
,
enterpriseId
,
"链接描述"
,
oldDTO
.
getRemark
(),
newDTO
.
getRemark
(),
sb
,
0
);
comp
(
wxEnterpriseId
,
enterpriseId
,
"分配规则"
,
oldDTO
.
getStoreRuleJson
(),
newDTO
.
getStoreRuleJson
(),
sb
,
3
);
comp
(
wxEnterpriseId
,
enterpriseId
,
"分配规则"
,
oldDTO
.
getCustomRuleJson
(),
newDTO
.
getCustomRuleJson
(),
sb
,
4
);
comp
(
wxEnterpriseId
,
enterpriseId
,
"链接标签"
,
oldDTO
.
getMemberLabelId
(),
newDTO
.
getMemberLabelId
(),
sb
,
1
);
comp
(
wxEnterpriseId
,
enterpriseId
,
"欢迎语"
,
oldDTO
.
getWelcomeId
(),
newDTO
.
getWelcomeId
(),
sb
,
2
);
return
sb
.
toString
();
StringBuilder
content
=
new
StringBuilder
();
String
a
=
comp
(
wxEnterpriseId
,
enterpriseId
,
"链接名称"
,
oldDTO
.
getName
(),
newDTO
.
getName
(),
0
);
String
b
=
comp
(
wxEnterpriseId
,
enterpriseId
,
"链接描述"
,
oldDTO
.
getRemark
(),
newDTO
.
getRemark
(),
0
);
String
c
=
comp
(
wxEnterpriseId
,
enterpriseId
,
"分配规则"
,
oldDTO
.
getStoreRuleJson
(),
newDTO
.
getStoreRuleJson
(),
3
);
String
d
=
comp
(
wxEnterpriseId
,
enterpriseId
,
"分配规则"
,
oldDTO
.
getCustomRuleJson
(),
newDTO
.
getCustomRuleJson
(),
4
);
String
e
=
comp
(
wxEnterpriseId
,
enterpriseId
,
"链接标签"
,
oldDTO
.
getMemberLabelId
(),
newDTO
.
getMemberLabelId
(),
1
);
String
f
=
comp
(
wxEnterpriseId
,
enterpriseId
,
"欢迎语"
,
oldDTO
.
getWelcomeId
(),
newDTO
.
getWelcomeId
(),
2
);
content
.
append
(
a
).
append
(
b
).
append
(
c
).
append
(
c
).
append
(
d
).
append
(
e
).
append
(
f
);
if
(
content
.
toString
().
length
()
==
0
)
{
return
null
;
}
return
sb
.
append
(
content
).
toString
();
}
// type 会员标签1 , 2 欢迎语
public
void
comp
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
title
,
String
oldValue
,
String
newValue
,
StringBuilder
sb
,
int
type
)
{
public
String
comp
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
title
,
String
oldValue
,
String
newValue
,
int
type
)
{
StringBuilder
sb
=
new
StringBuilder
();
if
(
null
==
oldValue
)
{
oldValue
=
""
;
}
...
...
@@ -130,6 +137,7 @@ public class HmLinkController {
}
if
(
type
==
0
&&
!
oldValue
.
equals
(
newValue
))
{
sb
.
append
(
title
).
append
(
"「"
).
append
(
oldValue
).
append
(
"」变更「"
).
append
(
newValue
).
append
(
"」"
);
return
sb
.
toString
();
}
// 会员标签
if
(
type
==
1
&&
!
oldValue
.
equals
(
newValue
))
{
...
...
@@ -142,15 +150,19 @@ public class HmLinkController {
newValue
=
newResp
.
getTagName
()
+
"-"
+
newResp
.
getTagItemName
();
}
sb
.
append
(
title
).
append
(
"「"
).
append
(
oldValue
).
append
(
"」变更「"
).
append
(
newValue
).
append
(
"」"
);
}
// 欢迎语
return
sb
.
toString
();
}
// 欢迎语
if
(
type
==
2
&&
!
oldValue
.
equals
(
newValue
))
{
if
(
StringUtils
.
isEmpty
(
oldValue
))
{
ServiceResponse
<
WelcomeDetailDTO
>
resp
=
this
.
welcomeApiService
.
getWelcome
(
newValue
,
enterpriseId
);
if
(
null
!=
resp
&&
null
!=
resp
.
getResult
())
{
sb
.
append
(
"欢迎语变更为"
).
append
(
"「"
).
append
(
resp
.
getResult
().
getTitle
()).
append
(
"」"
);
return
sb
.
toString
();
}
}
else
if
(
StringUtils
.
isEmpty
(
newValue
))
{
sb
.
append
(
"欢迎语变更为"
).
append
(
"「"
).
append
(
"不发送欢迎语"
).
append
(
"」"
);
return
sb
.
toString
();
}
else
{
ServiceResponse
<
WelcomeDetailDTO
>
oldResp
=
this
.
welcomeApiService
.
getWelcome
(
oldValue
,
enterpriseId
);
ServiceResponse
<
WelcomeDetailDTO
>
newResp
=
this
.
welcomeApiService
.
getWelcome
(
newValue
,
enterpriseId
);
...
...
@@ -161,13 +173,14 @@ public class HmLinkController {
newValue
=
newResp
.
getResult
().
getTitle
();
}
sb
.
append
(
title
).
append
(
"「"
).
append
(
oldValue
).
append
(
"」变更「"
).
append
(
newValue
).
append
(
"」"
);
return
sb
.
toString
();
}
}
// 分批规则
if
(
type
==
3
)
{
JSONObject
oldStoreRuleObj
=
JSONObject
.
parseObject
(
oldValue
);
JSONObject
newStoreRuleObj
=
JSONObject
.
parseObject
(
newValue
);
logger
.
info
(
"{},{}"
,
oldStoreRuleObj
,
newStoreRuleObj
);
logger
.
info
(
"{},{}"
,
oldStoreRuleObj
,
newStoreRuleObj
);
// 层级一-
HmLinkStoreSettingDTO
oldFwStore
=
oldStoreRuleObj
.
getObject
(
"fw_store"
,
HmLinkStoreSettingDTO
.
class
);
HmLinkStoreSettingDTO
newFwStore
=
newStoreRuleObj
.
getObject
(
"fw_store"
,
HmLinkStoreSettingDTO
.
class
);
...
...
@@ -176,13 +189,16 @@ public class HmLinkController {
HmLinkStoreSettingDTO
oldXgStore
=
oldStoreRuleObj
.
getObject
(
"xg_store"
,
HmLinkStoreSettingDTO
.
class
);
HmLinkStoreSettingDTO
newXgStore
=
newStoreRuleObj
.
getObject
(
"xg_store"
,
HmLinkStoreSettingDTO
.
class
);
ruleLog
(
oldXgStore
,
newXgStore
,
sb
,
2
);
return
sb
.
toString
();
}
if
(
type
==
4
)
{
JSONObject
oldStoreRuleObj
=
JSONObject
.
parseObject
(
oldValue
);
JSONObject
newStoreRuleObj
=
JSONObject
.
parseObject
(
newValue
);
logger
.
info
(
"{},{}"
,
oldStoreRuleObj
,
newStoreRuleObj
);
logger
.
info
(
"{},{}"
,
oldStoreRuleObj
,
newStoreRuleObj
);
otherStoreRuleLog
(
oldStoreRuleObj
,
newStoreRuleObj
,
sb
);
}
return
null
;
}
private
static
void
otherStoreRuleLog
(
JSONObject
oldStoreRuleObj
,
JSONObject
newStoreRuleObj
,
StringBuilder
sb
)
{
...
...
@@ -210,11 +226,11 @@ public class HmLinkController {
tempSb
.
append
(
cityLog
);
}
else
{
if
(
newStoreType
==
1
)
{
tempSb
.
append
(
ruleLog
1
(
oldtore
,
newStore
,
sb
,
5
));
tempSb
.
append
(
ruleLog
Other
(
oldtore
,
newStore
,
sb
,
5
));
}
else
if
(
newStoreType
==
2
)
{
tempSb
.
append
(
ruleLog
1
(
oldtore
,
newStore
,
sb
,
6
));
tempSb
.
append
(
ruleLog
Other
(
oldtore
,
newStore
,
sb
,
6
));
}
tempSb
.
append
(
ruleLog
1
(
oldCityStore
,
newCityStore
,
sb
,
4
));
tempSb
.
append
(
ruleLog
Other
(
oldCityStore
,
newCityStore
,
sb
,
4
));
}
}
...
...
@@ -250,7 +266,7 @@ public class HmLinkController {
}
private
static
String
ruleLog
1
(
HmLinkStoreSettingDTO
oldStore
,
HmLinkStoreSettingDTO
newStore
,
StringBuilder
sb
,
private
static
String
ruleLog
Other
(
HmLinkStoreSettingDTO
oldStore
,
HmLinkStoreSettingDTO
newStore
,
StringBuilder
sb
,
int
level
)
{
StringBuilder
tempSb
=
new
StringBuilder
();
String
title
=
""
;
...
...
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