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
def39d93
Commit
def39d93
authored
Jul 12, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 移除落地页关联表
parent
d8d08512
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
186 additions
and
553 deletions
+186
-553
HmLinkMapper.java
...gic/haoban/manage/service/dao/mapper/hm/HmLinkMapper.java
+2
-1
TabHaobanHmPageRelationMapper.java
.../service/dao/mapper/hm/TabHaobanHmPageRelationMapper.java
+0
-24
TabHaobanHmGroupSetting.java
...ban/manage/service/entity/hm/TabHaobanHmGroupSetting.java
+0
-10
HmWelcomeRelationBO.java
...haoban/manage/service/pojo/bo/hm/HmWelcomeRelationBO.java
+3
-0
WelcomeService.java
...com/gic/haoban/manage/service/service/WelcomeService.java
+2
-2
HmGroupService.java
.../gic/haoban/manage/service/service/hm/HmGroupService.java
+0
-15
HmLinkService.java
...m/gic/haoban/manage/service/service/hm/HmLinkService.java
+1
-1
HmPageRelationService.java
...oban/manage/service/service/hm/HmPageRelationService.java
+0
-57
HmPageService.java
...m/gic/haoban/manage/service/service/hm/HmPageService.java
+0
-6
WelcomeRelationService.java
...ban/manage/service/service/hm/WelcomeRelationService.java
+0
-1
HmGroupServiceImpl.java
...an/manage/service/service/hm/impl/HmGroupServiceImpl.java
+0
-22
HmLinkServiceImpl.java
...ban/manage/service/service/hm/impl/HmLinkServiceImpl.java
+3
-2
HmPageRelationServiceImpl.java
...ge/service/service/hm/impl/HmPageRelationServiceImpl.java
+0
-115
HmPageServiceImpl.java
...ban/manage/service/service/hm/impl/HmPageServiceImpl.java
+21
-13
WelcomeRelationServiceImpl.java
...e/service/service/hm/impl/WelcomeRelationServiceImpl.java
+31
-5
WelcomeServiceImpl.java
...aoban/manage/service/service/impl/WelcomeServiceImpl.java
+31
-27
HmGroupApiServiceImpl.java
...ge/service/service/out/impl/hm/HmGroupApiServiceImpl.java
+22
-6
HmPageApiServiceImpl.java
...age/service/service/out/impl/hm/HmPageApiServiceImpl.java
+28
-22
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+0
-5
HmLinkMapper.xml
...ge3-service/src/main/resources/mapper/hm/HmLinkMapper.xml
+5
-1
TabHaobanHmGroupSettingMapper.xml
...ain/resources/mapper/hm/TabHaobanHmGroupSettingMapper.xml
+3
-14
TabHaobanHmPageRelationMapper.xml
...ain/resources/mapper/hm/TabHaobanHmPageRelationMapper.xml
+0
-182
HmLinkTest.java
haoban-manage3-service/src/test/java/HmLinkTest.java
+1
-1
HmPageServiceTest.java
haoban-manage3-service/src/test/java/HmPageServiceTest.java
+33
-21
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/hm/HmLinkMapper.java
View file @
def39d93
...
@@ -62,5 +62,5 @@ public interface HmLinkMapper {
...
@@ -62,5 +62,5 @@ public interface HmLinkMapper {
@Param
(
"searchParams"
)
String
searchParams
);
@Param
(
"searchParams"
)
String
searchParams
);
public
List
<
TabHmLink
>
queryPageRelationList
(
@Param
(
"pageId"
)
Long
pageId
,
public
List
<
TabHmLink
>
queryPageRelationList
(
@Param
(
"pageId"
)
Long
pageId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"searchText"
)
String
searchText
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/hm/TabHaobanHmPageRelationMapper.java
deleted
100644 → 0
View file @
d8d08512
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
.
hm
;
import
com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageRelationQO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabHaobanHmPageRelationMapper
{
int
deleteByPrimaryKey
(
Long
relationId
);
int
insert
(
TabHaobanHmPageRelation
record
);
int
insertSelective
(
TabHaobanHmPageRelation
record
);
TabHaobanHmPageRelation
selectByPrimaryKey
(
Long
relationId
);
int
updateByPrimaryKeySelective
(
TabHaobanHmPageRelation
record
);
int
updateByPrimaryKey
(
TabHaobanHmPageRelation
record
);
List
<
TabHaobanHmPageRelation
>
queryPageRelationList
(
HmPageRelationQO
pageRelationQo
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/hm/TabHaobanHmGroupSetting.java
View file @
def39d93
...
@@ -11,8 +11,6 @@ public class TabHaobanHmGroupSetting {
...
@@ -11,8 +11,6 @@ public class TabHaobanHmGroupSetting {
private
String
wxEnterpriseId
;
private
String
wxEnterpriseId
;
private
Integer
referNum
;
private
Integer
status
;
private
Integer
status
;
private
Integer
sort
;
private
Integer
sort
;
...
@@ -61,14 +59,6 @@ public class TabHaobanHmGroupSetting {
...
@@ -61,14 +59,6 @@ public class TabHaobanHmGroupSetting {
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
}
public
Integer
getReferNum
()
{
return
referNum
;
}
public
void
setReferNum
(
Integer
referNum
)
{
this
.
referNum
=
referNum
;
}
public
Integer
getStatus
()
{
public
Integer
getStatus
()
{
return
status
;
return
status
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/hm/HmWelcomeRelationBO.java
View file @
def39d93
...
@@ -14,6 +14,9 @@ public class HmWelcomeRelationBO implements Serializable {
...
@@ -14,6 +14,9 @@ public class HmWelcomeRelationBO implements Serializable {
private
static
final
long
serialVersionUID
=
-
5265091280402568359L
;
private
static
final
long
serialVersionUID
=
-
5265091280402568359L
;
private
Long
relationId
;
private
Long
relationId
;
/**
*
*/
private
String
enterpriseId
;
private
String
enterpriseId
;
private
String
wxEnterpriseId
;
private
String
wxEnterpriseId
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WelcomeService.java
View file @
def39d93
...
@@ -132,10 +132,10 @@ public interface WelcomeService {
...
@@ -132,10 +132,10 @@ public interface WelcomeService {
*
*
* @param staffId
* @param staffId
* @param wxEnterpriseId
* @param wxEnterpriseId
* @param
state
* @param
referId 活码 / 链接id
* @return
* @return
*/
*/
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
String
state
);
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
String
referId
);
/**
/**
* 删除欢迎语
* 删除欢迎语
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmGroupService.java
View file @
def39d93
...
@@ -16,21 +16,6 @@ import java.util.List;
...
@@ -16,21 +16,6 @@ import java.util.List;
**/
**/
public
interface
HmGroupService
{
public
interface
HmGroupService
{
/**
* 更新 分组被引用数量
*
* @param groupId
* @param changeCount
* @return
*/
Boolean
updateGroupRelationCount
(
Long
groupId
,
Integer
changeCount
);
/**
* @param groupRelations
* @return
*/
Boolean
batchUpdateGroupRelationCount
(
List
<
HmGroupRelationBO
>
groupRelations
);
/**
/**
* 查询分组被引用的次数
* 查询分组被引用的次数
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmLinkService.java
View file @
def39d93
...
@@ -23,6 +23,6 @@ public interface HmLinkService {
...
@@ -23,6 +23,6 @@ public interface HmLinkService {
public
Page
<
HmLinkBO
>
listPage
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
);
public
Page
<
HmLinkBO
>
listPage
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
);
public
Page
<
HmLinkBO
>
queryPageRelationList
(
Long
pageId
,
String
enterpriseId
,
BasePageInfo
basePageInfo
);
public
Page
<
HmLinkBO
>
queryPageRelationList
(
Long
pageId
,
String
enterpriseId
,
String
searchText
,
BasePageInfo
basePageInfo
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmPageRelationService.java
deleted
100644 → 0
View file @
d8d08512
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
hm
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageRelationBO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageRelationQO
;
import
java.util.List
;
/**
* @Author MUSI
* @Date 2022/7/1 5:37 PM
* @Description
* @Version
**/
public
interface
HmPageRelationService
{
/**
* 保存活码 与落地页的引用关系
*
* @param hmPageRelationBO
*
* @return true 保存成功
*/
boolean
savePageRelation
(
HmPageRelationBO
hmPageRelationBO
);
/**
* 更新 落地页关联状态
* referId pageId
*
* @param hmPageRelationBO
* @return
*/
boolean
updatePageRelation
(
HmPageRelationBO
hmPageRelationBO
);
/**
* 根据落地页模板code 查询关联的引用方
*
* @param pageCode
* @return
*/
List
<
HmPageRelationBO
>
queryPageRelation
(
String
pageCode
);
/**
* 链接code/模板名称 条件查询
* @param hmPageRelationQo
* @return
*/
Page
<
HmPageRelationBO
>
queryPageRelationWithSearchText
(
HmPageRelationQO
hmPageRelationQo
);
/**
* 统计pageCode 被引用的总数
* @param pageCode
* @return
*/
Integer
countPageTemplateRelation
(
String
pageCode
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmPageService.java
View file @
def39d93
...
@@ -14,12 +14,6 @@ import com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO;
...
@@ -14,12 +14,6 @@ import com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO;
**/
**/
public
interface
HmPageService
{
public
interface
HmPageService
{
/**
* 根据 referId 查询关联的落地页数据
* @param referId
* @return
*/
HmPageBO
queryHmPageTemplateWithReferId
(
String
referId
);
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/WelcomeRelationService.java
View file @
def39d93
...
@@ -56,7 +56,6 @@ public interface WelcomeRelationService {
...
@@ -56,7 +56,6 @@ public interface WelcomeRelationService {
*
*
* @param hmWelcomeRelationBO
* @param hmWelcomeRelationBO
*
*
* @see com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum
* @return
* @return
*/
*/
Boolean
updateWelcomeRelation
(
HmWelcomeRelationBO
hmWelcomeRelationBO
);
Boolean
updateWelcomeRelation
(
HmWelcomeRelationBO
hmWelcomeRelationBO
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmGroupServiceImpl.java
View file @
def39d93
...
@@ -42,28 +42,6 @@ public class HmGroupServiceImpl implements HmGroupService {
...
@@ -42,28 +42,6 @@ public class HmGroupServiceImpl implements HmGroupService {
@Autowired
@Autowired
private
TabHaobanHmGroupSettingMapper
haobanHmGroupSettingMapper
;
private
TabHaobanHmGroupSettingMapper
haobanHmGroupSettingMapper
;
@Override
public
Boolean
updateGroupRelationCount
(
Long
groupId
,
Integer
changeCount
)
{
if
(
groupId
==
null
){
return
Boolean
.
TRUE
;
}
TabHaobanHmGroupSetting
tabHaobanHmGroupSetting
=
haobanHmGroupSettingMapper
.
selectByPrimaryKey
(
groupId
);
if
(
tabHaobanHmGroupSetting
==
null
||
!
HmGroupStatus
.
ENABLE
.
getCode
().
equals
(
tabHaobanHmGroupSetting
.
getStatus
())){
return
Boolean
.
FALSE
;
}
return
haobanHmGroupSettingMapper
.
updateGroupSettingCount
(
groupId
,
changeCount
)
==
1
;
}
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
Boolean
batchUpdateGroupRelationCount
(
List
<
HmGroupRelationBO
>
groupRelations
)
{
groupRelations
.
forEach
(
item
->
{
haobanHmGroupSettingMapper
.
updateGroupSettingCount
(
item
.
getGroupId
(),
item
.
getChangeCount
());
});
return
null
;
}
/**
/**
* 查询分组被引用的次数
* 查询分组被引用的次数
*
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmLinkServiceImpl.java
View file @
def39d93
...
@@ -131,6 +131,7 @@ public class HmLinkServiceImpl implements HmLinkService {
...
@@ -131,6 +131,7 @@ public class HmLinkServiceImpl implements HmLinkService {
welcome
.
setEnterpriseId
(
dto
.
getEnterpriseId
());
welcome
.
setEnterpriseId
(
dto
.
getEnterpriseId
());
welcome
.
setReferName
(
dto
.
getName
());
welcome
.
setReferName
(
dto
.
getName
());
welcome
.
setRelationId
(
dto
.
getLinkId
());
welcome
.
setRelationId
(
dto
.
getLinkId
());
welcome
.
setReferId
(
dto
.
getLinkId
()+
""
);
welcome
.
setReferCode
(
dto
.
getLinkCode
());
welcome
.
setReferCode
(
dto
.
getLinkCode
());
welcome
.
setType
(
HmWelcomeReferType
.
LINK
.
getCode
());
welcome
.
setType
(
HmWelcomeReferType
.
LINK
.
getCode
());
// 新增
// 新增
...
@@ -155,9 +156,9 @@ public class HmLinkServiceImpl implements HmLinkService {
...
@@ -155,9 +156,9 @@ public class HmLinkServiceImpl implements HmLinkService {
}
}
@Override
@Override
public
Page
<
HmLinkBO
>
queryPageRelationList
(
Long
pageId
,
String
enterpriseId
,
BasePageInfo
basePageInfo
)
{
public
Page
<
HmLinkBO
>
queryPageRelationList
(
Long
pageId
,
String
enterpriseId
,
String
searchText
,
BasePageInfo
basePageInfo
)
{
PageHelper
.
startPage
(
basePageInfo
);
PageHelper
.
startPage
(
basePageInfo
);
List
<
TabHmLink
>
list
=
this
.
linkMapper
.
queryPageRelationList
(
pageId
,
enterpriseId
);
List
<
TabHmLink
>
list
=
this
.
linkMapper
.
queryPageRelationList
(
pageId
,
enterpriseId
,
searchText
);
Page
<
HmLinkBO
>
retPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
list
,
HmLinkBO
.
class
);
Page
<
HmLinkBO
>
retPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
list
,
HmLinkBO
.
class
);
return
retPage
;
return
retPage
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmPageRelationServiceImpl.java
deleted
100644 → 0
View file @
d8d08512
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
hm
.
impl
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.enums.hm.HmPageStatus
;
import
com.gic.haoban.manage.api.enums.hm.HmPageType
;
import
com.gic.haoban.manage.service.dao.mapper.hm.TabHaobanHmPageRelationMapper
;
import
com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageRelationBO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageRelationQO
;
import
com.gic.haoban.manage.service.service.hm.HmPageRelationService
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author MUSI
* @Date 2022/7/3 9:45 PM
* @Description
* @Version
**/
@Component
public
class
HmPageRelationServiceImpl
implements
HmPageRelationService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
HmPageRelationServiceImpl
.
class
);
@Autowired
private
TabHaobanHmPageRelationMapper
haobanHmPageRelationMapper
;
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
boolean
savePageRelation
(
HmPageRelationBO
hmPageRelationBO
)
{
TabHaobanHmPageRelation
pageRelation
=
new
TabHaobanHmPageRelation
();
pageRelation
.
setEnterpriseId
(
hmPageRelationBO
.
getEnterpriseId
());
pageRelation
.
setWxEnterpriseId
(
hmPageRelationBO
.
getWxEnterpriseId
());
pageRelation
.
setPageCode
(
hmPageRelationBO
.
getPageCode
());
pageRelation
.
setReferId
(
hmPageRelationBO
.
getReferId
());
pageRelation
.
setReferCode
(
hmPageRelationBO
.
getReferCode
());
pageRelation
.
setReferName
(
hmPageRelationBO
.
getReferName
());
pageRelation
.
setCreateTime
(
new
Date
());
pageRelation
.
setUpdateTime
(
new
Date
());
pageRelation
.
setType
(
HmPageType
.
LINK
.
getCode
());
pageRelation
.
setStatus
(
HmPageStatus
.
ENABLE
.
getCode
());
return
haobanHmPageRelationMapper
.
insertSelective
(
pageRelation
)
==
1
;
}
@Override
public
boolean
updatePageRelation
(
HmPageRelationBO
hmPageRelationBO
)
{
// 移除该referId之前的引用
Date
now
=
new
Date
();
HmPageRelationQO
pageRelationQo
=
new
HmPageRelationQO
();
pageRelationQo
.
setStatus
(
HmPageStatus
.
ENABLE
.
getCode
());
pageRelationQo
.
setReferId
(
hmPageRelationBO
.
getReferId
());
List
<
TabHaobanHmPageRelation
>
tabHaobanHmPageRelations
=
haobanHmPageRelationMapper
.
queryPageRelationList
(
pageRelationQo
);
if
(
CollectionUtils
.
isNotEmpty
(
tabHaobanHmPageRelations
)){
for
(
TabHaobanHmPageRelation
tabHaobanHmPageRelation
:
tabHaobanHmPageRelations
)
{
tabHaobanHmPageRelation
.
setStatus
(
HmPageStatus
.
DISABLE
.
getCode
());
tabHaobanHmPageRelation
.
setUpdateTime
(
now
);
haobanHmPageRelationMapper
.
updateByPrimaryKey
(
tabHaobanHmPageRelation
);
}
}
// insert new relation
return
this
.
savePageRelation
(
hmPageRelationBO
);
}
@Override
public
List
<
HmPageRelationBO
>
queryPageRelation
(
String
pageCode
)
{
HmPageRelationQO
hmPageRelationQo
=
new
HmPageRelationQO
();
hmPageRelationQo
.
setPageCode
(
pageCode
);
hmPageRelationQo
.
setStatus
(
HmPageStatus
.
ENABLE
.
getCode
());
hmPageRelationQo
.
setPageSize
(
1
);
PageHelper
.
startPage
(
hmPageRelationQo
.
getPageNum
(),
hmPageRelationQo
.
getPageSize
());
List
<
TabHaobanHmPageRelation
>
tabHaobanHmPageRelations
=
haobanHmPageRelationMapper
.
queryPageRelationList
(
hmPageRelationQo
);
return
tabHaobanHmPageRelations
.
stream
().
map
(
item
->
{
HmPageRelationBO
temp
=
new
HmPageRelationBO
();
BeanUtils
.
copyProperties
(
item
,
temp
);
return
temp
;
}).
collect
(
Collectors
.
toList
());
}
/**
* 链接code/模板名称 条件查询
*
* @return
*/
@Override
public
Page
<
HmPageRelationBO
>
queryPageRelationWithSearchText
(
HmPageRelationQO
hmPageRelationQo
)
{
PageHelper
.
startPage
(
hmPageRelationQo
.
getPageNum
(),
hmPageRelationQo
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanHmPageRelation
>
pageRelationPage
=
(
com
.
github
.
pagehelper
.
Page
<
TabHaobanHmPageRelation
>)
haobanHmPageRelationMapper
.
queryPageRelationList
(
hmPageRelationQo
);
return
PageUtil
.
changePageHelperToCurrentPage
(
pageRelationPage
,
HmPageRelationBO
.
class
);
}
/**
* 统计templateCode 被引用的总数
*
* @param pageCode
* @return
*/
@Override
public
Integer
countPageTemplateRelation
(
String
pageCode
)
{
return
null
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmPageServiceImpl.java
View file @
def39d93
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.hm.impl;
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.hm.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.hm.HmPageDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageDTO
;
import
com.gic.haoban.manage.api.enums.hm.HmPageStatus
;
import
com.gic.haoban.manage.api.enums.hm.HmPageStatus
;
...
@@ -11,6 +12,7 @@ import com.gic.haoban.manage.service.entity.hm.TabHaobanHmPage;
...
@@ -11,6 +12,7 @@ import com.gic.haoban.manage.service.entity.hm.TabHaobanHmPage;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageBO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO
;
import
com.gic.haoban.manage.service.service.hm.HmPageService
;
import
com.gic.haoban.manage.service.service.hm.HmPageService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -20,6 +22,7 @@ import org.springframework.stereotype.Component;
...
@@ -20,6 +22,7 @@ import org.springframework.stereotype.Component;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* @Author MUSI
* @Author MUSI
...
@@ -37,16 +40,9 @@ public class HmPageServiceImpl implements HmPageService {
...
@@ -37,16 +40,9 @@ public class HmPageServiceImpl implements HmPageService {
private
static
final
String
TEMPLATE_CODE_PREFIX
=
"MB01"
;
private
static
final
String
TEMPLATE_CODE_PREFIX
=
"MB01"
;
/**
private
static
final
String
PAGE_CACHE_KEY_PRE
=
"HM:page:"
;
* 根据 referId 查询关联的落地页数据
*
private
static
final
Long
PAGE_CACHE_KEY_EXPIRE_TIME
=
5
*
60L
;
* @param referId
* @return
*/
@Override
public
HmPageBO
queryHmPageTemplateWithReferId
(
String
referId
)
{
return
null
;
}
/**
/**
* 根据pageId 查询落地页详情
* 根据pageId 查询落地页详情
...
@@ -54,13 +50,18 @@ public class HmPageServiceImpl implements HmPageService {
...
@@ -54,13 +50,18 @@ public class HmPageServiceImpl implements HmPageService {
* @return
* @return
*/
*/
public
HmPageBO
queryHmPageDetail
(
Long
pageId
){
public
HmPageBO
queryHmPageDetail
(
Long
pageId
){
String
pageCacheKey
=
PAGE_CACHE_KEY_PRE
+
pageId
;
HmPageBO
pageCache
=
RedisUtil
.
getCache
(
pageCacheKey
,
HmPageBO
.
class
);
if
(
pageCache
!=
null
){
return
pageCache
;
}
TabHaobanHmPage
haobanHmPage
=
haobanHmPageMapper
.
selectByPrimaryKey
(
pageId
);
TabHaobanHmPage
haobanHmPage
=
haobanHmPageMapper
.
selectByPrimaryKey
(
pageId
);
if
(
haobanHmPage
==
null
){
if
(
haobanHmPage
==
null
){
return
null
;
return
null
;
}
}
HmPageBO
pageB
O
=
new
HmPageBO
(
);
HmPageBO
pageB
o
=
EntityUtil
.
changeEntityByOrika
(
HmPageBO
.
class
,
haobanHmPage
);
BeanUtils
.
copyProperties
(
haobanHmPage
,
pageBO
);
RedisUtil
.
setCache
(
pageCacheKey
,
pageBo
,
PAGE_CACHE_KEY_EXPIRE_TIME
,
TimeUnit
.
SECONDS
);
return
pageB
O
;
return
pageB
o
;
}
}
/**
/**
...
@@ -92,6 +93,12 @@ public class HmPageServiceImpl implements HmPageService {
...
@@ -92,6 +93,12 @@ public class HmPageServiceImpl implements HmPageService {
tempHmPage
.
setModifierName
(
pageDTO
.
getModifierName
());
tempHmPage
.
setModifierName
(
pageDTO
.
getModifierName
());
log
.
info
(
"[deleteHmPageTemplate] params:{}"
,
JSON
.
toJSONString
(
tempHmPage
));
log
.
info
(
"[deleteHmPageTemplate] params:{}"
,
JSON
.
toJSONString
(
tempHmPage
));
haobanHmPageMapper
.
updateByPrimaryKeySelective
(
tempHmPage
);
haobanHmPageMapper
.
updateByPrimaryKeySelective
(
tempHmPage
);
this
.
removeCache
(
pageDTO
.
getPageId
());
}
private
void
removeCache
(
Long
pageId
){
String
pageCacheKey
=
PAGE_CACHE_KEY_PRE
+
pageId
;
RedisUtil
.
delCache
(
pageCacheKey
);
}
}
/**
/**
...
@@ -129,6 +136,7 @@ public class HmPageServiceImpl implements HmPageService {
...
@@ -129,6 +136,7 @@ public class HmPageServiceImpl implements HmPageService {
haobanHmPage
.
setModifierId
(
pageDTO
.
getModifierId
());
haobanHmPage
.
setModifierId
(
pageDTO
.
getModifierId
());
haobanHmPage
.
setModifierName
(
pageDTO
.
getModifierName
());
haobanHmPage
.
setModifierName
(
pageDTO
.
getModifierName
());
haobanHmPageMapper
.
updateByPrimaryKeySelective
(
haobanHmPage
);
haobanHmPageMapper
.
updateByPrimaryKeySelective
(
haobanHmPage
);
this
.
removeCache
(
pageDTO
.
getPageId
());
return
haobanHmPage
.
getPageId
();
return
haobanHmPage
.
getPageId
();
}
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/WelcomeRelationServiceImpl.java
View file @
def39d93
...
@@ -13,8 +13,10 @@ import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO;
...
@@ -13,8 +13,10 @@ import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO
;
import
com.gic.haoban.manage.service.service.WelcomeService
;
import
com.gic.haoban.manage.service.service.WelcomeService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -25,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -25,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -44,6 +47,10 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
...
@@ -44,6 +47,10 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
@Autowired
@Autowired
private
WelcomeService
welcomeService
;
private
WelcomeService
welcomeService
;
private
static
final
String
WELCOME_RELATION_KEY
=
"HM:welcome:relation:"
;
private
static
final
Long
WELCOME_RELATION_CACHE_TIME
=
5
*
60L
;
/**
/**
* 查询欢迎语关联关系
* 查询欢迎语关联关系
*
*
...
@@ -53,11 +60,18 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
...
@@ -53,11 +60,18 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
*/
*/
@Override
@Override
public
HmWelcomeRelationBO
queryWelcomeRelation
(
String
referId
,
Integer
status
)
{
public
HmWelcomeRelationBO
queryWelcomeRelation
(
String
referId
,
Integer
status
)
{
String
welcomeRelationCacheKey
=
WELCOME_RELATION_KEY
+
referId
;
HmWelcomeRelationBO
cache
=
RedisUtil
.
getCache
(
welcomeRelationCacheKey
,
HmWelcomeRelationBO
.
class
);
if
(
cache
!=
null
){
return
cache
;
}
List
<
TabHaobanWelcomeTemplateRelation
>
welcomeTemplateRelations
=
welcomeTemplateRelationMapper
.
queryWelTemplateRelation
(
null
,
referId
,
status
);
List
<
TabHaobanWelcomeTemplateRelation
>
welcomeTemplateRelations
=
welcomeTemplateRelationMapper
.
queryWelTemplateRelation
(
null
,
referId
,
status
);
if
(
CollectionUtils
.
isEmpty
(
welcomeTemplateRelations
))
{
if
(
CollectionUtils
.
isEmpty
(
welcomeTemplateRelations
))
{
return
null
;
return
null
;
}
}
return
EntityUtil
.
changeEntityByOrika
(
HmWelcomeRelationBO
.
class
,
welcomeTemplateRelations
.
get
(
0
));
HmWelcomeRelationBO
welcomeRelationBO
=
EntityUtil
.
changeEntityByOrika
(
HmWelcomeRelationBO
.
class
,
welcomeTemplateRelations
.
get
(
0
));
RedisUtil
.
setCache
(
welcomeRelationCacheKey
,
welcomeRelationBO
,
WELCOME_RELATION_CACHE_TIME
,
TimeUnit
.
SECONDS
);
return
welcomeRelationBO
;
}
}
/**
/**
...
@@ -148,11 +162,23 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
...
@@ -148,11 +162,23 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
// 取消该referId已有的引用
// 取消该referId已有的引用
List
<
TabHaobanWelcomeTemplateRelation
>
tabHaobanWelcomeTemplateRelations
=
List
<
TabHaobanWelcomeTemplateRelation
>
tabHaobanWelcomeTemplateRelations
=
welcomeTemplateRelationMapper
.
queryWelTemplateRelation
(
null
,
hmWelcomeRelationBO
.
getReferId
(),
WelcomeRelationStatusEnum
.
ENABLE
.
getCode
());
welcomeTemplateRelationMapper
.
queryWelTemplateRelation
(
null
,
hmWelcomeRelationBO
.
getReferId
(),
WelcomeRelationStatusEnum
.
ENABLE
.
getCode
());
for
(
TabHaobanWelcomeTemplateRelation
tabHaobanWelcomeTemplateRelation
:
tabHaobanWelcomeTemplateRelations
)
{
TabHaobanWelcomeTemplateRelation
welcomeTemplateRelation
=
tabHaobanWelcomeTemplateRelations
.
get
(
0
);
tabHaobanWelcomeTemplateRelation
.
setStatus
(
WelcomeRelationStatusEnum
.
DISABLE
.
getCode
());
if
(
StringUtils
.
equals
(
welcomeTemplateRelation
.
getReferId
(),
hmWelcomeRelationBO
.
getReferId
())){
tabHaobanWelcomeTemplateRelation
.
setUpdateTime
(
new
Date
());
return
Boolean
.
TRUE
;
welcomeTemplateRelationMapper
.
updateByPrimaryKeySelective
(
tabHaobanWelcomeTemplateRelation
);
}
}
welcomeTemplateRelation
.
setUpdateTime
(
new
Date
());
welcomeTemplateRelation
.
setStatus
(
WelcomeRelationStatusEnum
.
ENABLE
.
getCode
());
welcomeTemplateRelationMapper
.
updateByPrimaryKeySelective
(
welcomeTemplateRelation
);
// 定义
this
.
removeWelcomeRelationCache
(
welcomeTemplateRelation
.
getReferId
());
if
(
StringUtils
.
isNotBlank
(
welcomeTemplateRelation
.
getWelcomeId
()))
{
return
this
.
saveHmWelcomeRelation
(
hmWelcomeRelationBO
);
return
this
.
saveHmWelcomeRelation
(
hmWelcomeRelationBO
);
}
}
return
Boolean
.
TRUE
;
}
private
void
removeWelcomeRelationCache
(
String
referId
){
String
welcomeRelationCacheKey
=
WELCOME_RELATION_KEY
+
referId
;
RedisUtil
.
delCache
(
welcomeRelationCacheKey
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WelcomeServiceImpl.java
View file @
def39d93
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.KeyDataDTO
;
import
com.gic.haoban.manage.api.dto.welcome.dto.WelcomeRemoveCheckDTO
;
import
com.gic.haoban.manage.api.dto.welcome.dto.WelcomeRemoveCheckDTO
;
import
com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO
;
import
com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO
;
import
com.gic.haoban.manage.api.enums.FriendSettingTypeEnum
;
import
com.gic.haoban.manage.api.enums.FriendSettingTypeEnum
;
import
com.gic.haoban.manage.api.enums.KeyDataEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeMediaTypeEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeMediaTypeEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeSuitTypeEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeSuitTypeEnum
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeType
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeType
;
import
com.gic.haoban.manage.service.dao.mapper.*
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanFriendSettingMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMediaMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeSuitRangMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabMiniprogramSettingMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanFriendSetting
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanWelcomeMedia
;
import
com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang
;
import
com.gic.haoban.manage.service.entity.TabMiniprogramSetting
;
import
com.gic.haoban.manage.service.entity.TabWelcome
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.*
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.FriendSettingDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.SaveFriendSettingBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.SaveWelcomeBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.SaveWelcomeMediaBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeListBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeMediaBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitDepartmentBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitStaffBO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeInfoQO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeInfoQO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO
;
import
com.gic.haoban.manage.service.service.KeyDataService
;
import
com.gic.haoban.manage.service.service.KeyDataService
;
...
@@ -33,7 +47,13 @@ import org.slf4j.LoggerFactory;
...
@@ -33,7 +47,13 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -641,30 +661,14 @@ public class WelcomeServiceImpl implements WelcomeService {
...
@@ -641,30 +661,14 @@ public class WelcomeServiceImpl implements WelcomeService {
}
}
@Override
@Override
public
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
String
state
)
{
public
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
String
referId
)
{
logger
.
info
(
"[getMatchWelcomeWithReferId] staffId:{}, wxEnterpriseId:{}, referId:{}"
,
logger
.
info
(
"[getMatchWelcomeWithReferId] staffId:{}, wxEnterpriseId:{}, referId:{}"
,
staffId
,
wxEnterpriseId
,
state
);
staffId
,
wxEnterpriseId
,
referId
);
String
referId
=
""
;
if
(
StringUtils
.
startsWith
(
state
,
"HM"
)){
// 活码
// 根据referId 查询 关联关系表
referId
=
StringUtils
.
substring
(
state
,
2
);
}
if
(
StringUtils
.
startsWith
(
staffId
,
"DT"
)){
// 链接 key
KeyDataDTO
keyData
=
keyDataService
.
getDataByKey
(
StringUtils
.
substring
(
state
,
2
),
KeyDataEnum
.
DYNAMIC_HM
,
null
);
if
(
keyData
!=
null
){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
keyData
.
getData
());
if
(
jsonObject
!=
null
){
referId
=
jsonObject
.
get
(
"ljid"
).
toString
();
}
}
}
if
(
StringUtils
.
isBlank
(
referId
)){
if
(
StringUtils
.
isBlank
(
referId
)){
return
null
;
return
null
;
}
}
HmWelcomeRelationBO
welcomeRelationBO
=
welcomeRelationService
.
queryWelcomeRelation
(
state
,
WelcomeRelationStatusEnum
.
ENABLE
.
getCode
());
HmWelcomeRelationBO
welcomeRelationBO
=
welcomeRelationService
.
queryWelcomeRelation
(
referId
,
WelcomeRelationStatusEnum
.
ENABLE
.
getCode
());
if
(
welcomeRelationBO
==
null
){
if
(
welcomeRelationBO
==
null
){
// 不存在
// 不存在
return
null
;
return
null
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmGroupApiServiceImpl.java
View file @
def39d93
...
@@ -12,8 +12,10 @@ import com.gic.haoban.manage.api.enums.hm.HmGroupStatus;
...
@@ -12,8 +12,10 @@ import com.gic.haoban.manage.api.enums.hm.HmGroupStatus;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.service.errorcode.HaoBanErrCode
;
import
com.gic.haoban.manage.service.errorcode.HaoBanErrCode
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO
;
import
com.gic.haoban.manage.service.pojo.qo.HmGroupInfoQO
;
import
com.gic.haoban.manage.service.pojo.qo.HmGroupInfoQO
;
import
com.gic.haoban.manage.service.service.hm.HmGroupService
;
import
com.gic.haoban.manage.service.service.hm.HmGroupService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
...
@@ -25,6 +27,10 @@ import org.springframework.stereotype.Component;
...
@@ -25,6 +27,10 @@ import org.springframework.stereotype.Component;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
/**
* @Author MUSI
* @Author MUSI
...
@@ -43,6 +49,9 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
...
@@ -43,6 +49,9 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
@Autowired
@Autowired
private
HmGroupService
groupService
;
private
HmGroupService
groupService
;
@Autowired
private
HmQrcodeService
qrcodeService
;
@Override
@Override
public
ServiceResponse
<
Long
>
saveOrUpdateHmGroupSetting
(
HmGroupDTO
hmGroupDTO
)
{
public
ServiceResponse
<
Long
>
saveOrUpdateHmGroupSetting
(
HmGroupDTO
hmGroupDTO
)
{
log
.
info
(
"[saveOrUpdateHmGroupSetting] params:{}"
,
JSON
.
toJSONString
(
hmGroupDTO
));
log
.
info
(
"[saveOrUpdateHmGroupSetting] params:{}"
,
JSON
.
toJSONString
(
hmGroupDTO
));
...
@@ -100,13 +109,20 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
...
@@ -100,13 +109,20 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
Page
<
HmGroupDTO
>
groupDtoPage
=
PageUtil
.
changeToCurrentPage
(
groupSettingPage
,
HmGroupDTO
.
class
);
Page
<
HmGroupDTO
>
groupDtoPage
=
PageUtil
.
changeToCurrentPage
(
groupSettingPage
,
HmGroupDTO
.
class
);
List
<
HmGroupDTO
>
result
=
new
ArrayList
<>();
List
<
HmGroupDTO
>
result
=
new
ArrayList
<>();
if
(
groupQueryDTO
.
getPageNum
()
==
1
)
{
if
(
groupQueryDTO
.
getPageNum
()
==
1
)
{
// 第一页展示默认分组选项
// 仅第一页展示默认分组选项
// todo query 活码 默认分组的总数
result
.
add
(
buildDefault
(
0
));
result
.
add
(
buildDefault
(
0
));
}
}
if
(
CollectionUtils
.
isNotEmpty
(
groupDtoPage
.
getResult
()))
{
groupDtoPage
.
getResult
().
forEach
(
item
->
item
.
setDefaultFlag
(
0
));
result
.
addAll
(
groupDtoPage
.
getResult
());
result
.
addAll
(
groupDtoPage
.
getResult
());
List
<
Long
>
groupIds
=
result
.
stream
().
map
(
HmGroupDTO:
:
getGroupId
).
collect
(
Collectors
.
toList
());
List
<
HmQrcodeGroupNumBO
>
qrcodeGroupNumBoList
=
qrcodeService
.
getGroupIdNumByEnterpriseId
(
groupQueryDTO
.
getEnterpriseId
());
Map
<
Integer
,
Integer
>
qrcodeGroupNumMap
=
qrcodeGroupNumBoList
.
stream
()
.
collect
(
Collectors
.
toMap
(
HmQrcodeGroupNumBO:
:
getHmGroupId
,
HmQrcodeGroupNumBO:
:
getNum
,
(
v1
,
v2
)
->
v1
));
for
(
HmGroupDTO
groupDTO
:
result
)
{
Integer
referNum
=
Optional
.
ofNullable
(
qrcodeGroupNumMap
.
get
(
groupDTO
.
getGroupId
().
intValue
())).
orElse
(
0
);
groupDTO
.
setReferNum
(
referNum
);
if
(!
DEFAULT_GROUP_ID
.
equals
(
groupDTO
.
getGroupId
())){
groupDTO
.
setDefaultFlag
(
0
);
}
}
}
groupDtoPage
.
setResult
(
result
);
groupDtoPage
.
setResult
(
result
);
return
ServiceResponse
.
success
(
groupDtoPage
);
return
ServiceResponse
.
success
(
groupDtoPage
);
...
@@ -151,8 +167,8 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
...
@@ -151,8 +167,8 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
*/
*/
@Override
@Override
public
ServiceResponse
<
Integer
>
queryGroupTotalReferCount
(
String
enterpriseId
,
String
wxEnterpriseId
)
{
public
ServiceResponse
<
Integer
>
queryGroupTotalReferCount
(
String
enterpriseId
,
String
wxEnterpriseId
)
{
Integer
referCount
=
groupService
.
queryGroupTotalReferCount
(
enterpriseId
,
wxE
nterpriseId
);
int
totalReferCount
=
qrcodeService
.
getTotalByEnterpriseId
(
e
nterpriseId
);
return
ServiceResponse
.
success
(
r
eferCount
);
return
ServiceResponse
.
success
(
totalR
eferCount
);
}
}
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmPageApiServiceImpl.java
View file @
def39d93
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
hm
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
hm
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon
;
import
com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon
;
...
@@ -11,13 +12,11 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmPageQDTO;
...
@@ -11,13 +12,11 @@ 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.dto.qdto.hm.HmPageRelationQDTO
;
import
com.gic.haoban.manage.api.enums.hm.HmPageStatus
;
import
com.gic.haoban.manage.api.enums.hm.HmPageStatus
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmPageRelationBO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageRelationQO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO
;
import
com.gic.haoban.manage.service.service.hm.Hm
PageRelation
Service
;
import
com.gic.haoban.manage.service.service.hm.Hm
Link
Service
;
import
com.gic.haoban.manage.service.service.hm.HmPageService
;
import
com.gic.haoban.manage.service.service.hm.HmPageService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -40,12 +39,13 @@ import java.util.stream.Collectors;
...
@@ -40,12 +39,13 @@ import java.util.stream.Collectors;
public
class
HmPageApiServiceImpl
implements
HmPageApiService
{
public
class
HmPageApiServiceImpl
implements
HmPageApiService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
HmPageApiServiceImpl
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
HmPageApiServiceImpl
.
class
);
@Autowired
private
HmPageRelationService
pageRelationService
;
@Autowired
@Autowired
private
HmPageService
haobanHmPageService
;
private
HmPageService
haobanHmPageService
;
@Autowired
private
HmLinkService
linkService
;
@Override
@Override
public
ServiceResponse
<
Long
>
saveOrUpdateHmPage
(
HmPageDTO
pageDTO
)
{
public
ServiceResponse
<
Long
>
saveOrUpdateHmPage
(
HmPageDTO
pageDTO
)
{
...
@@ -76,7 +76,7 @@ public class HmPageApiServiceImpl implements HmPageApiService {
...
@@ -76,7 +76,7 @@ public class HmPageApiServiceImpl implements HmPageApiService {
if
(
Objects
.
isNull
(
pageBo
)
||
!
Objects
.
equals
(
HmPageStatus
.
ENABLE
.
getCode
(),
pageBo
.
getStatus
()))
{
if
(
Objects
.
isNull
(
pageBo
)
||
!
Objects
.
equals
(
HmPageStatus
.
ENABLE
.
getCode
(),
pageBo
.
getStatus
()))
{
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_8
.
getMsg
());
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_8
.
getMsg
());
}
}
if
(
this
.
checkPageIsBeQuoted
(
pageBo
.
getPage
Code
())
>
0
)
{
if
(
this
.
checkPageIsBeQuoted
(
pageBo
.
getPage
Id
(),
pageBo
.
getEnterpriseId
())
>
0
)
{
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_9
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_9
.
getMsg
());
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_9
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_9
.
getMsg
());
}
}
haobanHmPageService
.
deleteHmPage
(
pageDTO
);
haobanHmPageService
.
deleteHmPage
(
pageDTO
);
...
@@ -96,13 +96,15 @@ public class HmPageApiServiceImpl implements HmPageApiService {
...
@@ -96,13 +96,15 @@ public class HmPageApiServiceImpl implements HmPageApiService {
/**
/**
* 校验落地页模板pageTemplateCode 是否被关联
* 校验落地页模板pageTemplateCode 是否被关联
*
*
* @param page
Code
* @param page
Id
* @return true 存在关联
* @return true 存在关联
* false 不存在关联关系
* false 不存在关联关系
*/
*/
private
Integer
checkPageIsBeQuoted
(
String
pageCode
)
{
private
Integer
checkPageIsBeQuoted
(
Long
pageId
,
String
enterpriseId
)
{
List
<
HmPageRelationBO
>
relations
=
pageRelationService
.
queryPageRelation
(
pageCode
);
BasePageInfo
pageInfo
=
new
BasePageInfo
();
return
relations
.
size
();
pageInfo
.
setPageSize
(
1
);
Page
<
HmLinkBO
>
linkBOPage
=
linkService
.
queryPageRelationList
(
pageId
,
enterpriseId
,
null
,
pageInfo
);
return
linkBOPage
.
getTotalCount
();
}
}
/**
/**
...
@@ -113,17 +115,21 @@ public class HmPageApiServiceImpl implements HmPageApiService {
...
@@ -113,17 +115,21 @@ public class HmPageApiServiceImpl implements HmPageApiService {
*/
*/
@Override
@Override
public
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
queryPageRelation
(
HmPageRelationQDTO
relationQueryDTO
)
{
public
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
queryPageRelation
(
HmPageRelationQDTO
relationQueryDTO
)
{
HmPageRelationQO
hmPageRelationQo
=
new
HmPageRelationQO
();
BasePageInfo
pageInfo
=
new
BasePageInfo
();
hmPageRelationQo
.
setTemplateSearchText
(
relationQueryDTO
.
getSearchText
());
pageInfo
.
setPageNum
(
relationQueryDTO
.
getPageNum
());
hmPageRelationQo
.
setEnterpriseId
(
relationQueryDTO
.
getEnterpriseId
());
pageInfo
.
setPageSize
(
relationQueryDTO
.
getPageSize
());
hmPageRelationQo
.
setWxEnterpriseId
(
relationQueryDTO
.
getWxEnterpriseId
());
Page
<
HmLinkBO
>
hmLinkBOPage
=
linkService
.
queryPageRelationList
(
relationQueryDTO
.
getPageId
(),
relationQueryDTO
.
getEnterpriseId
(),
relationQueryDTO
.
getSearchText
(),
pageInfo
);
hmPageRelationQo
.
setPageNum
(
relationQueryDTO
.
getPageNum
());
List
<
HmPageRelationDTO
>
pageRelations
=
hmLinkBOPage
.
getResult
().
stream
()
hmPageRelationQo
.
setPageSize
(
relationQueryDTO
.
getPageSize
());
.
map
(
item
->
{
hmPageRelationQo
.
setPageCode
(
relationQueryDTO
.
getPageId
()
+
""
);
HmPageRelationDTO
pageRelation
=
new
HmPageRelationDTO
();
hmPageRelationQo
.
setStatus
(
HmPageStatus
.
ENABLE
.
getCode
());
pageRelation
.
setReferName
(
item
.
getName
());
Page
<
HmPageRelationBO
>
hmPageRelationPage
=
pageRelationService
.
queryPageRelationWithSearchText
(
hmPageRelationQo
);
pageRelation
.
setReferId
(
item
.
getLinkId
()
+
""
);
Page
<
HmPageRelationDTO
>
pageRelationResult
=
PageUtil
.
changeToCurrentPage
(
hmPageRelationPage
,
HmPageRelationDTO
.
class
);
pageRelation
.
setReleationId
(
item
.
getLinkCode
());
return
ServiceResponse
.
success
(
pageRelationResult
);
return
pageRelation
;
}).
collect
(
Collectors
.
toList
());
Page
<
HmPageRelationDTO
>
pageRelationDTOPage
=
PageUtil
.
changeToCurrentPage
(
hmLinkBOPage
,
HmPageRelationDTO
.
class
);
pageRelationDTOPage
.
setResult
(
pageRelations
);
return
ServiceResponse
.
success
(
pageRelationDTOPage
);
}
}
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
def39d93
...
@@ -141,10 +141,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -141,10 +141,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
}
int
saveResult
=
hmQrcodeService
.
insert
(
hmQrcodeQDTO
);
int
saveResult
=
hmQrcodeService
.
insert
(
hmQrcodeQDTO
);
if
(
saveResult
==
1
)
{
if
(
saveResult
==
1
)
{
// update group refer count
if
(
hmQrcodeQDTO
.
getHmGroupId
()
!=
null
)
{
groupService
.
updateGroupRelationCount
(
hmQrcodeQDTO
.
getHmGroupId
(),
1
);
}
// save welcome relation
// save welcome relation
this
.
saveWelcomeRelation
(
hmQrcodeQDTO
);
this
.
saveWelcomeRelation
(
hmQrcodeQDTO
);
}
}
...
@@ -219,7 +215,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -219,7 +215,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
int
updateResult
=
hmQrcodeService
.
update
(
hmQrcodeQDTO
);
int
updateResult
=
hmQrcodeService
.
update
(
hmQrcodeQDTO
);
if
(
updateResult
==
1
)
{
if
(
updateResult
==
1
)
{
// 更新分组引用次数
// 更新欢迎语引用次数
// 更新欢迎语引用次数
this
.
updateWelcomeRelation
(
hmQrcodeQDTO
);
this
.
updateWelcomeRelation
(
hmQrcodeQDTO
);
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/hm/HmLinkMapper.xml
View file @
def39d93
...
@@ -147,9 +147,12 @@
...
@@ -147,9 +147,12 @@
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"queryPageRelationList"
resultMap=
"
BaseResultMap
"
>
<select
id=
"queryPageRelationList"
resultMap=
"
result-map-tabHaobanHmLink
"
>
select
<include
refid=
"Base_Column_List"
/>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_hm_link where page_id = #{pageId} and enterprise_id=#{enterpriseId}
from tab_haoban_hm_link where page_id = #{pageId} and enterprise_id=#{enterpriseId}
<if
test=
"searchText != null and searchText != '' "
>
and ( link_code = #{searchText} or name like CONCAT('%', #{searchText},'%'))
</if>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmGroupSettingMapper.xml
View file @
def39d93
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
<result
column=
"group_name"
property=
"groupName"
jdbcType=
"VARCHAR"
/>
<result
column=
"group_name"
property=
"groupName"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"refer_num"
property=
"referNum"
jdbcType=
"INTEGER"
/>
<result
column=
"status"
property=
"status"
jdbcType=
"INTEGER"
/>
<result
column=
"status"
property=
"status"
jdbcType=
"INTEGER"
/>
<result
column=
"sort"
property=
"sort"
jdbcType=
"INTEGER"
/>
<result
column=
"sort"
property=
"sort"
jdbcType=
"INTEGER"
/>
<result
column=
"creator_id"
property=
"creatorId"
jdbcType=
"VARCHAR"
/>
<result
column=
"creator_id"
property=
"creatorId"
jdbcType=
"VARCHAR"
/>
...
@@ -18,7 +17,7 @@
...
@@ -18,7 +17,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
group_id
group_id
, group_name, enterprise_id, wx_enterprise_id,
refer_num,
status, sort, creator_id,
, group_name, enterprise_id, wx_enterprise_id, status, sort, creator_id,
creator_name, modifier_id, create_time, update_time, modifier_name
creator_name, modifier_id, create_time, update_time, modifier_name
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -35,12 +34,12 @@
...
@@ -35,12 +34,12 @@
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"groupId"
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"groupId"
parameterType=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmGroupSetting"
>
parameterType=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmGroupSetting"
>
insert into tab_haoban_hm_group_setting (group_id, group_name, enterprise_id,
insert into tab_haoban_hm_group_setting (group_id, group_name, enterprise_id,
wx_enterprise_id,
refer_num,
status,
wx_enterprise_id, status,
sort, creator_id, creator_name,
sort, creator_id, creator_name,
modifier_id, create_time, update_time,
modifier_id, create_time, update_time,
modifier_name)
modifier_name)
values (#{groupId,jdbcType=BIGINT}, #{groupName,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
values (#{groupId,jdbcType=BIGINT}, #{groupName,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{
referNum,jdbcType=INTEGER}, #{
status,jdbcType=INTEGER},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{sort,jdbcType=INTEGER}, #{creatorId,jdbcType=VARCHAR}, #{creatorName,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{creatorId,jdbcType=VARCHAR}, #{creatorName,jdbcType=VARCHAR},
#{modifierId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{modifierId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{modifierName,jdbcType=VARCHAR})
#{modifierName,jdbcType=VARCHAR})
...
@@ -61,9 +60,6 @@
...
@@ -61,9 +60,6 @@
<if
test=
"wxEnterpriseId != null"
>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
wx_enterprise_id,
</if>
</if>
<if
test=
"referNum != null"
>
refer_num,
</if>
<if
test=
"status != null"
>
<if
test=
"status != null"
>
status,
status,
</if>
</if>
...
@@ -102,9 +98,6 @@
...
@@ -102,9 +98,6 @@
<if
test=
"wxEnterpriseId != null"
>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"referNum != null"
>
#{referNum,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
#{status,jdbcType=INTEGER},
</if>
</if>
...
@@ -144,9 +137,6 @@
...
@@ -144,9 +137,6 @@
<if
test=
"wxEnterpriseId != null"
>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"referNum != null"
>
refer_num = #{referNum,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
</if>
</if>
...
@@ -179,7 +169,6 @@
...
@@ -179,7 +169,6 @@
set group_name = #{groupName,jdbcType=VARCHAR},
set group_name = #{groupName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
refer_num = #{referNum,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
creator_id = #{creatorId,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=VARCHAR},
...
...
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmPageRelationMapper.xml
deleted
100644 → 0
View file @
d8d08512
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.hm.TabHaobanHmPageRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation"
>
<id
column=
"relation_id"
property=
"relationId"
jdbcType=
"BIGINT"
/>
<result
column=
"page_code"
property=
"pageCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"refer_id"
property=
"referId"
jdbcType=
"VARCHAR"
/>
<result
column=
"refer_code"
property=
"referCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"refer_name"
property=
"referName"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"status"
property=
"status"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
relation_id
, page_code, enterprise_id, wx_enterprise_id, refer_id, refer_name,
create_time, update_time, type, status, refer_code
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_hm_page_relation
where relation_id = #{relationId,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete
from tab_haoban_hm_page_relation
where relation_id = #{relationId,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation"
>
insert into tab_haoban_hm_page_relation (relation_id, page_code, enterprise_id,
wx_enterprise_id, refer_id, refer_name,
create_time, update_time, type,
status, refer_code)
values (#{relationId,jdbcType=BIGINT}, #{pageCode,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{referId,jdbcType=VARCHAR}, #{referName,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{type,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{referCode,jdbcType=VARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation"
>
insert into tab_haoban_hm_page_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"relationId != null"
>
relation_id,
</if>
<if
test=
"pageCode != null"
>
page_code,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"referId != null"
>
refer_id,
</if>
<if
test=
"referCode != null"
>
refer_code,
</if>
<if
test=
"referName != null"
>
refer_name,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"type != null"
>
type,
</if>
<if
test=
"status != null"
>
status,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"relationId != null"
>
#{relationId,jdbcType=BIGINT},
</if>
<if
test=
"pageCode != null"
>
#{pageCode,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"referId != null"
>
#{referId,jdbcType=VARCHAR},
</if>
<if
test=
"referCode != null"
>
#{referCode,jdbcType=VARCHAR},
</if>
<if
test=
"referName != null"
>
#{referName,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation"
>
update tab_haoban_hm_page_relation
<set>
<if
test=
"pageCode != null"
>
page_code = #{pageCode,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"referId != null"
>
refer_id = #{referId,jdbcType=VARCHAR},
</if>
<if
test=
"referCode != null"
>
refer_code = #{referCode,jdbcType=VARCHAR},
</if>
<if
test=
"referName != null"
>
refer_name = #{referName,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
</set>
where relation_id = #{relationId,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.hm.TabHaobanHmPageRelation"
>
update tab_haoban_hm_page_relation
set page_code = #{pageCode,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
refer_id = #{referId,jdbcType=VARCHAR},
refer_code = #{referCode,jdbcType=VARCHAR},
refer_name = #{referName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`type` = #{type,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER}
where relation_id = #{relationId,jdbcType=BIGINT}
</update>
<select
id=
"queryPageRelationList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_hm_page_relation
<where>
<if
test=
"pageCode != null and pageCode != ''"
>
page_code = #{pageCode}
</if>
<if
test=
"status != null"
>
and `status` = #{status}
</if>
</where>
order by relation_id desc
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/test/java/HmLinkTest.java
View file @
def39d93
...
@@ -117,7 +117,7 @@ public class HmLinkTest {
...
@@ -117,7 +117,7 @@ public class HmLinkTest {
public
void
test3
()
{
public
void
test3
()
{
this
.
keyDataApiService
.
saveMobileData
(
"112"
,
"10000"
,
"15999"
)
;
this
.
keyDataApiService
.
saveMobileData
(
"112"
,
"10000"
,
"15999"
)
;
System
.
out
.
println
(
this
.
keyDataApiService
.
getDataByKey
(
"679f17d8c2e940a28dc484689c0339db"
,
KeyDataEnum
.
MOBILE
));
//
System.out.println(this.keyDataApiService.getDataByKey("679f17d8c2e940a28dc484689c0339db", KeyDataEnum.MOBILE));
}
}
@Test
@Test
...
...
haoban-manage3-service/src/test/java/HmPageServiceTest.java
View file @
def39d93
import
cn.hutool.core.thread.ConcurrencyTester
;
import
cn.hutool.core.thread.ThreadUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupQueryDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageDTO
;
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.HmPageQDTO
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmPageRelationQDTO
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.service.pojo.qo.HmPageTemplateQO
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.TestService
;
import
com.gic.haoban.manage.service.service.hm.HmPageService
;
import
com.gic.wechat.api.dto.qywx.DepartmentDTO
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
public
class
HmPageServiceTest
{
public
class
HmPageServiceTest
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
HmPageServiceTest
.
class
);
@Autowired
@Autowired
private
HmPageApiService
pageService
;
private
HmPageApiService
pageService
;
@Autowired
@Autowired
private
WxEnterpriseRelatedApiService
enterpriseRelatedApiService
;
private
WxEnterpriseRelatedApiService
enterpriseRelatedApiService
;
@Autowired
private
HmGroupApiService
groupService
;
@Test
@Test
public
void
test
(){
public
void
test
(){
HmPageQDTO
pageQDTO
=
new
HmPageQDTO
();
HmPageQDTO
pageQDTO
=
new
HmPageQDTO
();
...
@@ -57,4 +44,29 @@ public class HmPageServiceTest {
...
@@ -57,4 +44,29 @@ public class HmPageServiceTest {
System
.
out
.
println
(
JSON
.
toJSONString
(
enterpriseDetailDTOServiceResponse
));
System
.
out
.
println
(
JSON
.
toJSONString
(
enterpriseDetailDTOServiceResponse
));
}
}
@Test
public
void
queryPageList
(){
HmPageRelationQDTO
pageRelationQDTO
=
new
HmPageRelationQDTO
();
pageRelationQDTO
.
setPageId
(
418460224953786370L
);
pageRelationQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
pageRelationQDTO
.
setSearchText
(
"LJ01419636016144465921"
);
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
pageServiceResponse
=
pageService
.
queryPageRelation
(
pageRelationQDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
}
@Test
public
void
deletePage
(){
HmPageDTO
pageDTO
=
new
HmPageDTO
();
pageDTO
.
setPageId
(
418460224953786370L
);
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
pageService
.
deleteHmPage
(
pageDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
booleanServiceResponse
));
}
@Test
public
void
groupList
(){
HmGroupQueryDTO
groupQueryDTO
=
new
HmGroupQueryDTO
();
ServiceResponse
<
Page
<
HmGroupDTO
>>
pageServiceResponse
=
groupService
.
queryHmGroupSettingList
(
groupQueryDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
}
}
}
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