Compare commits
15
Commits
develop
...
feature_lsl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69d784c70d | ||
|
|
3de774517e | ||
|
|
7299cc0777 | ||
|
|
ac0d185ae2 | ||
|
|
621f3be143 | ||
|
|
7782b350c9 | ||
|
|
b133788f01 | ||
|
|
c65bdaae47 | ||
|
|
9ca13415ee | ||
|
|
7f3ebdaa5d | ||
|
|
23bb330f43 | ||
|
|
52d38807a7 | ||
|
|
6af0ab37d4 | ||
|
|
f475d940be | ||
|
|
df5e94886a |
@@ -137,6 +137,80 @@ stateDiagram-v2
|
|||||||
|
|
||||||
### 4. 关键接口设计
|
### 4. 关键接口设计
|
||||||
|
|
||||||
|
#### 4.0 获取访问Token(OAuth2)
|
||||||
|
|
||||||
|
**接口地址:** `POST /api-uaa/oauth/token`
|
||||||
|
|
||||||
|
**认证方式:** HTTP Basic(`Authorization: Basic base64(clientId:clientSecret)`)
|
||||||
|
|
||||||
|
**请求头:**
|
||||||
|
- `Authorization: Basic {base64(clientId:clientSecret)}`
|
||||||
|
- `Content-Type: application/x-www-form-urlencoded`
|
||||||
|
|
||||||
|
**授权模式与参数:**
|
||||||
|
- 密码验证码模式(推荐)
|
||||||
|
- `grant_type=password_code`
|
||||||
|
- `username` 用户名
|
||||||
|
- `password` 密码
|
||||||
|
- `validCode` 校验码(图形/短信)
|
||||||
|
- `deviceId` 设备ID(可用于风控)
|
||||||
|
- 密码模式
|
||||||
|
- `grant_type=password`
|
||||||
|
- `username`
|
||||||
|
- `password`
|
||||||
|
- 客户端模式(服务器到服务器)
|
||||||
|
- `grant_type=client_credentials`
|
||||||
|
- 刷新令牌
|
||||||
|
- `grant_type=refresh_token`
|
||||||
|
- `refresh_token` 刷新令牌
|
||||||
|
|
||||||
|
**响应示例:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"access_token": "eyJraWQiOi...",
|
||||||
|
"token_type": "Bearer",
|
||||||
|
"expires_in": 3600,
|
||||||
|
"refresh_token": "def50200...",
|
||||||
|
"scope": "all openid profile"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**调用示例:**
|
||||||
|
|
||||||
|
- 密码验证码模式
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://{gateway}/api-uaa/oauth/token' \
|
||||||
|
-H 'Authorization: Basic {base64(clientId:clientSecret)}' \
|
||||||
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||||
|
-d 'grant_type=password_code&username=admin&password=123456&validCode=abcd&deviceId=web'
|
||||||
|
```
|
||||||
|
|
||||||
|
- 密码模式
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://{gateway}/api-uaa/oauth/token' \
|
||||||
|
-H 'Authorization: Basic {base64(clientId:clientSecret)}' \
|
||||||
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||||
|
-d 'grant_type=password&username=admin&password=123456'
|
||||||
|
```
|
||||||
|
|
||||||
|
- 客户端模式
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://{gateway}/api-uaa/oauth/token' \
|
||||||
|
-H 'Authorization: Basic {base64(clientId:clientSecret)}' \
|
||||||
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||||
|
-d 'grant_type=client_credentials'
|
||||||
|
```
|
||||||
|
|
||||||
|
- 刷新令牌
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://{gateway}/api-uaa/oauth/token' \
|
||||||
|
-H 'Authorization: Basic {base64(clientId:clientSecret)}' \
|
||||||
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||||
|
-d 'grant_type=refresh_token&refresh_token={refresh_token}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> 说明:可用客户端在 `oauth_client_details` 管理(如 `webApp`、`app`、`zlt` 等示例);令牌类型支持不透明令牌与JWT,网关域名与前缀以实际环境为准。
|
||||||
|
|
||||||
#### 4.1 设备执行任务API
|
#### 4.1 设备执行任务API
|
||||||
|
|
||||||
**接口地址:** `POST /api-device/execute/task`
|
**接口地址:** `POST /api-device/execute/task`
|
||||||
|
|||||||
+65
-4
@@ -20,6 +20,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备操作controller
|
* 设备操作controller
|
||||||
@@ -47,6 +49,9 @@ public class ApiDeviceController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RequestUtils requestUtils;
|
private RequestUtils requestUtils;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
private ControlMessageConstant controlMessageConstant = new ControlMessageConstant();
|
private ControlMessageConstant controlMessageConstant = new ControlMessageConstant();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -86,23 +91,36 @@ public class ApiDeviceController {
|
|||||||
return Result.failed("参数错误");
|
return Result.failed("参数错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 检查订单状态
|
// 2. 幂等性检查
|
||||||
|
String idempotencyKey = generateIdempotencyKey(deviceId, orderNo, control);
|
||||||
|
log.info("生成幂等性key: deviceId={}, orderNo={}, control={}, key={}", deviceId, orderNo, control, idempotencyKey);
|
||||||
|
|
||||||
|
if (isRequestProcessed(idempotencyKey)) {
|
||||||
|
log.info("检测到重复请求,返回幂等性响应: deviceId={}, orderNo={}, control={}", deviceId, orderNo, control);
|
||||||
|
return Result.succeed("请求已处理,请勿重复操作");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 立即标记请求已处理(防止并发请求)
|
||||||
|
markRequestAsProcessed(idempotencyKey);
|
||||||
|
log.info("幂等性检查通过,立即标记请求已处理: deviceId={}, orderNo={}, control={}", deviceId, orderNo, control);
|
||||||
|
|
||||||
|
// 4. 检查订单状态
|
||||||
String orderStatus = orderCenterService.getOrderStatusByOrderNo(orderNo);
|
String orderStatus = orderCenterService.getOrderStatusByOrderNo(orderNo);
|
||||||
if (!isValidOrderStatus(orderStatus)) {
|
if (!isValidOrderStatus(orderStatus)) {
|
||||||
return Result.failed("设备已处理,请关注订单详情");
|
return Result.failed("设备已处理,请关注订单详情");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 构建控制消息
|
// 5. 构建控制消息
|
||||||
JsonObject controlMessage = buildControlMessage(control, orderNo, deviceId);
|
JsonObject controlMessage = buildControlMessage(control, orderNo, deviceId);
|
||||||
if (controlMessage == null) {
|
if (controlMessage == null) {
|
||||||
return Result.failed("暂未开放控制权限");
|
return Result.failed("暂未开放控制权限");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. 发送设备控制请求
|
// 6. 发送设备控制请求
|
||||||
String url = baseUrl + "/device/instance/" + deviceId + "/property";
|
String url = baseUrl + "/device/instance/" + deviceId + "/property";
|
||||||
Map<String, String> result = requestUtils.getPostRequestResultMap(url, controlMessage.toString());
|
Map<String, String> result = requestUtils.getPostRequestResultMap(url, controlMessage.toString());
|
||||||
|
|
||||||
// 5. 处理响应结果
|
// 7. 处理响应结果
|
||||||
return handleDeviceResponse(result, orderNo);
|
return handleDeviceResponse(result, orderNo);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -305,4 +323,47 @@ public class ApiDeviceController {
|
|||||||
|
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成幂等性key
|
||||||
|
*/
|
||||||
|
private String generateIdempotencyKey(String deviceId, String orderNo, String control) {
|
||||||
|
return String.format("device:writeProperties:%s:%s:%s", deviceId, orderNo, control);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查请求是否已处理
|
||||||
|
*/
|
||||||
|
private boolean isRequestProcessed(String idempotencyKey) {
|
||||||
|
try {
|
||||||
|
Boolean hasKey = redisTemplate.hasKey(idempotencyKey);
|
||||||
|
log.info("检查幂等性key: key={}, hasKey={}", idempotencyKey, hasKey);
|
||||||
|
|
||||||
|
if (hasKey != null && hasKey) {
|
||||||
|
// 获取key的值进行额外验证
|
||||||
|
String value = redisTemplate.opsForValue().get(idempotencyKey);
|
||||||
|
log.info("幂等性key已存在: key={}, value={}", idempotencyKey, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("幂等性key不存在: key={}", idempotencyKey);
|
||||||
|
return false;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("检查幂等性key异常: key={}, error={}", idempotencyKey, e.getMessage(), e);
|
||||||
|
return false; // Redis异常时不阻止请求
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记请求已处理
|
||||||
|
*/
|
||||||
|
private void markRequestAsProcessed(String idempotencyKey) {
|
||||||
|
try {
|
||||||
|
// 设置5分钟过期时间,防止Redis内存占用过多
|
||||||
|
redisTemplate.opsForValue().set(idempotencyKey, "processed", 5, TimeUnit.MINUTES);
|
||||||
|
log.info("标记请求已处理: key={}", idempotencyKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("标记幂等性key异常: key={}, error={}", idempotencyKey, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-4
@@ -120,7 +120,9 @@ public class FileController {
|
|||||||
PageResult<FileInfo> pageResult = fileService.findList(params);
|
PageResult<FileInfo> pageResult = fileService.findList(params);
|
||||||
if(pageResult.getCount() >0){
|
if(pageResult.getCount() >0){
|
||||||
for (FileInfo fileInfo: pageResult.getData()){
|
for (FileInfo fileInfo: pageResult.getData()){
|
||||||
fileInfo.setUrl(timeWindowStorageService.getSmartViewUrlByPath(fileInfo.getName()));
|
String url = timeWindowStorageService.getSmartViewUrlByPath(fileInfo.getName());
|
||||||
|
log.info("文件查询URL: name={}, url={}", fileInfo.getName(), url);
|
||||||
|
fileInfo.setUrl(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pageResult;
|
return pageResult;
|
||||||
@@ -136,17 +138,23 @@ public class FileController {
|
|||||||
|
|
||||||
@GetMapping("/files/{id}")
|
@GetMapping("/files/{id}")
|
||||||
public Result getViewUrl(@PathVariable String id) {
|
public Result getViewUrl(@PathVariable String id) {
|
||||||
return Result.succeed(timeWindowStorageService.getSmartViewUrl(id),"获取成功");
|
String url = timeWindowStorageService.getSmartViewUrl(id);
|
||||||
|
log.info("文件查询URL: id={}, url={}", id, url);
|
||||||
|
return Result.succeed(url,"获取成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/file/path")
|
@GetMapping("/file/path")
|
||||||
public Result getFileViewUrlByPath(@RequestParam String path) {
|
public Result getFileViewUrlByPath(@RequestParam String path) {
|
||||||
return Result.succeed(timeWindowStorageService.getSmartViewUrlByPath(path),"获取成功");
|
String url = timeWindowStorageService.getSmartViewUrlByPath(path);
|
||||||
|
log.info("文件查询URL: path={}, url={}", path, url);
|
||||||
|
return Result.succeed(url,"获取成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/files/path")
|
@GetMapping("/files/path")
|
||||||
public String getViewUrlByPath(@RequestParam String path) {
|
public String getViewUrlByPath(@RequestParam String path) {
|
||||||
return timeWindowStorageService.getSmartViewUrlByPath(path);
|
String url = timeWindowStorageService.getSmartViewUrlByPath(path);
|
||||||
|
log.info("文件查询URL: path={}, url={}", path, url);
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/files/path/style")
|
@GetMapping("/files/path/style")
|
||||||
|
|||||||
+114
-86
@@ -4,14 +4,15 @@ import com.central.common.model.FileInfo;
|
|||||||
import com.central.file.service.impl.OssService;
|
import com.central.file.service.impl.OssService;
|
||||||
import com.central.file.service.impl.S3Service;
|
import com.central.file.service.impl.S3Service;
|
||||||
import com.central.file.service.impl.EnhancedS3Service;
|
import com.central.file.service.impl.EnhancedS3Service;
|
||||||
|
import com.central.file.mapper.FileMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时间窗口智能存储服务
|
* 时间窗口智能存储服务
|
||||||
@@ -36,15 +37,17 @@ public class TimeWindowStorageService {
|
|||||||
@Qualifier("enhancedS3FileService")
|
@Qualifier("enhancedS3FileService")
|
||||||
private EnhancedS3Service enhancedS3Service;
|
private EnhancedS3Service enhancedS3Service;
|
||||||
|
|
||||||
@Autowired(required = false)
|
// 自动同步逻辑已取消,不再注入同步服务
|
||||||
private OssToS3SyncService ossToS3SyncService;
|
|
||||||
|
@Autowired
|
||||||
|
private FileMapper fileMapper;
|
||||||
|
|
||||||
// 配置参数
|
// 配置参数
|
||||||
@Value("${zlt.storage.hot-data-days:30}")
|
// @Value("${zlt.storage.hot-data-days}")
|
||||||
private int hotDataDays; // 热数据保留天数,默认30天
|
private int hotDataDays = 90; // 热数据保留天数,默认30天
|
||||||
|
|
||||||
@Value("${zlt.storage.enable-time-window:true}")
|
// @Value("${zlt.storage.enable-time-window:true}")
|
||||||
private boolean enableTimeWindow; // 是否启用时间窗口存储
|
private boolean enableTimeWindow = false; // 是否启用时间窗口存储
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 智能获取文件访问URL
|
* 智能获取文件访问URL
|
||||||
@@ -64,6 +67,8 @@ public class TimeWindowStorageService {
|
|||||||
|
|
||||||
// 2. 判断存储类型
|
// 2. 判断存储类型
|
||||||
String storageType = getStorageTypeByTime(fileInfo);
|
String storageType = getStorageTypeByTime(fileInfo);
|
||||||
|
log.info("时间窗口判定: fileId={} createTime={} hotDataDays={} enableTimeWindow={} -> storageType={}",
|
||||||
|
fileInfo.getId(), fileInfo.getCreateTime(), hotDataDays, enableTimeWindow, storageType);
|
||||||
|
|
||||||
// 3. 根据存储类型获取URL
|
// 3. 根据存储类型获取URL
|
||||||
String viewUrl = getViewUrlByStorageType(fileInfo, storageType);
|
String viewUrl = getViewUrlByStorageType(fileInfo, storageType);
|
||||||
@@ -86,25 +91,82 @@ public class TimeWindowStorageService {
|
|||||||
*/
|
*/
|
||||||
public String getSmartViewUrlByPath(String filePath) {
|
public String getSmartViewUrlByPath(String filePath) {
|
||||||
try {
|
try {
|
||||||
// 1. 根据路径特征判断存储类型
|
// 先按路径查询数据库,若查到则走时间窗口策略
|
||||||
if (isS3Path(filePath)) {
|
FileInfo fileInfo = getFileInfoByPath(filePath);
|
||||||
log.debug("S3路径,直接查询S3: path={}", filePath);
|
if (fileInfo != null) {
|
||||||
return queryFromS3ByPath(filePath);
|
String storageType = getStorageTypeByTime(fileInfo);
|
||||||
} else if (isOssPath(filePath)) {
|
log.info("[PATH] 时间窗口判定: path={} createTime={} hotDataDays={} enableTimeWindow={} -> storageType={}",
|
||||||
log.debug("OSS路径,直接查询OSS: path={}", filePath);
|
filePath, fileInfo.getCreateTime(), hotDataDays, enableTimeWindow, storageType);
|
||||||
return ossService.getViewUrlByPath(filePath);
|
String url = getViewUrlByStorageType(fileInfo, storageType);
|
||||||
|
log.info("[PATH] 按时间窗口获取URL: path={} storageType={} url={}", filePath, storageType, url);
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 若DB无记录,仍按时间窗口开关执行策略:
|
||||||
|
// - 若未启用时间窗口:按热数据策略(OSS)
|
||||||
|
// - 若启用时间窗口:作为未知创建时间,采用冷优先(S3→OSS)的策略
|
||||||
|
if (!enableTimeWindow) {
|
||||||
|
log.warn("[PATH] 数据库未找到文件信息,时间窗口关闭,直接从OSS获取: path={}", filePath);
|
||||||
|
try {
|
||||||
|
String ossUrl = ossService.getViewUrlByPath(filePath);
|
||||||
|
if (ossUrl != null && !ossUrl.isEmpty()) {
|
||||||
|
log.debug("OSS查询成功: path={}", filePath);
|
||||||
|
return ossUrl;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("OSS查询失败: path={}, error={}", filePath, e.getMessage());
|
||||||
|
}
|
||||||
|
log.warn("路径查询失败(OSS未命中): path={}", filePath);
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
log.warn("[PATH] 数据库未找到文件信息,时间窗口开启,按冷优先策略查询: path={}", filePath);
|
||||||
|
// 1) 先尝试S3(不触发任何自动同步)
|
||||||
|
String s3Url = queryFromS3ByPath(filePath);
|
||||||
|
if (s3Url != null && !s3Url.isEmpty()) {
|
||||||
|
log.debug("S3查询成功: path={}", filePath);
|
||||||
|
return s3Url;
|
||||||
|
}
|
||||||
|
// 2) 再尝试OSS
|
||||||
|
try {
|
||||||
|
String ossUrl = ossService.getViewUrlByPath(filePath);
|
||||||
|
if (ossUrl != null && !ossUrl.isEmpty()) {
|
||||||
|
log.debug("OSS查询成功: path={}", filePath);
|
||||||
|
return ossUrl;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("OSS查询失败: path={}, error={}", filePath, e.getMessage());
|
||||||
|
}
|
||||||
|
log.warn("路径查询失败(OSS/S3均未命中): path={}", filePath);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 路径特征不明确,尝试智能查询
|
|
||||||
log.debug("路径特征不明确,尝试智能查询: path={}", filePath);
|
|
||||||
return getViewUrlByFallback(filePath);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("智能存储查询失败: path={}, error={}", filePath, e.getMessage(), e);
|
log.error("智能存储路径查询异常: path={}, error={}", filePath, e.getMessage(), e);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FileInfo getFileInfoByPath(String filePath) {
|
||||||
|
try {
|
||||||
|
if (filePath == null || filePath.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
QueryWrapper<FileInfo> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("path", filePath).last("limit 1");
|
||||||
|
FileInfo info = fileMapper.selectOne(wrapper);
|
||||||
|
if (info == null) {
|
||||||
|
// 某些历史数据可能将 name 作为相对路径,可兼容一次
|
||||||
|
wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("name", filePath).last("limit 1");
|
||||||
|
info = fileMapper.selectOne(wrapper);
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.warn("按路径查询文件信息异常: path={}, error={}", filePath, ex.getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据文件创建时间判断存储类型
|
* 根据文件创建时间判断存储类型
|
||||||
*/
|
*/
|
||||||
@@ -155,7 +217,9 @@ public class TimeWindowStorageService {
|
|||||||
}
|
}
|
||||||
// S3查询失败,降级到OSS
|
// S3查询失败,降级到OSS
|
||||||
log.warn("S3查询失败,降级到OSS: fileId={}", fileInfo.getId());
|
log.warn("S3查询失败,降级到OSS: fileId={}", fileInfo.getId());
|
||||||
return queryFromOss(fileInfo);
|
String ossUrl = queryFromOss(fileInfo);
|
||||||
|
log.info("OSS降级查询结果: fileId={}, url={}", fileInfo.getId(), ossUrl);
|
||||||
|
return ossUrl;
|
||||||
} else {
|
} else {
|
||||||
// 热数据,优先从OSS查询
|
// 热数据,优先从OSS查询
|
||||||
log.info("热数据,优先从OSS查询: fileId={}", fileInfo.getId());
|
log.info("热数据,优先从OSS查询: fileId={}", fileInfo.getId());
|
||||||
@@ -166,7 +230,9 @@ public class TimeWindowStorageService {
|
|||||||
}
|
}
|
||||||
// OSS查询失败,降级到S3
|
// OSS查询失败,降级到S3
|
||||||
log.warn("OSS查询失败,降级到S3: fileId={}", fileInfo.getId());
|
log.warn("OSS查询失败,降级到S3: fileId={}", fileInfo.getId());
|
||||||
return queryFromS3(fileInfo);
|
String s3Url = queryFromS3(fileInfo);
|
||||||
|
log.info("S3降级查询结果: fileId={}, url={}", fileInfo.getId(), s3Url);
|
||||||
|
return s3Url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +241,13 @@ public class TimeWindowStorageService {
|
|||||||
*/
|
*/
|
||||||
private String queryFromOss(FileInfo fileInfo) {
|
private String queryFromOss(FileInfo fileInfo) {
|
||||||
try {
|
try {
|
||||||
return ossService.getViewUrlByPath(fileInfo.getPath());
|
String url = ossService.getViewUrlByPath(fileInfo.getPath());
|
||||||
|
if (url == null || url.isEmpty()) {
|
||||||
|
log.warn("从OSS查询为空: fileId={} path={}", fileInfo.getId(), fileInfo.getPath());
|
||||||
|
} else {
|
||||||
|
log.debug("从OSS获取URL: fileId={} url={}", fileInfo.getId(), url);
|
||||||
|
}
|
||||||
|
return url;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("从OSS查询失败: fileId={}, error={}", fileInfo.getId(), e.getMessage());
|
log.warn("从OSS查询失败: fileId={}, error={}", fileInfo.getId(), e.getMessage());
|
||||||
return "";
|
return "";
|
||||||
@@ -190,10 +262,22 @@ public class TimeWindowStorageService {
|
|||||||
// 优先使用EnhancedS3Service
|
// 优先使用EnhancedS3Service
|
||||||
if (enhancedS3Service != null) {
|
if (enhancedS3Service != null) {
|
||||||
log.debug("使用EnhancedS3Service查询: fileId={}, path={}", fileInfo.getId(), fileInfo.getPath());
|
log.debug("使用EnhancedS3Service查询: fileId={}, path={}", fileInfo.getId(), fileInfo.getPath());
|
||||||
return enhancedS3Service.getViewUrlByPath(fileInfo.getPath());
|
String url = enhancedS3Service.getViewUrlByPath(fileInfo.getPath());
|
||||||
|
if (url == null || url.isEmpty()) {
|
||||||
|
log.warn("从S3查询为空(Enhanced): fileId={} path={}", fileInfo.getId(), fileInfo.getPath());
|
||||||
|
} else {
|
||||||
|
log.debug("从S3获取URL(Enhanced): fileId={} url={}", fileInfo.getId(), url);
|
||||||
|
}
|
||||||
|
return url;
|
||||||
} else if (s3Service != null) {
|
} else if (s3Service != null) {
|
||||||
log.debug("使用S3Service查询: fileId={}, path={}", fileInfo.getId(), fileInfo.getPath());
|
log.debug("使用S3Service查询: fileId={}, path={}", fileInfo.getId(), fileInfo.getPath());
|
||||||
return s3Service.getViewUrlByPath(fileInfo.getPath());
|
String url = s3Service.getViewUrlByPath(fileInfo.getPath());
|
||||||
|
if (url == null || url.isEmpty()) {
|
||||||
|
log.warn("从S3查询为空(基础): fileId={} path={}", fileInfo.getId(), fileInfo.getPath());
|
||||||
|
} else {
|
||||||
|
log.debug("从S3获取URL(基础): fileId={} url={}", fileInfo.getId(), url);
|
||||||
|
}
|
||||||
|
return url;
|
||||||
} else {
|
} else {
|
||||||
log.warn("S3服务未配置,无法查询S3: fileId={}", fileInfo.getId());
|
log.warn("S3服务未配置,无法查询S3: fileId={}", fileInfo.getId());
|
||||||
return "";
|
return "";
|
||||||
@@ -212,21 +296,7 @@ public class TimeWindowStorageService {
|
|||||||
// 优先使用EnhancedS3Service
|
// 优先使用EnhancedS3Service
|
||||||
if (enhancedS3Service != null) {
|
if (enhancedS3Service != null) {
|
||||||
log.debug("使用EnhancedS3Service查询: path={}", filePath);
|
log.debug("使用EnhancedS3Service查询: path={}", filePath);
|
||||||
String s3Url = enhancedS3Service.getViewUrlByPath(filePath);
|
return enhancedS3Service.getViewUrlByPath(filePath);
|
||||||
|
|
||||||
// 如果S3中没有找到文件,尝试从OSS同步
|
|
||||||
if ((s3Url == null || s3Url.isEmpty()) && ossToS3SyncService != null) {
|
|
||||||
log.info("S3中未找到文件,尝试从OSS同步: path={}", filePath);
|
|
||||||
boolean syncResult = ossToS3SyncService.syncFileToS3(filePath);
|
|
||||||
if (syncResult) {
|
|
||||||
log.info("OSS同步到S3成功,重新获取URL: path={}", filePath);
|
|
||||||
s3Url = enhancedS3Service.getViewUrlByPath(filePath);
|
|
||||||
} else {
|
|
||||||
log.warn("OSS同步到S3失败: path={}", filePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return s3Url;
|
|
||||||
} else if (s3Service != null) {
|
} else if (s3Service != null) {
|
||||||
log.debug("使用S3Service查询: path={}", filePath);
|
log.debug("使用S3Service查询: path={}", filePath);
|
||||||
return s3Service.getViewUrlByPath(filePath);
|
return s3Service.getViewUrlByPath(filePath);
|
||||||
@@ -243,61 +313,19 @@ public class TimeWindowStorageService {
|
|||||||
/**
|
/**
|
||||||
* 降级查询策略
|
* 降级查询策略
|
||||||
*/
|
*/
|
||||||
private String getViewUrlByFallback(String filePath) {
|
// 删除未使用的降级方法以消除告警
|
||||||
// 先尝试OSS
|
// private String getViewUrlByFallback(String filePath) { return ""; }
|
||||||
try {
|
|
||||||
String ossUrl = ossService.getViewUrlByPath(filePath);
|
|
||||||
if (ossUrl != null && !ossUrl.isEmpty()) {
|
|
||||||
log.debug("OSS降级查询成功: path={}", filePath);
|
|
||||||
return ossUrl;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("OSS降级查询失败: path={}, error={}", filePath, e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 再尝试S3
|
|
||||||
try {
|
|
||||||
String s3Url = queryFromS3ByPath(filePath);
|
|
||||||
if (s3Url != null && !s3Url.isEmpty()) {
|
|
||||||
log.debug("S3降级查询成功: path={}", filePath);
|
|
||||||
return s3Url;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("S3降级查询失败: path={}, error={}", filePath, e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
log.warn("所有存储查询都失败: path={}", filePath);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否为S3路径
|
* 判断是否为S3路径
|
||||||
*/
|
*/
|
||||||
private boolean isS3Path(String path) {
|
// 删除未使用的方法以消除告警
|
||||||
return path != null && (
|
// private boolean isS3Path(String path) { return false; }
|
||||||
path.startsWith("s3://") ||
|
|
||||||
path.contains("minio") ||
|
|
||||||
path.startsWith("cold-storage") ||
|
|
||||||
path.contains("S3") ||
|
|
||||||
path.startsWith("hot-sync/") || // 兼容旧的hot-sync前缀
|
|
||||||
// 只有明确包含S3标识的路径才认为是S3路径
|
|
||||||
path.contains("s3://") ||
|
|
||||||
path.contains("minio://")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否为OSS路径
|
* 判断是否为OSS路径
|
||||||
*/
|
*/
|
||||||
private boolean isOssPath(String path) {
|
// private boolean isOssPath(String path) { return false; }
|
||||||
return path != null && (
|
|
||||||
path.startsWith("oss://") ||
|
|
||||||
path.contains("aliyun") ||
|
|
||||||
path.contains("ali-oss") ||
|
|
||||||
path.contains("OSS") ||
|
|
||||||
path.startsWith("https://goflyapp.oss-cn-beijing.aliyuncs.com/")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查文件是否需要迁移
|
* 检查文件是否需要迁移
|
||||||
|
|||||||
+28
-26
@@ -1,7 +1,6 @@
|
|||||||
package com.central.file.service.impl;
|
package com.central.file.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.central.common.constant.CommonConstant;
|
|
||||||
import com.central.common.model.FileInfo;
|
import com.central.common.model.FileInfo;
|
||||||
import com.central.oss.model.ObjectInfo;
|
import com.central.oss.model.ObjectInfo;
|
||||||
import com.central.oss.properties.FileServerProperties;
|
import com.central.oss.properties.FileServerProperties;
|
||||||
@@ -69,17 +68,18 @@ public class EnhancedS3Service extends AbstractIFileService {
|
|||||||
try {
|
try {
|
||||||
S3Object s3Object = parsePath(name);
|
S3Object s3Object = parsePath(name);
|
||||||
log.info("解析S3路径: {} -> bucket: {}, object: {}", name, s3Object.bucketName, s3Object.objectName);
|
log.info("解析S3路径: {} -> bucket: {}, object: {}", name, s3Object.bucketName, s3Object.objectName);
|
||||||
|
// 打印未签名的S3完整访问路径(endpoint/bucket/object)
|
||||||
// 检查文件是否存在
|
try {
|
||||||
boolean exists = s3Template.doesObjectExist(s3Object.bucketName, s3Object.objectName);
|
String endpoint = fileServerProperties.getS3().getEndpoint();
|
||||||
log.info("S3文件存在检查: bucket={}, object={}, exists={}", s3Object.bucketName, s3Object.objectName, exists);
|
if (endpoint != null && !endpoint.isEmpty()) {
|
||||||
|
String normalizedEndpoint = endpoint.endsWith("/") ? endpoint.substring(0, endpoint.length() - 1) : endpoint;
|
||||||
if (!exists) {
|
String rawUrl = normalizedEndpoint + "/" + s3Object.bucketName + "/" + s3Object.objectName;
|
||||||
log.warn("S3文件不存在: bucket={}, object={}", s3Object.bucketName, s3Object.objectName);
|
log.info("S3访问完整路径(未签名): {}", rawUrl);
|
||||||
return "";
|
}
|
||||||
|
} catch (Exception ignore) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用getViewUrl方法获取预签名URL
|
// 直接生成预签名URL,避免额外的HEAD存在性检查引发的握手问题
|
||||||
String url = s3Template.getViewUrl(s3Object.bucketName, s3Object.objectName, 60); // 60分钟有效期
|
String url = s3Template.getViewUrl(s3Object.bucketName, s3Object.objectName, 60); // 60分钟有效期
|
||||||
log.info("生成S3 URL: {}", url);
|
log.info("生成S3 URL: {}", url);
|
||||||
return url;
|
return url;
|
||||||
@@ -336,7 +336,7 @@ public class EnhancedS3Service extends AbstractIFileService {
|
|||||||
private S3Object parsePath(String path) {
|
private S3Object parsePath(String path) {
|
||||||
S3Object s3Object = new S3Object();
|
S3Object s3Object = new S3Object();
|
||||||
if (StrUtil.isNotEmpty(path)) {
|
if (StrUtil.isNotEmpty(path)) {
|
||||||
// 处理s3://bucket/object格式
|
// 1) 显式 s3://bucket/object 格式
|
||||||
if (path.startsWith("s3://")) {
|
if (path.startsWith("s3://")) {
|
||||||
String[] parts = path.substring(5).split("/", 2);
|
String[] parts = path.substring(5).split("/", 2);
|
||||||
if (parts.length >= 2) {
|
if (parts.length >= 2) {
|
||||||
@@ -346,23 +346,25 @@ public class EnhancedS3Service extends AbstractIFileService {
|
|||||||
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
||||||
s3Object.objectName = decodeUrl(parts[0]);
|
s3Object.objectName = decodeUrl(parts[0]);
|
||||||
}
|
}
|
||||||
} else if (path.startsWith("hot-sync/")) {
|
return s3Object;
|
||||||
// 处理hot-sync前缀的路径(兼容旧格式)
|
|
||||||
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
|
||||||
s3Object.objectName = decodeUrl(path.substring("hot-sync/".length())); // 去掉hot-sync/前缀并解码
|
|
||||||
} else {
|
|
||||||
// 处理相对路径或无前缀路径
|
|
||||||
int splitIndex = path.lastIndexOf(CommonConstant.PATH_SPLIT);
|
|
||||||
if (splitIndex != -1) {
|
|
||||||
s3Object.bucketName = path.substring(0, splitIndex);
|
|
||||||
s3Object.objectName = decodeUrl(path.substring(splitIndex + 1));
|
|
||||||
} else {
|
|
||||||
// 如果没有分隔符,使用配置的bucket
|
|
||||||
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
|
||||||
s3Object.objectName = decodeUrl(path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2) 兼容历史 hot-sync/ 前缀:对象名去掉前缀,bucket 用配置
|
||||||
|
if (path.startsWith("hot-sync/")) {
|
||||||
|
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
||||||
|
s3Object.objectName = decodeUrl(path.substring("hot-sync/".length()));
|
||||||
|
return s3Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) 统一相对路径策略:bucket 固定取配置,objectName 使用完整 path
|
||||||
|
// 这样与 OSS 目录保持一致:同一个 filePath 在 S3 作为对象键
|
||||||
|
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
||||||
|
s3Object.objectName = decodeUrl(path);
|
||||||
|
return s3Object;
|
||||||
}
|
}
|
||||||
|
// path 为空时,退回配置 bucket,空对象名
|
||||||
|
s3Object.bucketName = fileServerProperties.getS3().getBucketName();
|
||||||
|
s3Object.objectName = "";
|
||||||
return s3Object;
|
return s3Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
# OSS到MinIO同步配置
|
|
||||||
zlt:
|
|
||||||
storage:
|
|
||||||
# 热数据保留天数
|
|
||||||
hot-data-days: 30
|
|
||||||
|
|
||||||
# 同步功能配置
|
|
||||||
sync:
|
|
||||||
# 是否启用同步
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# 夜间同步配置
|
|
||||||
night-start: "0 0 0 * * ?" # 每天晚上00:00启动
|
|
||||||
night-stop: "0 0 6 * * ?" # 每天早上6:00停止
|
|
||||||
|
|
||||||
# 同步间隔(毫秒)
|
|
||||||
interval: 180000 # 3分钟
|
|
||||||
|
|
||||||
# 批量同步大小
|
|
||||||
batch-size: 100
|
|
||||||
|
|
||||||
# 是否启用事件驱动同步
|
|
||||||
event-driven: true
|
|
||||||
|
|
||||||
# 同步线程池配置
|
|
||||||
thread-pool:
|
|
||||||
core-size: 2
|
|
||||||
max-size: 5
|
|
||||||
queue-size: 100
|
|
||||||
keep-alive: 60
|
|
||||||
|
|
||||||
# 日志配置
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
com.central.file.service.OssToMinioSyncScheduler: INFO
|
|
||||||
com.central.file.service.OssToS3SyncService: DEBUG
|
|
||||||
@@ -47,25 +47,7 @@ zlt:
|
|||||||
bucketName: ${zlt.oss.bucketName}
|
bucketName: ${zlt.oss.bucketName}
|
||||||
# 时间窗口存储配置
|
# 时间窗口存储配置
|
||||||
storage:
|
storage:
|
||||||
enable-time-window: true # 启用时间窗口智能存储
|
|
||||||
hot-data-days: 30 # 热数据保留天数
|
hot-data-days: 30 # 热数据保留天数
|
||||||
migration:
|
|
||||||
enable-verification: true # 启用迁移验证
|
|
||||||
delete-source: false # 迁移后是否删除源文件
|
|
||||||
batch-size: 100 # 迁移批次大小
|
|
||||||
hot-sync:
|
|
||||||
enabled: true # 启用热数据同步
|
|
||||||
batch-size: 100 # 批次大小
|
|
||||||
interval-minutes: 30 # 同步间隔
|
|
||||||
access-threshold: 10 # 访问次数阈值
|
|
||||||
max-threads: 5 # 最大线程数
|
|
||||||
|
|
||||||
sync:
|
|
||||||
schedule:
|
|
||||||
enabled: true # 启用定时任务
|
|
||||||
cron: "0 0 2 * * ?" # 每日同步时间
|
|
||||||
status-check:
|
|
||||||
cron: "0 0 * * * ?" # 状态检查时间
|
|
||||||
#多租户配置
|
#多租户配置
|
||||||
tenant:
|
tenant:
|
||||||
enable: false
|
enable: false
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
-- 创建套餐表
|
||||||
|
-- 执行前请备份数据
|
||||||
|
|
||||||
|
USE `order-center`;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `packages` (
|
||||||
|
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||||
|
`code_id` VARCHAR(64) NOT NULL COMMENT '二维码编码(与qrcodes.code_id对应)',
|
||||||
|
`vlog_count` INT DEFAULT 0 COMMENT 'Vlog数量',
|
||||||
|
`video_count` INT DEFAULT 0 COMMENT '视频数量',
|
||||||
|
`photo_count` INT DEFAULT 0 COMMENT '照片数量',
|
||||||
|
`tenant_id` VARCHAR(64) DEFAULT NULL COMMENT '租户ID',
|
||||||
|
`company` VARCHAR(128) DEFAULT NULL COMMENT '所属公司',
|
||||||
|
`is_del` TINYINT(1) DEFAULT 0 COMMENT '是否删除 0-否 1-是',
|
||||||
|
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_code_id` (`code_id`),
|
||||||
|
KEY `idx_tenant_id` (`tenant_id`),
|
||||||
|
KEY `idx_create_time` (`create_time`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='套餐表';
|
||||||
|
|
||||||
+73
-17
@@ -22,6 +22,9 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -40,6 +43,8 @@ import java.util.Map;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class OrderFileController {
|
public class OrderFileController {
|
||||||
|
|
||||||
|
private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOrderFileService orderFileService;
|
private IOrderFileService orderFileService;
|
||||||
|
|
||||||
@@ -256,6 +261,7 @@ public class OrderFileController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查素材数量是否达到二维码要求,如果达到则更新订单状态为UPLOADED
|
* 检查素材数量是否达到二维码要求,如果达到则更新订单状态为UPLOADED
|
||||||
|
* 并在7分钟后若仍为UPLOADED则自动更新为COMPLETE
|
||||||
* @param order 订单信息
|
* @param order 订单信息
|
||||||
*/
|
*/
|
||||||
private void checkAndUpdateOrderStatus(Order order) {
|
private void checkAndUpdateOrderStatus(Order order) {
|
||||||
@@ -274,28 +280,43 @@ public class OrderFileController {
|
|||||||
log.info("检查素材数量,订单号: {}, 二维码要求数量: {}, 当前上传数量: {}",
|
log.info("检查素材数量,订单号: {}, 二维码要求数量: {}, 当前上传数量: {}",
|
||||||
order.getOrderNo(), qrCode.getMaterialCount(), currentFileCount);
|
order.getOrderNo(), qrCode.getMaterialCount(), currentFileCount);
|
||||||
|
|
||||||
// 如果当前文件数量达到或超过二维码要求的数量,则更新订单状态为素材上传完成
|
// 如果当前文件数量达到或超过二维码要求的数量,则更新订单状态为素材上传完成(UPLOADED)
|
||||||
if (currentFileCount >= qrCode.getMaterialCount()) {
|
if (currentFileCount >= qrCode.getMaterialCount()) {
|
||||||
|
|
||||||
|
// 并发场景下,实时查询最新订单状态再做判断
|
||||||
|
Order latestOrder = orderService.getOrderByNumber(order.getOrderNo());
|
||||||
|
if (latestOrder == null) {
|
||||||
|
log.warn("达到素材数量阈值时订单不存在: orderNo={}", order.getOrderNo());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Tourism tourism = tourismService.getTourismById(qrCode.getTourismId());
|
Tourism tourism = tourismService.getTourismById(qrCode.getTourismId());
|
||||||
|
|
||||||
// 自动更新订单状态为设备执行完成
|
boolean isComplete = OrderStatus.COMPLETE.getId().equals(latestOrder.getOrderStatus());
|
||||||
if (!OrderStatus.COMPLETE.getId().equals(order.getOrderStatus())) {
|
|
||||||
order.setOrderStatus(OrderStatus.COMPLETE.getId());
|
// 更新订单状态为UPLOADED(素材上传完成),但若已为COMPLETE则不更新
|
||||||
boolean updateResult = orderService.updateOrder(order);
|
if (!isComplete && !OrderStatus.UPLOADED.getId().equals(latestOrder.getOrderStatus())) {
|
||||||
|
Integer oldStatus = latestOrder.getOrderStatus();
|
||||||
|
latestOrder.setOrderStatus(OrderStatus.UPLOADED.getId());
|
||||||
|
boolean updateResult = orderService.updateOrder(latestOrder);
|
||||||
if (updateResult) {
|
if (updateResult) {
|
||||||
log.info("订单状态已自动更新为设备执行完成: orderNo={}, oldStatus={}, newStatus={}",
|
log.info("订单状态已更新为UPLOADED: orderNo={}, oldStatus={}, newStatus={}",
|
||||||
order.getOrderNo(), order.getOrderStatus(), OrderStatus.COMPLETE.getId());
|
latestOrder.getOrderNo(), oldStatus, OrderStatus.UPLOADED.getId());
|
||||||
} else {
|
} else {
|
||||||
log.error("订单状态更新失败: orderNo={}", order.getOrderNo());
|
log.error("订单状态更新为UPLOADED失败: orderNo={}", latestOrder.getOrderNo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//发送用户素材上传成功通知
|
//发送用户素材上传成功通知
|
||||||
sendMessageForResouresUploaded(order,tourism);
|
sendMessageForResouresUploaded(latestOrder,tourism);
|
||||||
|
|
||||||
// 预热订单相关的文件到CDN
|
// 预热订单相关的文件到CDN
|
||||||
prefetchOrderFilesToCdn(order.getOrderNo());
|
prefetchOrderFilesToCdn(latestOrder.getOrderNo());
|
||||||
|
|
||||||
|
// 7分钟后如果状态仍为UPLOADED,则自动更新为COMPLETE;若已完成则不再安排
|
||||||
|
if (!isComplete) {
|
||||||
|
scheduleAutoCompleteIfStillUploaded(latestOrder.getOrderNo());
|
||||||
|
}
|
||||||
|
|
||||||
// 检查是否开启一键成片功能
|
// 检查是否开启一键成片功能
|
||||||
if (isVideoEditEnabled(qrCode)) {
|
if (isVideoEditEnabled(qrCode)) {
|
||||||
@@ -303,30 +324,30 @@ public class OrderFileController {
|
|||||||
order.getOrderNo(), order.getCodeId());
|
order.getOrderNo(), order.getCodeId());
|
||||||
|
|
||||||
// 检查是否存在进行中的编辑任务
|
// 检查是否存在进行中的编辑任务
|
||||||
EditTask existingTask = editTaskService.getTaskByOrderSn(order.getOrderNo());
|
EditTask existingTask = editTaskService.getTaskByOrderSn(latestOrder.getOrderNo());
|
||||||
if (existingTask != null && EditTaskStatus.isProcessing(existingTask.getStatus())) {
|
if (existingTask != null && EditTaskStatus.isProcessing(existingTask.getStatus())) {
|
||||||
log.info("已存在进行中的编辑任务: orderNo={}, taskId={}", order.getOrderNo(), existingTask.getId());
|
log.info("已存在进行中的编辑任务: orderNo={}, taskId={}", latestOrder.getOrderNo(), existingTask.getId());
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//触发一键成片
|
//触发一键成片
|
||||||
// 1. 创建新任务
|
// 1. 创建新任务
|
||||||
EditTask task = editTaskService.createTask(order.getOrderNo(), order.getUserId());
|
EditTask task = editTaskService.createTask(latestOrder.getOrderNo(), latestOrder.getUserId());
|
||||||
|
|
||||||
// 2. 获取素材文件
|
// 2. 获取素材文件
|
||||||
List<OrderFile> orderFiles = orderFileService.getOrderFileByOrderNo(order.getOrderNo());
|
List<OrderFile> orderFiles = orderFileService.getOrderFileByOrderNo(latestOrder.getOrderNo());
|
||||||
|
|
||||||
// 3. 提交编辑任务
|
// 3. 提交编辑任务
|
||||||
String jobId = videoEditService.submitEditTask(order.getOrderNo(), orderFiles);
|
String jobId = videoEditService.submitEditTask(latestOrder.getOrderNo(), orderFiles);
|
||||||
log.info("提交一键成片任务成功: orderNo={}, jobId={}, totalMediaFiles={}",
|
log.info("提交一键成片任务成功: orderNo={}, jobId={}, totalMediaFiles={}",
|
||||||
order.getOrderNo(), jobId, orderFiles.size());
|
latestOrder.getOrderNo(), jobId, orderFiles.size());
|
||||||
// 4. 更新任务信息
|
// 4. 更新任务信息
|
||||||
task.setJobId(jobId);
|
task.setJobId(jobId);
|
||||||
task.setStatus(EditTaskStatus.PROCESSING);
|
task.setStatus(EditTaskStatus.PROCESSING);
|
||||||
editTaskService.saveOrUpdateTask(task);
|
editTaskService.saveOrUpdateTask(task);
|
||||||
} else {
|
} else {
|
||||||
log.info("二维码未开启一键成片功能,跳过一键成片: orderNo={}, codeId={}, enableVideoEdit={}",
|
log.info("二维码未开启一键成片功能,跳过一键成片: orderNo={}, codeId={}, enableVideoEdit={}",
|
||||||
order.getOrderNo(), order.getCodeId(), qrCode.getEnableVideoEdit());
|
latestOrder.getOrderNo(), latestOrder.getCodeId(), qrCode.getEnableVideoEdit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -334,6 +355,41 @@ public class OrderFileController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7分钟后检查订单状态是否仍为UPLOADED,如是则自动置为COMPLETE
|
||||||
|
*/
|
||||||
|
private void scheduleAutoCompleteIfStillUploaded(String orderNo) {
|
||||||
|
try {
|
||||||
|
scheduler.schedule(() -> {
|
||||||
|
try {
|
||||||
|
Order latest = orderService.getOrderByNumber(orderNo);
|
||||||
|
if (latest == null) {
|
||||||
|
log.warn("延迟完成检查时订单不存在: orderNo={}", orderNo);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (OrderStatus.UPLOADED.getId().equals(latest.getOrderStatus())) {
|
||||||
|
Integer oldStatus = latest.getOrderStatus();
|
||||||
|
latest.setOrderStatus(OrderStatus.COMPLETE.getId());
|
||||||
|
boolean updated = orderService.updateOrder(latest);
|
||||||
|
if (updated) {
|
||||||
|
log.info("订单状态在7分钟后自动由UPLOADED更新为COMPLETE: orderNo={}, oldStatus={}, newStatus={}",
|
||||||
|
orderNo, oldStatus, OrderStatus.COMPLETE.getId());
|
||||||
|
} else {
|
||||||
|
log.error("订单状态在7分钟后自动更新为COMPLETE失败: orderNo={}", orderNo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("订单状态在7分钟后已非UPLOADED,跳过自动完成: orderNo={}, currentStatus={}",
|
||||||
|
orderNo, latest.getOrderStatus());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("订单状态7分钟后自动完成检查异常: orderNo={}", orderNo, e);
|
||||||
|
}
|
||||||
|
}, 7, TimeUnit.MINUTES);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("安排订单状态自动完成任务失败: orderNo={}", orderNo, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查是否开启一键成片功能
|
* 检查是否开启一键成片功能
|
||||||
*/
|
*/
|
||||||
|
|||||||
+88
@@ -0,0 +1,88 @@
|
|||||||
|
package com.central.order.controller;
|
||||||
|
|
||||||
|
import com.central.common.context.TenantContextHolder;
|
||||||
|
import com.central.common.model.PageResult;
|
||||||
|
import com.central.common.model.Result;
|
||||||
|
import com.central.order.model.PackagePlan;
|
||||||
|
import com.central.order.model.QrCode;
|
||||||
|
import com.central.order.service.IPackagePlanService;
|
||||||
|
import com.central.order.service.IQrCodeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "套餐管理")
|
||||||
|
@RequestMapping("/package")
|
||||||
|
public class PackagePlanController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPackagePlanService packagePlanService;
|
||||||
|
@Autowired
|
||||||
|
private IQrCodeService qrCodeService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询套餐列表")
|
||||||
|
@Parameters({
|
||||||
|
@Parameter(name = "page",description = "分页起始位置",required = true,in=ParameterIn.QUERY),
|
||||||
|
@Parameter(name = "limit",description = "分页结束位置",required = true,in=ParameterIn.QUERY)
|
||||||
|
})
|
||||||
|
@GetMapping
|
||||||
|
public PageResult list(@RequestParam Map<String, Object> params) {
|
||||||
|
return packagePlanService.findList(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID查询套餐")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public Result<PackagePlan> getById(@PathVariable("id") Long id) {
|
||||||
|
PackagePlan plan = packagePlanService.getById(id);
|
||||||
|
if (plan == null) {
|
||||||
|
return Result.failed("暂无数据");
|
||||||
|
}
|
||||||
|
return Result.succeed(plan, "获取成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据二维码编码获取套餐内容")
|
||||||
|
@GetMapping("/byCode/{codeId}")
|
||||||
|
public Result<List<PackagePlan>> getByCode(@PathVariable("codeId") String codeId) {
|
||||||
|
List<PackagePlan> list = packagePlanService.getByCodeId(codeId);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return Result.succeed(list, "暂无数据");
|
||||||
|
}
|
||||||
|
return Result.succeed(list, "获取成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增或更新套餐")
|
||||||
|
@PostMapping
|
||||||
|
public Result<PackagePlan> saveOrUpdate(@RequestBody PackagePlan plan) {
|
||||||
|
if (plan.getId() == null) {
|
||||||
|
// 新增时补齐租户ID:优先取二维码的租户,否则用当前上下文租户
|
||||||
|
if (plan.getCodeId() != null) {
|
||||||
|
QrCode qr = qrCodeService.getByCodeId(plan.getCodeId());
|
||||||
|
if (qr != null) {
|
||||||
|
plan.setTenantId(qr.getTenantId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (plan.getTenantId() == null) {
|
||||||
|
plan.setTenantId(TenantContextHolder.getTenant());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boolean ok = packagePlanService.saveOrUpdate(plan);
|
||||||
|
return ok ? Result.succeed(plan, "操作成功") : Result.failed("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID删除套餐")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public Result<String> delete(@PathVariable("id") Long id) {
|
||||||
|
boolean ok = packagePlanService.removeById(id);
|
||||||
|
return ok ? Result.succeed("删除成功") : Result.failed("删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
+62
@@ -5,6 +5,9 @@ import com.central.common.model.Result;
|
|||||||
import com.central.order.feign.FileCenterService;
|
import com.central.order.feign.FileCenterService;
|
||||||
import com.central.order.model.*;
|
import com.central.order.model.*;
|
||||||
import com.central.order.service.IOrderService;
|
import com.central.order.service.IOrderService;
|
||||||
|
import com.central.order.service.IPackagePlanService;
|
||||||
|
import com.central.order.model.PackagePlan;
|
||||||
|
import com.central.order.model.dto.QrcodeWithPlanDTO;
|
||||||
import com.central.order.service.IQrCodeService;
|
import com.central.order.service.IQrCodeService;
|
||||||
import com.central.order.service.ITourismFileService;
|
import com.central.order.service.ITourismFileService;
|
||||||
import com.central.order.service.ITourismService;
|
import com.central.order.service.ITourismService;
|
||||||
@@ -13,10 +16,12 @@ import io.swagger.v3.oas.annotations.Parameter;
|
|||||||
import io.swagger.v3.oas.annotations.Parameters;
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -52,6 +57,9 @@ public class QrCodeController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOrderService orderService;
|
private IOrderService orderService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPackagePlanService packagePlanService;
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@@ -164,4 +172,58 @@ public class QrCodeController {
|
|||||||
map.put("tourismId",qrCode.getTourismId());
|
map.put("tourismId",qrCode.getTourismId());
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "创建/修改二维码并同步套餐")
|
||||||
|
@PostMapping("/withPlan")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Result<QrCode> saveOrUpdateQrcodeWithPlan(@RequestBody QrcodeWithPlanDTO body) throws Exception {
|
||||||
|
Assert.notNull(body, "请求体不能为空");
|
||||||
|
Assert.notNull(body.getQrCode(), "二维码参数不能为空");
|
||||||
|
|
||||||
|
QrCode qrCode = body.getQrCode();
|
||||||
|
Integer vlogCount = body.getVlogCount();
|
||||||
|
Integer videoCount = body.getVideoCount();
|
||||||
|
Integer photoCount = body.getPhotoCount();
|
||||||
|
|
||||||
|
// 先复用现有的创建/修改逻辑
|
||||||
|
Result<QrCode> result;
|
||||||
|
if (qrCode.getId() == null) {
|
||||||
|
String codeId = UUID.randomUUID().toString();
|
||||||
|
Result<Map> upload = fileCenterService.uploadQrCodeFile(codeId);
|
||||||
|
if (upload.getResp_code() != 0) {
|
||||||
|
return Result.failed("创建二维码文件失败");
|
||||||
|
}
|
||||||
|
Tourism tourism = tourismService.getTourismById(qrCode.getTourismId());
|
||||||
|
Assert.notNull(tourism, "请选择景区数据");
|
||||||
|
qrCode.setTenantId(tourism.getTenantId());
|
||||||
|
qrCode.setCodeId(codeId);
|
||||||
|
qrCode.setFilePath(upload.getData().get("filePath").toString());
|
||||||
|
qrCode.setFileId(upload.getData().get("fileId").toString());
|
||||||
|
if (qrCodeService.saveOrUpdate(qrCode)) {
|
||||||
|
result = Result.succeed(qrCode, "qrcode创建成功");
|
||||||
|
} else {
|
||||||
|
return Result.failed("qrcode创建失败");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qrCodeService.saveOrUpdate(qrCode);
|
||||||
|
result = Result.succeed(qrCode, "qrcode修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同步套餐:有则更新,无则创建
|
||||||
|
String codeId = qrCode.getCodeId();
|
||||||
|
if (codeId != null) {
|
||||||
|
List<PackagePlan> exists = packagePlanService.getByCodeId(codeId);
|
||||||
|
PackagePlan plan = exists != null && !exists.isEmpty() ? exists.get(0) : new PackagePlan();
|
||||||
|
plan.setCodeId(codeId);
|
||||||
|
if (plan.getTenantId() == null) {
|
||||||
|
plan.setTenantId(qrCode.getTenantId());
|
||||||
|
}
|
||||||
|
if (vlogCount != null) plan.setVlogCount(vlogCount);
|
||||||
|
if (videoCount != null) plan.setVideoCount(videoCount);
|
||||||
|
if (photoCount != null) plan.setPhotoCount(photoCount);
|
||||||
|
packagePlanService.saveOrUpdate(plan);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import lombok.Getter;
|
|||||||
* @author lsl create by 2025/1/10
|
* @author lsl create by 2025/1/10
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public enum OrderStatus implements ZltEnum {
|
public enum
|
||||||
|
OrderStatus implements ZltEnum {
|
||||||
UNPAID(0,"待支付"),
|
UNPAID(0,"待支付"),
|
||||||
PAID(1, "已支付排队中"),
|
PAID(1, "已支付排队中"),
|
||||||
CANCELED(2, "已取消"),
|
CANCELED(2, "已取消"),
|
||||||
|
|||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package com.central.order.mapper;
|
||||||
|
|
||||||
|
import com.central.db.mapper.SuperMapper;
|
||||||
|
import com.central.order.model.PackagePlan;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PackagePlanMapper extends SuperMapper<PackagePlan> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据二维码编码查询套餐列表
|
||||||
|
*/
|
||||||
|
List<PackagePlan> findByCodeId(@Param("codeId") String codeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
List<PackagePlan> findList(Page<PackagePlan> page, @Param("p") Map<String, Object> params);
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ public class Order extends SuperEntity {
|
|||||||
@Schema(description = "订单状态")
|
@Schema(description = "订单状态")
|
||||||
private Integer orderStatus;
|
private Integer orderStatus;
|
||||||
|
|
||||||
@Schema(description = "支付类型(1:微信支付,2:优惠券支付)")
|
@Schema(description = "支付类型(1:微信支付,2:优惠券支付, 3: 第三方聚到核销)")
|
||||||
private Integer payType;
|
private Integer payType;
|
||||||
|
|
||||||
private Date payTime;
|
private Date payTime;
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.central.order.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.central.common.model.SuperEntity;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 套餐配置
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("packages")
|
||||||
|
@Schema(description = "套餐配置")
|
||||||
|
public class PackagePlan extends SuperEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "二维码编码(codeId)")
|
||||||
|
private String codeId;
|
||||||
|
|
||||||
|
@Schema(description = "Vlog数量")
|
||||||
|
private Integer vlogCount;
|
||||||
|
|
||||||
|
@Schema(description = "视频数量")
|
||||||
|
private Integer videoCount;
|
||||||
|
|
||||||
|
@Schema(description = "照片数量")
|
||||||
|
private Integer photoCount;
|
||||||
|
|
||||||
|
@Schema(description = "租户ID")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "所属公司")
|
||||||
|
private String company;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除 0-否 1-是")
|
||||||
|
private Integer isDel;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.central.order.model.dto;
|
||||||
|
|
||||||
|
import com.central.order.model.QrCode;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "二维码与套餐创建/修改请求体")
|
||||||
|
public class QrcodeWithPlanDTO {
|
||||||
|
@Schema(description = "二维码实体")
|
||||||
|
private QrCode qrCode;
|
||||||
|
|
||||||
|
@Schema(description = "Vlog数量")
|
||||||
|
private Integer vlogCount;
|
||||||
|
|
||||||
|
@Schema(description = "视频数量")
|
||||||
|
private Integer videoCount;
|
||||||
|
|
||||||
|
@Schema(description = "照片数量")
|
||||||
|
private Integer photoCount;
|
||||||
|
}
|
||||||
|
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.central.order.service;
|
||||||
|
|
||||||
|
import com.central.common.model.PageResult;
|
||||||
|
import com.central.common.service.ISuperService;
|
||||||
|
import com.central.order.model.PackagePlan;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 套餐服务
|
||||||
|
*/
|
||||||
|
public interface IPackagePlanService extends ISuperService<PackagePlan> {
|
||||||
|
/**
|
||||||
|
* 根据二维码编码查询套餐列表
|
||||||
|
*/
|
||||||
|
List<PackagePlan> getByCodeId(String codeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询
|
||||||
|
*/
|
||||||
|
PageResult<PackagePlan> findList(java.util.Map<String, Object> params);
|
||||||
|
}
|
||||||
+19
-10
@@ -131,7 +131,7 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
|
|
||||||
// 3. 获取视频文件
|
// 3. 获取视频文件
|
||||||
// List<OrderFile> videoFiles = orderFileService.getOrderVideoFiles(orderNo);
|
// List<OrderFile> videoFiles = orderFileService.getOrderVideoFiles(orderNo);
|
||||||
if (orderFiles == null || orderFiles.size() < 7) {
|
if (orderFiles == null || orderFiles.size() < qrCode.getMaterialCount()) {
|
||||||
throw new BusinessException("订单视频文件数量不足,至少需要2个视频文件");
|
throw new BusinessException("订单视频文件数量不足,至少需要2个视频文件");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,16 +188,17 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
List<OrderFile> videoFiles = taskData.getVideoFiles();
|
List<OrderFile> videoFiles = taskData.getVideoFiles();
|
||||||
//@TODO 后期需要通过模板参数进行动态设置clips参数
|
//@TODO 后期需要通过模板参数进行动态设置clips参数
|
||||||
|
|
||||||
clips.put("1", fileCenterService.getViewUrlByPath(videoFiles.get(4).getFilePath()));
|
// 保持既有模板顺序;当索引越界或无素材时返回空URL
|
||||||
clips.put("2", fileCenterService.getViewUrlByPath(videoFiles.get(5).getFilePath()));
|
clips.put("1", getUrlBySafeIndex(videoFiles, 4));
|
||||||
clips.put("3", fileCenterService.getViewUrlByPath(videoFiles.get(6).getFilePath()));
|
clips.put("2", getUrlBySafeIndex(videoFiles, 5));
|
||||||
clips.put("4", fileCenterService.getViewUrlByPath(videoFiles.get(0).getFilePath()));
|
clips.put("3", getUrlBySafeIndex(videoFiles, 6));
|
||||||
clips.put("5", fileCenterService.getViewUrlByPath(videoFiles.get(1).getFilePath()));
|
clips.put("4", getUrlBySafeIndex(videoFiles, 0));
|
||||||
clips.put("6", fileCenterService.getViewUrlByPath(videoFiles.get(2).getFilePath()));
|
clips.put("5", getUrlBySafeIndex(videoFiles, 1));
|
||||||
clips.put("7", fileCenterService.getViewUrlByPath(videoFiles.get(3).getFilePath()));
|
clips.put("6", getUrlBySafeIndex(videoFiles, 2));
|
||||||
|
clips.put("7", getUrlBySafeIndex(videoFiles, 3));
|
||||||
|
|
||||||
if (taskData.getVideoFiles().size() > 7) {
|
if (videoFiles != null && videoFiles.size() > 7) {
|
||||||
clips.put("8", fileCenterService.getViewUrlByPath(videoFiles.get(7).getFilePath()));
|
clips.put("8", getUrlBySafeIndex(videoFiles, 7));
|
||||||
}
|
}
|
||||||
|
|
||||||
return JSON.toJSONString(clips);
|
return JSON.toJSONString(clips);
|
||||||
@@ -206,6 +207,14 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getUrlBySafeIndex(List<OrderFile> videoFiles, int index) {
|
||||||
|
int size = (videoFiles == null) ? 0 : videoFiles.size();
|
||||||
|
if (size == 0 || index < 0 || index >= size) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return fileCenterService.getViewUrlByPath(videoFiles.get(index).getFilePath());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建输出配置
|
* 构建输出配置
|
||||||
*/
|
*/
|
||||||
|
|||||||
+11
-2
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.central.common.context.TenantContextHolder;
|
import com.central.common.context.TenantContextHolder;
|
||||||
import com.central.common.lock.DistributedLock;
|
import com.central.common.lock.DistributedLock;
|
||||||
import com.central.common.model.PageResult;
|
import com.central.common.model.PageResult;
|
||||||
|
import com.central.common.model.SysUser;
|
||||||
import com.central.common.service.impl.SuperServiceImpl;
|
import com.central.common.service.impl.SuperServiceImpl;
|
||||||
import com.central.order.enums.OrderStatus;
|
import com.central.order.enums.OrderStatus;
|
||||||
import com.central.order.event.OrderStatusChangeEvent;
|
import com.central.order.event.OrderStatusChangeEvent;
|
||||||
@@ -89,7 +90,10 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|||||||
List<Order> list = baseMapper.findList(page, params);
|
List<Order> list = baseMapper.findList(page, params);
|
||||||
log.info("查询结果数量: {}", list.size());
|
log.info("查询结果数量: {}", list.size());
|
||||||
for (Order order : list){
|
for (Order order : list){
|
||||||
order.setMobile(userCenterService.findUserById(order.getUserId()).getMobile());
|
SysUser user = userCenterService.findUserById(order.getUserId());
|
||||||
|
if (user != null){
|
||||||
|
order.setMobile(user.getMobile());
|
||||||
|
}
|
||||||
order.setTourismName(tourismMapper.selectById(order.getTourismId()).getTourismName());
|
order.setTourismName(tourismMapper.selectById(order.getTourismId()).getTourismName());
|
||||||
}
|
}
|
||||||
return PageResult.<Order>builder().data(list).resp_code(0).count(page.getTotal()).build();
|
return PageResult.<Order>builder().data(list).resp_code(0).count(page.getTotal()).build();
|
||||||
@@ -98,7 +102,12 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|||||||
// 创建订单,初始状态为"待支付"
|
// 创建订单,初始状态为"待支付"
|
||||||
@Override
|
@Override
|
||||||
public boolean createOrder(Order order) {
|
public boolean createOrder(Order order) {
|
||||||
order.setOrderStatus(OrderStatus.UNPAID.getId());
|
// payType=3 视为已支付,否则为待支付
|
||||||
|
if (order.getPayType() != null && order.getPayType() == 3) {
|
||||||
|
order.setOrderStatus(OrderStatus.PAID.getId());
|
||||||
|
} else {
|
||||||
|
order.setOrderStatus(OrderStatus.UNPAID.getId());
|
||||||
|
}
|
||||||
String orderNo = generateOrderNumber(order.getTourismId());
|
String orderNo = generateOrderNumber(order.getTourismId());
|
||||||
order.setOrderNo(orderNo);
|
order.setOrderNo(orderNo);
|
||||||
|
|
||||||
|
|||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
package com.central.order.service.impl;
|
||||||
|
|
||||||
|
import com.central.common.service.impl.SuperServiceImpl;
|
||||||
|
import com.central.order.mapper.PackagePlanMapper;
|
||||||
|
import com.central.order.model.PackagePlan;
|
||||||
|
import com.central.order.service.IPackagePlanService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.central.common.model.PageResult;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PackagePlanServiceImpl extends SuperServiceImpl<PackagePlanMapper, PackagePlan> implements IPackagePlanService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PackagePlan> getByCodeId(String codeId) {
|
||||||
|
return baseMapper.findByCodeId(codeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<PackagePlan> findList(Map<String, Object> params) {
|
||||||
|
Page<PackagePlan> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
|
||||||
|
List<PackagePlan> list = baseMapper.findList(page, params);
|
||||||
|
return PageResult.<PackagePlan>builder().data(list).resp_code(0).count(page.getTotal()).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.central.order.mapper.PackagePlanMapper">
|
||||||
|
|
||||||
|
<resultMap id="PackagePlanResultMap" type="com.central.order.model.PackagePlan">
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="findList" resultMap="PackagePlanResultMap">
|
||||||
|
SELECT *
|
||||||
|
FROM packages t
|
||||||
|
<where>
|
||||||
|
<if test="p.codeId != null and p.codeId != ''">
|
||||||
|
AND t.code_id = #{p.codeId}
|
||||||
|
</if>
|
||||||
|
<if test="p.isDel != null">
|
||||||
|
AND t.is_del = #{p.isDel}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY t.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findByCodeId" resultMap="PackagePlanResultMap">
|
||||||
|
SELECT *
|
||||||
|
FROM packages
|
||||||
|
WHERE code_id = #{codeId}
|
||||||
|
AND (is_del IS NULL OR is_del = 0)
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -28,8 +28,10 @@ zlt.fdfs.trackerList=${zlt.fdfs.web-url}:22122
|
|||||||
##### s3配置
|
##### s3配置
|
||||||
zlt.s3.access-key=Hq78CaYg2BI6ZfxCRMKI
|
zlt.s3.access-key=Hq78CaYg2BI6ZfxCRMKI
|
||||||
zlt.s3.accessKeySecret=DJCt5q9K7GQ2zcBEfr3twb1vQ6BgUW1LKFlI5NSw
|
zlt.s3.accessKeySecret=DJCt5q9K7GQ2zcBEfr3twb1vQ6BgUW1LKFlI5NSw
|
||||||
zlt.s3.endpoint=http://220.205.16.27:9000
|
#zlt.s3.endpoint=http://local.goflytec.com:9194
|
||||||
zlt.s3.bucketName=goflyapp
|
zlt.s3.endpoint=https://local.goflytec.com
|
||||||
|
#zlt.s3.endpoint=http://220.205.16.27:9000
|
||||||
|
zlt.s3.bucketName=goflymedia
|
||||||
zlt.s3.region=us-east-1
|
zlt.s3.region=us-east-1
|
||||||
|
|
||||||
zlt.oss.secretId=LTAI5tSNV1RvexXpMMCZhxSe
|
zlt.oss.secretId=LTAI5tSNV1RvexXpMMCZhxSe
|
||||||
|
|||||||
Binary file not shown.
+31
-1
@@ -238,8 +238,38 @@ const CreateForm: React.FC<CreateFormProps> = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
|
|
||||||
|
{/* 套餐配置 */}
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormDigit
|
||||||
|
width="md"
|
||||||
|
name="vlogCount"
|
||||||
|
label="Vlog数量"
|
||||||
|
min={0}
|
||||||
|
initialValue={0}
|
||||||
|
placeholder="请输入Vlog数量"
|
||||||
|
/>
|
||||||
|
<ProFormDigit
|
||||||
|
width="md"
|
||||||
|
name="videoCount"
|
||||||
|
label="视频数量"
|
||||||
|
min={0}
|
||||||
|
initialValue={0}
|
||||||
|
placeholder="请输入视频数量"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormDigit
|
||||||
|
width="md"
|
||||||
|
name="photoCount"
|
||||||
|
label="照片数量"
|
||||||
|
min={0}
|
||||||
|
initialValue={0}
|
||||||
|
placeholder="请输入照片数量"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CreateForm;
|
export default CreateForm;
|
||||||
|
|||||||
@@ -245,6 +245,33 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
|
|
||||||
|
{/* 套餐配置 */}
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormDigit
|
||||||
|
width="md"
|
||||||
|
name="vlogCount"
|
||||||
|
label="Vlog数量"
|
||||||
|
min={0}
|
||||||
|
placeholder="请输入Vlog数量"
|
||||||
|
/>
|
||||||
|
<ProFormDigit
|
||||||
|
width="md"
|
||||||
|
name="videoCount"
|
||||||
|
label="视频数量"
|
||||||
|
min={0}
|
||||||
|
placeholder="请输入视频数量"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormDigit
|
||||||
|
width="md"
|
||||||
|
name="photoCount"
|
||||||
|
label="照片数量"
|
||||||
|
min={0}
|
||||||
|
placeholder="请输入照片数量"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { deleteQrcode, qrcode, saveOrUpdateQrcode, getTourismList, getVideoTemplateList, getTenantList } from '@/services/orders/api';
|
import { deleteQrcode, qrcode, saveOrUpdateQrcodeWithPlan, getTourismList, getVideoTemplateList, getTenantList, getPackageByCode } from '@/services/orders/api';
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
||||||
import {
|
import {
|
||||||
@@ -121,29 +121,55 @@ const TableList: React.FC = () => {
|
|||||||
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理添加
|
// 处理添加(先创建二维码,再创建套餐)
|
||||||
const handleAdd = async (fields: Partial<ORDERS.Qrcode>) => {
|
const handleAdd = async (fields: Partial<ORDERS.Qrcode>) => {
|
||||||
const template = templateOptions.find(item => item.value === fields.templateId);
|
const hide = message.loading('正在添加');
|
||||||
return handleApiRequest(
|
try {
|
||||||
() => saveOrUpdateQrcode({
|
const { vlogCount, videoCount, photoCount, ...qrcodePayload } = (fields || {}) as any;
|
||||||
...fields,
|
const res = await saveOrUpdateQrcodeWithPlan({
|
||||||
} as ORDERS.Qrcode),
|
qrCode: qrcodePayload as ORDERS.Qrcode,
|
||||||
'正在添加',
|
vlogCount: Number(vlogCount ?? 0),
|
||||||
'添加成功'
|
videoCount: Number(videoCount ?? 0),
|
||||||
);
|
photoCount: Number(photoCount ?? 0),
|
||||||
|
});
|
||||||
|
if (res.resp_code !== 0) {
|
||||||
|
message.error(res.resp_msg || '创建失败');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
message.success('添加成功');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
message.error('添加失败');
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
hide();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理编辑
|
// 处理编辑(更新二维码,同时新增/更新套餐)
|
||||||
const handleEdit = async (original: ORDERS.Qrcode, fields: Partial<ORDERS.Qrcode>) => {
|
const handleEdit = async (original: ORDERS.Qrcode, fields: Partial<ORDERS.Qrcode>) => {
|
||||||
const template = templateOptions.find(item => item.value === fields.templateId);
|
const hide = message.loading('正在更新');
|
||||||
return handleApiRequest(
|
try {
|
||||||
() => saveOrUpdateQrcode({
|
const { vlogCount, videoCount, photoCount, ...qrcodePayload } = (fields || {}) as any;
|
||||||
id: original.id,
|
const qrPayload = { id: original.id, codeId: original.codeId, ...(qrcodePayload as any) } as ORDERS.Qrcode;
|
||||||
...fields
|
const res = await saveOrUpdateQrcodeWithPlan({
|
||||||
}),
|
qrCode: qrPayload,
|
||||||
'正在更新',
|
vlogCount: vlogCount as number | undefined,
|
||||||
'修改成功'
|
videoCount: videoCount as number | undefined,
|
||||||
);
|
photoCount: photoCount as number | undefined,
|
||||||
|
});
|
||||||
|
if (res.resp_code !== 0) {
|
||||||
|
message.error(res.resp_msg || '更新失败');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
message.success('修改成功');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
message.error('修改失败');
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
hide();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理删除
|
// 处理删除
|
||||||
@@ -525,8 +551,19 @@ const TableList: React.FC = () => {
|
|||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space>
|
<Space>
|
||||||
<Link
|
<Link
|
||||||
onClick={() => {
|
onClick={async () => {
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
try {
|
||||||
|
if (record?.codeId) {
|
||||||
|
const planRes = await getPackageByCode(record.codeId);
|
||||||
|
const plan = (planRes.resp_code === 0 && Array.isArray(planRes.data) && planRes.data.length > 0) ? planRes.data[0] : undefined;
|
||||||
|
if (plan) {
|
||||||
|
setCurrentRow(prev => ({ ...(prev as any), vlogCount: plan.vlogCount, videoCount: plan.videoCount, photoCount: plan.photoCount } as any));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// ignore preload error
|
||||||
|
}
|
||||||
handleUpdateModalVisible(true);
|
handleUpdateModalVisible(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -112,6 +112,34 @@ export async function saveOrUpdateQrcode(data: ORDERS.Qrcode): Promise<API.Resul
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 根据二维码编码获取套餐列表 */
|
||||||
|
export async function getPackageByCode(codeId: string): Promise<API.Result<ORDERS.PackagePlan[]>> {
|
||||||
|
return request<API.Result<ORDERS.PackagePlan[]>>(`/api-order/package/byCode/${codeId}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增或更新套餐 */
|
||||||
|
export async function saveOrUpdatePackagePlan(data: ORDERS.PackagePlan): Promise<API.Result<ORDERS.PackagePlan>> {
|
||||||
|
return request<API.Result<ORDERS.PackagePlan>>('/api-order/package', {
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 一次性创建/修改二维码及套餐 */
|
||||||
|
export async function saveOrUpdateQrcodeWithPlan(payload: {
|
||||||
|
qrCode: ORDERS.Qrcode;
|
||||||
|
vlogCount?: number;
|
||||||
|
videoCount?: number;
|
||||||
|
photoCount?: number;
|
||||||
|
}): Promise<API.Result<ORDERS.Qrcode>> {
|
||||||
|
return request<API.Result<ORDERS.Qrcode>>('/api-order/qrcode/withPlan', {
|
||||||
|
method: 'POST',
|
||||||
|
data: payload,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function homeCarousel(params?: { [key: string]: string | number }) {
|
export async function homeCarousel(params?: { [key: string]: string | number }) {
|
||||||
const { current, pageSize, ...rest } = params ?? {};
|
const { current, pageSize, ...rest } = params ?? {};
|
||||||
const result = await request<SYSTEM.Page<ORDERS.HomeCarousel>>('/api-order/home/carousel', {
|
const result = await request<SYSTEM.Page<ORDERS.HomeCarousel>>('/api-order/home/carousel', {
|
||||||
@@ -480,4 +508,4 @@ export async function getTenantList(params: {
|
|||||||
return request('/api-uaa/clients/all', {
|
return request('/api-uaa/clients/all', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,6 +248,18 @@ declare namespace ORDERS {
|
|||||||
createTime: string;
|
createTime: string;
|
||||||
updateTime: string;
|
updateTime: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 套餐定义 */
|
||||||
|
type PackagePlan = {
|
||||||
|
id?: number;
|
||||||
|
codeId: string;
|
||||||
|
vlogCount?: number;
|
||||||
|
videoCount?: number;
|
||||||
|
photoCount?: number;
|
||||||
|
tenantId?: string;
|
||||||
|
createTime?: string;
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare namespace API {
|
declare namespace API {
|
||||||
@@ -292,4 +304,4 @@ declare namespace API {
|
|||||||
queueCount?: number;
|
queueCount?: number;
|
||||||
estimatedTime?: number;
|
estimatedTime?: number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user