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
932e1b9e
Commit
932e1b9e
authored
Apr 18, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自建接口调整
parent
37c541be
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
17 deletions
+30
-17
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+3
-2
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+2
-1
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+25
-14
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
932e1b9e
...
...
@@ -40,6 +40,7 @@ import com.gic.haoban.manage.service.service.MaterialService;
import
com.gic.haoban.manage.service.service.MiniprogramSettingService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.util.CommonUtil
;
import
com.gic.haoban.manage.service.util.QwUtils
;
import
com.gic.wechat.api.enums.QywxMediaTypeEnum
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -145,7 +146,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
type
==
3
)
{
String
imgUrl
=
materialDTO
.
getImgUrl
();
logger
.
info
(
"【上传图片】imgUrl={}"
,
imgUrl
);
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
qwDTO
.
getThirdCorpid
()
,
config
.
getWxSuiteid
(),
CommonUtil
.
getFileByte
(
imgUrl
));
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
qwDTO
.
getThirdCorpid
()
,
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
CommonUtil
.
getFileByte
(
imgUrl
)
,
qwDTO
.
isSelf
(
));
logger
.
info
(
"【上传图片返回】response={}"
,
JSON
.
toJSONString
(
response
));
String
wxImgUrl
=
response
.
getResult
()
==
null
?
""
:
response
.
getResult
().
toString
();
materialDTO
.
setWxImgUrl
(
wxImgUrl
);
...
...
@@ -215,7 +216,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
String
imgUrl
=
materialDTO
.
getImgUrl
();
String
oldImgUrl
=
materialDTO
.
getImgUrl
();
if
(!
imgUrl
.
equals
(
oldImgUrl
))
{
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
CommonUtil
.
getFileByte
(
imgUrl
));
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
CommonUtil
.
getFileByte
(
imgUrl
)
,
qwDTO
.
isSelf
(
));
String
wxImgUrl
=
response
.
getResult
()
==
null
?
""
:
response
.
getResult
().
toString
();
materialDTO
.
setWxImgUrl
(
wxImgUrl
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
932e1b9e
...
...
@@ -98,6 +98,7 @@ import com.gic.haoban.manage.service.service.chat.GroupChatService;
import
com.gic.haoban.manage.service.service.hm.HmLinkService
;
import
com.gic.haoban.manage.service.service.hm.WxUserAddLogService
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.haoban.manage.service.util.QwUtils
;
import
com.gic.member.api.dto.MemberDTO
;
import
com.gic.member.api.dto.MemberSimpleDetailDTO
;
import
com.gic.member.api.dto.MemberSourceDetailDTO
;
...
...
@@ -1144,7 +1145,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if
(
qwDTO
==
null
)
{
return
null
;
}
return
qywxSuiteApiService
.
resultExternalMessage
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
wxMessageId
);
return
qywxSuiteApiService
.
resultExternalMessage
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
wxMessageId
,
qwDTO
.
isSelf
()
);
}
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
932e1b9e
...
...
@@ -20,6 +20,7 @@ import com.gic.haoban.manage.service.pojo.QywxSyncTagFormatPojo;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.QywxTagService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.util.QwUtils
;
import
com.gic.member.api.dto.MemberTagDTO
;
import
com.gic.member.api.service.MemberTagService
;
import
com.gic.member.tag.api.dto.MemberTagItemDTO
;
...
...
@@ -93,7 +94,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"企业标签所在企业不存在"
);
return
;
}
QywxGetCorpTagListDTO
corpTagListResp
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
null
,
-
1
);
QywxGetCorpTagListDTO
corpTagListResp
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
null
,
-
1
,
qwDTO
.
isSelf
()
);
if
(
corpTagListResp
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"企业微信标签有问题:{}"
,
wxEnterpriseId
);
return
;
...
...
@@ -110,7 +111,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
ServiceResponse
ret
=
new
ServiceResponse
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
//调用企业微信接口保存
QywxGetCorpTagListDTO
resp
=
this
.
saveQywxTag
(
qwDTO
.
getThirdCorpid
(),
infoDTO
,
items
);
QywxGetCorpTagListDTO
resp
=
this
.
saveQywxTag
(
qwDTO
.
getThirdCorpid
(),
infoDTO
,
items
,
qwDTO
);
if
(
resp
.
getErrcode
()
!=
0
&&
CollectionUtils
.
isEmpty
(
resp
.
getTagGroup
()))
{
logger
.
info
(
"同步失败:{}"
,
JSONObject
.
toJSONString
(
resp
));
ret
.
setCode
(
resp
.
getErrcode
());
...
...
@@ -187,7 +188,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
* @param items
* @return
*/
private
QywxGetCorpTagListDTO
saveQywxTag
(
String
corpid
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
)
{
private
QywxGetCorpTagListDTO
saveQywxTag
(
String
corpid
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
,
WxEnterpriseQwDTO
qwDTO
)
{
QywxTagGroupDTO
qywxTagGroupDTO
=
new
QywxTagGroupDTO
();
qywxTagGroupDTO
.
setGroupName
(
"GIC"
+
infoDTO
.
getQywxGroupName
());
qywxTagGroupDTO
.
setOrder
(
infoDTO
.
getOrder
());
...
...
@@ -200,8 +201,11 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
return
qywxTagDTO
;
}).
collect
(
Collectors
.
toList
());
qywxTagGroupDTO
.
setTag
(
tagItems
);
return
qywxSuiteApiService
.
saveCorpTag
(
corpid
,
config
.
getWxSuiteid
(),
qywxTagGroupDTO
);
String
secret
=
config
.
getWxSuiteid
()
;
if
(
qwDTO
.
isSelf
())
{
secret
=
qwDTO
.
getSelfSecret
()
;
}
return
qywxSuiteApiService
.
saveCorpTag
(
corpid
,
secret
,
qywxTagGroupDTO
,
qwDTO
.
isSelf
());
}
@Override
...
...
@@ -217,7 +221,11 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagService
.
closeSync
(
wxEnterpriseId
,
memberTagId
);
List
<
String
>
delIds
=
new
ArrayList
<>();
delIds
.
add
(
tabQywxTag
.
getQywxGroupKey
());
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
delIds
,
0
);
String
secret
=
config
.
getWxSuiteid
()
;
if
(
qwDTO
.
isSelf
())
{
secret
=
qwDTO
.
getSelfSecret
()
;
}
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
secret
,
delIds
,
0
,
qwDTO
.
isSelf
());
logger
.
info
(
"关闭同步:{}"
,
JSONObject
.
toJSONString
(
responseDTO
));
if
(
responseDTO
.
getErrcode
()
!=
0
)
{
resp
.
setMessage
(
responseDTO
.
getErrmsg
());
...
...
@@ -241,7 +249,11 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
List
<
String
>
delIds
=
new
ArrayList
<>();
delIds
.
add
(
qywxTagItem
.
getQywxTagKey
());
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
delIds
,
1
);
String
secret
=
config
.
getWxSuiteid
()
;
if
(
qwDTO
.
isSelf
())
{
secret
=
qwDTO
.
getSelfSecret
()
;
}
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
secret
,
delIds
,
1
,
qwDTO
.
isSelf
());
logger
.
info
(
"删除标签项:{}"
,
JSONObject
.
toJSONString
(
responseDTO
));
if
(
responseDTO
.
getErrcode
()
!=
0
)
{
resp
.
setMessage
(
responseDTO
.
getErrmsg
());
...
...
@@ -285,7 +297,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"新增标签组无需操作:{}"
,
callbackDTO
.
getTagId
());
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
callbackDTO
.
getTagId
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()
,
qwDTO
.
isSelf
());
if
(
tagDetail
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"没有关联,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
return
;
...
...
@@ -298,7 +310,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//查找对应的标签组 如果标签组关联了
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
callbackDTO
.
getTagId
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
ids
,
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getType
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getType
()
,
qwDTO
.
isSelf
());
if
(
tagDetail
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"查询失败,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
return
;
...
...
@@ -405,7 +417,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO
.
setId
(
callbackDTO
.
getTagId
());
qywxTagDTO
.
setName
(
qywxGroupKey
.
getQywxGroupName
());
qywxTagDTO
.
setOrder
(
qywxGroupKey
.
getOrder
());
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
qywxTagDTO
);
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
()
);
//标签项
}
else
if
(
Objects
.
equals
(
relationTypeEnum
.
getTagType
(),
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getTagType
()))
{
...
...
@@ -425,7 +437,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO
.
setId
(
callbackDTO
.
getTagId
());
qywxTagDTO
.
setName
(
qywxTagItem
.
getQywxTagName
());
qywxTagDTO
.
setOrder
(
qywxTagItem
.
getOrder
());
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
qywxTagDTO
);
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
()
);
}
}
...
...
@@ -754,7 +766,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO
.
setId
(
renameQywxKey
);
qywxTagDTO
.
setName
(
name
);
qywxTagDTO
.
setOrder
(
order
);
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
qywxTagDTO
);
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
()
);
logger
.
info
(
"同步名称:{}"
,
JSONObject
.
toJSONString
(
responseDTO
));
if
(
responseDTO
.
getErrcode
()
!=
0
)
{
resp
.
setMessage
(
responseDTO
.
getErrmsg
());
...
...
@@ -837,7 +849,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
relation
.
getWxEnterpriseId
())
;
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
tabQywxTag
.
getQywxGroupKey
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()
,
qwDTO
.
isSelf
());
if
(
tagDetail
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"查询失败,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
ret
.
put
(
"描述"
,
"查询失败:"
+
tagDetail
.
getErrmsg
());
...
...
@@ -951,5 +963,4 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
RedisUtil
.
setCache
(
key
,
currentTimes
+
1
,
2L
,
TimeUnit
.
HOURS
);
}
}
}
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