|
|
@ -161,15 +161,15 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result confirmAdjustPoint(EpdcAdjustVolunteerPointsDTO formDto) { |
|
|
|
if(formDto.getOperatePoints()== NumConstant.ZERO){ |
|
|
|
if (formDto.getOperatePoints() == NumConstant.ZERO) { |
|
|
|
return new Result().error("操作积分不能为0"); |
|
|
|
} |
|
|
|
//根据动作编码获取动作信息
|
|
|
|
Result<BehaviorResultDto> behaviorCodeInfoByBehaviorCode = pointsBehaviorService.getBehaviorCodeInfoByBehaviorCode(formDto.getBehaviorCode()); |
|
|
|
if (!behaviorCodeInfoByBehaviorCode.success() || behaviorCodeInfoByBehaviorCode.getData()==null){ |
|
|
|
if (!behaviorCodeInfoByBehaviorCode.success() || behaviorCodeInfoByBehaviorCode.getData() == null) { |
|
|
|
throw new RenException("获取动作编码信息异常或无此动作编码"); |
|
|
|
} |
|
|
|
PointsLogsEntity pointsLogsEntity=new PointsLogsEntity(); |
|
|
|
PointsLogsEntity pointsLogsEntity = new PointsLogsEntity(); |
|
|
|
pointsLogsEntity.setVolunteerId(formDto.getId()); |
|
|
|
pointsLogsEntity.setUserId(formDto.getUserId()); |
|
|
|
pointsLogsEntity.setNickname(formDto.getNickname()); |
|
|
@ -195,7 +195,7 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points |
|
|
|
pointsLogsEntity.setBehaviorCode(formDto.getBehaviorCode()); |
|
|
|
this.insert(pointsLogsEntity); |
|
|
|
//给用户发送消息通知
|
|
|
|
this.issueSmsNotification(pointsLogsEntity,formDto); |
|
|
|
this.issueSmsNotification(pointsLogsEntity, formDto); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
@ -254,10 +254,10 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result confirmUserAdjustPoint(EpdcAdjustUserPointsDTO formDto) { |
|
|
|
if(formDto.getOperatePoints()== NumConstant.ZERO){ |
|
|
|
if (formDto.getOperatePoints() == NumConstant.ZERO) { |
|
|
|
return new Result().error("操作积分不能为0"); |
|
|
|
} |
|
|
|
PointsLogsEntity pointsLogsEntity=new PointsLogsEntity(); |
|
|
|
PointsLogsEntity pointsLogsEntity = new PointsLogsEntity(); |
|
|
|
pointsLogsEntity.setUserId(formDto.getId()); |
|
|
|
pointsLogsEntity.setNickname(formDto.getNickname()); |
|
|
|
pointsLogsEntity.setFaceImg(formDto.getFaceImg()); |
|
|
@ -283,21 +283,23 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取【排好序】的排行榜数据 |
|
|
|
* |
|
|
|
* @param formDto |
|
|
|
* @return java.util.List<com.elink.esua.epdc.dto.result.EpdcAppPointsRankingTopTenDTO> |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 16:09 2020-05-13 |
|
|
|
**/ |
|
|
|
private List<EpdcAppPointsRankingTopTenDTO> sortListPointsRank(EpdcAppPointsRankingFormDTO formDto){ |
|
|
|
private List<EpdcAppPointsRankingTopTenDTO> sortListPointsRank(EpdcAppPointsRankingFormDTO formDto) { |
|
|
|
List<EpdcAppPointsRankingTopTenDTO> listPointsRank = new ArrayList<>(); |
|
|
|
listPointsRank = baseDao.selectListPointsRanking(formDto); |
|
|
|
int sortNumber = 1; |
|
|
|
if (listPointsRank != null){ |
|
|
|
for (int i = 1; i < listPointsRank.size(); i++){ |
|
|
|
if (listPointsRank != null) { |
|
|
|
for (int i = 1; i < listPointsRank.size(); i++) { |
|
|
|
listPointsRank.get(0).setRank(NumConstant.ONE); |
|
|
|
if(listPointsRank.get(i - NumConstant.ONE).getPoints().intValue() == listPointsRank.get(i).getPoints().intValue()){ |
|
|
|
if (listPointsRank.get(i - NumConstant.ONE).getPoints().intValue() == listPointsRank.get(i).getPoints().intValue()) { |
|
|
|
listPointsRank.get(i).setRank(sortNumber); |
|
|
|
} else { |
|
|
|
sortNumber = sortNumber + NumConstant.ONE; |
|
|
@ -310,12 +312,13 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询积分排行接口(0 周排行、1 月排行)如果没有当前登录用户的积分记录,返回 处理(总排名+1) 过的排名信息 |
|
|
|
* |
|
|
|
* @param formDto |
|
|
|
* @return com.elink.esua.epdc.dto.result.EpdcAppPointsRankingUserDTO |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 13:35 2020-05-13 |
|
|
|
**/ |
|
|
|
private EpdcAppPointsRankingUserDTO noPointsRecordIsUserRanking(EpdcAppPointsRankingFormDTO formDto){ |
|
|
|
private EpdcAppPointsRankingUserDTO noPointsRecordIsUserRanking(EpdcAppPointsRankingFormDTO formDto) { |
|
|
|
EpdcAppPointsRankingUserDTO userRang = new EpdcAppPointsRankingUserDTO(); |
|
|
|
int pointCountRaning = baseDao.selectCountPointsRanking(formDto); |
|
|
|
userRang.setUserId(formDto.getUserId()); |
|
|
@ -324,4 +327,11 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points |
|
|
|
userRang.setRank(pointCountRaning + NumConstant.ONE); |
|
|
|
return userRang; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<PointsStatisticsListResultDTO> listPagePoint(Map<String, Object> params) { |
|
|
|
IPage<PointsStatisticsListResultDTO> page = getPage(params); |
|
|
|
List<PointsStatisticsListResultDTO> list = baseDao.selectPointsList(params); |
|
|
|
return new PageData(list, page.getTotal()); |
|
|
|
} |
|
|
|
} |
|
|
|