Commit 3f0e48a8 by 墨竹

fix:代码优化

parent 6023f3b4
......@@ -328,8 +328,12 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
return;
}
QywxTagRelationTypeEnum relationTypeEnum = QywxTagRelationTypeEnum.getByTagType(callbackDTO.getTagType());
if (relationTypeEnum == null) {
logger.error("未找到对应关系,{}", callbackDTO.getTagType());
return;
}
//标签组
if (relationTypeEnum.getTagType() == QywxTagRelationTypeEnum.TAG_GROUP.getTagType()) {
if (Objects.equals(relationTypeEnum.getTagType(), QywxTagRelationTypeEnum.TAG_GROUP.getTagType())) {
TabQywxTag qywxGroupKey = qywxTagService.getQywxTagByQywxGroupKey(wxEnterpriseDto.getWxEnterpriseId(), callbackDTO.getTagId());
if (null == qywxGroupKey) {
logger.info("原型不存在,不需要处理");
......@@ -349,7 +353,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagService.delQywxTag(callbackDTO.getTagId(), wxEnterpriseDto.getWxEnterpriseId());
saveCloseTask(qywxGroupKey.getQywxGroupName().substring(3), "-1", relation.getWxEnterpriseId(), relation.getEnterpriseId());
//标签项
} else if (relationTypeEnum.getTagType() == QywxTagRelationTypeEnum.TAG_ITEM.getTagType()) {
} else if (Objects.equals(relationTypeEnum.getTagType(), QywxTagRelationTypeEnum.TAG_ITEM.getTagType())) {
TabQywxTagRelation qywxTagRelation = qywxTagService.getQywxTagRelationByQywxKey(wxEnterpriseDto.getWxEnterpriseId(), callbackDTO.getTagId(), QywxTagRelationTypeEnum.TAG_ITEM.getType());
if (null == qywxTagRelation) {
logger.info("没有关联,无需操作");
......@@ -383,8 +387,12 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
return;
}
QywxTagRelationTypeEnum relationTypeEnum = QywxTagRelationTypeEnum.getByTagType(callbackDTO.getTagType());
if (relationTypeEnum == null) {
logger.error("未找到对应关系,{}", callbackDTO.getTagType());
return;
}
//标签组
if (relationTypeEnum.getTagType() == QywxTagRelationTypeEnum.TAG_GROUP.getTagType()) {
if (Objects.equals(relationTypeEnum.getTagType(), QywxTagRelationTypeEnum.TAG_GROUP.getTagType())) {
//判断是否存在关联 存在需要同步回去
TabQywxTagRelation relaton = qywxTagService.getQywxTagRelationByQywxKey(wxEnterpriseDto.getWxEnterpriseId(), callbackDTO.getTagId(), QywxTagRelationTypeEnum.TAG_GROUP.getType());
if (null == relaton) {
......@@ -400,7 +408,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxSuiteApiService.editCorpTagNameOrOrder(wxEnterpriseDto.getCorpid(), config.getWxSuiteid(), qywxTagDTO);
//标签项
} else if (relationTypeEnum.getTagType() == QywxTagRelationTypeEnum.TAG_ITEM.getTagType()) {
} else if (Objects.equals(relationTypeEnum.getTagType(), QywxTagRelationTypeEnum.TAG_ITEM.getTagType())) {
TabQywxTagItem qywxTagItem = qywxTagService.getQywxTagItemByQywxItemKey(wxEnterpriseDto.getWxEnterpriseId(), callbackDTO.getTagId());
if (null == qywxTagItem) {
logger.info("没有关联,无需操作");
......@@ -418,7 +426,6 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO.setName(qywxTagItem.getQywxTagName());
qywxTagDTO.setOrder(qywxTagItem.getOrder());
qywxSuiteApiService.editCorpTagNameOrOrder(wxEnterpriseDto.getCorpid(), config.getWxSuiteid(), qywxTagDTO);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment