From 619e1cbde4dcccf6e41e4166024d549d6a05abd8 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 19 Nov 2020 17:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/UserBadgeListResultDTO.java | 3 ++- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 2 +- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java index 4b76f3eaea..940955725c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java @@ -43,12 +43,13 @@ public class UserBadgeListResultDTO implements Serializable { @JsonIgnore private Integer sort; @JsonIgnore - private Date updatedTime; + private Long updatedTime; public UserBadgeListResultDTO() { this.badgeId = ""; this.badgeIcon = ""; this.isOpened = "0"; this.status = false; + this.updatedTime = 0L; } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 729ccb00f5..0512616153 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -99,7 +99,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { } }); if (!CollectionUtils.isEmpty(noOpenBadge)){ - userBadgeListResultDTOS.addAll(noOpenBadge.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList())); + userBadgeListResultDTOS.addAll(noOpenBadge); } return userBadgeListResultDTOS.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getIsOpened).reversed().thenComparing(UserBadgeListResultDTO::getUpdatedTime).reversed().thenComparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList()); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 5b7bdea2a4..dfb53c3363 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -29,7 +29,7 @@ ub.IS_OPENED, b.FIXATION_BADGE_TYPE as badgeType, b.sort, - ub.UPDATED_TIME + UNIX_TIMESTAMP(ub.updated_time) AS updatedTime FROM resi_user_badge ub LEFT JOIN badge b ON b.ID = ub.BADGE_ID WHERE ub.DEL_FLAG = '0'