|
|
@ -42,6 +42,8 @@ import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.compress.utils.Lists; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -447,6 +449,7 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD |
|
|
|
public List<VolunteerPolyPieResultDTO> getStatistics(VolunteerPolyPieFormDTO form) { |
|
|
|
|
|
|
|
List<VolunteerPolyPieResultDTO> list = baseDao.getStatistics(form); |
|
|
|
Map<String, String> map = list.stream().collect(Collectors.toMap(VolunteerPolyPieResultDTO::getCode, VolunteerPolyPieResultDTO::getValue)); |
|
|
|
|
|
|
|
//获取志愿者类别
|
|
|
|
IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); |
|
|
@ -457,13 +460,15 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD |
|
|
|
|
|
|
|
Map<String, String> data = volunteerMap.getData(); |
|
|
|
|
|
|
|
return list.stream().map(item -> { |
|
|
|
List<VolunteerPolyPieResultDTO> result = Lists.newArrayList(); |
|
|
|
data.forEach((key, label) -> { |
|
|
|
VolunteerPolyPieResultDTO dto = new VolunteerPolyPieResultDTO(); |
|
|
|
dto.setCode(item.getCode()); |
|
|
|
dto.setValue(item.getValue()); |
|
|
|
dto.setLabel(data.get(item.getCode())); |
|
|
|
return dto; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
dto.setCode(key); |
|
|
|
dto.setLabel(label); |
|
|
|
dto.setValue(MapUtils.getString(map, key, NumConstant.ZERO_STR)); |
|
|
|
result.add(dto); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|