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
3a4b005a
Commit
3a4b005a
authored
Jul 20, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存校验
parent
b7ca6282
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletions
+31
-1
HmLinkController.java
...gic/haoban/manage/web/controller/hm/HmLinkController.java
+31
-1
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmLinkController.java
View file @
3a4b005a
...
...
@@ -44,6 +44,7 @@ import com.gic.haoban.manage.api.service.hm.HmPageApiService;
import
com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService
;
import
com.gic.haoban.manage.api.service.out.WelcomeApiService
;
import
com.gic.haoban.manage.api.util.DataHttpUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.qo.hm.data.HmLinkChartQO
;
import
com.gic.haoban.manage.web.qo.hm.data.HmLinkClerkListQO
;
...
...
@@ -69,6 +70,7 @@ import com.gic.member.tag.api.service.MemberTagApiService;
*/
@RestController
@RequestMapping
(
"/hm/link"
)
@SuppressWarnings
(
"unchecked"
)
public
class
HmLinkController
{
private
static
org
.
apache
.
logging
.
log4j
.
Logger
logger
=
LogManager
.
getLogger
(
HmLinkController
.
class
);
...
...
@@ -87,6 +89,10 @@ public class HmLinkController {
@GicLogRecord
(
value
=
"${#logValue}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HM_LINK_ADD
,
userFunc
=
LogRecordUserServiceImpl
.
class
,
optPage
=
"引流链接-新建链接"
)
public
RestResponse
<
Object
>
save
(
@RequestBody
HmLinkDTO
dto
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
RestResponse
<
Object
>
checkResp
=
this
.
saveCheck
(
dto
)
;
if
(!
"0"
.
equals
(
checkResp
.
getCode
()))
{
return
checkResp
;
}
dto
.
setCreatorId
(
loginUser
.
getClerkId
());
dto
.
setCreatorName
(
loginUser
.
getClerkName
());
dto
.
setModifierId
(
loginUser
.
getClerkId
());
...
...
@@ -109,6 +115,10 @@ public class HmLinkController {
public
RestResponse
<
Object
>
update
(
@RequestBody
HmLinkDTO
dto
)
{
Long
linkId
=
dto
.
getLinkId
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
RestResponse
<
Object
>
checkResp
=
this
.
saveCheck
(
dto
)
;
if
(!
"0"
.
equals
(
checkResp
.
getCode
()))
{
return
checkResp
;
}
ServiceResponse
<
HmLinkDTO
>
resp
=
this
.
hmLinkApiService
.
getByLinkId
(
loginUser
.
getWxEnterpriseId
(),
loginUser
.
getEnterpriseId
(),
linkId
);
if
(!
resp
.
isSuccess
())
{
...
...
@@ -131,7 +141,27 @@ public class HmLinkController {
}
return
RestResponse
.
failure
(
saveResp
.
getCode
(),
saveResp
.
getResult
());
}
// 链接类型,名称,标签,分配规则,落地页模板
private
RestResponse
<
Object
>
saveCheck
(
HmLinkDTO
dto
)
{
if
(
StringUtils
.
isEmpty
(
dto
.
getName
()))
{
return
RestResponse
.
failure
(
"9999"
,
"链接名称不能为空"
)
;
}
if
(
StringUtils
.
isEmpty
(
dto
.
getMemberLabelId
()))
{
return
RestResponse
.
failure
(
"9999"
,
"链接标签不能为空"
)
;
}
if
(
null
==
dto
.
getPageId
())
{
return
RestResponse
.
failure
(
"9999"
,
"请选择落地页模板"
)
;
}
if
(
null
==
dto
.
getLinkId
())
{
return
RestResponse
.
failure
(
"9999"
,
"请选择链接类型"
)
;
}
if
(
StringUtils
.
isEmpty
(
dto
.
getStoreRuleJson
())
||
StringUtils
.
isEmpty
(
dto
.
getCustomRuleJson
()))
{
return
RestResponse
.
failure
(
"9999"
,
"请选择分配规则"
)
;
}
return
RestResponse
.
successResult
()
;
}
private
String
getUpdateLog
(
HmLinkDTO
oldDTO
,
HmLinkDTO
newDTO
)
{
String
wxEnterpriseId
=
newDTO
.
getWxEnterpriseId
();
String
enterpriseId
=
newDTO
.
getEnterpriseId
();
...
...
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