Commit 02fd5073 by fudahua

会员标签同步-重命名-fix

parent 0bf77378
......@@ -190,5 +190,12 @@ public interface QywxTagService {
*/
public TabQywxTagItem getQywxTagItemById(String wxEnterpriseId, String id);
/**
* 更新名称
*
* @return
*/
public boolean saveQywxTagOrTagItemName(String id, String name, Integer relationType);
}
......@@ -229,4 +229,22 @@ public class QywxTagServiceImpl implements QywxTagService {
public TabQywxTagItem getQywxTagItemById(String wxEnterpriseId, String id) {
return qywxTagItemMapper.selectByPrimaryKey(id);
}
@Override
public boolean saveQywxTagOrTagItemName(String id, String name, Integer relationType) {
if (relationType == QywxTagRelationTypeEnum.TAG_GROUP.getType()) {
TabQywxTag tabQywxTag = new TabQywxTag();
tabQywxTag.setQywxTagId(id);
tabQywxTag.setQywxGroupName(name);
tabQywxTag.setUpdateTime(new Date());
qywxTagMapper.updateByPrimaryKeySelective(tabQywxTag);
} else if (relationType == QywxTagRelationTypeEnum.TAG_ITEM.getType()) {
TabQywxTagItem tabQywxTagItem = new TabQywxTagItem();
tabQywxTagItem.setQywxTagItemId(id);
tabQywxTagItem.setQywxTagName(name);
tabQywxTagItem.setUpdateTime(new Date());
qywxTagItemMapper.updateByPrimaryKeySelective(tabQywxTagItem);
}
return true;
}
}
......@@ -1557,6 +1557,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
external.setStatusFlag(1);
externalClerkRelatedService.update(external);
}
return "";
}
......
......@@ -825,7 +825,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
ServiceResponse resp = new ServiceResponse();
String renameQywxKey = null;
Long order = null;
String relationId = null;
//标签组
if (type == QywxTagRelationTypeEnum.TAG_GROUP.getType()) {
......@@ -837,6 +837,8 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
renameQywxKey = tabQywxTag.getQywxGroupKey();
order = tabQywxTag.getOrder();
name = "GIC" + name;
relationId = tabQywxTag.getQywxTagId();
} else if (type == QywxTagRelationTypeEnum.TAG_ITEM.getType()) {
TabQywxTagItem qywxTagItem = qywxTagService.getQywxTagItemById(wxEnterpriseId, id);
if (null == qywxTagItem) {
......@@ -845,8 +847,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
renameQywxKey = qywxTagItem.getQywxTagKey();
order = qywxTagItem.getOrder();
}
relationId = qywxTagItem.getQywxTagId();
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
//名称同步回去
......@@ -857,6 +860,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
QywxResponseDTO responseDTO = qywxSuiteApiService.editCorpTagNameOrOrder(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), qywxTagDTO);
logger.info("同步名称:{}", JSONObject.toJSONString(responseDTO));
if (responseDTO.getErrcode() != 0) {
qywxTagService.saveQywxTagOrTagItemName(relationId, name, type);
resp.setMessage(responseDTO.getErrmsg());
resp.setCode(responseDTO.getErrcode());
}
......
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