diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java index f0e8b1e5bc..8b84fd1039 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -47,6 +47,7 @@ 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.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -450,7 +451,6 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl getStatistics(VolunteerPolyPieFormDTO form) { List list = baseDao.getStatistics(form); - Map map = list.stream().collect(Collectors.toMap(VolunteerPolyPieResultDTO::getCode, VolunteerPolyPieResultDTO::getValue)); //获取志愿者类别 IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); @@ -461,20 +461,13 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl data = volunteerMap.getData(); - data.values().forEach(item -> { - for (int i = 0 ; i< list.size() ; i++){ - list.get(i).setLabel(item); - } - }); - - return list; - /*return list.stream().map(item -> { + return list.stream().map(item -> { VolunteerPolyPieResultDTO dto = new VolunteerPolyPieResultDTO(); dto.setCode(item.getCode()); dto.setValue(item.getValue()); - dto.setLabel(item.getLabel()); + dto.setLabel(data.get(item.getCode())); return dto; - }).collect(Collectors.toList());*/ + }).collect(Collectors.toList()); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml index df518e0aad..f8ae7b74a0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -36,7 +36,7 @@ LEFT JOIN ic_resi_user u ON p.IC_RESI_USER = u.id and u.del_flag = '0' p.del_flag = '0' - AND CUSTOMER_ID = #{customerId} + AND p.CUSTOMER_ID = #{customerId} AND p.VOLUNTEER_CATEGORY = #{code} @@ -64,8 +64,10 @@ FROM ic_volunteer_poly p LEFT JOIN ic_volunteer_poly_category c ON p.ID_CARD = c.ID_CARD - where - p.CUSTOMER_ID = #{customerId} + WHERE + p.CUSTOMER_ID = #{customerId} and c.VOLUNTEER_CATEGORY is not null + AND + c.VOLUNTEER_CATEGORY != '' GROUP BY c.VOLUNTEER_CATEGORY