gongfuzhu 9 hónapja
szülő
commit
0cbab0ae34

+ 7 - 1
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/service/QiuXiangService.java

@@ -23,8 +23,14 @@ public interface QiuXiangService {
     @ApiOperation("订单详情")
     @RequestMapping(value = "orderDelit", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
     ResultContent<OrderDelitResponse> orderDelit(String orderId);
-
     @ApiOperation("取消订单")
     @RequestMapping(value = "cancelOrder", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
     ResultContent<OrderDelitResponse>  cancelOrder(String orderId, String reason) ;
+
+    @ApiOperation("订单详情")
+    @RequestMapping(value = "driverLocation", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+    ResultContent<OrderDelitResponse> driverLocation(String orderId);
+
+    @RequestMapping(value = "driverLocationLog", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+    ResultContent<OrderDelitResponse> driverLocationLog(String orderId);
 }

+ 2 - 2
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/QiuXiangController.java

@@ -63,14 +63,14 @@ public class QiuXiangController {
     @ResourceAuth(value = "user", type = AuthType.User)
     @RequestMapping(value = "driverLocation", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE})
     public ResultContent driverLocation(@RequestBody Map<String, String> orderRequest) {
-        return ResultContent.buildContent(qiuXiangApi.driverLocation(orderRequest.get("orderId")));
+        return ResultContent.buildContent(qiuXiangService.driverLocation(orderRequest.get("orderId")));
     }
 
     @ApiOperation("获取司机行驶轨迹")
     @ResourceAuth(value = "user", type = AuthType.User)
     @RequestMapping(value = "driverLocationLog", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE})
     public ResultContent driverLocationLog(@RequestBody Map<String, String> orderRequest) {
-        return ResultContent.buildContent(qiuXiangApi.driverLocationLog(orderRequest.get("orderId")));
+        return ResultContent.buildContent(qiuXiangService.driverLocationLog(orderRequest.get("orderId")));
     }
 
 }

+ 27 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/impl/QiuXiangServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zswl.cloud.springBtach.server.core.service.impl;
 
+import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.github.microservice.auth.client.content.ResultContent;
@@ -141,4 +142,30 @@ public class QiuXiangServiceImpl implements QiuXiangService {
         }
 
     }
+
+    @Override
+    public ResultContent<OrderDelitResponse> driverLocation(String orderId) {
+
+        ResultContent<GoodsResultModel> goodsResultModelResultContent = orderService2.qrGoods(orderId);
+        GoodsResultModel content = goodsResultModelResultContent.getContent();
+        JSONObject goodsInfo = content.getGoodsInfo();
+        String goodsId = goodsInfo.get("channelOrderId").toString();
+
+        JSONObject entries = qiuXiangApi.driverLocation(goodsId);
+
+        return ResultContent.build(ResultState.Success, entries);
+    }
+
+    @Override
+    public ResultContent<OrderDelitResponse> driverLocationLog(String orderId) {
+
+        ResultContent<GoodsResultModel> goodsResultModelResultContent = orderService2.qrGoods(orderId);
+        GoodsResultModel content = goodsResultModelResultContent.getContent();
+        JSONObject goodsInfo = content.getGoodsInfo();
+        String goodsId = goodsInfo.get("channelOrderId").toString();
+
+        JSONArray entries = qiuXiangApi.driverLocationLog(goodsId);
+
+        return ResultContent.build(ResultState.Success, entries);
+    }
 }