From a53ecd0736c945ad1e8df302928e8a223639f628 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 18 May 2020 13:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ActUserRelationServiceImpl.java | 27 +++++++++++++++++++ .../volunteer/dao/VolunteerRankDao.java | 7 +++++ .../impl/VolunteerRankServiceImpl.java | 1 + .../mapper/activity/ActUserRelationDao.xml | 7 +++-- .../mapper/volunteer/VolunteerRankDao.xml | 5 +++- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java index 24b24b0..7b086d9 100644 --- a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java @@ -454,6 +454,10 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl data = baseDao.selectListActUserInfo(actId); @@ -471,6 +475,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl { * @return */ List leaderboard(); + + /** + * 清空排行数据 + * @Author + * @return + */ + void clearGenerateRankingList(); } \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java index 5b8434b..da0ee46 100644 --- a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java @@ -123,6 +123,7 @@ public class VolunteerRankServiceImpl extends BaseServiceImpl list){ if(list != null && list.size() > 0){ + baseDao.clearGenerateRankingList(); for(int i = 0 ; i < list.size(); i++ ){ EpdcGetVolunteerRankDTO epdcGetVolunteerRankDTO = list.get(i); VolunteerRankEntity entity = ConvertUtils.sourceToTarget(epdcGetVolunteerRankDTO, VolunteerRankEntity.class); diff --git a/epdc-cloud-heart/src/main/resources/mapper/activity/ActUserRelationDao.xml b/epdc-cloud-heart/src/main/resources/mapper/activity/ActUserRelationDao.xml index 5ea3a72..c6c0b29 100644 --- a/epdc-cloud-heart/src/main/resources/mapper/activity/ActUserRelationDao.xml +++ b/epdc-cloud-heart/src/main/resources/mapper/activity/ActUserRelationDao.xml @@ -41,6 +41,7 @@ + - select NICKNAME,FACE_IMG,PARTY_FLAG,KINDNESS_TIME,PARTICIPATION_NUM,SORT + select SUBSTR(NICKNAME,LOCATE('-',NICKNAME+1)) AS NICKNAME,FACE_IMG,PARTY_FLAG,KINDNESS_TIME,PARTICIPATION_NUM,SORT from epdc_volunteer_rank where GENERATE_DATE = DATE_FORMAT(NOW(),'%Y-%m-%d') order by sort + + delete from epdc_volunteer_rank + \ No newline at end of file