Browse Source

小组成就相关接口

dev
zhaoqifeng 4 years ago
parent
commit
406ee7d44c
  1. 17
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java
  2. 38
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java
  3. 44
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRankingResultDTO.java
  4. 6
      epmet-module/epmet-point/epmet-point-server/pom.xml
  5. 76
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java
  6. 13
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointUserTotalDetailDao.java
  7. 150
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java
  8. 172
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointUserTotalDetailService.java
  9. 83
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  10. 99
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java
  11. 8
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointUserTotalDetailDao.xml
  12. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java
  13. 46
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupPointDetailResultDTO.java
  14. 17
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/AchievementResultDTO.java
  15. 17
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupAchievementDTO.java
  16. 35
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  17. 44
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  18. 55
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  19. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  20. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  21. 30
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  22. 65
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  23. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

17
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/21 9:50
*/
@Data
public class GroupPointFormDTO implements Serializable {
private static final long serialVersionUID = -3231073030413434313L;
private String groupId;
private String gridId;
}

38
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java

@ -0,0 +1,38 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/21 10:34
*/
@NoArgsConstructor
@Data
public class GroupPointRankingResultDTO implements Serializable {
private static final long serialVersionUID = -9215609608003827403L;
/**
* 排名
*/
private String ranking;
/**
* 小组名
*/
private String groupName;
/**
* 小组积分
*/
private String point;
/**
* 是否本小组
*/
private String isMine;
/**
* 小组ID
*/
private String groupId;
}

44
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRankingResultDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/21 10:05
*/
@NoArgsConstructor
@Data
public class PointRankingResultDTO implements Serializable {
private static final long serialVersionUID = -5383837225811609227L;
/**
* 头像
*/
private String headPhoto;
/**
* 支部小组-姓名/普通小组-昵称
*/
private String name;
/**
* 积分
*/
private String point;
/**
* 排名
*/
private String ranking;
/**
* 是否本人
*/
private String isMine;
/**
* 用户ID
*/
@JsonIgnore
private String userId;
}

6
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -87,6 +87,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-group-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

76
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java

@ -0,0 +1,76 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO;
import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.dto.result.PointRankingResultDTO;
import com.epmet.service.BizPointTotalDetailService;
import com.epmet.service.BizPointUserTotalDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author zhaoqifeng
* 小组积分
* @date 2021/4/21 9:45
*/
@RestController
@RequestMapping("group/point")
public class GroupPointController {
@Autowired
private BizPointUserTotalDetailService bizPointUserTotalDetailService;
@Autowired
private BizPointTotalDetailService bizPointTotalDetailService;
/**
* 小组积分贡献榜
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.PointRankingResultDTO>>
* @author zhaoqifeng
* @date 2021/4/21 14:02
*/
@PostMapping("pointranking")
public Result<List<PointRankingResultDTO>> pointRanking(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) {
List<PointRankingResultDTO> list = bizPointUserTotalDetailService.pointRanking(tokenDto, formDTO);
return new Result<List<PointRankingResultDTO>>().ok(list);
}
/**
* 网格小组积分排行
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.GroupPointRankingResultDTO>>
* @author zhaoqifeng
* @date 2021/4/21 14:02
*/
@PostMapping("grouppointranking")
public Result<List<GroupPointRankingResultDTO>> groupPointRanking(@RequestBody GroupPointFormDTO formDTO) {
List<GroupPointRankingResultDTO> list = bizPointTotalDetailService.groupPointRanking(formDTO);
return new Result<List<GroupPointRankingResultDTO>>().ok(list);
}
/**
* 小组积分详情
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO>
* @author zhaoqifeng
* @date 2021/4/21 14:02
*/
@PostMapping("pointdetail")
public Result<GroupPointDetailResultDTO> pointDetail(@RequestBody GroupPointFormDTO formDTO) {
GroupPointDetailResultDTO result = bizPointTotalDetailService.pointDetail(formDTO);
return new Result<GroupPointDetailResultDTO>().ok(result);
}
}

13
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointUserTotalDetailDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.BizPointUserTotalDetailEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 按业务类型积分总计
@ -29,5 +30,15 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface BizPointUserTotalDetailDao extends BaseDao<BizPointUserTotalDetailEntity> {
/**
* 获取今日积分增量
* @author zhaoqifeng
* @date 2021/4/21 16:56
* @param type
* @param objectId
* @return java.lang.Integer
*/
Integer selectIncrease(@Param("type")String type, @Param("objectId")String objectId);
}

150
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java

@ -20,6 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO;
import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.entity.BizPointTotalDetailEntity;
import java.util.List;
@ -33,73 +36,94 @@ import java.util.Map;
*/
public interface BizPointTotalDetailService extends BaseService<BizPointTotalDetailEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<BizPointTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
PageData<BizPointTotalDetailDTO> page(Map<String, Object> params);
/**
* 默认分页
*
* @param params
* @return PageData<BizPointTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
PageData<BizPointTotalDetailDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<BizPointTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
List<BizPointTotalDetailDTO> list(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<BizPointTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
List<BizPointTotalDetailDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return BizPointTotalDetailDTO
* @author generator
* @date 2021-04-20
*/
BizPointTotalDetailDTO get(String id);
/**
* 单条查询
*
* @param id
* @return BizPointTotalDetailDTO
* @author generator
* @date 2021-04-20
*/
BizPointTotalDetailDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void save(BizPointTotalDetailDTO dto);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void save(BizPointTotalDetailDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void update(BizPointTotalDetailDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void update(BizPointTotalDetailDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-04-20
*/
void delete(String[] ids);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-04-20
*/
void delete(String[] ids);
/**
* 根据业务类型查找数据
* @author zhaoqifeng
* @date 2021/4/20 16:53
* @param type
* @param objectId
* @return com.epmet.dto.BizPointTotalDetailDTO
*/
BizPointTotalDetailDTO getDataByObject(String type, String objectId);
/**
* 根据业务类型查找数据
*
* @param type
* @param objectId
* @return com.epmet.dto.BizPointTotalDetailDTO
* @author zhaoqifeng
* @date 2021/4/20 16:53
*/
BizPointTotalDetailDTO getDataByObject(String type, String objectId);
/**
* 小组积分详情
*
* @param formDTO
* @return com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO
* @author zhaoqifeng
* @date 2021/4/21 14:05
*/
GroupPointDetailResultDTO pointDetail(GroupPointFormDTO formDTO);
/**
* 网格小组积分排行
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.GroupPointRankingResultDTO>
* @author zhaoqifeng
* @date 2021/4/21 14:05
*/
List<GroupPointRankingResultDTO> groupPointRanking(GroupPointFormDTO formDTO);
}

172
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointUserTotalDetailService.java

@ -19,7 +19,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.BizPointUserTotalDetailDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.PointRankingResultDTO;
import com.epmet.entity.BizPointUserTotalDetailEntity;
import java.util.List;
@ -33,85 +36,108 @@ import java.util.Map;
*/
public interface BizPointUserTotalDetailService extends BaseService<BizPointUserTotalDetailEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<BizPointUserTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
PageData<BizPointUserTotalDetailDTO> page(Map<String, Object> params);
/**
* 默认分页
*
* @param params
* @return PageData<BizPointUserTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
PageData<BizPointUserTotalDetailDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<BizPointUserTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
List<BizPointUserTotalDetailDTO> list(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<BizPointUserTotalDetailDTO>
* @author generator
* @date 2021-04-20
*/
List<BizPointUserTotalDetailDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return BizPointUserTotalDetailDTO
* @author generator
* @date 2021-04-20
*/
BizPointUserTotalDetailDTO get(String id);
/**
* 单条查询
*
* @param id
* @return BizPointUserTotalDetailDTO
* @author generator
* @date 2021-04-20
*/
BizPointUserTotalDetailDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void save(BizPointUserTotalDetailDTO dto);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void save(BizPointUserTotalDetailDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void update(BizPointUserTotalDetailDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-20
*/
void update(BizPointUserTotalDetailDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-04-20
*/
void delete(String[] ids);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-04-20
*/
void delete(String[] ids);
/**
* 根据业务类型查找用户数据
* @author zhaoqifeng
* @date 2021/4/20 16:53
* @param type
* @param objectId
* @param userId
* @return com.epmet.dto.BizPointTotalDetailDTO
*/
BizPointUserTotalDetailDTO getDataByObject(String type, String objectId, String userId);
/**
* 根据业务类型查找用户数据
*
* @param type
* @param objectId
* @param userId
* @return com.epmet.dto.BizPointTotalDetailDTO
* @author zhaoqifeng
* @date 2021/4/20 16:53
*/
BizPointUserTotalDetailDTO getDataByObject(String type, String objectId, String userId);
/**
* 根据业务类型查找积分总和
* @author zhaoqifeng
* @date 2021/4/20 17:21
* @param type
* @param objectId
* @return java.lang.Integer
*/
Integer getTotalByObject(String type, String objectId);
/**
* 根据业务类型查找积分总和
*
* @param type
* @param objectId
* @return java.lang.Integer
* @author zhaoqifeng
* @date 2021/4/20 17:21
*/
Integer getTotalByObject(String type, String objectId);
/**
* 小组积分贡献榜
*
* @param tokenDto
* @param formDTO
* @return java.util.List<com.epmet.dto.result.PointRankingResultDTO>
* @author zhaoqifeng
* @date 2021/4/21 14:06
*/
List<PointRankingResultDTO> pointRanking(TokenDto tokenDto, GroupPointFormDTO formDTO);
/**
* 获取今日增量
* @author zhaoqifeng
* @date 2021/4/21 16:41
* @param type
* @param objectId
* @return java.lang.Integer
*/
Integer getIncrease(String type, String objectId);
}

83
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -20,21 +20,32 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.BizPointTotalDetailDao;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO;
import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.entity.BizPointTotalDetailEntity;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.BizPointTotalDetailService;
import com.epmet.service.BizPointUserTotalDetailService;
import org.apache.commons.lang3.StringUtils;
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;
import java.util.stream.Collectors;
/**
* 按业务类型积分总计
@ -45,6 +56,10 @@ import java.util.Map;
@Service
public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTotalDetailDao, BizPointTotalDetailEntity> implements BizPointTotalDetailService {
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Autowired
private BizPointUserTotalDetailService bizPointUserTotalDetailService;
@Override
public PageData<BizPointTotalDetailDTO> page(Map<String, Object> params) {
@ -112,4 +127,72 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
return baseDao.selectDataByObject(type, objectId);
}
/**
* 小组积分详情
*
* @param formDTO
* @return com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO
* @author zhaoqifeng
* @date 2021/4/21 14:05
*/
@Override
public GroupPointDetailResultDTO pointDetail(GroupPointFormDTO formDTO) {
Result<GroupPointDetailResultDTO> result = resiGroupOpenFeignClient.groupPointDetail(formDTO.getGroupId());
if (!result.success() || null == result.getData()) {
throw new RenException(result.getCode(), result.getMsg());
}
GroupPointDetailResultDTO detail = result.getData();
QueryWrapper<BizPointTotalDetailEntity> wrapper = new QueryWrapper<>();
wrapper.eq("BIZ_TYPE", "group")
.eq("OBJECT_ID", formDTO.getGroupId())
.eq("DEL_FLAG", NumConstant.ZERO_STR);
BizPointTotalDetailEntity entity = baseDao.selectOne(wrapper);
int toUpgrade = Integer.parseInt(detail.getNextLevelPoint()) - entity.getTotalPoint();
detail.setToUpgrade(Integer.toString(toUpgrade));
Integer increase = bizPointUserTotalDetailService.getIncrease("group", formDTO.getGroupId());
detail.setIncrease(increase.toString());
detail.setTotal(entity.getTotalPoint().toString());
detail.setCurrentPoint(entity.getTotalPoint().toString());
return detail;
}
/**
* 网格小组积分排行
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.GroupPointRankingResultDTO>
* @author zhaoqifeng
* @date 2021/4/21 14:05
*/
@Override
public List<GroupPointRankingResultDTO> groupPointRanking(GroupPointFormDTO formDTO) {
List<GroupPointRankingResultDTO> list = new ArrayList<>();
QueryWrapper<BizPointTotalDetailEntity> wrapper = new QueryWrapper<>();
wrapper.eq("BIZ_TYPE", "group")
.eq("GRID_ID", formDTO.getGridId())
.eq("DEL_FLAG", NumConstant.ZERO_STR)
.orderByDesc("TOTAL_POINT");
List<BizPointTotalDetailEntity> totalDetailList = baseDao.selectList(wrapper);
Result<List<ResiGroupDTO>> groupList = resiGroupOpenFeignClient.getGroupListByGrid(formDTO.getGridId());
list =
totalDetailList.stream().flatMap(detail -> groupList.getData().stream().filter(item -> item.getId().equals(detail.getObjectId())).map(group -> {
GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO();
dto.setGroupId(group.getId());
dto.setGroupName(group.getGroupName());
dto.setPoint(detail.getTotalPoint().toString());
if (formDTO.getGroupId().equals(group.getId())) {
dto.setIsMine(NumConstant.ONE_STR);
} else {
dto.setIsMine(NumConstant.ZERO_STR);
}
return dto;
})).collect(Collectors.toList());
int i = 1;
for (GroupPointRankingResultDTO dto : list) {
dto.setRanking(String.valueOf(i));
i++;
}
return list;
}
}

99
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java

@ -21,20 +21,32 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.BizPointUserTotalDetailDao;
import com.epmet.dto.BizPointUserTotalDetailDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.PointRankingResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.BizPointUserTotalDetailEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.BizPointUserTotalDetailService;
import org.apache.commons.lang3.StringUtils;
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;
import java.util.stream.Collectors;
/**
* 按业务类型积分总计
@ -45,6 +57,10 @@ import java.util.Map;
@Service
public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl<BizPointUserTotalDetailDao, BizPointUserTotalDetailEntity> implements BizPointUserTotalDetailService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Override
public PageData<BizPointUserTotalDetailDTO> page(Map<String, Object> params) {
@ -113,7 +129,8 @@ public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl<BizPoint
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>();
wrapper.eq("BIZ_TYPE", type)
.eq("OBJECT_ID", objectId)
.eq("USER_ID", userId);
.eq("USER_ID", userId)
.eq("DEL_FLAG", NumConstant.ZERO_STR);
BizPointUserTotalDetailEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, BizPointUserTotalDetailDTO.class);
}
@ -130,8 +147,10 @@ public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl<BizPoint
@Override
public Integer getTotalByObject(String type, String objectId) {
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>();
wrapper.select("sum(TOTAL_POINT) as TOTAL_POINT").eq("BIZ_TYPE", type)
.eq("OBJECT_ID", objectId);
wrapper.select("IFNULL(SUM(TOTAL_POINT), 0) as TOTAL_POINT")
.eq("BIZ_TYPE", type)
.eq("OBJECT_ID", objectId)
.eq("DEL_FLAG", NumConstant.ZERO_STR);
BizPointUserTotalDetailEntity entity = baseDao.selectOne(wrapper);
if (null == entity) {
return NumConstant.ZERO;
@ -139,4 +158,78 @@ public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl<BizPoint
return entity.getTotalPoint();
}
/**
* 小组积分贡献榜
*
* @param tokenDto
* @param formDTO
* @return java.util.List<com.epmet.dto.result.PointRankingResultDTO>
* @author zhaoqifeng
* @date 2021/4/21 14:06
*/
@Override
public List<PointRankingResultDTO> pointRanking(TokenDto tokenDto, GroupPointFormDTO formDTO) {
List<PointRankingResultDTO> list = new ArrayList<>();
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>();
wrapper.eq("BIZ_TYPE", "group")
.eq("OBJECT_ID", formDTO.getGroupId())
.eq("DEL_FLAG", NumConstant.ZERO_STR)
.orderByDesc("TOTAL_POINT");
List<BizPointUserTotalDetailEntity> userTotalList = baseDao.selectList(wrapper);
int i = 1;
list = userTotalList.stream().map(item -> {
PointRankingResultDTO dto = new PointRankingResultDTO();
dto.setUserId(item.getUserId());
dto.setPoint(item.getTotalPoint().toString());
if (tokenDto.getUserId().equals(item.getUserId())) {
dto.setIsMine(NumConstant.ONE_STR);
} else {
dto.setIsMine(NumConstant.ZERO_STR);
}
return dto;
}).collect(Collectors.toList());
for (PointRankingResultDTO dto : list) {
dto.setRanking(String.valueOf(i));
i++;
}
//获取小组信息
Result<ResiGroupDTO> group = resiGroupOpenFeignClient.getGroupDetail(formDTO.getGroupId());
if (!group.success() || null == group.getData()) {
throw new RenException(group.getCode(), group.getMsg());
}
//获取用户信息
List<String> userIds = userTotalList.stream().map(BizPointUserTotalDetailEntity :: getUserId).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> userInfoListResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
if (!userInfoListResult.success() || null == userInfoListResult.getData()) {
throw new RenException(userInfoListResult.getCode(), userInfoListResult.getMsg());
}
list.forEach(item -> userInfoListResult.getData().stream().filter(baseInfo -> item.getUserId().equals(baseInfo.getUserId())).forEach(
user -> {
//楼院小组显示昵称,支部小组显示姓名
if (("ordinary").equals(group.getData().getGroupType())) {
item.setName(user.getNickname());
} else {
item.setName(user.getName());
}
item.setHeadPhoto(user.getHeadImgUrl());
}
));
return list;
}
/**
* 获取今日增量
*
* @param type
* @param objectId
* @return java.lang.Integer
* @author zhaoqifeng
* @date 2021/4/21 16:41
*/
@Override
public Integer getIncrease(String type, String objectId) {
return baseDao.selectIncrease(type, objectId);
}
}

8
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointUserTotalDetailDao.xml

@ -19,6 +19,14 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectIncrease" resultType="java.lang.Integer">
SELECT IFNULL(SUM(TOTAL_POINT), 0)
FROM biz_point_user_total_detail
WHERE
BIZ_TYPE = #{type}
AND OBJECT_ID = #{objectId}
AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
</select>
</mapper>

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java

@ -85,6 +85,16 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/
private String visitSwitch;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 小组等级
*/
private Integer level;
/**
* 删除标记 0未删除1已删除
*/

46
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupPointDetailResultDTO.java

@ -0,0 +1,46 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/21 10:37
*/
@NoArgsConstructor
@Data
public class GroupPointDetailResultDTO implements Serializable {
private static final long serialVersionUID = -1158521486690554498L;
/**
* 小组当前等级
*/
private String level;
/**
* 总积分
*/
private String total;
/**
* 今日增长
*/
private String increase;
/**
* 距离升级所需积分
*/
private String toUpgrade;
/**
* 下一等级积分
*/
private String nextLevelPoint;
/**
* 下一等级
*/
private String nextLevel;
/**
* 当前积分
*/
private String currentPoint;
}

17
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/AchievementResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.resi.group.dto.member.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/22 9:24
*/
@Data
public class AchievementResultDTO implements Serializable {
private static final long serialVersionUID = 8079550501852632061L;
private List<String> achievement;
}

17
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupAchievementDTO.java

@ -0,0 +1,17 @@
package com.epmet.resi.group.dto.member.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/22 9:42
*/
@Data
public class GroupAchievementDTO implements Serializable {
private static final long serialVersionUID = 2195790168656351743L;
private String groupName;
private String achievementName;
}

35
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -5,10 +5,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO;
import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*;
@ -216,4 +213,34 @@ public interface ResiGroupOpenFeignClient {
**/
@PostMapping(value = "/resi/group/topic/topicattachmentlist")
Result<TopicAttachmentResultDTO> topicAttachmentList(@RequestBody TopicAttachmentFormDTO formDTO);
/**
* 获取小组详情
* @author zhaoqifeng
* @date 2021/4/21 15:20
* @param groupId
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.ResiGroupDTO>
*/
@PostMapping("resi/group/group/groupDetail/{groupId}")
Result<ResiGroupDTO> getGroupDetail(@PathVariable String groupId);
/**
* 获取网格下小组
* @author zhaoqifeng
* @date 2021/4/21 15:57
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.group.dto.group.ResiGroupDTO>>
*/
@PostMapping("resi/group/group/groupList/{gridId}")
Result<List<ResiGroupDTO>> getGroupListByGrid(@PathVariable String gridId);
/**
* 小组积分详情
* @author zhaoqifeng
* @date 2021/4/21 16:30
* @param groupId
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO>
*/
@PostMapping("resi/group/group/groupPointDetail/{groupId}")
Result<GroupPointDetailResultDTO> groupPointDetail(@PathVariable String groupId);
}

44
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO;
import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*;
@ -157,4 +154,43 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
public Result<TopicAttachmentResultDTO> topicAttachmentList(TopicAttachmentFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "topicAttachmentList", formDTO);
}
/**
* 获取小组详情
*
* @param groupId
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.ResiGroupDTO>
* @author zhaoqifeng
* @date 2021/4/21 15:20
*/
@Override
public Result<ResiGroupDTO> getGroupDetail(String groupId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGroupDetail", groupId);
}
/**
* 获取网格下小组
*
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.resi.group.dto.group.ResiGroupDTO>>
* @author zhaoqifeng
* @date 2021/4/21 15:57
*/
@Override
public Result<List<ResiGroupDTO>> getGroupListByGrid(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGroupListByGrid", gridId);
}
/**
* 小组积分详情
*
* @param groupId
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO>
* @author zhaoqifeng
* @date 2021/4/21 16:30
*/
@Override
public Result<GroupPointDetailResultDTO> groupPointDetail(String groupId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupPointDetail", groupId);
}
}

55
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -31,13 +31,11 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -515,4 +513,53 @@ public class ResiGroupController {
return new Result<AchievementDetailResultDTO>().ok(resiGroupService.achievementDetail(formDTO));
}
/**
* 获取小组详情
* @author zhaoqifeng
* @date 2021/4/21 15:17
* @param groupId
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.ResiGroupDTO>
*/
@PostMapping("groupDetail/{groupId}")
public Result<ResiGroupDTO> getGroupDetail(@PathVariable String groupId) {
ResiGroupDTO groupDTO = resiGroupService.get(groupId);
return new Result<ResiGroupDTO>().ok(groupDTO);
}
/**
* 获取网格下小组
* @author zhaoqifeng
* @date 2021/4/21 15:57
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.group.dto.group.ResiGroupDTO>>
*/
@PostMapping("groupList/{gridId}")
public Result<List<ResiGroupDTO>> getGroupListByGrid(@PathVariable String gridId) {
List<ResiGroupDTO> list = resiGroupService.getGroupListByGrid(gridId);
return new Result<List<ResiGroupDTO>>().ok(list);
}
/**
* 小组积分详情
* @author zhaoqifeng
* @date 2021/4/21 16:22
* @param groupId
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO>
*/
@PostMapping("groupPointDetail/{groupId}")
public Result<GroupPointDetailResultDTO> groupPointDetail(@PathVariable String groupId) {
return new Result<GroupPointDetailResultDTO>().ok(resiGroupService.groupPointDetail(groupId));
}
/**
* 小组近段时间实现的成就列表
* @author zhaoqifeng
* @date 2021/4/22 9:27
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.member.result.AchievementResultDTO>
*/
@PostMapping("achievement")
public Result<AchievementResultDTO> achievement(@LoginUser TokenDto tokenDto) {
return new Result<AchievementResultDTO>().ok(resiGroupService.achievement(tokenDto));
}
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -236,4 +237,13 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @Date 2020/12/25 13:18
**/
List<GroupProcessingCountResultDTO> queryGroupProcessingCount(@Param("gridIdList") List<String> gridIdList);
/**
* 我所在小组最近完成的成就
* @author zhaoqifeng
* @date 2021/4/22 9:47
* @param userId
* @return java.util.List<com.epmet.resi.group.dto.member.result.GroupAchievementDTO>
*/
List<GroupAchievementDTO> selectRecentGroupAchievements(@Param("userId") String userId);
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -83,4 +83,14 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
* VISIT_SWITCH 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 小组等级
*/
private Integer level;
}

30
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -20,6 +20,7 @@ package com.epmet.modules.group.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.resi.group.dto.UserRoleDTO;
@ -28,6 +29,8 @@ import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import jdk.nashorn.internal.parser.Token;
import java.util.HashMap;
import java.util.List;
@ -379,4 +382,31 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @return com.epmet.resi.group.dto.group.result.AchievementDetailResultDTO
*/
AchievementDetailResultDTO achievementDetail(GroupFormDTO formDTO);
/**
* 获取网格下小组列表
* @author zhaoqifeng
* @date 2021/4/21 15:42
* @param gridId
* @return java.util.List<com.epmet.resi.group.dto.group.ResiGroupDTO>
*/
List<ResiGroupDTO> getGroupListByGrid(String gridId);
/**
* 小组积分详情
* @author zhaoqifeng
* @date 2021/4/21 16:22
* @param groupId
* @return com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO
*/
GroupPointDetailResultDTO groupPointDetail(String groupId);
/**
* 小组近段时间实现的成就列表
* @author zhaoqifeng
* @date 2021/4/22 9:27
* @param tokenDto
* @return com.epmet.resi.group.dto.member.result.AchievementResultDTO
*/
AchievementResultDTO achievement(TokenDto tokenDto);
}

65
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
@ -40,6 +41,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.group.constant.GroupConstant;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.feign.EpmetMessageFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
@ -57,6 +59,7 @@ import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.member.redis.ResiGroupMemberRedis;
import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.support.GroupLevelUtils;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.*;
import com.epmet.resi.group.dto.UserRoleDTO;
@ -69,6 +72,8 @@ import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -1209,6 +1214,66 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return resultDTO;
}
/**
* 获取网格下小组列表
*
* @param gridId
* @return java.util.List<com.epmet.resi.group.dto.group.ResiGroupDTO>
* @author zhaoqifeng
* @date 2021/4/21 15:42
*/
@Override
public List<ResiGroupDTO> getGroupListByGrid(String gridId) {
QueryWrapper<ResiGroupEntity> wrapper = new QueryWrapper<>();
wrapper.eq("GRID_ID", gridId)
.eq("STATE", GroupStateConstant.GROUP_APPROVED)
.eq("DEL_FLAG", NumConstant.ZERO_STR);
List<ResiGroupEntity> list = baseDao.selectList(wrapper);
return ConvertUtils.sourceToTarget(list, ResiGroupDTO.class);
}
/**
* 小组积分详情
*
* @param groupId
* @return com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO
* @author zhaoqifeng
* @date 2021/4/21 16:22
*/
@Override
public GroupPointDetailResultDTO groupPointDetail(String groupId) {
GroupPointDetailResultDTO result = new GroupPointDetailResultDTO();
ResiGroupEntity group = baseDao.selectById(groupId);
Integer nextLevel = group.getLevel() + 1;
Integer nextLevelPoint = GroupLevelUtils.getPoint(nextLevel);
result.setLevel("LV" + group.getLevel().toString());
result.setNextLevel("LV" + nextLevel.toString());
result.setNextLevelPoint(nextLevelPoint.toString());
return result;
}
/**
* 小组近段时间实现的成就列表
*
* @param tokenDto
* @return com.epmet.resi.group.dto.member.result.AchievementResultDTO
* @author zhaoqifeng
* @date 2021/4/22 9:27
*/
@Override
public AchievementResultDTO achievement(TokenDto tokenDto) {
AchievementResultDTO result = new AchievementResultDTO();
List<String> achievements = new ArrayList<>();
List<GroupAchievementDTO> list = baseDao.selectRecentGroupAchievements(tokenDto.getUserId());
if (CollectionUtils.isNotEmpty(list)) {
achievements = list.stream().map(item -> {
return item.getGroupName() + ":" + "达成“" + item.getAchievementName() + "”" + "成就";
}).collect(Collectors.toList());
}
result.setAchievement(achievements);
return result;
}
@Override
public GroupDetailResultDTO getGroupDetail(String groupId) {
GroupDetailResultDTO groupDetail = new GroupDetailResultDTO();

15
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -523,4 +523,19 @@
GROUP BY
temp.gridId
</select>
<select id="selectRecentGroupAchievements" resultType="com.epmet.resi.group.dto.member.result.GroupAchievementDTO">
SELECT
rg.GROUP_NAME,
rgas.ACHIEVEMENT_NAME
FROM
resi_group_achievement_stats rgas
INNER JOIN resi_group rg ON rgas.GROUP_ID = rg.ID
INNER JOIN resi_group_member rgm ON rgas.GROUP_ID = rgm.RESI_GROUP_ID
AND rgm.CUSTOMER_USER_ID = #{userId}
WHERE
rgas.IS_ARRIVE = 1
ORDER BY
rgas.ARRIVE_TIME DESC
LIMIT 10
</select>
</mapper>

Loading…
Cancel
Save