fix(优化):订单统计按时间升序,新增设备视频流生成,新增设备推流地址缓存逻辑
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@ package com.central.device.controller;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.JsonElement;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
|
import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
|
||||||
import com.central.common.model.Result;
|
import com.central.common.model.Result;
|
||||||
import com.central.device.feign.OrderCenterService;
|
import com.central.device.feign.OrderCenterService;
|
||||||
@@ -140,7 +141,7 @@ public class ApiDeviceController {
|
|||||||
data.addProperty("file_md5", lineFile.getSign());
|
data.addProperty("file_md5", lineFile.getSign());
|
||||||
// 设置设备视频流地址
|
// 设置设备视频流地址
|
||||||
try {
|
try {
|
||||||
data.addProperty("stream_urls", liveStreamService.generateStreamUrls(deviceId).toString());
|
data.add("stream_urls", gson.fromJson(liveStreamService.generateStreamUrls(deviceId).toJSONString(), JsonElement.class));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("生成设备推流/拉流地址异常: deviceId={}, error={}", deviceId, e.getMessage(), e);
|
log.error("生成设备推流/拉流地址异常: deviceId={}, error={}", deviceId, e.getMessage(), e);
|
||||||
data.addProperty("stream_urls", "{}"); // 或者空字符串 ""
|
data.addProperty("stream_urls", "{}"); // 或者空字符串 ""
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ server:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: device-center
|
name: device-center
|
||||||
cloud:
|
# cloud:
|
||||||
nacos:
|
# nacos:
|
||||||
discovery:
|
# discovery:
|
||||||
ip: 119.45.169.13
|
# ip: 119.45.169.13
|
||||||
# cloud:
|
# cloud:
|
||||||
# nacos:
|
# nacos:
|
||||||
# discovery:
|
# discovery:
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ public interface OrderStatisticsMapper extends BaseMapper<OrderStatistics> {
|
|||||||
" AND o.code_id = #{qrcodeId}",
|
" AND o.code_id = #{qrcodeId}",
|
||||||
"</if>",
|
"</if>",
|
||||||
"GROUP BY ${groupField}",
|
"GROUP BY ${groupField}",
|
||||||
"ORDER BY totalOrders DESC",
|
"ORDER BY o.create_time ASC",
|
||||||
"</script>"
|
"</script>"
|
||||||
})
|
})
|
||||||
List<Map<String, Object>> getOrderStatisticsByGroup(OrderStatisticsQuery query);
|
List<Map<String, Object>> getOrderStatisticsByGroup(OrderStatisticsQuery query);
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ server:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: user-center
|
name: user-center
|
||||||
cloud:
|
# cloud:
|
||||||
nacos:
|
# nacos:
|
||||||
discovery:
|
# discovery:
|
||||||
ip: 124.222.128.40
|
# ip: 124.222.128.40
|
||||||
# cloud:
|
# cloud:
|
||||||
# nacos:
|
# nacos:
|
||||||
# discovery:
|
# discovery:
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
########################## 统一变量配置 ##########################
|
########################## 统一变量配置 ##########################
|
||||||
##### 数据库配置
|
##### 数据库配置
|
||||||
zlt.datasource.ip=127.0.0.1
|
#zlt.datasource.ip=127.0.0.1
|
||||||
zlt.datasource.username=root
|
|
||||||
zlt.datasource.password=root
|
|
||||||
#zlt.datasource.ip=sh-cdb-i6yxaaec.sql.tencentcdb.com:58797
|
|
||||||
#zlt.datasource.username=root
|
#zlt.datasource.username=root
|
||||||
#zlt.datasource.password=ZXC_zxc!@#123+
|
#zlt.datasource.password=root
|
||||||
|
zlt.datasource.ip=sh-cdb-i6yxaaec.sql.tencentcdb.com:58797
|
||||||
|
zlt.datasource.username=root
|
||||||
|
zlt.datasource.password=ZXC_zxc!@#123+
|
||||||
|
|
||||||
##### redis配置
|
##### redis配置
|
||||||
spring.data.redis.host=192.168.2.20
|
spring.data.redis.host=192.168.2.20
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
########################## bootstrap级别通用配置 ##########################
|
########################## bootstrap级别通用配置 ##########################
|
||||||
# 默认开发环境
|
# 默认开发环境
|
||||||
spring.profiles.active=prod
|
spring.profiles.active=dev
|
||||||
|
|
||||||
##### nacos(注册中心和配置中心)地址
|
##### nacos(注册中心和配置中心)地址
|
||||||
spring.cloud.nacos.server-addr=81.70.164.178:8848
|
#spring.cloud.nacos.server-addr=81.70.164.178:8848
|
||||||
#spring.cloud.nacos.server-addr=127.0.0.1:8848
|
spring.cloud.nacos.server-addr=127.0.0.1:8848
|
||||||
spring.cloud.nacos.username=nacos
|
spring.cloud.nacos.username=nacos
|
||||||
#spring.cloud.nacos.password=nacos
|
spring.cloud.nacos.password=nacos
|
||||||
spring.cloud.nacos.password=nacosGFLY
|
#spring.cloud.nacos.password=nacosGFLY
|
||||||
spring.cloud.nacos.config.file-extension=yml
|
spring.cloud.nacos.config.file-extension=yml
|
||||||
spring.cloud.nacos.config.shared-configs[0].data-id=common.yml
|
spring.cloud.nacos.config.shared-configs[0].data-id=common.yml
|
||||||
spring.cloud.nacos.config.shared-configs[0].refresh=true
|
spring.cloud.nacos.config.shared-configs[0].refresh=true
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ server:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: uaa-server
|
name: uaa-server
|
||||||
cloud:
|
# cloud:
|
||||||
nacos:
|
# nacos:
|
||||||
discovery:
|
# discovery:
|
||||||
ip: 124.222.128.40
|
# ip: 124.222.128.40
|
||||||
|
|
||||||
encrypt:
|
encrypt:
|
||||||
key-store:
|
key-store:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const Settings: LayoutSettings & {
|
|||||||
fixedHeader: false,
|
fixedHeader: false,
|
||||||
fixSiderbar: true,
|
fixSiderbar: true,
|
||||||
colorWeak: false,
|
colorWeak: false,
|
||||||
title: 'Iking-Platform',
|
title: 'G-Fly',
|
||||||
pwa: false,
|
pwa: false,
|
||||||
logo: './logo.png',
|
logo: './logo.png',
|
||||||
iconfontUrl: '',
|
iconfontUrl: '',
|
||||||
|
|||||||
@@ -9,43 +9,43 @@
|
|||||||
export default {
|
export default {
|
||||||
dev: {
|
dev: {
|
||||||
'/api-uaa/': {
|
'/api-uaa/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-user/': {
|
'/api-user/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-log/': {
|
'/api-log/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-search/': {
|
'/api-search/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-generator/': {
|
'/api-generator/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-file/': {
|
'/api-file/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-order/': {
|
'/api-order/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api-device/': {
|
'/api-device/': {
|
||||||
target: 'http://119.45.169.13:9900',
|
// target: 'http://119.45.169.13:9900',
|
||||||
// target: 'http://127.0.0.1:9900',
|
target: 'http://127.0.0.1:9900',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,4 +103,20 @@ server {
|
|||||||
return 204;
|
return 204;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# API 代理配置
|
||||||
|
location /api-device/ {
|
||||||
|
proxy_pass http://119.45.169.13:9900/api-device/; # 替换为您的后端API地址
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
|
# 处理 OPTIONS 请求
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
|
||||||
|
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@ export async function wayline(params?: { [key: string]: string | number }) {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { page: current, limit: pageSize, ...rest },
|
params: { page: current, limit: pageSize, ...rest },
|
||||||
});
|
});
|
||||||
|
console.log(result);
|
||||||
return { data: result.data, total: result.count };
|
return { data: result.data, total: result.count };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ declare namespace API {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface OrderDetail {
|
interface OrderDetail {
|
||||||
|
mobile: ReactNode;
|
||||||
orderNo: string;
|
orderNo: string;
|
||||||
orderStatus: number;
|
orderStatus: number;
|
||||||
orderAmount: string;
|
orderAmount: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user