Browse Source

修改label逻辑

master
HAHA 3 years ago
parent
commit
226c4216bf
  1. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java
  2. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

15
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<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();
@ -461,20 +461,13 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD
Map<String, String> 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());
}
}

8
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'
<where>
p.del_flag = '0'
AND CUSTOMER_ID = #{customerId}
AND p.CUSTOMER_ID = #{customerId}
<if test="code != null and code != ''">
AND p.VOLUNTEER_CATEGORY = #{code}
</if>
@ -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
</select>

Loading…
Cancel
Save