Browse Source

标签查询时的补偿机制修改

dev_shibei_match
wangchao 4 years ago
parent
commit
fa8918d425
  1. 24
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java

24
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java

@ -266,21 +266,29 @@ public class IssueProjectTagDictRedis {
List<IssueProjectTagDictEntity> db = new LinkedList<>(); List<IssueProjectTagDictEntity> db = new LinkedList<>();
if(CollectionUtils.isEmpty(preResult) || CollectionUtils.isEmpty(preResult.get(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME))){ CategoryTagInitFormDTO customerIdParam = new CategoryTagInitFormDTO();
CategoryTagInitFormDTO customerIdParam = new CategoryTagInitFormDTO(); customerIdParam.setCustomerId(customerId); customerIdParam.setCustomerId(customerId);
if(ifOtherOnly || CollectionUtils.isEmpty(category)) { if (!CollectionUtils.isEmpty(redisUtils.keys(GovIssueRedisKeys.getGovernmentTagKey(customerId, null)))){
if(CollectionUtils.isEmpty(preResult) || CollectionUtils.isEmpty(preResult.get(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME))) {
if (ifOtherOnly || CollectionUtils.isEmpty(category)) {
//补偿全部默认标签 //补偿全部默认标签
categoryDictService.init(customerIdParam); categoryDictService.init(customerIdParam);
db.addAll(poolDao.selectTagListByCustomer(customerId)); db.addAll(poolDao.selectTagListByCustomer(customerId));
}else{ } else {
if(NumConstant.ZERO <= poolDao.selectCountByCustomerId(customerId)){ if (NumConstant.ZERO <= poolDao.selectCountByCustomerId(customerId)) {
categoryDictService.init(customerIdParam); categoryDictService.init(customerIdParam);
}else{ } else {
//只插入category中的标签 //只插入category中的标签
tagDictService.insertBatch(poolDao.selectTagByCategory(category,"default",customerId)); tagDictService.insertBatch(poolDao.selectTagByCategory(category, "default", customerId));
db.addAll(poolDao.selectTagsByCustomerIdAndTagIds(customerId,category)); db.addAll(poolDao.selectTagsByCustomerIdAndTagIds(customerId, category));
}
} }
} }
}else{
if (NumConstant.ZERO <= poolDao.selectCountByCustomerId(customerId)) {
categoryDictService.init(customerIdParam);
}
db.addAll(poolDao.selectTagListByCustomer(customerId));
} }
if(CollectionUtils.isEmpty(preResult) || CollectionUtils.isEmpty(preResult.get(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME))){ if(CollectionUtils.isEmpty(preResult) || CollectionUtils.isEmpty(preResult.get(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME))){

Loading…
Cancel
Save