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
e88b4ecc
Commit
e88b4ecc
authored
Aug 19, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:创建活码定时任务改为消息队列
parent
7f9b4742
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
53 deletions
+31
-53
HmQrcodeApiService.java
.../gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
+4
-5
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+22
-41
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+0
-6
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/hm/HmQrcodeApiService.java
View file @
e88b4ecc
...
...
@@ -124,13 +124,12 @@ public interface HmQrcodeApiService {
/**
* 检查员工开启联系我
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* "routerName": "checkStaffOpenContactByWxEnterpriseIdMq"
* @param param 参数
* @author mozhu
* @date 2022-08-
08 22:01:43
* @date 2022-08-
19 15:04:37
*/
void
checkStaffOpenContactByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
);
void
checkStaffOpenContactByWxEnterpriseId
(
String
param
);
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
e88b4ecc
...
...
@@ -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
;
...
...
@@ -29,10 +30,7 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.pojo.bo.hm.*
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.WelcomeService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.hm.HmClerkRelationService
;
import
com.gic.haoban.manage.service.service.hm.HmGroupService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
...
...
@@ -104,6 +102,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
private
WelcomeService
welcomeService
;
@Autowired
private
RightService
rightService
;
@Autowired
private
WxEnterpriseRelatedService
wxEnterpriseRelatedService
;
@GicLogRecord
(
value
=
"新增员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
...
...
@@ -767,51 +767,31 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger
.
info
(
"该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}"
,
enterpriseId
,
wxEnterpriseId
);
continue
;
}
//企微已经开启联系我
List
<
String
>
wxUserIdsList
=
qywxUserApiService
.
listCorpExternalUser
(
wxEnterpriseDTO
.
getCorpid
(),
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
);
}
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
);
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
);
}
}
logger
.
info
(
"检查员工是否开启联系我,定时任务,end"
);
}
@Override
public
void
checkStaffOpenContactByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
public
void
checkStaffOpenContactByWxEnterpriseId
(
String
param
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
String
wxEnterpriseId
=
jsonObject
.
getString
(
"wxEnterpriseId"
);
String
enterpriseId
=
jsonObject
.
getString
(
"enterpriseId"
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
error
(
"无wx企业:{}"
,
wxEnterpriseId
);
return
;
}
logger
.
info
(
"检查企业员工是否开启联系我:wxEnterpriseId:{},enterpriseId:{}"
,
wxEnterpriseId
,
enterpriseId
);
//查询出所有正常的导购
//企微已经开启联系我
List
<
String
>
wxUserIdsList
=
qywxUserApiService
.
listCorpExternalUser
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
...
...
@@ -848,6 +828,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 @
e88b4ecc
...
...
@@ -50,10 +50,4 @@ public class ServiceTest {
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
}
@Test
public
void
test2
()
{
hmQrcodeApiService
.
checkStaffOpenContactByWxEnterpriseId
(
"5bd929fd3b2c49deaa1184bcb0d669b3"
,
"ff8080815dacd3a2015dacd3ef5c0000"
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
e88b4ecc
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