|
@ -25,11 +25,13 @@ import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.epmet.constant.GovIssueRedisKeys; |
|
|
import com.epmet.dao.IssueProjectTagDictDao; |
|
|
import com.epmet.dao.IssueProjectTagDictDao; |
|
|
import com.epmet.dto.IssueProjectTagDictDTO; |
|
|
import com.epmet.dto.IssueProjectTagDictDTO; |
|
|
import com.epmet.dto.form.TagDifferentSetFormDTO; |
|
|
import com.epmet.dto.form.TagDifferentSetFormDTO; |
|
|
import com.epmet.dto.form.TagListFormDTO; |
|
|
import com.epmet.dto.form.TagListFormDTO; |
|
|
import com.epmet.dto.result.IssueCategoryTagResultDTO; |
|
|
import com.epmet.dto.result.IssueCategoryTagResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.IssueProjectTagsResultDTO; |
|
|
import com.epmet.dto.result.TagListResultDTO; |
|
|
import com.epmet.dto.result.TagListResultDTO; |
|
|
import com.epmet.entity.IssueProjectTagDictEntity; |
|
|
import com.epmet.entity.IssueProjectTagDictEntity; |
|
|
import com.epmet.redis.IssueProjectTagDictRedis; |
|
|
import com.epmet.redis.IssueProjectTagDictRedis; |
|
@ -152,8 +154,58 @@ public class IssueProjectTagDictServiceImpl extends BaseServiceImpl<IssueProject |
|
|
* @date 2020.12.11 14:00 |
|
|
* @date 2020.12.11 14:00 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void updateTagHeat(TagDifferentSetFormDTO param) { |
|
|
public void updateTagHeat(TagDifferentSetFormDTO param) { |
|
|
|
|
|
//key : 1(plus) 0(minus)
|
|
|
|
|
|
//value : {
|
|
|
|
|
|
// key : redisKey
|
|
|
|
|
|
// value : List<Obj>
|
|
|
|
|
|
// }
|
|
|
|
|
|
Map<String,Map<String,List<IssueCategoryTagResultDTO>>> redisParam = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(param.getMinus())){ |
|
|
|
|
|
List<IssueProjectTagDictEntity> tags = baseDao.selectTagsByCustomerIdAndTagIds(param.getCustomerId(),param.getMinus()); |
|
|
|
|
|
if(CollectionUtils.isNotEmpty(tags)){ |
|
|
|
|
|
Map<String,List<IssueCategoryTagResultDTO>> value = new HashMap<>(); |
|
|
|
|
|
tags.forEach(tag -> { |
|
|
|
|
|
String redisKey = GovIssueRedisKeys.getGovernmentTagKey(param.getCustomerId(),tag.getCategoryId()); |
|
|
|
|
|
IssueCategoryTagResultDTO cache = new IssueCategoryTagResultDTO(); |
|
|
|
|
|
cache.setId(tag.getId());cache.setName(tag.getTagName()); |
|
|
|
|
|
if(CollectionUtils.isNotEmpty(value.get(redisKey))){ |
|
|
|
|
|
value.get(redisKey).add(cache); |
|
|
|
|
|
}else{ |
|
|
|
|
|
List<IssueCategoryTagResultDTO> list = new LinkedList<>(); |
|
|
|
|
|
list.add(cache); |
|
|
|
|
|
value.put(redisKey,list); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if(!value.isEmpty()) redisParam.put(NumConstant.ZERO_STR,value); |
|
|
|
|
|
baseDao.updateTagUsage(param.getMinus(),param.getCustomerId(),NumConstant.ONE_NEG); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(param.getPlus())){ |
|
|
|
|
|
List<IssueProjectTagDictEntity> tags = baseDao.selectTagsByCustomerIdAndTagIds(param.getCustomerId(),param.getPlus()); |
|
|
|
|
|
if(CollectionUtils.isNotEmpty(tags)){ |
|
|
|
|
|
Map<String,List<IssueCategoryTagResultDTO>> value = new HashMap<>(); |
|
|
|
|
|
tags.forEach(tag -> { |
|
|
|
|
|
String redisKey = GovIssueRedisKeys.getGovernmentTagKey(param.getCustomerId(),tag.getCategoryId()); |
|
|
|
|
|
IssueCategoryTagResultDTO cache = new IssueCategoryTagResultDTO(); |
|
|
|
|
|
cache.setId(tag.getId());cache.setName(tag.getTagName()); |
|
|
|
|
|
if(CollectionUtils.isNotEmpty(value.get(redisKey))){ |
|
|
|
|
|
value.get(redisKey).add(cache); |
|
|
|
|
|
}else{ |
|
|
|
|
|
List<IssueCategoryTagResultDTO> list = new LinkedList<>(); |
|
|
|
|
|
list.add(cache); |
|
|
|
|
|
value.put(redisKey,list); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if(!value.isEmpty()) redisParam.put(NumConstant.ONE_STR,value); |
|
|
|
|
|
baseDao.updateTagUsage(param.getPlus(),param.getCustomerId(),NumConstant.ONE); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
issueProjectTagDictRedis.batchIncrScore(redisParam); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |