记得上下班打卡 | git大法好,push需谨慎

Commit 4b49e993 authored by jiangxiulong's avatar jiangxiulong

增加Ar演出艺人时间表接口 判断空

parent 53c23bb8
...@@ -19,6 +19,7 @@ import io.swagger.annotations.Api; ...@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -27,6 +28,7 @@ import java.util.List; ...@@ -27,6 +28,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@Api(tags = "小程序") @Api(tags = "小程序")
@Slf4j
@RestController @RestController
@RequestMapping("/sweet-applet") @RequestMapping("/sweet-applet")
public class SweetAppletController { public class SweetAppletController {
...@@ -198,6 +200,7 @@ public class SweetAppletController { ...@@ -198,6 +200,7 @@ public class SweetAppletController {
List<SweetPerformArtistTimeListDto> artistTimeList = arDataUtils.getArtistTimeList(performanceId); List<SweetPerformArtistTimeListDto> artistTimeList = arDataUtils.getArtistTimeList(performanceId);
return ResponseDto.success(artistTimeList); return ResponseDto.success(artistTimeList);
} catch (Exception e) { } catch (Exception e) {
log.error("演出艺人时间表EX [e:{}]", e);
return ResponseDto.failure("获取失败"); return ResponseDto.failure("获取失败");
} }
} }
......
package com.liquidnet.service.sweet.utils; package com.liquidnet.service.sweet.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.sweet.constant.SweetConstant; import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.dto.*; import com.liquidnet.service.sweet.dto.*;
...@@ -37,35 +38,38 @@ public class RedisArDataUtils { ...@@ -37,35 +38,38 @@ public class RedisArDataUtils {
List<SweetPerformArtistTimeListDto> performArtistTimeList = new ArrayList<>(); List<SweetPerformArtistTimeListDto> performArtistTimeList = new ArrayList<>();
// 演出日期 // 演出日期
List<SweetManualAppletArDto> performTime = sweetManualMapper.getManualAppletArDto(performanceId); List<SweetManualAppletArDto> performTime = sweetManualMapper.getManualAppletArDto(performanceId);
Date dateEnd = DateUtil.parse(performTime.get(0).getTimeEnd(), DateUtil.DATE_SMALL_STR); if (!CollectionUtil.isEmpty(performTime)) {
Date dateStart = DateUtil.parse(performTime.get(0).getTimeStart(), DateUtil.DATE_SMALL_STR); Date dateEnd = DateUtil.parse(performTime.get(0).getTimeEnd(), DateUtil.DATE_SMALL_STR);
int intervalDay = (int) DateUtil.intervalDays(dateStart, dateEnd); Date dateStart = DateUtil.parse(performTime.get(0).getTimeStart(), DateUtil.DATE_SMALL_STR);
for (int i = 0; i <= intervalDay; i++) { int intervalDay = (int) DateUtil.intervalDays(dateStart, dateEnd);
String time = DateUtil.format(DateUtil.addDay(dateStart, i), DateUtil.Formatter.yyyy_MM_dd); for (int i = 0; i <= intervalDay; i++) {
SweetPerformArtistTimeListDto performArtistTimeListDto = SweetPerformArtistTimeListDto.getNew(); String time = DateUtil.format(DateUtil.addDay(dateStart, i), DateUtil.Formatter.yyyy_MM_dd);
performArtistTimeListDto.setStartTime(time); SweetPerformArtistTimeListDto performArtistTimeListDto = SweetPerformArtistTimeListDto.getNew();
// 场地 performArtistTimeListDto.setStartTime(time);
List<SweetManualArtistStageListArDto> stageList = sweetManualArtistsMapper.getStageNameListAr(performanceId); // 场地
// 艺人 List<SweetManualArtistStageListArDto> stageList = sweetManualArtistsMapper.getStageNameListAr(performanceId);
List<SweetManualArtistListArDto> artistList = sweetManualArtistsMapper.getManualListAr(performanceId); // 艺人
for (SweetManualArtistListArDto artist : artistList) { List<SweetManualArtistListArDto> artistList = sweetManualArtistsMapper.getManualListAr(performanceId);
List<SweetManualArtistResourceUrlArDto> urlList = sweetArtistsUrlMapper.selectListOfAid(artist.getArtistId());
artist.setResourceUrl(urlList);
}
for (SweetManualArtistStageListArDto stage : stageList) {
List<SweetManualArtistListArDto> artistListArList = new ArrayList<>();
for (SweetManualArtistListArDto artist : artistList) { for (SweetManualArtistListArDto artist : artistList) {
if (artist.getPerformanceStart().contains(time) && stage.getStageId().equals(artist.getStageId())) { List<SweetManualArtistResourceUrlArDto> urlList = sweetArtistsUrlMapper.selectListOfAid(artist.getArtistId());
artistListArList.add(artist); artist.setResourceUrl(urlList);
}
for (SweetManualArtistStageListArDto stage : stageList) {
List<SweetManualArtistListArDto> artistListArList = new ArrayList<>();
for (SweetManualArtistListArDto artist : artistList) {
if (artist.getPerformanceStart().contains(time) && stage.getStageId().equals(artist.getStageId())) {
artistListArList.add(artist);
}
} }
stage.setArtistList(artistListArList);
} }
stage.setArtistList(artistListArList); performArtistTimeListDto.setStageList(stageList);
}
performArtistTimeListDto.setStageList(stageList);
performArtistTimeList.add(performArtistTimeListDto); performArtistTimeList.add(performArtistTimeListDto);
}
redisUtil.set(redisKey, performArtistTimeList);
} }
redisUtil.set(redisKey, performArtistTimeList);
return performArtistTimeList; return performArtistTimeList;
} else { } else {
return (List<SweetPerformArtistTimeListDto>) obj; return (List<SweetPerformArtistTimeListDto>) obj;
......
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