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
a86c85db
Commit
a86c85db
authored
Jul 12, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
链接
parent
08dd04f4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
4 deletions
+59
-4
HmLinkMapper.java
...gic/haoban/manage/service/dao/mapper/hm/HmLinkMapper.java
+4
-0
HmLinkService.java
...m/gic/haoban/manage/service/service/hm/HmLinkService.java
+6
-4
HmLinkServiceImpl.java
...ban/manage/service/service/hm/impl/HmLinkServiceImpl.java
+40
-0
HmLinkMapper.xml
...ge3-service/src/main/resources/mapper/hm/HmLinkMapper.xml
+6
-0
HmLinkController.java
...gic/haoban/manage/web/controller/hm/HmLinkController.java
+3
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/hm/HmLinkMapper.java
View file @
a86c85db
...
...
@@ -60,4 +60,7 @@ public interface HmLinkMapper {
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"startDate"
)
Date
startDate
,
@Param
(
"endDate"
)
Date
endDate
,
@Param
(
"linkType"
)
Integer
linkType
,
@Param
(
"searchParams"
)
String
searchParams
);
public
List
<
TabHmLink
>
queryPageRelationList
(
@Param
(
"pageId"
)
Long
pageId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmLinkService.java
View file @
a86c85db
...
...
@@ -11,11 +11,11 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO;
public
interface
HmLinkService
{
public
HmLinkBO
getByLinkId
(
String
wxEnterpriseId
,
String
enterprieId
,
Long
linkId
);
public
HmLinkBO
getByLinkId
(
String
wxEnterpriseId
,
String
enterprieId
,
Long
linkId
);
public
HmLinkBO
getByLinkShortCode
(
String
shortCode
);
public
HmLinkBO
getByLinkIdFormCache
(
String
wxEnterpriseId
,
String
enterprieId
,
Long
linkId
);
public
HmLinkBO
getByLinkIdFormCache
(
String
wxEnterpriseId
,
String
enterprieId
,
Long
linkId
);
public
List
<
HmLinkBO
>
listForSms
(
String
wxEnterpriseId
,
String
enterprieId
,
String
linkName
,
Integer
linkType
);
...
...
@@ -23,4 +23,6 @@ public interface HmLinkService {
public
Page
<
HmLinkBO
>
listPage
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
);
public
Page
<
HmLinkBO
>
queryPageRelationList
(
Long
pageId
,
String
enterpriseId
,
BasePageInfo
basePageInfo
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmLinkServiceImpl.java
View file @
a86c85db
...
...
@@ -19,11 +19,14 @@ import com.gic.commons.util.UniqueIdUtils;
import
com.gic.haoban.manage.api.dto.hm.HmLinkDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmLinkSearchQDTO
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.service.dao.mapper.hm.HmLinkMapper
;
import
com.gic.haoban.manage.service.entity.hm.TabHmLink
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.service.hm.HmLinkService
;
import
com.gic.haoban.manage.service.service.hm.HmLinkStoreService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -41,6 +44,8 @@ public class HmLinkServiceImpl implements HmLinkService {
private
HmLinkMapper
linkMapper
;
@Autowired
private
HmLinkStoreService
hmLinkStoreService
;
@Autowired
private
WelcomeRelationService
welcomeRelationService
;
@Override
public
HmLinkBO
getByLinkId
(
String
wxEnterpriseId
,
String
enterprieId
,
Long
linkId
)
{
...
...
@@ -86,6 +91,7 @@ public class HmLinkServiceImpl implements HmLinkService {
public
String
saveLink
(
HmLinkDTO
dto
,
List
<
HmLinkStoreDTO
>
storeList
)
{
// 新增
Long
linkId
=
dto
.
getLinkId
();
String
oldWelcomeId
=
null
;
if
(
null
==
linkId
)
{
linkId
=
UniqueIdUtils
.
uniqueLong
();
StringBuilder
sb
=
new
StringBuilder
(
"LJ"
).
append
(
"0"
).
append
(
dto
.
getLinkType
()).
append
(
linkId
);
...
...
@@ -97,6 +103,8 @@ public class HmLinkServiceImpl implements HmLinkService {
TabHmLink
entity
=
EntityUtil
.
changeEntityByJSON
(
TabHmLink
.
class
,
dto
);
this
.
linkMapper
.
insert
(
entity
);
}
else
{
TabHmLink
oldLink
=
this
.
linkMapper
.
selectById
(
linkId
);
oldWelcomeId
=
oldLink
.
getWelcomeId
();
TabHmLink
entity
=
EntityUtil
.
changeEntityByJSON
(
TabHmLink
.
class
,
dto
);
this
.
linkMapper
.
update
(
entity
);
}
...
...
@@ -106,10 +114,32 @@ public class HmLinkServiceImpl implements HmLinkService {
item
.
setEnterpriseId
(
dto
.
getEnterpriseId
());
});
}
String
newWelcomeId
=
dto
.
getWelcomeId
();
this
.
saveWelcomeRelation
(
oldWelcomeId
,
newWelcomeId
,
dto
);
this
.
hmLinkStoreService
.
saveStore
(
linkId
,
storeList
);
return
dto
.
getLinkCode
();
}
private
void
saveWelcomeRelation
(
String
oldWelcomeId
,
String
newWelcomeId
,
HmLinkDTO
dto
)
{
// 如果一样就返回
if
((
null
==
oldWelcomeId
&&
null
==
newWelcomeId
)
||
(
null
!=
oldWelcomeId
&&
null
!=
newWelcomeId
&&
oldWelcomeId
.
equals
(
newWelcomeId
)))
{
return
;
}
HmWelcomeRelationBO
welcome
=
new
HmWelcomeRelationBO
();
welcome
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
welcome
.
setEnterpriseId
(
dto
.
getEnterpriseId
());
welcome
.
setReferName
(
dto
.
getName
());
welcome
.
setRelationId
(
dto
.
getLinkId
());
welcome
.
setReferCode
(
dto
.
getLinkCode
());
welcome
.
setType
(
HmWelcomeReferType
.
LINK
.
getCode
());
// 新增
if
(!(
null
!=
oldWelcomeId
&&
newWelcomeId
==
null
))
{
welcome
.
setWelcomeId
(
newWelcomeId
);
}
this
.
welcomeRelationService
.
updateWelcomeRelation
(
welcome
);
}
@Override
public
Page
<
HmLinkBO
>
listPage
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
)
{
PageHelper
.
startPage
(
basePageInfo
);
...
...
@@ -123,6 +153,15 @@ public class HmLinkServiceImpl implements HmLinkService {
Page
<
HmLinkBO
>
retPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
list
,
HmLinkBO
.
class
);
return
retPage
;
}
@Override
public
Page
<
HmLinkBO
>
queryPageRelationList
(
Long
pageId
,
String
enterpriseId
,
BasePageInfo
basePageInfo
)
{
PageHelper
.
startPage
(
basePageInfo
);
List
<
TabHmLink
>
list
=
this
.
linkMapper
.
queryPageRelationList
(
pageId
,
enterpriseId
);
Page
<
HmLinkBO
>
retPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
list
,
HmLinkBO
.
class
);
return
retPage
;
}
public
String
shortCode
(
String
enterpriseId
)
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
@@ -146,6 +185,7 @@ public class HmLinkServiceImpl implements HmLinkService {
if
(
null
==
link
)
{
return
code
;
}
log
.
info
(
"code重复={}"
,
code
);
return
shortCode
(
enterpriseId
);
}
...
...
haoban-manage3-service/src/main/resources/mapper/hm/HmLinkMapper.xml
View file @
a86c85db
...
...
@@ -147,4 +147,9 @@
and status_flag = 1
</select>
<select
id=
"queryPageRelationList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_hm_link where page_id = #{pageId} and enterprise_id=#{enterpriseId}
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmLinkController.java
View file @
a86c85db
...
...
@@ -107,6 +107,9 @@ public class HmLinkController {
ServiceResponse
<
String
>
saveResp
=
this
.
hmLinkApiService
.
save
(
dto
);
if
(
saveResp
.
isSuccess
())
{
String
logContent
=
this
.
getUpdateLog
(
oldDTO
,
dto
);
if
(
StringUtils
.
isBlank
(
logContent
))
{
GicLogRecordEvaluationContext
.
noWriteLog
();
}
logger
.
info
(
logContent
);
GicLogRecordEvaluationContext
.
putAttribute
(
"logValue"
,
logContent
);
GicLogRecordEvaluationContext
.
putOptTargetId
(
AuthWebRequestUtil
.
getLoginUser
().
getClerkId
());
...
...
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