diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java new file mode 100644 index 000000000..d589c4f99 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcAppVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java index 600a3934e..47a697039 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java @@ -25,11 +25,11 @@ public class ApiActPhraseController { * 使用次数加一 * @param id * @return com.elink.esua.epdc.commons.tools.utils.Result - * @author wanggongfeng @LoginUser TokenDto tokenDto, + * @author wanggongfeng * @date 2019/12/13 14:41 */ @GetMapping("sagenumAddOne/{id}") - public Result sagenumAddOneById(@PathVariable("id") String id) { + public Result sagenumAddOneById( @PathVariable("id") String id) { return actPhraseService.sagenumAddOneById(id); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java index 1ba680c64..0bbb08352 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java @@ -129,7 +129,6 @@ public class ApiActUserRelationController { */ @GetMapping("clockList") public Result getClockList(@LoginUser TokenDto tokenDto, @PathVariable("actId") String actId) { - Result result = actUserRelationService.getClockList(actId); EpdcAppClockListDTO epdcAppClockListDTO = ConvertUtils.sourceToTarget(result.getData(), EpdcAppClockListDTO.class); Result result1 = new Result(); @@ -138,6 +137,4 @@ public class ApiActUserRelationController { } - - } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java index 07b938fec..143b30ef1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java @@ -2,15 +2,18 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; +import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; +import com.elink.esua.epdc.dto.result.EpdcAppVolunteerRankDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; import com.elink.esua.epdc.service.AppUserService; import org.springframework.beans.factory.annotation.Autowired; @@ -280,4 +283,18 @@ public class ApiAppUserController { return appUserService.volunteerAuthenticate(tokenDto, formDto); } + + /** + * 获取排行榜 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("volunteer/leaderboard") + public Result> leaderboard() { + Result> data = appUserService.leaderboard(); + List list2 = ConvertUtils.sourceToTarget(data.getData(), EpdcAppVolunteerRankDTO.class); + return new Result().ok(list2); + + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java index 6a8da9847..3c23c8d1b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java @@ -37,14 +37,6 @@ public interface AppActUserRelationFeignClient { @GetMapping("heart/appactuserrelation/activityCancelSignUp/{userId}/{actId}") Result activityCancelSignUp(@PathVariable("userId") String userId,@PathVariable("actId") String actId); - /** - * 通过活动ID查询人员活动关心信息 - * @param actId - * @return - */ - @GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}") - Result selectListActUserRelation(@PathVariable("actId") String actId); - /** * 活动打卡 * @param appActUserClockLogDTO @@ -52,4 +44,12 @@ public interface AppActUserRelationFeignClient { */ @GetMapping(value = "heart/appactuserclocklog/activityClock",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + /** + * 通过活动ID查询打卡列表 + * @param actId + * @return + */ + @GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}") + Result selectListActUserRelation(@PathVariable("actId") String actId); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index b04801acd..776cc12d4 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -344,4 +344,11 @@ public interface UserFeignClient { */ @GetMapping("app-user/epdc-app/volunteerinfo/insertVolunteerInfo") Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO); + + /** + * 获取排行榜 + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/leaderboard") + Result> leaderboard(); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java index 286ae39a9..4c98cd398 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java @@ -25,13 +25,14 @@ public class AppActUserRelationFeignClientFallback implements AppActUserRelation } @Override - public Result selectListActUserRelation(String actId) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId); + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityClock", appActUserClockLogDTO); } @Override - public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityClock", appActUserClockLogDTO); + public Result selectListActUserRelation(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId); } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 2bb8043a5..5a5ffa153 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -169,4 +169,9 @@ public class UserFeignClientFallback implements UserFeignClient { public Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "insertVolunteerInfo", epdcCompleteVolunteerInfoFormDTO); } + + @Override + public Result> leaderboard() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "leaderboard"); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java index 99d97ecd4..56f5460bf 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java @@ -37,7 +37,7 @@ public interface ActUserRelationService { Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); /** - * 获取活动列表 + * 获取打卡列表 * @param actId * @Author wanggongfeng * @return diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index e540cbdc9..6590597ac 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -5,10 +5,11 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; +import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; import java.util.List; @@ -236,4 +237,11 @@ public interface AppUserService { */ Result getVolunteerCountById(TokenDto tokenDto); + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + Result> leaderboard(); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java index b457c011c..e1307dfb6 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java @@ -42,7 +42,6 @@ public class ActUserRelationServiceImpl implements ActUserRelationService { @Override public Result getClockList(String actId) { - //根据actID获取人员活动关系数据 Result result = actInfoFeignClient.selectListActUserRelation(actId); return result; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index 80e6717cb..c92265333 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -18,10 +18,7 @@ import com.elink.esua.epdc.dto.epdc.EpdcCompleteAppUserDTO; import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; +import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserPartyMemberFormDTO; @@ -1101,5 +1098,16 @@ public class AppUserServiceImpl implements AppUserService { return result; } + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result> leaderboard() { + Result> dataResult = userFeignClient.leaderboard(); + return dataResult; + } + } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java index 2eebe8c76..9aa38d2ab 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java @@ -58,7 +58,7 @@ public class AppActUserRelationController { } /** - * 通过活动ID查询人员活动关心信息 + * 通过活动ID查询打卡列表 * @param actId * @return */ diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java index 1b24e19e2..3ae2029e0 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java @@ -53,7 +53,7 @@ public interface ActUserRelationDao extends BaseDao { Result selectOneActUserRelationInfo(@Param("userId")String userId, @Param("actId")String actId); /** - * 通过活动ID查询人员活动关心信息 + * 通过活动ID查询人员活动关系信息 * @param actId * @return */ diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java index 2a20fea41..839a681e6 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java @@ -135,7 +135,7 @@ public interface ActUserRelationService extends BaseService - select - aur.FACE_IMG, - aur.NICKNAME, - aur.PARTY_FLAG, - auc.CLOCK_TIME, - auc.CLOCK_DESC, - auc.ID + aur.FACE_IMG faceImg, + aur.NICKNAME nickname, + aur.PARTY_FLAG partyFlag, + auc.CLOCK_TIME clockTime, + auc.CLOCK_DESC clockDesc, + auc.ID id from epdc_act_user_relation aur left join epdc_act_user_clock_log auc on aur.ID = auc.ACT_USER_ID where aur.DEL_FLAG = '0' and auc.DEL_FLAG = '0' and aur.ACT_ID = #{actId} - and aur.status in ('2') + and aur.status in ('2','0') - select CLOCK_ID,CLOCK_PIC from epdc_act_clock_pic where DEL_FLAG = '0' and CLOCK_ID IN diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerRankDTO.java new file mode 100644 index 000000000..ae4b09cce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerRankDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java index 783f14260..4cc274f94 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO; import com.elink.esua.epdc.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 对移动端开放 * @@ -50,4 +53,14 @@ public class EpdcAppVolunteerInfoController { return result; } + /** + * 获取排行榜 + * @return + */ + @GetMapping(value="leaderboard") + public Result> leaderboard() { + List list = volunteerInfoService.leaderboard(); + return new Result().ok(list); + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java index 745673c5e..93696ada5 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java @@ -21,6 +21,7 @@ import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO; import com.elink.esua.epdc.entity.VolunteerInfoEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -98,4 +99,11 @@ public interface VolunteerInfoDao extends BaseDao { * @Date 2019/12/16 17:54 **/ EpdcAdjustVolunteerPointsDTO selectAdjustVolunteerPointsDTO(String id); + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + List leaderboard(); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java index e89c18fda..d0596a94b 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java @@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO; import com.elink.esua.epdc.entity.VolunteerInfoEntity; import java.util.List; @@ -163,4 +164,11 @@ public interface VolunteerInfoService extends BaseService { **/ Result getAdjustVolunteerPointsDTO(String userId); + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + List leaderboard(); + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java index feb505e17..9208886c9 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java @@ -32,6 +32,7 @@ import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO; import com.elink.esua.epdc.entity.VolunteerInfoEntity; import com.elink.esua.epdc.redis.VolunteerInfoRedis; import com.elink.esua.epdc.service.UserService; @@ -41,6 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -242,4 +244,15 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl().ok(adjustVolunteerPointsDTO); } + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public List leaderboard(){ + List list = baseDao.leaderboard(); + return list; + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml index 8a093f7f1..e9ced078e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -148,7 +148,7 @@ + +