|
|
@@ -417,6 +417,7 @@ public class AssetService {
|
|
|
Page<TokenHistory> page = tokenHistoryRepo.findAll(((root, criteriaQuery, criteriaBuilder) -> {
|
|
|
List<Predicate> and = JpaUtils.toPredicates(pageQuery, TokenHistory.class, root, criteriaQuery, criteriaBuilder);
|
|
|
Map<String, Object> query = pageQuery.getQuery();
|
|
|
+ String operation = (String) query.get("operation");
|
|
|
if (ObjectUtils.isEmpty(query.get("toUserId")) && ObjectUtils.isEmpty(query.get("fromUserId"))) {
|
|
|
and.add(criteriaBuilder.or(criteriaBuilder.equal(root.get("toUserId"), userId), criteriaBuilder.equal(root.get("fromUserId"), userId)));
|
|
|
} else {
|
|
|
@@ -426,6 +427,9 @@ public class AssetService {
|
|
|
and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get("fromUserId"), userId)));
|
|
|
}
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotEmpty(query.get("operation"))){
|
|
|
+ and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get("operation"),operation)));
|
|
|
+ }
|
|
|
return criteriaBuilder.and(and.toArray(new Predicate[0]));
|
|
|
}), JpaUtils.toPageRequest(pageQuery));
|
|
|
|
|
|
@@ -442,13 +446,14 @@ public class AssetService {
|
|
|
switch (tokenHistory.getOperation()) {
|
|
|
case "出售":
|
|
|
case "转让":
|
|
|
- userHistory.setDescription(tokenHistory.getToUserId().equals(userId) ? "作品交易——买入" : "作品交易——售出");
|
|
|
+ userHistory.setDescription(tokenHistory.getToUserId().equals(userId) ? "买入" : "卖出");
|
|
|
break;
|
|
|
case "空投":
|
|
|
- userHistory.setDescription("空投");
|
|
|
+ userHistory.setDescription("买入");
|
|
|
break;
|
|
|
case "转赠":
|
|
|
- userHistory.setDescription(tokenHistory.getToUserId().equals(userId) ? "他人赠送" : "作品赠送");
|
|
|
+ //userHistory.setDescription(tokenHistory.getToUserId().equals(userId) ? "他人赠送" : "作品赠送");
|
|
|
+ userHistory.setDescription("赠送");
|
|
|
break;
|
|
|
}
|
|
|
return userHistory;
|