浏览代码

初始化拉手

wangwx 1 年之前
父节点
当前提交
6f91181cda

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/advertiser/domain/dto/CarouselPlanDayDto.java

@@ -32,4 +32,6 @@ public class CarouselPlanDayDto {
     List<MaterialUrlDto> adMaterialsEvening;
     /** 非高峰时段图片对象集合*/
     List<MaterialUrlDto> adMaterialsNormal;
+    /** 公益素材 */
+    List<MaterialUrlDto> adMaterials123;
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/advertiser/domain/dto/CarouselPlanRedisDto.java

@@ -32,4 +32,6 @@ public class CarouselPlanRedisDto {
     List<MaterialLscUrlDto> adMaterialsEvening;
     /** 非高峰时段图片对象集合*/
     List<MaterialLscUrlDto> adMaterialsNormal;
+    /** 公益素材 */
+    List<MaterialLscUrlDto> adMaterials123;
 }

+ 3 - 1
ruoyi-system/src/main/java/com/ruoyi/advertiser/service/impl/CarouselPlanServiceImpl.java

@@ -105,11 +105,13 @@ public class CarouselPlanServiceImpl implements ICarouselPlanService {
         getTimeMapData(stationStartDate, list, morningBetweenMinute, morningTimeMaterials, 0, displayTime);
 
         CarouselPlanDayDto result = new CarouselPlanDayDto();
+        // 公益素材放进去
         result.setStationStartDate(stationStartDate)
                 .setStationEndDate(stationEndDate)
                 .setImageBindingIds(morning)
                 .setDataList(list)
-                .setAdMaterialsMorning(allPic);
+                .setAdMaterialsMorning(allPic)
+                .setAdMaterials123(materialMapper.selectMaterialByIds(new Long[]{Long.valueOf(SubwayConstant.AD_PUBLIC_BENEFIT_MATERIAL)}));
        return result;
     }
 

+ 6 - 1
ruoyi-system/src/main/java/com/ruoyi/advertiser/util/CreateCarouselPlanUtil.java

@@ -114,6 +114,10 @@ public class CreateCarouselPlanUtil {
             bindingIds = ArrayUtil.insert(bindingIds,0, new Long[]{ Long.valueOf(SubwayConstant.AD_PUBLIC_BENEFIT_MATERIAL) });
         }
 
+        List<MaterialLscUrlDto> list123 = new ArrayList<>();
+        dayDto.getAdMaterials123().forEach(item->{
+            list123.add(new MaterialLscUrlDto().setId(item.getId()).setConvertedFileUrl(item.getConvertedFileUrl()));
+        });
         // 存入redis
         CarouselPlanRedisDto adCarouselPlanRedisDto = new CarouselPlanRedisDto();
         adCarouselPlanRedisDto.setAdMaterialsMorning(adMaterialsMorning)
@@ -122,7 +126,8 @@ public class CreateCarouselPlanUtil {
                 .setImageIds(imageIds)
                 .setStationStartDate(dayDto.getStationStartDate())
                 .setStationEndDate(dayDto.getStationEndDate())
-                .setImageBindingIds(bindingIds);
+                .setImageBindingIds(bindingIds)
+                .setAdMaterials123(list123);
         redisCache.setCacheObject(SubwayConstant.AD_CAROUSEL_PLAN_KEY + carouselPlan.getSubwayId().toString(), adCarouselPlanRedisDto);
 
     }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/mcu/server/DealServer.java

@@ -334,6 +334,7 @@ public class DealServer {
         materials.addAll(carouselPlanCache.getAdMaterialsMorning());
         materials.addAll(carouselPlanCache.getAdMaterialsEvening());
         materials.addAll(carouselPlanCache.getAdMaterialsNormal());
+        materials.addAll(carouselPlanCache.getAdMaterials123());
         //文件路径
         String imagePathHead = "";
         // 获取LSC文件路径