|
|
@ -266,22 +266,30 @@ public class IssueProjectTagDictRedis { |
|
|
|
|
|
|
|
List<IssueProjectTagDictEntity> 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))){ |
|
|
|
//先去数据库查询自定义,为空则是最终结果,不为空则补偿
|
|
|
|