Commit 6023f3b4 by 墨竹

fix:代码优化

parent 5c4ab7ba
......@@ -278,8 +278,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())) {
logger.info("新增标签组无需操作:{}", callbackDTO.getTagId());
List<String> ids = new ArrayList<>();
ids.add(callbackDTO.getTagId());
......@@ -292,7 +296,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//保存标签项
qywxTagService.saveQywxTagByQywxGroupKey(wxEnterpriseDto.getWxEnterpriseId(), qywxTagGroupDTO);
//标签项
} else if (relationTypeEnum.getTagType() == QywxTagRelationTypeEnum.TAG_ITEM.getTagType()) {
} else if (Objects.equals(relationTypeEnum.getTagType(), QywxTagRelationTypeEnum.TAG_ITEM.getTagType())) {
//查找对应的标签组 如果标签组关联了
List<String> ids = new ArrayList<>();
ids.add(callbackDTO.getTagId());
......@@ -306,10 +310,8 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
return;
}
QywxTagGroupDTO qywxTagGroupDTO = tagDetail.getTagGroup().get(0);
//保存标签项
qywxTagService.saveQywxTagByQywxGroupKey(wxEnterpriseDto.getWxEnterpriseId(), qywxTagGroupDTO);
}
}
......@@ -799,7 +801,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
for (TabQywxTagRelation qywxTagRelation : qywxTagRelations) {
Map<String, Object> map = checkQywxSyncByQywxTag(qywxTagRelation, wxEnterprise, pojo);
if (MapUtils.isNotEmpty(map)) {
logger.error("企微与好办同步标签不相同:{}",JSON.toJSONString(map));
logger.error("企微与好办同步标签不相同:{}", JSON.toJSONString(map));
}
}
} catch (Exception e) {
......
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