|
@@ -42,8 +42,14 @@ public class CategoryStrategy implements ScoreStrategy {
|
|
|
if (CollectionUtils.isEmpty(param.getContents())) {
|
|
|
return scores;
|
|
|
}
|
|
|
- AccountCategory accountCategory = accountCategoryRepository.getByGhIdAndStatus(param.getGhId(), StatusEnum.ONE.getCode());
|
|
|
- if (Objects.isNull(accountCategory) || !StringUtils.hasText(accountCategory.getCategoryMap())) {
|
|
|
+ List<AccountCategory> accountCategoryList = accountCategoryRepository.getByGhIdAndStatus(param.getGhId(), StatusEnum.ONE.getCode());
|
|
|
+ if (CollectionUtils.isEmpty(accountCategoryList)) {
|
|
|
+ return scores;
|
|
|
+ }
|
|
|
+ AccountCategory accountCategory = accountCategoryList.stream()
|
|
|
+ .sorted(Comparator.comparing(AccountCategory::getDt, Comparator.reverseOrder()))
|
|
|
+ .findFirst().get();
|
|
|
+ if (!StringUtils.hasText(accountCategory.getCategoryMap())) {
|
|
|
return scores;
|
|
|
}
|
|
|
JSONObject categoryWeightMap = JSONObject.parseObject(accountCategory.getCategoryMap());
|