Przeglądaj źródła

提交原矿物流合同

chenxiaofei 1 miesiąc temu
rodzic
commit
efb960c6c9

+ 4 - 4
sckw-modules/sckw-order/src/main/resources/bootstrap-cxf.yml

@@ -3,16 +3,16 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: @nacos.server@
+        server-addr: 118.116.4.155:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-ng-service-platform-xf
         # 共享配置
         group: sckw-ng-service-platform
       config:
         # 配置中心地址
-        server-addr: @nacos.server@
+        server-addr: 118.116.4.155:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-ng-service-platform-xf
         # 共享配置
         group: sckw-ng-service-platform
         # 配置文件格式

+ 20 - 43
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/BiDashboardController.java

@@ -1,12 +1,13 @@
 package com.sckw.report.controller;
 
 import com.sckw.core.web.response.BaseResult;
-import com.sckw.core.web.response.HttpResult;
+import com.sckw.order.api.model.OrderExecutionDisplayVo;
 import com.sckw.report.service.KwCapacityAnalysisService;
 import com.sckw.report.service.KwHomeService;
-
 import com.sckw.report.service.KwOrderExecutionService;
 import com.sckw.report.service.KwRealtimeSalesService;
+import com.sckw.transport.api.model.vo.CurrentCapacityAnalysisVo;
+import com.sckw.transport.api.model.vo.RealtimeSalesVolumeVo;
 import com.sckw.transport.api.model.vo.TransportTopStatisticsVo;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -16,69 +17,45 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 @AllArgsConstructor
 @RestController
 @RequestMapping("/kwBiCapacityAnalysis")
-@Tag(name = "BI大屏", description = "BI大屏")
+@Tag(name = "BI Dashboard", description = "BI Dashboard")
 public class BiDashboardController {
     private final KwHomeService kwHomeService;
     private final KwCapacityAnalysisService capacityAnalysisService;
     private final KwOrderExecutionService orderExecutionService;
     private final KwRealtimeSalesService realtimeSalesService;
 
-
-    /**
-     * 首页顶部数据展示区统计接口。
-     * <p>
-     * 一次性返回以下四个指标,供页面顶部卡片直接展示:
-     * 1. 累计运量:系统内所有已完成运单的净重汇总;
-     * 2. 累计车次:系统内所有已完成运单数量;
-     * 3. 今日车次:系统内当日完成运单数量,按运单完成时间统计;
-     * 4. 今日运量:系统内当日完成运单的净重汇总,按运单完成时间统计。
-     * </p>
-     *
-     * @return 顶部数据展示区统计结果
-     */
     @GetMapping("/transportTopStatistics")
-    @Operation(summary = "首页顶部数据展示区统计", description = "累计运量、累计车次、今日车次、今日运量")
+    @Operation(summary = "Transport top statistics", description = "Total volume, total trips, today trips, today volume")
     public BaseResult<TransportTopStatisticsVo> transportTopStatistics() {
         return BaseResult.success(kwHomeService.transportTopStatistics());
     }
 
-    /**
-     * 当前运力分析展示:待进场、装载作业、配送中
-     */
-    @Operation(summary = "当前运力分析展示", description = "待进场、装载作业、配送中车辆实时数量")
     @PostMapping("/currentDisplay")
-    public HttpResult currentDisplay() {
-        return capacityAnalysisService.currentCapacityAnalysis();
+    @Operation(summary = "Current capacity display", description = "Waiting, loading and delivering")
+    public BaseResult<CurrentCapacityAnalysisVo> currentDisplay() {
+        return BaseResult.success(capacityAnalysisService.currentCapacityAnalysis());
     }
 
-    /**
-     * 当前运力分析展示(子运单口径:kwt_waybill_order_subtask)
-     */
-    @Operation(summary = "当前运力分析展示(子运单口径)", description = "基于子运单状态聚合:待进场、装载作业、配送中")
     @PostMapping("/currentDisplayBySubtask")
-    public HttpResult currentDisplayBySubtask() {
-        return capacityAnalysisService.currentCapacityAnalysisBySubtask();
+    @Operation(summary = "Current capacity by subtask", description = "Waiting, loading and delivering by subtask")
+    public BaseResult<CurrentCapacityAnalysisVo> currentDisplayBySubtask() {
+        return BaseResult.success(capacityAnalysisService.currentCapacityAnalysisBySubtask());
     }
 
-    /**
-     * 订单执行情况看板
-     */
-
-    @Operation(summary = "订单执行情况展示", description = "计划量、已装载、车次、完成率;列表超过 9 条由前端向上轮播")
     @GetMapping("/display")
-    public HttpResult display() {
-        return orderExecutionService.orderExecutionDisplay();
+    @Operation(summary = "Order execution display", description = "Order execution metrics and list")
+    public BaseResult<List<OrderExecutionDisplayVo>> display() {
+        return BaseResult.success(orderExecutionService.orderExecutionDisplay());
     }
 
-    /**
-     * 实时销量看板
-     */
-    @Operation(summary = "实时销量", description = "近12个整点,每点为上小时完成运单净重汇总(吨),按商品分线")
     @GetMapping("/volume")
-    public HttpResult volume() {
-        return realtimeSalesService.realtimeSalesVolume();
+    @Operation(summary = "Realtime sales volume", description = "Realtime sales volume trend")
+    public BaseResult<RealtimeSalesVolumeVo> volume() {
+        return BaseResult.success(realtimeSalesService.realtimeSalesVolume());
     }
-}
+}

+ 44 - 17
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwCapacityAnalysisService.java

@@ -1,8 +1,8 @@
 package com.sckw.report.service;
 
+import com.sckw.core.exception.SystemException;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.BaseResult;
-import com.sckw.core.web.response.HttpResult;
 import com.sckw.transport.api.feign.TransportApi;
 import com.sckw.transport.api.model.vo.CurrentCapacityAnalysisVo;
 import lombok.RequiredArgsConstructor;
@@ -10,7 +10,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 /**
- * 运力看板相关统计(聚合远程运输服务)
+ * 库位容量分析服务类
+ * 提供获取当前库位容量分析数据的相关业务逻辑
  */
 @Slf4j
 @Service
@@ -20,42 +21,68 @@ public class KwCapacityAnalysisService {
     private final TransportApi transportApi;
 
     /**
-     * 当前运力分析展示
+     * 获取当前库位容量分析数据
+     *
+     * @return 当前库位容量分析视图对象
+     * @throws SystemException 当远程调用失败或返回异常时抛出系统异常
      */
-    public HttpResult currentCapacityAnalysis() {
+    public CurrentCapacityAnalysisVo currentCapacityAnalysis() {
         BaseResult<CurrentCapacityAnalysisVo> remote;
         try {
+            // 调用远程接口获取当前库位容量分析数据
             remote = transportApi.currentCapacityAnalysis();
         } catch (Exception e) {
-            log.error("调用运输服务「当前运力分析」失败", e);
-            return HttpResult.error("获取当前运力分析数据失败:" + e.getMessage());
+            // 记录远程调用失败的错误日志
+            log.error("调用当前库位容量分析接口失败", e);
+            throw new SystemException("获取当前库位容量分析失败: " + e.getMessage());
         }
+        
+        // 检查远程响应是否为空
         if (remote == null) {
-            return HttpResult.error("获取当前运力分析数据失败:远程无响应");
+            log.error("获取当前库位容量分析失败: 远程响应为空");
+            throw new SystemException("获取当前库位容量分析失败: 远程响应为空");
         }
+        
+        // 检查远程调用是否成功
         if (remote.getCode() != HttpStatus.SUCCESS_CODE) {
-            return HttpResult.error(remote.getCode(), remote.getMessage() != null ? remote.getMessage() : "远程调用失败");
+            String errorMsg = remote.getMessage() != null ? remote.getMessage() : "远程调用失败";
+            log.error("获取当前库位容量分析失败, 错误码: {}, 错误信息: {}", remote.getCode(), errorMsg);
+            throw new SystemException(remote.getCode(), errorMsg);
         }
-        return HttpResult.ok(remote.getData());
+        
+        return remote.getData();
     }
 
     /**
-     * 当前运力分析(子运单表口径)
+     * 按子任务获取当前库位容量分析数据
+     *
+     * @return 当前库位容量分析视图对象
+     * @throws SystemException 当远程调用失败或返回异常时抛出系统异常
      */
-    public HttpResult currentCapacityAnalysisBySubtask() {
+    public CurrentCapacityAnalysisVo currentCapacityAnalysisBySubtask() {
         BaseResult<CurrentCapacityAnalysisVo> remote;
         try {
+            // 调用远程接口按子任务获取当前库位容量分析数据
             remote = transportApi.currentCapacityAnalysisBySubtask();
         } catch (Exception e) {
-            log.error("调用运输服务「当前运力分析(子运单口径)」失败", e);
-            return HttpResult.error("获取当前运力分析数据失败:" + e.getMessage());
+            // 记录远程调用失败的错误日志
+            log.error("调用按子任务获取当前库位容量分析接口失败", e);
+            throw new SystemException("按子任务获取当前库位容量分析失败: " + e.getMessage());
         }
+        
+        // 检查远程响应是否为空
         if (remote == null) {
-            return HttpResult.error("获取当前运力分析数据失败:远程无响应");
+            log.error("按子任务获取当前库位容量分析失败: 远程响应为空");
+            throw new SystemException("按子任务获取当前库位容量分析失败: 远程响应为空");
         }
+        
+        // 检查远程调用是否成功
         if (remote.getCode() != HttpStatus.SUCCESS_CODE) {
-            return HttpResult.error(remote.getCode(), remote.getMessage() != null ? remote.getMessage() : "远程调用失败");
+            String errorMsg = remote.getMessage() != null ? remote.getMessage() : "远程调用失败";
+            log.error("按子任务获取当前库位容量分析失败, 错误码: {}, 错误信息: {}", remote.getCode(), errorMsg);
+            throw new SystemException(remote.getCode(), errorMsg);
         }
-        return HttpResult.ok(remote.getData());
+        
+        return remote.getData();
     }
-}
+}

+ 5 - 6
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwOrderExecutionService.java

@@ -1,6 +1,6 @@
 package com.sckw.report.service;
 
-import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.exception.SystemException;
 import com.sckw.order.api.feign.TradeOrderApi;
 import com.sckw.order.api.model.OrderExecutionDisplayVo;
 import lombok.RequiredArgsConstructor;
@@ -20,15 +20,14 @@ public class KwOrderExecutionService {
     private final TradeOrderApi tradeOrderApi;
 
     /**
-     * 已下单未结算订单执行列表(前端超过 9 条自行向上轮播)
+     * 已下单未结算订单执行列表(前端超过 9 条自行向上轮播)
      */
-    public HttpResult orderExecutionDisplay() {
+    public List<OrderExecutionDisplayVo> orderExecutionDisplay() {
         try {
-            List<OrderExecutionDisplayVo> list = tradeOrderApi.orderExecutionDisplay();
-            return HttpResult.ok(list);
+            return tradeOrderApi.orderExecutionDisplay();
         } catch (Exception e) {
             log.error("调用订单服务「订单执行情况」失败", e);
-            return HttpResult.error("获取订单执行情况失败:" + e.getMessage());
+            throw new SystemException("获取订单执行情况失败:" + e.getMessage());
         }
     }
 }

+ 6 - 6
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwRealtimeSalesService.java

@@ -1,8 +1,8 @@
 package com.sckw.report.service;
 
+import com.sckw.core.exception.SystemException;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.BaseResult;
-import com.sckw.core.web.response.HttpResult;
 import com.sckw.transport.api.feign.TransportApi;
 import com.sckw.transport.api.model.vo.RealtimeSalesVolumeVo;
 import lombok.RequiredArgsConstructor;
@@ -19,20 +19,20 @@ public class KwRealtimeSalesService {
 
     private final TransportApi transportApi;
 
-    public HttpResult realtimeSalesVolume() {
+    public RealtimeSalesVolumeVo realtimeSalesVolume() {
         BaseResult<RealtimeSalesVolumeVo> remote;
         try {
             remote = transportApi.realtimeSalesVolume();
         } catch (Exception e) {
             log.error("调用运输服务「实时销量」失败", e);
-            return HttpResult.error("获取实时销量失败:" + e.getMessage());
+            throw new SystemException("获取实时销量失败:" + e.getMessage());
         }
         if (remote == null) {
-            return HttpResult.error("获取实时销量失败:远程无响应");
+            throw new SystemException("获取实时销量失败:远程无响应");
         }
         if (remote.getCode() != HttpStatus.SUCCESS_CODE) {
-            return HttpResult.error(remote.getCode(), remote.getMessage() != null ? remote.getMessage() : "远程调用失败");
+            throw new SystemException(remote.getCode(), remote.getMessage() != null ? remote.getMessage() : "远程调用失败");
         }
-        return HttpResult.ok(remote.getData());
+        return remote.getData();
     }
 }

+ 4 - 4
sckw-modules/sckw-report/src/main/resources/bootstrap-cxf.yml

@@ -3,16 +3,16 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: @nacos.server@
+        server-addr: 118.116.4.155:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-ng-service-platform-xf
         # 共享配置
         group: sckw-ng-service-platform
       config:
         # 配置中心地址
-        server-addr: @nacos.server@
+        server-addr: 118.116.4.155:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-ng-service-platform-xf
         # 共享配置
         group: sckw-ng-service-platform
         # 配置文件格式