|
@@ -112,7 +112,7 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
CorpTagGroup corpTagGroup = Optional.ofNullable(corpTagGroupMapper.selectOne(Wrappers.lambdaQuery(CorpTagGroup.class)
|
|
CorpTagGroup corpTagGroup = Optional.ofNullable(corpTagGroupMapper.selectOne(Wrappers.lambdaQuery(CorpTagGroup.class)
|
|
|
- .eq(CorpTagGroup::getGroupId, corp_tagGroup.getGroupId()).last("limit 1")))
|
|
|
|
|
|
|
+ .eq(CorpTagGroup::getGroupId, corp_tagGroup.getGroupId()).last("limit 1")))
|
|
|
.orElseGet(() -> {
|
|
.orElseGet(() -> {
|
|
|
CorpTagGroup corpTagGroup2 = new CorpTagGroup();
|
|
CorpTagGroup corpTagGroup2 = new CorpTagGroup();
|
|
|
corpTagGroup2.setGroupId(corp_tagGroup.getGroupId());
|
|
corpTagGroup2.setGroupId(corp_tagGroup.getGroupId());
|
|
@@ -120,6 +120,7 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
corpTagGroup2.setOrdered(corp_tagGroup.getOrder());
|
|
corpTagGroup2.setOrdered(corp_tagGroup.getOrder());
|
|
|
return corpTagGroup2;
|
|
return corpTagGroup2;
|
|
|
});
|
|
});
|
|
|
|
|
+ corpTagGroup.setRemark(tagGroup.getRemark());
|
|
|
if (corpTagGroup.getId() == null) corpTagGroupMapper.insert(corpTagGroup);
|
|
if (corpTagGroup.getId() == null) corpTagGroupMapper.insert(corpTagGroup);
|
|
|
corpTagGroupMapper.updateById(corpTagGroup);
|
|
corpTagGroupMapper.updateById(corpTagGroup);
|
|
|
} catch (DuplicateKeyException e) {
|
|
} catch (DuplicateKeyException e) {
|
|
@@ -142,10 +143,10 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
params.putOpt("id", tagGroup.getGroupId());
|
|
params.putOpt("id", tagGroup.getGroupId());
|
|
|
params.putOpt("name", tagGroup.getGroupName());
|
|
params.putOpt("name", tagGroup.getGroupName());
|
|
|
wxCorpOps.editCorpTag(params);
|
|
wxCorpOps.editCorpTag(params);
|
|
|
-
|
|
|
|
|
- corpTagGroup.setGroupName(tagGroup.getGroupName());
|
|
|
|
|
- corpTagGroupMapper.updateById(corpTagGroup);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ corpTagGroup.setGroupName(tagGroup.getGroupName());
|
|
|
|
|
+ corpTagGroup.setRemark(tagGroup.getRemark());
|
|
|
|
|
+ corpTagGroupMapper.updateById(corpTagGroup);
|
|
|
|
|
|
|
|
List<CorpUserExternalTagGroupInfo.Tag> newTagsList = new ArrayList<>();
|
|
List<CorpUserExternalTagGroupInfo.Tag> newTagsList = new ArrayList<>();
|
|
|
Map<String, CorpTag> corpTagMap = new ConcurrentHashMap<>();
|
|
Map<String, CorpTag> corpTagMap = new ConcurrentHashMap<>();
|
|
@@ -260,7 +261,7 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
tagGrous.getTagList().forEach(tag -> {
|
|
tagGrous.getTagList().forEach(tag -> {
|
|
|
if (tag.getType() == 2) {
|
|
if (tag.getType() == 2) {
|
|
|
Optional.ofNullable(corpTagRuleRelationMapper.selectList(Wrappers.lambdaQuery(CorpTagRuleRelation.class)
|
|
Optional.ofNullable(corpTagRuleRelationMapper.selectList(Wrappers.lambdaQuery(CorpTagRuleRelation.class)
|
|
|
- .eq(CorpTagRuleRelation::getTagId, tag.getId())))
|
|
|
|
|
|
|
+ .eq(CorpTagRuleRelation::getTagId, tag.getId())))
|
|
|
.ifPresent(rules -> {
|
|
.ifPresent(rules -> {
|
|
|
tag.setRuleRelationList(rules);
|
|
tag.setRuleRelationList(rules);
|
|
|
if (StrUtil.isNotEmpty(tag.getRuleNameListStr())) {
|
|
if (StrUtil.isNotEmpty(tag.getRuleNameListStr())) {
|
|
@@ -284,10 +285,10 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Page<CorpTagBackView> getCorpTagBackView(Integer start, Integer limit, Integer type, String[] tagIds, String[] groupIds, String sort, String order) {
|
|
|
|
|
|
|
+ public Page<CorpTagBackView> getCorpTagBackView(Integer start, Integer limit, Integer type, String name, String[] groupIds, String sort, String order) throws Exception {
|
|
|
Long wxCorpId = 2l;
|
|
Long wxCorpId = 2l;
|
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
|
- Page<CorpTagBackView> corpTagBackViewPage = corpTagMapper.getCorpTagBackView(new Page<>(start, limit), tagIds, sort, order, wxCorpId);
|
|
|
|
|
|
|
+ Page<CorpTagBackView> corpTagBackViewPage = corpTagMapper.getCorpTagBackView(new Page<>(start, limit), name,groupIds, sort, order, wxCorpId);
|
|
|
corpTagBackViewPage.getRecords().forEach(view -> {
|
|
corpTagBackViewPage.getRecords().forEach(view -> {
|
|
|
if (StrUtil.isNotEmpty(view.getRuleNameListStr())) {
|
|
if (StrUtil.isNotEmpty(view.getRuleNameListStr())) {
|
|
|
try {
|
|
try {
|
|
@@ -299,8 +300,8 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
});
|
|
});
|
|
|
return corpTagBackViewPage;
|
|
return corpTagBackViewPage;
|
|
|
}
|
|
}
|
|
|
- Page<CorpTagBackView> corpTagBackView = corpTagGroupMapper.getCorpTagBackView(new Page<>(start, limit), groupIds, sort, order, wxCorpId);
|
|
|
|
|
- corpTagBackView.getRecords().forEach(data->{
|
|
|
|
|
|
|
+ Page<CorpTagBackView> corpTagBackView = corpTagGroupMapper.getCorpTagBackView(new Page<>(start, limit), name, sort, order, wxCorpId);
|
|
|
|
|
+ corpTagBackView.getRecords().forEach(data -> {
|
|
|
CorpTagBackView info = corpTagGroupMapper.fillCorpGroupTagInfo(data.getGroupIdStr(), wxCorpId);
|
|
CorpTagBackView info = corpTagGroupMapper.fillCorpGroupTagInfo(data.getGroupIdStr(), wxCorpId);
|
|
|
data.setTagSize(info.getTagSize());
|
|
data.setTagSize(info.getTagSize());
|
|
|
data.setNumOfCustomer(info.getNumOfCustomer());
|
|
data.setNumOfCustomer(info.getNumOfCustomer());
|
|
@@ -320,8 +321,8 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
Page<CorpUserView> page = corpUserTagMapper.selectCorpUserDetailByCondition(new Page<>(start, limit), groupId, tagId, wxCorpId);
|
|
Page<CorpUserView> page = corpUserTagMapper.selectCorpUserDetailByCondition(new Page<>(start, limit), groupId, tagId, wxCorpId);
|
|
|
page.getRecords().forEach(data -> {
|
|
page.getRecords().forEach(data -> {
|
|
|
Optional.ofNullable(userMapper.selectOne(Wrappers.lambdaQuery(User.class)
|
|
Optional.ofNullable(userMapper.selectOne(Wrappers.lambdaQuery(User.class)
|
|
|
- .eq(User::getUnionid, data.getUnionId())
|
|
|
|
|
- .last("limit 1")))
|
|
|
|
|
|
|
+ .eq(User::getUnionid, data.getUnionId())
|
|
|
|
|
+ .last("limit 1")))
|
|
|
.ifPresent(user -> {
|
|
.ifPresent(user -> {
|
|
|
data.setUserId(user.getId());
|
|
data.setUserId(user.getId());
|
|
|
data.setNickname(user.getNickname());
|
|
data.setNickname(user.getNickname());
|
|
@@ -374,7 +375,10 @@ public class CorpTagServiceImpl implements CorpTagService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (tagIds != null || groupIds != null) {
|
|
if (tagIds != null || groupIds != null) {
|
|
|
- wxCorpOps.delCorpTag(tagIds, groupIds);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ wxCorpOps.delCorpTag(tagIds, groupIds);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (StrUtil.isNotBlank(tagId)) {
|
|
if (StrUtil.isNotBlank(tagId)) {
|
|
|
corpTagMapper.delete(Wrappers.lambdaQuery(CorpTag.class).eq(CorpTag::getTagId, tagId));
|
|
corpTagMapper.delete(Wrappers.lambdaQuery(CorpTag.class).eq(CorpTag::getTagId, tagId));
|