Merge branch 'develop' of https://gitee.com/L-Shilin/go-fly-platform-services into test
# Conflicts: # zlt-config/src/main/resources/bootstrap.properties
This commit is contained in:
@@ -4,10 +4,10 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: file-center
|
||||
# cloud:
|
||||
# nacos:
|
||||
# discovery:
|
||||
# ip: 119.45.169.13
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: 119.45.169.13
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 20MB
|
||||
|
||||
+81
@@ -723,6 +723,87 @@ public class OrderController {
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版:查询用户订单详情列表(含视频/图片/一键成片)
|
||||
*/
|
||||
@Operation(summary = "新版-查询用户订单详情列表(含视频/图片/一键成片)")
|
||||
@Parameters({
|
||||
@Parameter(name = "page",description = "分页起始位置",required = true,in=ParameterIn.QUERY),
|
||||
@Parameter(name = "limit",description = "分页结束位置",required = true,in=ParameterIn.QUERY)
|
||||
})
|
||||
@GetMapping("/user/v2")
|
||||
public PageResult<Map> listInfoByUserV2(@RequestParam Map<String, Object> params) {
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
params.put("userId", user.getId());
|
||||
List<Integer> orderStatusList = List.of(OrderStatus.COMPLETE.getId(), OrderStatus.UPLOADING.getId(), OrderStatus.UPLOADED.getId());
|
||||
params.put("orderStatusList", orderStatusList);
|
||||
|
||||
PageResult<Order> result = orderService.findListByUser(params);
|
||||
if (result.getCount() > 0){
|
||||
List<Map> page = new ArrayList<>();
|
||||
Map<String, String> fileMap = new HashMap<>();
|
||||
fileMap.put("style", fileStyle);
|
||||
for(Order order : result.getData()){
|
||||
Map<String,Object> orderFileMap = new HashMap<>();
|
||||
orderFileMap.put("time", sdf.format(order.getCreateTime()));
|
||||
orderFileMap.put("addr", tourismService.getTourismById(order.getTourismId()).getTourismAddress());
|
||||
orderFileMap.put("orderNo", order.getOrderNo());
|
||||
|
||||
// 只查一次所有文件
|
||||
List<OrderFile> allFiles = orderFileService.getOrderFileByOrderNo(order.getOrderNo());
|
||||
|
||||
// aiVideo
|
||||
List<OrderFile> aiVideoFiles = allFiles.stream()
|
||||
.filter(f -> "ai_video".equals(f.getFileTag()))
|
||||
.toList();
|
||||
String aiVideoUrl = null;
|
||||
if (!aiVideoFiles.isEmpty()) {
|
||||
fileMap.put("path", aiVideoFiles.get(0).getFilePath());
|
||||
aiVideoUrl = fileCenterService.getViewUrlByPathStyle(fileMap);
|
||||
}
|
||||
orderFileMap.put("aiVideo", aiVideoUrl);
|
||||
|
||||
// 图片素材
|
||||
List<OrderFile> imgFiles = allFiles.stream()
|
||||
.filter(f -> "image/jpeg".equals(f.getFileType()))
|
||||
.toList();
|
||||
List<Map<String,String>> imgList = new ArrayList<>();
|
||||
for (OrderFile orderFile : imgFiles){
|
||||
Map<String,String> imgMap = new HashMap<>();
|
||||
String url = fileCenterService.getViewUrlByPath(orderFile.getFilePath());
|
||||
imgMap.put("url", url.replace(cdnOssUrl, cdnUrl));
|
||||
imgMap.put("contentType", orderFile.getFileType());
|
||||
imgMap.put("path", orderFile.getFilePath());
|
||||
fileMap.put("path",orderFile.getFilePath());
|
||||
imgMap.put("viewUrl", fileCenterService.getViewUrlByPathStyle(fileMap));
|
||||
imgList.add(imgMap);
|
||||
}
|
||||
orderFileMap.put("imgList", imgList);
|
||||
|
||||
// 视频素材
|
||||
List<OrderFile> videoFiles = allFiles.stream()
|
||||
.filter(f -> "raw_video".equals(f.getFileTag()))
|
||||
.toList();
|
||||
List<Map<String,String>> videoList = new ArrayList<>();
|
||||
for (OrderFile orderFile : videoFiles){
|
||||
Map<String,String> videoMap = new HashMap<>();
|
||||
String url = fileCenterService.getViewUrlByPath(orderFile.getFilePath());
|
||||
videoMap.put("url", url.replace(cdnOssUrl, cdnUrl));
|
||||
videoMap.put("contentType", orderFile.getFileType());
|
||||
videoMap.put("path", orderFile.getFilePath());
|
||||
fileMap.put("path",orderFile.getFilePath());
|
||||
videoMap.put("viewUrl", fileCenterService.getViewUrlByPathStyle(fileMap));
|
||||
videoList.add(videoMap);
|
||||
}
|
||||
orderFileMap.put("videoList", videoList);
|
||||
|
||||
page.add(orderFileMap);
|
||||
}
|
||||
return PageResult.<Map>builder().data(page).resp_code(0).count(result.getCount()).build();
|
||||
}
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除URL中的参数
|
||||
* @param url 原始URL
|
||||
|
||||
+4
@@ -220,6 +220,10 @@ public class OrderFileController {
|
||||
orderFile.setFilePath(fileInfo.getPath());
|
||||
orderFile.setFileType(fileInfo.getContentType());
|
||||
orderFile.setTourismId(order.getTourismId());
|
||||
// 新增:如果是视频素材且未指定fileTag,默认标记为raw_video
|
||||
if ("video/mp4".equals(orderFile.getFileType()) && (orderFile.getFileTag() == null || orderFile.getFileTag().isEmpty())) {
|
||||
orderFile.setFileTag("raw_video");
|
||||
}
|
||||
|
||||
// 保存记录
|
||||
boolean saved = orderFileService.save(orderFile);
|
||||
|
||||
+3
-1
@@ -14,7 +14,9 @@ public enum HomeCarouselType implements ZltEnum {
|
||||
ACTIVITY(1, "活动"),
|
||||
SHOOTING_ANGLE(2,"拍照角度"),
|
||||
GUIDANCE(3,"引导"),
|
||||
BIG_PICTURE(4,"大图");
|
||||
BIG_PICTURE(4,"大图"),
|
||||
VIDEO(5,"景区视频"),
|
||||
ORDER_SHOW(6,"订单展示图");
|
||||
|
||||
private Integer id;
|
||||
private String content;
|
||||
|
||||
@@ -53,6 +53,7 @@ public class Order extends SuperEntity {
|
||||
|
||||
private transient String waylineLinkUrl;
|
||||
private transient JSONObject streamUrls;
|
||||
private transient String tourismImgUrl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -46,4 +46,8 @@ public class OrderFile extends SuperEntity {
|
||||
private String tenantId;
|
||||
private Integer isDel;
|
||||
|
||||
/**
|
||||
* 文件标签,如ai_video、raw_video等
|
||||
*/
|
||||
private String fileTag;
|
||||
}
|
||||
|
||||
+24
@@ -1,5 +1,6 @@
|
||||
package com.central.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.central.common.lock.DistributedLock;
|
||||
@@ -8,12 +9,15 @@ import com.central.common.service.impl.SuperServiceImpl;
|
||||
import com.central.order.enums.OrderStatus;
|
||||
import com.central.order.event.OrderStatusChangeEvent;
|
||||
import com.central.order.feign.UserCenterService;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.mapper.OrderFileMapper;
|
||||
import com.central.order.mapper.OrderMapper;
|
||||
import com.central.order.mapper.TourismFileMapper;
|
||||
import com.central.order.mapper.TourismMapper;
|
||||
import com.central.order.model.Order;
|
||||
import com.central.order.model.OrderFile;
|
||||
import com.central.order.model.OrderRanking;
|
||||
import com.central.order.model.TourismFile;
|
||||
import com.central.order.service.IOrderService;
|
||||
import com.central.order.util.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -56,6 +60,10 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
|
||||
@Autowired
|
||||
private TourismMapper tourismMapper;
|
||||
|
||||
@Autowired
|
||||
private TourismFileMapper tourismFileMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderFileMapper orderFileMapper;
|
||||
|
||||
@@ -65,6 +73,9 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
@Autowired
|
||||
private UserCenterService userCenterService;
|
||||
|
||||
@Autowired
|
||||
private FileCenterService fileCenterService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param params
|
||||
@@ -225,6 +236,19 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
for (Order order : list) {
|
||||
order.setTourismName(tourismMapper.getTourismById(order.getTourismId()).getTourismName());
|
||||
order.setCreatedTime(sdf.format(order.getCreateTime()));
|
||||
// 设置景区订单展示图(type=6)的imageUrl
|
||||
List<TourismFile> tourismFiles = tourismFileMapper.selectList(
|
||||
new LambdaQueryWrapper<TourismFile>()
|
||||
.eq(TourismFile::getTourismId, order.getTourismId())
|
||||
.eq(TourismFile::getType, 6)
|
||||
.last("limit 1")
|
||||
);
|
||||
if (tourismFiles != null && !tourismFiles.isEmpty()) {
|
||||
String imgUrl = tourismFiles.get(0).getImageUrl();
|
||||
order.setTourismImgUrl(fileCenterService.getViewUrlByPath(imgUrl));
|
||||
} else {
|
||||
order.setTourismImgUrl(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return PageResult.<Order>builder().data(list).resp_code(0).count(page.getTotal()).build();
|
||||
|
||||
+1
@@ -153,6 +153,7 @@ public class VideoEditServiceImpl implements IVideoEditService {
|
||||
orderFile.setFileId(fileInfo.getId());
|
||||
orderFile.setOrderNo(orderNo);
|
||||
orderFile.setFileType("video/mp4");
|
||||
orderFile.setFileTag("ai_video");
|
||||
orderFile.setFilePath(extractFilePath(outputUrl));
|
||||
orderFile.setUserId(order.getUserId());
|
||||
orderFile.setTourismId(order.getTourismId());
|
||||
|
||||
Reference in New Issue
Block a user