Commit ac09e791 by fudahua

企业微信标签添加状态变更接口

parent 11c2e913
......@@ -75,4 +75,13 @@ public interface QywxTagApiService {
*/
public ServiceResponse syncFriendTagToQywxByExternalUserId(String wxEnterpriseId, String enterpriseId, String externalUserId, List<String> tagItemIds);
/**
* 更改状态
*
* @param memberTagId
* @param wxEnterpriseId
* @param status
*/
public void changeQywxTagStatus(String memberTagId, String wxEnterpriseId, int status);
}
......@@ -165,5 +165,13 @@ public interface QywxTagService {
*/
public List<TabQywxTagItem> listQywxTagItemByIds(String wxEnterpriseId, List<String> ids);
/**
* 变更状态
*
* @param id
* @param status
*/
public void changeTagRelationStatus(String id, int status);
}
......@@ -210,4 +210,13 @@ public class QywxTagServiceImpl implements QywxTagService {
public List<TabQywxTagItem> listQywxTagItemByIds(String wxEnterpriseId, List<String> ids) {
return qywxTagItemMapper.listByQywxTagItemsIds(wxEnterpriseId, ids);
}
@Override
public void changeTagRelationStatus(String id, int status) {
TabQywxTagRelation tabQywxTagRelation = new TabQywxTagRelation();
tabQywxTagRelation.setQywxTagRelationId(id);
tabQywxTagRelation.setStatusFlag(status);
tabQywxTagRelation.setUpdateTime(new Date());
qywxTagRelationMapper.updateByPrimaryKeySelective(tabQywxTagRelation);
}
}
......@@ -537,4 +537,18 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
return ret;
}
@Override
public void changeQywxTagStatus(String memberTagId, String wxEnterpriseId, int status) {
List<TabQywxTagRelation> tagRelations = qywxTagService.listQywxTagRelationByMemberTagId(wxEnterpriseId, memberTagId);
if (CollectionUtils.isEmpty(tagRelations)) {
return;
}
TabQywxTagRelation tagRelation = tagRelations.stream().filter(dto -> dto.getRelationType() == QywxTagRelationTypeEnum.TAG_GROUP.getType()).findFirst().orElse(null);
if (null == tagRelation) {
return;
}
qywxTagService.changeTagRelationStatus(tagRelation.getQywxTagRelationId(), status);
return;
}
}
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