Browse Source

王公峰:排名接口

feature/dangjian
wanggongfeng 6 years ago
parent
commit
2875acbd07
  1. 68
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java
  2. 4
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java
  3. 3
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java
  4. 19
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java
  5. 16
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java
  6. 7
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  7. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java
  8. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  9. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java
  10. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  11. 1
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java
  12. 16
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  13. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java
  14. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java
  15. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  16. 18
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
  17. 68
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerRankDTO.java
  18. 13
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java
  19. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java
  20. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java
  21. 13
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java
  22. 6
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

4
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);
}

3
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<EpdcAppClockListDTO> getClockList(@LoginUser TokenDto tokenDto, @PathVariable("actId") String actId) {
Result<AppClockListDTO> result = actUserRelationService.getClockList(actId);
EpdcAppClockListDTO epdcAppClockListDTO = ConvertUtils.sourceToTarget(result.getData(), EpdcAppClockListDTO.class);
Result<EpdcAppClockListDTO> result1 = new Result<EpdcAppClockListDTO>();
@ -138,6 +137,4 @@ public class ApiActUserRelationController {
}
}

19
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<List<EpdcAppVolunteerRankDTO>> leaderboard() {
Result<List<EpdcVolunteerRankDTO>> data = appUserService.leaderboard();
List<EpdcAppVolunteerRankDTO> list2 = ConvertUtils.sourceToTarget(data.getData(), EpdcAppVolunteerRankDTO.class);
return new Result().ok(list2);
}
}

16
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<AppClockListDTO> 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<AppClockListDTO> selectListActUserRelation(@PathVariable("actId") String actId);
}

7
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<Integer> insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO);
/**
* 获取排行榜
* @return
*/
@GetMapping("app-user/epdc-app/volunteerinfo/leaderboard")
Result<List<EpdcVolunteerRankDTO>> leaderboard();
}

9
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);
}
}

5
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<Integer> insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "insertVolunteerInfo", epdcCompleteVolunteerInfoFormDTO);
}
@Override
public Result<List<EpdcVolunteerRankDTO>> leaderboard() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "leaderboard");
}
}

2
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

10
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<List<EpdcVolunteerRankDTO>> leaderboard();
}

1
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<AppClockListDTO> getClockList(String actId) {
//根据actID获取人员活动关系数据
Result<AppClockListDTO> result = actInfoFeignClient.selectListActUserRelation(actId);
return result;
}

16
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<List<EpdcVolunteerRankDTO>> leaderboard() {
Result<List<EpdcVolunteerRankDTO>> dataResult = userFeignClient.leaderboard();
return dataResult;
}
}

2
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
*/

2
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<ActUserRelationEntity> {
Result<ActUserRelationDTO> selectOneActUserRelationInfo(@Param("userId")String userId, @Param("actId")String actId);
/**
* 通过活动ID查询人员活动关信息
* 通过活动ID查询人员活动关信息
* @param actId
* @return
*/

2
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<ActUserRelationEntit
Result updateActivityStatus(ActUserRelationDTO actUserRelationDTO);
/**
* 通过活动ID查询人员活动关心信息
* 通过活动ID查询打卡列表
*
* @param actId
* @return ActUserRelationDTO

18
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

@ -40,22 +40,22 @@
and status not in ('3' ,'4')
</select>
<select id="selectListActUserRelation" resultType="List" parameterType="String">
<select id="selectListActUserRelation" resultType="com.elink.esua.epdc.activity.ActClockListDTO" parameterType="String">
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>
<select id="selectListClockImg" resultType="List">
<select id="selectListClockImg" resultType="com.elink.esua.epdc.activity.ActClockPicDTO">
select CLOCK_ID,CLOCK_PIC
from epdc_act_clock_pic
where DEL_FLAG = '0' and CLOCK_ID IN

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

13
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<List<EpdcVolunteerRankDTO>> leaderboard() {
List<EpdcVolunteerRankDTO> list = volunteerInfoService.leaderboard();
return new Result().ok(list);
}
}

8
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<VolunteerInfoEntity> {
* @Date 2019/12/16 17:54
**/
EpdcAdjustVolunteerPointsDTO selectAdjustVolunteerPointsDTO(String id);
/**
* 获取排行榜
* @Author wanggongfeng
* @return
*/
List<EpdcVolunteerRankDTO> leaderboard();
}

8
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<VolunteerInfoEntity> {
**/
Result<EpdcAdjustVolunteerPointsDTO> getAdjustVolunteerPointsDTO(String userId);
/**
* 获取排行榜
* @Author wanggongfeng
* @return
*/
List<EpdcVolunteerRankDTO> leaderboard();
}

13
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<VolunteerInfoDao,
return new Result<EpdcAdjustVolunteerPointsDTO>().ok(adjustVolunteerPointsDTO);
}
/**
* 获取排行榜
* @Author wanggongfeng
* @return
*/
@Override
public List<EpdcVolunteerRankDTO> leaderboard(){
List<EpdcVolunteerRankDTO> list = baseDao.leaderboard();
return list;
}
}

6
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -148,7 +148,7 @@
</update>
<select id="getVolunteerCountById" resultType="Integer">
SELECT IFNULL(count(*),0) count FROM `epdc_volunteer_info` where del_flag = '0' and id = #{id} and AUDIT_STATUS = '1'
SELECT IFNULL(count(*),0) count FROM `epdc_volunteer_info` where del_flag = '0' and id = #{id} and AUDIT_STATUS in ('1')
</select>
<select id="selectAdjustVolunteerPointsDTO" parameterType="java.lang.String" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO">
@ -167,4 +167,8 @@
m.DEL_FLAG = '0'
AND m.ID = #{id}
</select>
<select id="leaderboard" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcVolunteerRankDTO">
select NICKNAME,FACE_IMG,PARTY_FLAG,KINDNESS_TIME,PARTICIPATION_NUM,SORT from epdc_volunteer_rank order by sort
</select>
</mapper>

Loading…
Cancel
Save