From fa8918d425d52613abd7bfe94263461a495707b1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Mar 2021 16:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=9F=A5=E8=AF=A2=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E8=A1=A5=E5=81=BF=E6=9C=BA=E5=88=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/redis/IssueProjectTagDictRedis.java | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java index 8424fa7ec4..b5ee686890 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java @@ -266,22 +266,30 @@ public class IssueProjectTagDictRedis { List db = new LinkedList<>(); - if(CollectionUtils.isEmpty(preResult) || CollectionUtils.isEmpty(preResult.get(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME))){ - CategoryTagInitFormDTO customerIdParam = new CategoryTagInitFormDTO(); customerIdParam.setCustomerId(customerId); - if(ifOtherOnly || CollectionUtils.isEmpty(category)) { - //补偿全部默认标签 - categoryDictService.init(customerIdParam); - db.addAll(poolDao.selectTagListByCustomer(customerId)); - }else{ - if(NumConstant.ZERO <= poolDao.selectCountByCustomerId(customerId)){ - categoryDictService.init(customerIdParam); - }else{ - //只插入category中的标签 - tagDictService.insertBatch(poolDao.selectTagByCategory(category,"default",customerId)); - db.addAll(poolDao.selectTagsByCustomerIdAndTagIds(customerId,category)); - } - } - } + CategoryTagInitFormDTO customerIdParam = new CategoryTagInitFormDTO(); + customerIdParam.setCustomerId(customerId); + 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); + db.addAll(poolDao.selectTagListByCustomer(customerId)); + } else { + if (NumConstant.ZERO <= poolDao.selectCountByCustomerId(customerId)) { + categoryDictService.init(customerIdParam); + } else { + //只插入category中的标签 + tagDictService.insertBatch(poolDao.selectTagByCategory(category, "default", customerId)); + 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))){ //先去数据库查询自定义,为空则是最终结果,不为空则补偿