feat: 二维码新增或者编辑绑定景区素材
This commit is contained in:
+10
@@ -29,6 +29,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* qrcode information
|
||||
@@ -222,6 +224,14 @@ public class QrCodeController {
|
||||
if (vlogCount != null) plan.setVlogCount(vlogCount);
|
||||
if (videoCount != null) plan.setVideoCount(videoCount);
|
||||
if (photoCount != null) plan.setPhotoCount(photoCount);
|
||||
// 景区素材ID集合存储到套餐表
|
||||
if (body.getTourismFileIds() != null && !body.getTourismFileIds().isEmpty()) {
|
||||
String idsStr = body.getTourismFileIds().stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
plan.setTourismFileIds(idsStr);
|
||||
}
|
||||
packagePlanService.saveOrUpdate(plan);
|
||||
}
|
||||
|
||||
|
||||
+19
-1
@@ -89,4 +89,22 @@ public class TourismFileController {
|
||||
return PageResult.<TourismFileGroupVO>builder().data(java.util.Collections.emptyList()).resp_code(1).count(0L).build();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 按景区ID获取资源列表
|
||||
*/
|
||||
@Operation(summary = "按景区ID获取资源列表")
|
||||
@GetMapping("/byTourism/{tourismId}")
|
||||
public Result listByTourismId(@PathVariable("tourismId") Long tourismId) {
|
||||
java.util.List<TourismFile> list = tourismFileService.getByTourismId(tourismId);
|
||||
if (list != null) {
|
||||
for (TourismFile f : list) {
|
||||
try {
|
||||
if (f != null && f.getImageUrl() != null) {
|
||||
f.setImageUrl(fileCenterService.getViewUrlByPath(f.getImageUrl()));
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
return Result.succeed(list, "操作成功");
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,10 @@ public class PackagePlan extends SuperEntity {
|
||||
@Schema(description = "照片数量")
|
||||
private Integer photoCount;
|
||||
|
||||
@Schema(description = "景区素材ID集合(逗号分隔)")
|
||||
private String tourismFileIds;
|
||||
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private String tenantId;
|
||||
|
||||
@@ -49,4 +53,4 @@ public class PackagePlan extends SuperEntity {
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -4,6 +4,8 @@ import com.central.order.model.QrCode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "二维码与套餐创建/修改请求体")
|
||||
public class QrcodeWithPlanDTO {
|
||||
@@ -18,5 +20,8 @@ public class QrcodeWithPlanDTO {
|
||||
|
||||
@Schema(description = "照片数量")
|
||||
private Integer photoCount;
|
||||
|
||||
@Schema(description = "景区素材ID集合(ID 数组)")
|
||||
private List<Long> tourismFileIds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user