Commit bb3b7b2c authored by libin's avatar libin

标签

parent 07a596d0
...@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; ...@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice("com.xxfc.platform") @RestControllerAdvice("com.xxfc.platform")
public class PlatformExceptionHandler { public class PlatformExceptionHandler {
@ExceptionHandler(value = {BaseException.class,Exception.class}) @ExceptionHandler(value = {BaseException.class})
public BaseResponse baseExceptionHandler(Exception e) { public BaseResponse baseExceptionHandler(Exception e) {
if (e instanceof BaseException){ if (e instanceof BaseException){
BaseException be = (BaseException) e; BaseException be = (BaseException) e;
......
...@@ -91,15 +91,18 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> { ...@@ -91,15 +91,18 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
List<Integer> tagIds = tourTags.stream().map(TourTag::getId).collect(Collectors.toList()); List<Integer> tagIds = tourTags.stream().map(TourTag::getId).collect(Collectors.toList());
Map<Integer, List<TourTagBannerDTO>> tourTagBannerMap = tourTagBannerBiz.findTourTagBannersByTagIds(tagIds); Map<Integer, List<TourTagBannerDTO>> tourTagBannerMap = tourTagBannerBiz.findTourTagBannersByTagIds(tagIds);
tourTags.forEach(tourTag -> { tourTags.forEach(tourTag -> {
});
for (TourTag tourTag:tourTags){
//vo转换 //vo转换
TourTagDTO tourTagDTO = new TourTagDTO(); TourTagDTO tourTagDTO = new TourTagDTO();
BeanUtils.copyProperties(tourTag,tourTagDTO); BeanUtils.copyProperties(tourTag,tourTagDTO);
//根据旅游标签id查询出标签banner相关信息 //根据旅游标签id查询出标签banner相关信息
List<TourTagBannerDTO> tagBannerDTOS = tourTagBannerMap.get(tourTag.getId()); List<TourTagBannerDTO> tagBannerDTOS = tourTagBannerMap.get(tourTag.getId());
//banner 数量 //banner 数量
tourTagDTO.setBannerNums(tagBannerDTOS.size()); tourTagDTO.setBannerNums(tagBannerDTOS==null?0:tagBannerDTOS.size());
tourTagAndBannerDTOS.add(TourTagAndBannerDTO.builder().tourTagDTO(tourTagDTO).tourTagBannerDTOS(tagBannerDTOS).build()); tourTagAndBannerDTOS.add(TourTagAndBannerDTO.builder().tourTagDTO(tourTagDTO).tourTagBannerDTOS(tagBannerDTOS).build());
}); }
//组装数据 //组装数据
tourTagAndBannerDTOPageDataVO.setData(tourTagAndBannerDTOS); tourTagAndBannerDTOPageDataVO.setData(tourTagAndBannerDTOS);
tourTagAndBannerDTOPageDataVO.setPageNum(pageDataVO.getPageNum()); tourTagAndBannerDTOPageDataVO.setPageNum(pageDataVO.getPageNum());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment