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
425337ea
Commit
425337ea
authored
Aug 19, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://git.gicdev.com/haoban3.0/haoban-manage3.0.git
into developer
parents
0a1d800d
1b4fc3d0
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
66 deletions
+47
-66
MessageApiService.java
.../com/gic/haoban/manage/api/service/MessageApiService.java
+2
-2
HmQrcodeApiService.java
.../gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
+5
-4
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+8
-3
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+2
-2
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+25
-47
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+0
-7
TestController.java
.../com/gic/haoban/manage/web/controller/TestController.java
+5
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MessageApiService.java
View file @
425337ea
...
...
@@ -68,11 +68,11 @@ public interface MessageApiService {
* 获取新的微信用户id
*
* @param wxEnterpriseId 微信企业id
* @param
wxUser
Id 微信用户id
* @param
staff
Id 微信用户id
* @return {@link String }
* @author mozhu
* @date 2022-03-10 13:48:10
*/
String
getNewWxUserId
(
String
wxEnterpriseId
,
String
wxUser
Id
);
String
getNewWxUserId
ByStaffId
(
String
wxEnterpriseId
,
String
staff
Id
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
View file @
425337ea
...
...
@@ -124,13 +124,14 @@ public interface HmQrcodeApiService {
/**
* 检查员工开启联系我
* <p>
* "routerName": "checkStaffOpenContactByWxEnterpriseIdMq"
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @param param 参数
* @author mozhu
* @date 2022-08-
08 22:01:43
* @date 2022-08-
19 15:18:29
*/
void
checkStaffOpenContactByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
);
void
checkStaffOpenContactByWxEnterpriseId
(
String
param
);
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
425337ea
...
...
@@ -1777,10 +1777,15 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
break
;
}
for
(
ExternalUserDTO
externalUserDTO
:
externalUseridInfoList
)
{
String
staffId
=
externalUserDTO
.
getStaffId
()
;
TabHaobanExternalClerkRelated
externalClerkRelated
=
externalClerkRelatedMapper
.
getByEnterpriseIdAndExternalUserId
(
wxEnterpriseId
,
staffId
,
enterpriseId
,
externalUserid
);
String
wxUserId
=
externalUserDTO
.
getWxUserId
();
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
tabHaobanStaff
==
null
)
{
log
.
error
(
"员工不存在:{}"
,
wxUserId
);
continue
;
}
TabHaobanExternalClerkRelated
externalClerkRelated
=
externalClerkRelatedMapper
.
getByEnterpriseIdAndExternalUserId
(
wxEnterpriseId
,
tabHaobanStaff
.
getStaffId
(),
enterpriseId
,
externalUserid
);
if
(
externalClerkRelated
==
null
)
{
log
.
info
(
"查询不到好友wxEnterpriseId:{}, wxUserId:{}, enterpriseId:{}, externalUserid:{}"
,
wxEnterpriseId
,
staffId
,
enterpriseId
,
externalUserid
);
log
.
info
(
"查询不到好友wxEnterpriseId:{}, wxUserId:{}, enterpriseId:{}, externalUserid:{}"
,
wxEnterpriseId
,
tabHaobanStaff
.
getStaffId
()
,
enterpriseId
,
externalUserid
);
continue
;
}
boolean
flag
=
externalClerkRelatedApiService
.
bindMemberIdExternalById
(
externalClerkRelated
.
getExternalClerkRelatedId
(),
enterpriseId
,
memberId
,
unionid
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
425337ea
...
...
@@ -582,12 +582,12 @@ public class MessageApiServiceImpl implements MessageApiService {
}
@Override
public
String
getNewWxUserId
(
String
wxEnterpriseId
,
String
wxUser
Id
)
{
public
String
getNewWxUserId
ByStaffId
(
String
wxEnterpriseId
,
String
staff
Id
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
if
(
qwDTO
==
null
)
{
return
""
;
}
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectBy
UserIdAndEnterpriseId
(
wxUserId
,
wxEnterprise
Id
);
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectBy
Id
(
staff
Id
);
if
(
tabHaobanStaff
==
null
)
{
return
""
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
425337ea
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.out.impl.hm;
import
cn.hutool.core.convert.Convert
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
...
...
@@ -115,7 +116,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
add
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
String
wxEnterpriseId
=
hmQrcodeQDTO
.
getWxEnterpriseId
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
qwDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
...
...
@@ -144,7 +145,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
qywxExternalcontactDTO
.
setRemark
(
hmQrcodeQDTO
.
getName
());
qywxExternalcontactDTO
.
setSkipVerify
(
hmQrcodeQDTO
.
getPassFlag
()
==
1
);
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
String
corpid
=
qwDTO
.
getThirdCorpid
()
;
String
corpid
=
qwDTO
.
getThirdCorpid
();
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
userIds
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
...
...
@@ -210,11 +211,11 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
}
String
lockKey
=
"qrCodeAdd"
+
wxEnterpriseId
;
String
lockKey
=
"qrCodeAdd"
+
wxEnterpriseId
;
if
(
RedisUtil
.
isLocked
(
lockKey
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_13
.
getCode
()),
"正在批量创建活码,请稍后再试"
);
}
RedisUtil
.
lock
(
lockKey
,
10L
);
RedisUtil
.
lock
(
lockKey
,
10L
);
String
enterpriseId
=
hmQrcodeQDTO
.
getEnterpriseId
();
List
<
String
>
clerkIdList
=
hmQrcodeQDTO
.
getClerkIdList
();
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
...
...
@@ -241,7 +242,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger
.
info
(
"发送消息到addHmQrcodeMq,{}"
,
clerkId
);
clientInstance
.
sendMessage
(
"addHmQrcodeMq"
,
JSON
.
toJSONString
(
hmQrcodeQDTO
));
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送消息到addHmQrcodeMq报错"
,
e
);
logger
.
info
(
"发送消息到addHmQrcodeMq报错"
,
e
);
}
}
...
...
@@ -302,7 +303,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
update
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
String
wxEnterpriseId
=
hmQrcodeQDTO
.
getWxEnterpriseId
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
qwDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
...
...
@@ -411,7 +412,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
//标签
String
memberLabelId
=
hmQrcodeQDTO
.
getMemberLabelId
();
String
memberLabelIdOld
=
hmOld
.
getMemberLabelId
();
if
(
StringUtils
.
isBlank
(
memberLabelId
)&&
StringUtils
.
isNotBlank
(
memberLabelIdOld
))
{
if
(
StringUtils
.
isBlank
(
memberLabelId
)
&&
StringUtils
.
isNotBlank
(
memberLabelIdOld
))
{
logContent
.
append
(
"活码标签变更为空"
);
}
if
(
StringUtils
.
isNotBlank
(
memberLabelId
)
&&
StringUtils
.
isBlank
(
memberLabelIdOld
))
{
...
...
@@ -678,7 +679,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
String
wxConfigId
=
hmQrcodeBO
.
getWxConfigId
();
if
(
StringUtils
.
isNotBlank
(
wxConfigId
))
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
hmQrcodeBO
.
getWxEnterpriseId
())
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
hmQrcodeBO
.
getWxEnterpriseId
());
QywxResponseDTO
qywxResponseDTO
=
qywxUserApiService
.
delContactWay
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
wxConfigId
);
int
errcode
=
qywxResponseDTO
.
getErrcode
();
//https://open.work.weixin.qq.com/devtool/query?e=41044
...
...
@@ -697,6 +698,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
/**
* 删除活码
*
* @param hmId
* @param invokingType
* @param loginDTO
...
...
@@ -780,52 +782,27 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger
.
info
(
"该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}"
,
enterpriseId
,
wxEnterpriseId
);
continue
;
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
//企微已经开启联系我
List
<
String
>
wxUserIdsList
=
qywxUserApiService
.
listCorpExternalUser
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
());
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listIdsByWxUserIds
(
wxUserIdsList
,
wxEnterpriseId
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
))
{
logger
.
error
(
"无导购关联数据"
);
continue
;
}
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
staffClerkRelationDTOS
)
{
//具有联系我功能的导购创建活码
staffClerkRelationService
.
updateOpenConcatFlagById
(
1
,
staffClerkRelationDTO
.
getStaffClerkRelationId
());
//创建活码
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
hmQrcodeQDTO
.
setHmType
(
1
);
hmQrcodeQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
hmQrcodeQDTO
.
setEnterpriseId
(
staffClerkRelationDTO
.
getEnterpriseId
());
hmQrcodeQDTO
.
setName
(
staffClerkRelationDTO
.
getStaffName
());
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setStoreId
(
staffClerkRelationDTO
.
getStoreId
());
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
staffClerkRelationDTO
.
getClerkId
()));
add
(
hmQrcodeQDTO
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"wxEnterpriseId"
,
wxEnterpriseId
);
jsonObject
.
put
(
"enterpriseId"
,
enterpriseId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendMessage
(
"checkStaffOpenContactByWxEnterpriseIdMq"
,
jsonObject
.
toJSONString
());
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送消息异常:{}"
,
e
.
getMessage
(),
e
);
}
List
<
StaffClerkRelationDTO
>
relationDTOS
=
staffClerkRelationService
.
listIdsByNotInWxUserIds
(
wxUserIdsList
,
wxEnterpriseId
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
relationDTOS
))
{
logger
.
error
(
"无导购不包含关联数据"
);
continue
;
}
for
(
StaffClerkRelationDTO
relationDTO
:
relationDTOS
)
{
//有活码,但是企微联系我功能 被关闭
String
clerkId
=
relationDTO
.
getClerkId
();
HmQrcodeBO
hmQrcodeBO
=
hmQrcodeService
.
queryByClerkId
(
clerkId
,
relationDTO
.
getWxEnterpriseId
());
if
(
hmQrcodeBO
==
null
)
{
logger
.
info
(
"导购无活码,无需处理:clerkId:{}"
,
clerkId
);
continue
;
}
staffClerkRelationService
.
updateOpenConcatFlagById
(
0
,
relationDTO
.
getStaffClerkRelationId
());
hmQrcodeService
.
updateStatusById
(
hmQrcodeBO
.
getHmId
(),
3
);
}
}
logger
.
info
(
"检查员工是否开启联系我,定时任务,end"
);
}
@Override
public
void
checkStaffOpenContactByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
public
void
checkStaffOpenContactByWxEnterpriseId
(
String
param
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
String
wxEnterpriseId
=
jsonObject
.
getString
(
"wxEnterpriseId"
);
String
enterpriseId
=
jsonObject
.
getString
(
"enterpriseId"
);
logger
.
info
(
"检查企业员工是否开启联系我:wxEnterpriseId:{},enterpriseId:{}"
,
wxEnterpriseId
,
enterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
//查询出所有正常的导购
//企微已经开启联系我
List
<
String
>
wxUserIdsList
=
qywxUserApiService
.
listCorpExternalUser
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
());
...
...
@@ -862,6 +839,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger
.
info
(
"导购无活码,无需处理:clerkId:{}"
,
clerkId
);
continue
;
}
staffClerkRelationService
.
updateOpenConcatFlagById
(
0
,
relationDTO
.
getStaffClerkRelationId
());
hmQrcodeService
.
updateStatusById
(
hmQrcodeBO
.
getHmId
(),
3
);
}
}
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
425337ea
...
...
@@ -56,13 +56,6 @@ public class ServiceTest {
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
}
@Test
public
void
test2
()
{
hmQrcodeApiService
.
checkStaffOpenContactByWxEnterpriseId
(
"5bd929fd3b2c49deaa1184bcb0d669b3"
,
"ff8080815dacd3a2015dacd3ef5c0000"
);
}
@Test
public
void
test3
()
{
haobanQywxFeeApiService
.
addFee
(
"5bd929fd3b2c49deaa1184bcb0d669b3"
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
425337ea
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.HttpClient
;
...
...
@@ -337,7 +338,10 @@ public class TestController extends WebBaseController {
*/
@RequestMapping
(
"/checkStaffOpenContactByWxEnterpriseId"
)
public
HaobanResponse
checkStaffOpenContactByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
hmQrcodeApiService
.
checkStaffOpenContactByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"wxEnterpriseId"
,
wxEnterpriseId
);
jsonObject
.
put
(
"enterpriseId"
,
enterpriseId
);
hmQrcodeApiService
.
checkStaffOpenContactByWxEnterpriseId
(
jsonObject
.
toJSONString
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
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