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
b341f1ac
Commit
b341f1ac
authored
Apr 25, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8cfdb28c
605585f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
29 deletions
+42
-29
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+26
-9
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+3
-0
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+1
-1
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+12
-19
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
b341f1ac
...
...
@@ -348,19 +348,36 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
private
void
dealDepartmentToMq
(
String
taskId
,
Set
<
String
>
dealList
,
SyncTaskStatusEnum
syncTaskStatusEnum
)
{
//预处理分组任务
syncTaskService
.
updateTaskStatus
(
taskId
,
syncTaskStatusEnum
.
getVal
());
dealList
.
forEach
(
relationId
->
{
//
// dealList.forEach(relationId -> {
// DealParamMqDTO dealParamMqDTO = new DealParamMqDTO();
// dealParamMqDTO.setTaskId(taskId);
// dealParamMqDTO.setData(relationId);
// dealParamMqDTO.setType(syncTaskStatusEnum.getVal());
// GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
// try {
// clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO));
// } catch (Exception e) {
// logger.info("发送失败:{},{}", taskId, relationId);
// e.printStackTrace();
// }
// });
List
<
String
>
listRet
=
dealList
.
stream
().
map
(
relationId
->
{
DealParamMqDTO
dealParamMqDTO
=
new
DealParamMqDTO
();
dealParamMqDTO
.
setTaskId
(
taskId
);
dealParamMqDTO
.
setData
(
relationId
);
dealParamMqDTO
.
setType
(
syncTaskStatusEnum
.
getVal
());
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendMessage
(
"departmentSyncDealMq"
,
JSONObject
.
toJSONString
(
dealParamMqDTO
));
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送失败:{},{}"
,
taskId
,
relationId
);
e
.
printStackTrace
();
}
});
return
JSONObject
.
toJSONString
(
dealParamMqDTO
);
}).
collect
(
Collectors
.
toList
());
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendBatchMessages
(
"departmentSyncDealMq"
,
listRet
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送失败:{},{}"
,
taskId
,
JSONObject
.
toJSONString
(
listRet
));
e
.
printStackTrace
();
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
b341f1ac
...
...
@@ -623,6 +623,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return
;
}
JSONArray
jsonArr
=
JSON
.
parseArray
(
res
);
if
(
jsonArr
.
size
()
==
0
)
{
return
;
}
List
<
MemberUnionidRelatedDTO
>
list
=
this
.
getByWxUserIdAndWxEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
List
<
String
>
externalUserIdList
=
list
.
stream
().
map
(
student
->
student
.
getSelfExternalUserid
())
.
collect
(
Collectors
.
toList
());
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
b341f1ac
...
...
@@ -166,7 +166,7 @@ public void sendMessage() {
@Test
public
void
extensionList
()
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk"
,
"
qiuwenmin
"
);
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk"
,
"
de2c33f2e8924ff884e0073ca2f2f711
"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
b341f1ac
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.enterprise.api.dto.EnterpriseAndUserDTO
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
...
...
@@ -29,7 +13,6 @@ import com.gic.enterprise.api.service.StoreService;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
...
...
@@ -46,6 +29,16 @@ import com.gic.wechat.api.dto.qywx.UserDTO;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.gic.wechat.token.api.dto.QywxCorpInfoDTO
;
import
com.gic.wechat.token.api.service.QywxTokenManageService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@RestController
public
class
WxEnterpriseController
extends
WebBaseController
{
...
...
@@ -224,7 +217,7 @@ public class WxEnterpriseController extends WebBaseController{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
!=
null
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterprise
.
getContactSecret
(),
wxEnterprise
.
getWxSecretKey
()
,
wxEnterprise
.
getMemberSecret
()
)){
if
(
wxEnterprise
!=
null
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterprise
.
getContactSecret
(),
wxEnterprise
.
getWxSecretKey
())){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
...
...
@@ -276,7 +269,7 @@ public class WxEnterpriseController extends WebBaseController{
}
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
wxEnterprise
.
getCorpid
(),
wxSecretKey
,
login
.
getStaffDTO
().
getWxUserId
());
logger
.
info
(
"【保存联系人key】res={}"
,
res
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
res
)
){
if
(
res
==
null
){
wxEnterprise
.
setWxSecretKeyLastTime
(
new
Date
());
wxEnterpriseApiService
.
update
(
wxEnterprise
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
...
...
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