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
1b7a63bb
Commit
1b7a63bb
authored
Jul 18, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:暂时注释企微接口
parent
c5210cb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
+29
-18
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+29
-18
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
1b7a63bb
...
...
@@ -51,7 +51,6 @@ import com.gic.member.tag.api.service.MemberTagApiService;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.response.QywxResponseDTO
;
import
com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO
;
import
com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
...
...
@@ -134,6 +133,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if
(
hmGroupId
==
null
)
{
hmQrcodeQDTO
.
setHmGroupId
(
0L
);
}
List
<
String
>
clerkIdList
=
setStoreClerk
(
hmQrcodeQDTO
,
wxEnterpriseId
,
hmId
,
hmType
);
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该导购已经生成过活码或未关联过好办"
);
...
...
@@ -151,12 +151,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
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
());
}
hmQrcodeQDTO
.
setWxQrcode
(
qywxExternalcontactResultDTO
.
getQr_code
());
hmQrcodeQDTO
.
setWxConfigId
(
qywxExternalcontactResultDTO
.
getConfig_id
());
//
QywxExternalcontactResultDTO qywxExternalcontactResultDTO = qywxUserApiService.addContactWay(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), qywxExternalcontactDTO);
//
if (qywxExternalcontactResultDTO.getErrcode() != 0) {
//
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_0.getCode()), "创建活码失败:" + qywxExternalcontactResultDTO.getErrmsg());
//
}
//
hmQrcodeQDTO.setWxQrcode(qywxExternalcontactResultDTO.getQr_code());
//
hmQrcodeQDTO.setWxConfigId(qywxExternalcontactResultDTO.getConfig_id());
int
saveResult
=
hmQrcodeService
.
insert
(
hmQrcodeQDTO
);
if
(
saveResult
==
1
)
{
// save welcome relation
...
...
@@ -168,6 +168,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GicLogRecord
(
value
=
"批量新增员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
optType
=
GicLogRecordOptTypeEnum
.
HUOMA_ADD
,
optPage
=
"活码管理-新增员工活码"
,
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
public
ServiceResponse
addList
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
String
wxEnterpriseId
=
hmQrcodeQDTO
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
...
...
@@ -187,6 +193,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
clerkId
));
add
(
hmQrcodeQDTO
);
}
setLoggerContext
(
hmQrcodeQDTO
.
getEnterpriseId
(),
wxEnterpriseId
,
hmQrcodeQDTO
.
getCreatorId
(),
hmQrcodeQDTO
.
getCreatorName
());
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
"【"
+
"批量创建数量"
+
clerkIdList
.
size
()
+
"】"
);
return
ServiceResponse
.
success
();
}
...
...
@@ -242,11 +250,11 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
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
());
}
//
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());
//
}
int
updateResult
=
hmQrcodeService
.
update
(
hmQrcodeQDTO
);
if
(
updateResult
==
1
)
{
...
...
@@ -305,7 +313,15 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if
(!
memberLabelId
.
equals
(
memberLabelIdOld
))
{
MemberTagDTO
memberTagDTO
=
memberTagApiService
.
getMemberTagById
(
memberLabelId
);
MemberTagDTO
memberTagDTOOld
=
memberTagApiService
.
getMemberTagById
(
memberLabelIdOld
);
logContent
.
append
(
"活码标签「"
).
append
(
memberTagDTOOld
.
getTagName
()).
append
(
"」"
).
append
(
"变更为「"
).
append
(
memberTagDTO
.
getTagName
()).
append
(
"」"
);
String
oldTagName
=
""
;
String
tagName
=
""
;
if
(
memberTagDTOOld
!=
null
)
{
oldTagName
=
memberTagDTOOld
.
getTagName
();
}
if
(
memberTagDTO
!=
null
)
{
tagName
=
memberTagDTO
.
getTagName
();
}
logContent
.
append
(
"活码标签「"
).
append
(
oldTagName
).
append
(
"」"
).
append
(
"变更为「"
).
append
(
tagName
).
append
(
"」"
);
}
//欢迎语
...
...
@@ -364,11 +380,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
else
if
(
hmType
==
1
)
{
//单人活码
String
clerkId
=
clerkIdList
.
get
(
0
);
HmQrcodeBO
hmQrcodeBO
=
hmQrcodeService
.
queryByClerkId
(
clerkId
,
wxEnterpriseId
);
if
(
hmQrcodeBO
!=
null
)
{
logger
.
error
(
"该导购已经生成过活码:{}"
,
clerkId
);
return
null
;
}
hmQrcodeQDTO
.
setClerkId
(
clerkId
);
ClerkDTO
clerkDTO
=
clerkService
.
getclerkById
(
clerkId
);
if
(
clerkDTO
!=
null
)
{
...
...
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