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
1
Merge Requests
1
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
3b1ab9ea
Commit
3b1ab9ea
authored
Jul 15, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:加好友逻辑修改
parent
a05e5257
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
22 deletions
+73
-22
HmQrcodeApiService.java
.../gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
+12
-0
TabHaobanHmClerkRelationMapper.java
...service/dao/mapper/hm/TabHaobanHmClerkRelationMapper.java
+8
-1
HmClerkRelationService.java
...ban/manage/service/service/hm/HmClerkRelationService.java
+12
-0
HmClerkRelationServiceImpl.java
...e/service/service/hm/impl/HmClerkRelationServiceImpl.java
+4
-0
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+5
-1
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+26
-20
TabHaobanHmClerkRelationMapper.xml
...in/resources/mapper/hm/TabHaobanHmClerkRelationMapper.xml
+6
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
View file @
3b1ab9ea
...
...
@@ -176,4 +176,16 @@ public interface HmQrcodeApiService {
*/
HmClerkRelationDTO
getOneHmClerkByHmId
(
Long
hmId
);
/**
* 根据活码id和staffId随机找一个
*
* @param hmId hm id
* @param staffId 员工id
* @return {@link HmClerkRelationDTO }
* @author mozhu
* @date 2022-07-15 17:24:01
*/
HmClerkRelationDTO
getOneHmClerkByHmIdAndStaffId
(
Long
hmId
,
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/hm/TabHaobanHmClerkRelationMapper.java
View file @
3b1ab9ea
...
...
@@ -113,7 +113,7 @@ public interface TabHaobanHmClerkRelationMapper {
/**
* 根据
导购信息获取hmid
* 根据
hmid 获取导购信息
*
* @param hmId hm id
* @return {@link List }<{@link TabHaobanHmClerkRelation }>
...
...
@@ -122,5 +122,12 @@ public interface TabHaobanHmClerkRelationMapper {
*/
List
<
TabHaobanHmClerkRelation
>
getHmClerkByHmId
(
@Param
(
"hmId"
)
Long
hmId
);
/**
* 根据hmid 获取导购信息
* @param hmId
* @param staffId
* @return
*/
TabHaobanHmClerkRelation
getHmClerkByHmIdAndStaffId
(
@Param
(
"hmId"
)
Long
hmId
,
@Param
(
"staffId"
)
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmClerkRelationService.java
View file @
3b1ab9ea
...
...
@@ -121,4 +121,16 @@ public interface HmClerkRelationService {
*/
List
<
HmClerkRelationBO
>
getHmClerkByHmId
(
Long
hmId
);
/**
* 获取导购
*
* @param hmId hm id
* @param staffId 员工id
* @return {@link HmClerkRelationBO }
* @author mozhu
* @date 2022-07-15 17:26:53
*/
HmClerkRelationBO
getHmClerkByHmIdAndStaffId
(
Long
hmId
,
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmClerkRelationServiceImpl.java
View file @
3b1ab9ea
...
...
@@ -84,4 +84,8 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
return
EntityUtil
.
changeEntityListByJSON
(
HmClerkRelationBO
.
class
,
tabHaobanHmClerkRelationMapper
.
getHmClerkByHmId
(
hmId
));
}
@Override
public
HmClerkRelationBO
getHmClerkByHmIdAndStaffId
(
Long
hmId
,
String
staffId
)
{
return
EntityUtil
.
changeEntityByOrika
(
HmClerkRelationBO
.
class
,
tabHaobanHmClerkRelationMapper
.
getHmClerkByHmIdAndStaffId
(
hmId
,
staffId
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
3b1ab9ea
...
...
@@ -351,12 +351,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
staffClerkRelationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
hmQrcodeDTO
.
getClerkId
(),
wxEnterpriseId
);
}
else
if
(
hmQrcodeDTO
.
getHmType
()
==
2
)
{
HmClerkRelationDTO
hmClerkRelationDTO
=
null
;
//有主门店导购绑定主导购,没有主门店导购绑定第一个导购,其余随机
TabHaobanClerkMainStoreRelated
mainStoreRelated
=
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
if
(
mainStoreRelated
!=
null
)
{
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
mainStoreRelated
.
getStoreId
());
hmClerkRelationDTO
=
hmQrcodeApiService
.
getHmClerkByHmIdAndClerkId
(
refId
,
relationDTO
.
getClerkId
());
if
(
hmClerkRelationDTO
==
null
)
{
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
refId
);
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmIdAndStaffId
(
refId
,
staffId
);
if
(
hmClerkRelationDTO
==
null
)
{
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
refId
);
}
}
}
else
{
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
refId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
3b1ab9ea
...
...
@@ -119,7 +119,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
}
hmQrcodeQDTO
.
setHmId
(
UniqueIdUtils
.
uniqueLong
());
...
...
@@ -136,7 +136,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
List
<
String
>
clerkIdList
=
setStoreClerk
(
hmQrcodeQDTO
,
wxEnterpriseId
,
hmId
,
hmType
);
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该导购已经生成过活码或未关联过好办"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该导购已经生成过活码或未关联过好办"
);
}
//生成活码
QywxExternalcontactDTO
qywxExternalcontactDTO
=
new
QywxExternalcontactDTO
();
...
...
@@ -147,13 +147,13 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
userIds
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
}
qywxExternalcontactDTO
.
setUser
(
userIds
);
logger
.
info
(
"新增活码参数:{}"
,
JSON
.
toJSONString
(
qywxExternalcontactDTO
));
QywxExternalcontactResultDTO
qywxExternalcontactResultDTO
=
qywxUserApiService
.
addContactWay
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxExternalcontactDTO
);
if
(
qywxExternalcontactResultDTO
.
getErrcode
()
!=
0
)
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_0
.
getCode
()),
"创建活码失败:"
+
qywxExternalcontactResultDTO
.
getErrmsg
());
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_0
.
getCode
()),
"创建活码失败:"
+
qywxExternalcontactResultDTO
.
getErrmsg
());
}
hmQrcodeQDTO
.
setWxQrcode
(
qywxExternalcontactResultDTO
.
getQr_code
());
hmQrcodeQDTO
.
setWxConfigId
(
qywxExternalcontactResultDTO
.
getConfig_id
());
...
...
@@ -173,11 +173,11 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
}
List
<
String
>
clerkIdList
=
hmQrcodeQDTO
.
getClerkIdList
();
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_5
.
getCode
()),
"导购不允许为空"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_5
.
getCode
()),
"导购不允许为空"
);
}
if
(
clerkIdList
.
contains
(
"-1"
))
{
List
<
TabHaobanStaffClerkRelation
>
tabHaobanStaffClerkRelations
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
...
...
@@ -221,14 +221,14 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
}
Long
hmId
=
hmQrcodeQDTO
.
getHmId
();
Integer
hmType
=
hmQrcodeQDTO
.
getHmType
();
List
<
String
>
clerkIdList
=
setStoreClerk
(
hmQrcodeQDTO
,
wxEnterpriseId
,
hmId
,
hmType
);
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该导购已经生成过活码或未关联过好办"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该导购已经生成过活码或未关联过好办"
);
}
//更新活码
QywxExternalcontactDTO
qywxExternalcontactDTO
=
new
QywxExternalcontactDTO
();
...
...
@@ -239,15 +239,15 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
userIds
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
}
qywxExternalcontactDTO
.
setUser
(
userIds
);
QywxResponseDTO
qywxResponseDTO
=
qywxUserApiService
.
updateContactWay
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxExternalcontactDTO
);
if
(
qywxResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
error
(
"更新企微活码失败"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_0
.
getCode
()),
qywxResponseDTO
.
getErrmsg
());
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_0
.
getCode
()),
qywxResponseDTO
.
getErrmsg
());
}
int
updateResult
=
hmQrcodeService
.
update
(
hmQrcodeQDTO
);
if
(
updateResult
==
1
)
{
// 更新欢迎语引用次数
...
...
@@ -262,6 +262,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
/**
* 修改活码操作日志
*
* @param hmQrcodeQDTO
* @param hmId
*/
...
...
@@ -448,7 +449,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if
(
hmGroupSettingBO
!=
null
)
{
hmQrcodeBO
.
setHmGroupName
(
hmGroupSettingBO
.
getGroupName
());
}
MemberTagDTO
memberTagDTO
=
memberTagApiService
.
getMemberTagById
(
hmQrcodeBO
.
getMemberLabelId
());
MemberTagDTO
memberTagDTO
=
memberTagApiService
.
getMemberTagById
(
hmQrcodeBO
.
getMemberLabelId
());
if
(
memberTagDTO
!=
null
)
{
hmQrcodeBO
.
setMemberLabelName
(
memberTagDTO
.
getTagName
());
}
...
...
@@ -492,17 +493,17 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public
ServiceResponse
delById
(
Long
hmId
)
{
HmQrcodeBO
hmQrcodeBO
=
hmQrcodeService
.
queryById
(
hmId
);
if
(
hmQrcodeBO
==
null
)
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"活码不存在"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"活码不存在"
);
}
String
wxConfigId
=
hmQrcodeBO
.
getWxConfigId
();
if
(
StringUtils
.
isBlank
(
wxConfigId
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"活码未生成"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"活码未生成"
);
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
hmQrcodeBO
.
getWxEnterpriseId
());
QywxResponseDTO
qywxResponseDTO
=
qywxUserApiService
.
delContactWay
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
wxConfigId
);
int
errcode
=
qywxResponseDTO
.
getErrcode
();
if
(
errcode
!=
0
)
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
qywxResponseDTO
.
getErrmsg
());
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
qywxResponseDTO
.
getErrmsg
());
}
hmQrcodeService
.
deleteById
(
hmId
);
setLoggerContext
(
hmQrcodeBO
.
getEnterpriseId
(),
hmQrcodeBO
.
getWxEnterpriseId
(),
hmQrcodeBO
.
getModifierId
(),
hmQrcodeBO
.
getModifierName
());
...
...
@@ -645,7 +646,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public
Page
<
HmClerkRelationDTO
>
getHmClerkByHmId
(
BasePageInfo
basePageInfo
,
Long
hmId
)
{
PageHelper
.
startPage
(
basePageInfo
);
List
<
HmClerkRelationBO
>
hmClerkByHmId
=
hmClerkRelationService
.
getHmClerkByHmId
(
hmId
);
return
PageUtil
.
changePageHelperToCurrentPage
(
new
PageInfo
<>(
hmClerkByHmId
),
HmClerkRelationDTO
.
class
);
return
PageUtil
.
changePageHelperToCurrentPage
(
new
PageInfo
<>(
hmClerkByHmId
),
HmClerkRelationDTO
.
class
);
}
/**
...
...
@@ -657,8 +658,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
*/
@Override
public
ServiceResponse
<
Boolean
>
batchUpdateHmQrcodeGroup
(
List
<
Long
>
hmIds
,
Long
groupId
)
{
if
(
CollectionUtils
.
isEmpty
(
hmIds
)
||
groupId
==
null
){
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_2
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_2
.
getMsg
());
if
(
CollectionUtils
.
isEmpty
(
hmIds
)
||
groupId
==
null
)
{
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_2
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_2
.
getMsg
());
}
int
updateCount
=
hmQrcodeService
.
batchUpdateQrcodeGroup
(
hmIds
,
groupId
);
return
ServiceResponse
.
success
(
updateCount
>
0
);
...
...
@@ -666,12 +667,17 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Override
public
HmClerkRelationDTO
getHmClerkByHmIdAndClerkId
(
Long
hmId
,
String
clerkId
)
{
return
EntityUtil
.
changeEntityNew
(
HmClerkRelationDTO
.
class
,
hmClerkRelationService
.
queryByHmIdAndClerkId
(
hmId
,
clerkId
));
return
EntityUtil
.
changeEntityNew
(
HmClerkRelationDTO
.
class
,
hmClerkRelationService
.
queryByHmIdAndClerkId
(
hmId
,
clerkId
));
}
@Override
public
HmClerkRelationDTO
getOneHmClerkByHmId
(
Long
hmId
)
{
HmClerkRelationBO
hmClerkRelationBO
=
hmClerkRelationService
.
getHmClerkByHmId
(
hmId
).
get
(
0
);
return
EntityUtil
.
changeEntityNew
(
HmClerkRelationDTO
.
class
,
hmClerkRelationBO
);
return
EntityUtil
.
changeEntityNew
(
HmClerkRelationDTO
.
class
,
hmClerkRelationBO
);
}
@Override
public
HmClerkRelationDTO
getOneHmClerkByHmIdAndStaffId
(
Long
hmId
,
String
staffId
)
{
return
EntityUtil
.
changeEntityNew
(
HmClerkRelationDTO
.
class
,
hmClerkRelationService
.
getHmClerkByHmIdAndStaffId
(
hmId
,
staffId
));
}
}
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmClerkRelationMapper.xml
View file @
3b1ab9ea
...
...
@@ -176,5 +176,11 @@
where hm_id = #{hmId} and status = 1
</select>
<select
id=
"getHmClerkByHmIdAndStaffId"
resultMap=
"TabHaobanHmClerkRelationMap"
>
select
<include
refid=
"Base_Column_List"
></include>
from tab_haoban_hm_clerk_relation
where hm_id = #{hmId} and staff_id = #{staffId} and status = 1 limit 1
</select>
</mapper>
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