Browse Source

全部党员

dev
zxc 4 years ago
parent
commit
cbde6493a7
  1. 46
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java
  2. 41
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java
  3. 12
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  4. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java
  5. 33
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java

46
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java

@ -0,0 +1,46 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/9/6 3:13 下午
* @DESC
*/
@Data
public class AllPartyFormDTO implements Serializable {
private static final long serialVersionUID = -600409785611581009L;
/**
* 页码
**/
private Integer pageNo = NumConstant.ONE;
/**
* 每页数据条数
**/
private Integer pageSize = NumConstant.TEN;
/**
* 本月 monthly 总排行 all;
* */
private String type;
/**
* 认证成功的党员 的用户ID
* */
private List<String> userIds;
/**
* 客户ID
*/
private String customerId;
}

41
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/9/6 3:12 下午
* @DESC
*/
@Data
public class AllPartyResultDTO implements Serializable {
private static final long serialVersionUID = -5889648842876122793L;
/**
* 排序
**/
private Integer ranking;
/**
* 积分
**/
private Integer point;
/**
* 头像
**/
private String userHeadPhoto;
/**
* 名称
**/
private String realName;
/**
* 用户id
**/
private String userId;
}

12
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java

@ -159,6 +159,18 @@ public class ResiPointController {
return new Result<List<ResiAroundPartyPointRankResultDTO>>().ok(resultDTOS);
}
/**
* @Description 全部党员积分排行
* @Param formDTO
* @author zxc
* @date 2021/9/6 3:30 下午
*/
@PostMapping("allparty")
public Result<List<AllPartyResultDTO>> allParty(@RequestBody AllPartyFormDTO formDTO,@LoginUser TokenDto tokenDto){
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<AllPartyResultDTO>>().ok(userPointStatisticalDailyService.allParty(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyPointTaskResultDTO>>
* @param tokenDto

10
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java

@ -20,8 +20,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.AllPartyFormDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.AllPartyResultDTO;
import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.entity.UserPointStatisticalDailyEntity;
@ -125,4 +127,12 @@ public interface UserPointStatisticalDailyService extends BaseService<UserPointS
* @Date 16:17 2020-12-28
**/
List<ResiAroundPartyPointRankResultDTO> listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO);
/**
* @Description 全部党员积分排行
* @Param formDTO
* @author zxc
* @date 2021/9/6 3:30 下午
*/
List<AllPartyResultDTO> allParty(AllPartyFormDTO formDTO);
}

33
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java

@ -23,11 +23,13 @@ import com.epmet.common.enu.AroundPartyConstant;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
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.utils.Result;
import com.epmet.dao.UserPointStatisticalDailyDao;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.AllPartyFormDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.*;
@ -45,6 +47,7 @@ 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 org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
@ -292,6 +295,36 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
return resultDTOS;
}
/**
* @Description 全部党员积分排行
* @Param formDTO
* @author zxc
* @date 2021/9/6 3:30 下午
*/
@Override
public List<AllPartyResultDTO> allParty(AllPartyFormDTO formDTO) {
Result<List<PartymemberInfoDTO>> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId());
if (!partyMemberInfosResult.success()){
throw new RenException("查询客户下的党员失败......");
}
if (CollectionUtils.isEmpty(partyMemberInfosResult.getData())){
return new ArrayList<>();
}
List<PartymemberInfoDTO> partyMemberInfos = partyMemberInfosResult.getData();
List<String> userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList());
ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class);
selDto.setUserIds(userIds);
List<ResiAroundPartyPointRankResultDTO> resultDTOS = new ArrayList<>();
if (AroundPartyConstant.ALL.equals(formDTO.getType())){
resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(selDto);
}else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){
resultDTOS = baseDao.selectListGridPartyRankByMonth(selDto);
}
resultDTOS = getPartyBaseInfo(resultDTOS);
List<AllPartyResultDTO> result = ConvertUtils.sourceToTarget(resultDTOS, AllPartyResultDTO.class);
return result;
}
/**
* 获取认证通过的党员的 用户id
*

Loading…
Cancel
Save