Search in sources :

Example 1 with SprintStoryPointVO

use of io.choerodon.agile.api.vo.SprintStoryPointVO in project agile-service by open-hand.

the class TeamPerformanceServiceImpl method querySprintStoryPoint.

@Override
public List<SprintStoryPointVO> querySprintStoryPoint(Long projectId) {
    List<SprintStoryPointVO> sprintStoryPoints = teamPerformanceMapper.querySprintStoryPoints(projectId);
    BigDecimal sumStoryPoints = new BigDecimal(0);
    BigDecimal sumStoryPointsComplete = new BigDecimal(0);
    List<Long> mainResponsibleIds = new ArrayList<>();
    for (SprintStoryPointVO sprintStoryPoint : sprintStoryPoints) {
        if (Objects.nonNull(sprintStoryPoint)) {
            sumStoryPoints = DataUtil.add(sumStoryPoints, sprintStoryPoint.getStoryPoints());
            sumStoryPointsComplete = DataUtil.add(sumStoryPointsComplete, sprintStoryPoint.getStoryPointsComplete());
            Long mainResponsibleId = sprintStoryPoint.getMainResponsibleId();
            if (Objects.nonNull(mainResponsibleId)) {
                mainResponsibleIds.add(mainResponsibleId);
            }
        }
    }
    Map<Long, UserMessageDTO> usersMap = userService.queryUsersMap(mainResponsibleIds, true);
    for (SprintStoryPointVO sprintStoryPoint : sprintStoryPoints) {
        handleUser(sprintStoryPoint, usersMap);
        handleMainRate(sumStoryPoints, sumStoryPointsComplete, sprintStoryPoint);
    }
    return sprintStoryPoints;
}
Also used : SprintStoryPointVO(io.choerodon.agile.api.vo.SprintStoryPointVO) UserMessageDTO(io.choerodon.agile.infra.dto.UserMessageDTO) BigDecimal(java.math.BigDecimal)

Aggregations

SprintStoryPointVO (io.choerodon.agile.api.vo.SprintStoryPointVO)1 UserMessageDTO (io.choerodon.agile.infra.dto.UserMessageDTO)1 BigDecimal (java.math.BigDecimal)1