lengfaqiang 2 лет назад
Родитель
Сommit
5b28611b41

+ 0 - 21
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageLogisticsController.java

@@ -1,21 +0,0 @@
-package com.sckw.transport.controller;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lfdc
- * @description 承运物流Controller
- * @date 2023-06-26 16:06:07
- */
-@Slf4j
-@RestController
-@RequiredArgsConstructor
-@RequestMapping(value = "/kwtAcceptCarriageLogistics")
-public class AcceptCarriageLogisticsController {
-
-
-
-}

+ 72 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageOrderController.java

@@ -1,11 +1,16 @@
 package com.sckw.transport.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.transport.model.dto.DocumentParamDTO;
+import com.sckw.transport.model.dto.OrderDTO;
 import com.sckw.transport.model.dto.OrderTakingDTO;
 import com.sckw.transport.model.dto.SendCarDTO;
 import com.sckw.transport.model.param.LogisticsConsignmentParam;
+import com.sckw.transport.model.param.LogisticsOrderParam;
 import com.sckw.transport.service.AcceptCarriageOrderService;
+import com.sckw.transport.service.TransportCommonService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.ibatis.annotations.Param;
@@ -30,6 +35,58 @@ public class AcceptCarriageOrderController {
     @Autowired
     AcceptCarriageOrderService acceptCarriageOrderService;
 
+    @Autowired
+    private TransportCommonService transportCommonService;
+
+    /**
+     * 获取订单详情-托运订单-承运订单
+     *
+     * @param dto
+     * @return
+     */
+    @RequestMapping(value = "/getOrderDetail", method = RequestMethod.POST)
+    public HttpResult getOrderDetail(@Validated @RequestBody DocumentParamDTO dto) {
+        log.info("获取订单详情参数:{}", JSONObject.toJSONString(dto));
+        try {
+            return transportCommonService.getOrderDetail(dto);
+        } catch (Exception e) {
+            log.error("获取订单详情失败:error {} ", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+    /**
+     * 托运订单/承运订单-撤销托运
+     *
+     * @param orderDto
+     * @return
+     */
+    @RequestMapping(value = "/cancelConsign", method = RequestMethod.POST)
+    public HttpResult cancelConsign(@Validated @RequestBody OrderDTO orderDto) {
+        try {
+            return transportCommonService.cancelConsign(orderDto);
+        } catch (Exception e) {
+            log.error("托运订单-撤销托运运单失败:订单id {},error {} ", orderDto.getId(), e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+    /**
+     * 对账管理-运费收款对账界面查询接口
+     * @param logisticsOrderParam
+     * @return
+     */
+    @RequestMapping(value = "/getAcceptCarriageOrder", method = RequestMethod.POST)
+    public HttpResult getAcceptCarriageOrder(@RequestBody @Validated LogisticsOrderParam logisticsOrderParam) {
+        try {
+            return transportCommonService.getAcceptCarriageOrder(logisticsOrderParam);
+        } catch (Exception e) {
+            log.error("派车给当前司机单据查询 error:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+
+    }
+
     /**
      * 承运订单-接单
      * @param orderDTO
@@ -84,4 +141,19 @@ public class AcceptCarriageOrderController {
             return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
         }
     }
+
+    /**
+     * 承运订单-获取运单详情
+     * @param wOrderId 运单id
+     * @return
+     */
+    @RequestMapping(value = "/updateDriver", method = RequestMethod.GET)
+    public HttpResult updateDriver(@Param("wOrderId") String wOrderId) {
+        try {
+            return acceptCarriageOrderService.getWaybillData(wOrderId);
+        } catch (Exception e) {
+            log.error("承运订单-获取运单详情 error:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
 }

+ 0 - 19
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/ConsignLogisticsController.java

@@ -1,19 +0,0 @@
-package com.sckw.transport.controller;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lfdc
- * @description 托运物流Controller
- * @date 2023-06-26 16:06:05
- */
-@Slf4j
-@RestController
-@RequiredArgsConstructor
-@RequestMapping(value = "/kwtConsignLogistics")
-public class ConsignLogisticsController {
-
-}

+ 0 - 57
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/DriverController.java

@@ -1,57 +0,0 @@
-package com.sckw.transport.controller;
-
-import com.sckw.core.web.constant.HttpStatus;
-import com.sckw.core.web.response.HttpResult;
-import com.sckw.transport.service.DriverService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lfdc
- * @description 司机端操作controller
- * @date 2023-07-14 11:07:10
- */
-@Slf4j
-@RestController
-@RequestMapping("/kwtDriverController")
-public class DriverController {
-
-    @Autowired
-    private DriverService driverService;
-
-    /**
-     * 根据当前登录 id获取派给当前id的车辆运单
-     *
-     * @return
-     */
-    @RequestMapping(value = "/getWaybillDriverDetail", method = RequestMethod.GET)
-    public HttpResult getWaybillDriverDetail(@RequestParam("id") Long id, @RequestParam("type") String type) {
-        try {
-            return driverService.getWaybillDriverDetail(id, type);
-        } catch (Exception e) {
-            log.error("派车给当前司机单据查询 error:{}", e.getMessage(), e);
-            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
-        }
-    }
-
-    /**
-     * 司机app top统计
-     *
-     * @param id 司机id
-     * @return
-     */
-    @RequestMapping(value = "/statistics", method = RequestMethod.POST)
-    public HttpResult statistics(@RequestParam("id") Long id) {
-        try {
-            return driverService.statistics(id);
-        } catch (Exception e) {
-            log.error("司机app top统计 error:{}", e.getMessage(), e);
-            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
-        }
-    }
-
-}

+ 37 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwtWaybillOrderController.java

@@ -1,17 +1,16 @@
 package com.sckw.transport.controller;
 
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.transport.model.dto.SendCarDto1;
+import com.sckw.transport.service.DriverService;
 import com.sckw.transport.service.KwtWaybillOrderService;
 import com.sckw.transport.model.dto.ValidList;
 import jakarta.validation.Valid;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author lfq
@@ -26,6 +25,40 @@ public class KwtWaybillOrderController {
     @Autowired
     KwtWaybillOrderService waybillOrderService;
 
+    @Autowired
+    private DriverService driverService;
+
+    /**
+     * 司机端 根据当前登录 id获取派给当前id的车辆运单
+     *
+     * @return
+     */
+    @RequestMapping(value = "/getWaybillDriverDetail", method = RequestMethod.GET)
+    public HttpResult getWaybillDriverDetail(@RequestParam("id") Long id, @RequestParam("type") String type) {
+        try {
+            return driverService.getWaybillDriverDetail(id, type);
+        } catch (Exception e) {
+            log.error("派车给当前司机单据查询 error:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+    /**
+     * 司机app top统计
+     *
+     * @param id 司机id
+     * @return
+     */
+    @RequestMapping(value = "/statistics", method = RequestMethod.POST)
+    public HttpResult statistics(@RequestParam("id") Long id) {
+        try {
+            return driverService.statistics(id);
+        } catch (Exception e) {
+            log.error("司机app top统计 error:{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
     //
     /**
      * @param params {}

+ 0 - 80
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/TransportCommonController.java

@@ -1,80 +0,0 @@
-package com.sckw.transport.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.sckw.core.web.constant.HttpStatus;
-import com.sckw.core.web.response.HttpResult;
-import com.sckw.transport.model.dto.DocumentParamDTO;
-import com.sckw.transport.model.dto.OrderDTO;
-import com.sckw.transport.model.param.LogisticsOrderParam;
-import com.sckw.transport.service.TransportCommonService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lfdc
- * @description 运输服务公共接口调用查询Controller
- * @date 2023-07-12 09:07:42
- */
-@Slf4j
-@RestController
-@RequestMapping(value = "/kwtTransport")
-public class TransportCommonController {
-    @Autowired
-    private TransportCommonService transportCommonService;
-
-    /**
-     * 获取订单详情-托运订单-承运订单
-     *
-     * @param dto
-     * @return
-     */
-    @RequestMapping(value = "/getOrderDetail", method = RequestMethod.POST)
-    public HttpResult getOrderDetail(@Validated @RequestBody DocumentParamDTO dto) {
-        log.info("获取订单详情参数:{}", JSONObject.toJSONString(dto));
-        try {
-            return transportCommonService.getOrderDetail(dto);
-        } catch (Exception e) {
-            log.error("获取订单详情失败:error {} ", e.getMessage(), e);
-            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
-        }
-    }
-
-    /**
-     * 托运订单/承运订单-撤销托运
-     *
-     * @param orderDto
-     * @return
-     */
-    @RequestMapping(value = "/cancelConsign", method = RequestMethod.POST)
-    public HttpResult cancelConsign(@Validated @RequestBody OrderDTO orderDto) {
-        try {
-            return transportCommonService.cancelConsign(orderDto);
-        } catch (Exception e) {
-            log.error("托运订单-撤销托运运单失败:订单id {},error {} ", orderDto.getId(), e.getMessage(), e);
-            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
-        }
-    }
-
-    /**
-     * 对账管理-运费收款对账界面查询接口
-     * @param logisticsOrderParam
-     * @return
-     */
-    @RequestMapping(value = "/getAcceptCarriageOrder", method = RequestMethod.POST)
-    public HttpResult getAcceptCarriageOrder(@RequestBody @Validated LogisticsOrderParam logisticsOrderParam) {
-        try {
-            return transportCommonService.getAcceptCarriageOrder(logisticsOrderParam);
-        } catch (Exception e) {
-            log.error("派车给当前司机单据查询 error:{}", e.getMessage(), e);
-            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
-        }
-
-    }
-
-
-}

+ 0 - 20
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/WaybillManagementController.java

@@ -1,20 +0,0 @@
-package com.sckw.transport.controller;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lfdc
- * @description 运单管理controller
- * @date 2023-07-05 10:07:50
- */
-
-@Slf4j
-@RestController
-@RequiredArgsConstructor
-@RequestMapping(value = "/kwtWaybillManagement")
-public class WaybillManagementController {
-
-}

+ 14 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/TransportCommonService.java

@@ -11,6 +11,9 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.DateUtil;
+import com.sckw.order.api.dubbo.TradeOrderInfoService;
+import com.sckw.order.api.model.OrderDetailRes;
+import com.sckw.order.api.model.UpdateOrderAmountParam;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.transport.api.model.dto.vo.LogisticsOrderDTO;
@@ -44,6 +47,9 @@ public class TransportCommonService {
     @DubboReference(version = "2.0.0", group = "design", check = false)
     RemoteSystemService remoteSystemService;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    TradeOrderInfoService tradeOrderInfoService;
+
     @Autowired
     public KwtLogisticsOrderGoodsMapper logisticsOrderGoodsMapper;
 
@@ -222,9 +228,14 @@ public class TransportCommonService {
         /**以此字段判别是否存在分包操作*/
         if (ObjectUtils.isEmpty(logisticsOrder.getPid())) {
             /**并不存在分包,撤销数据回归到贸易订单,[待接单状态]下才能撤销托运*/
-            //todo 调用dubbo 修改数值
+            /**调用dubbo 修改数值*/
             Long tOrderId = logisticsOrder.getTOrderId();
-            String tOrderNo = logisticsOrder.getTOrderNo();
+            OrderDetailRes orderDetailRes = tradeOrderInfoService.getOrderDetailById(tOrderId);
+            UpdateOrderAmountParam param = new UpdateOrderAmountParam();
+            param.setTOrderId(tOrderId);
+            param.setActualAmount(orderDetailRes.getActualAmount().add(logisticsOrder.getLoadAmount()));
+            param.setEntrustAmount(orderDetailRes.getEntrustAmount().add(logisticsOrder.getEntrustAmount().subtract(logisticsOrder.getLoadAmount())));
+            tradeOrderInfoService.updateOrderAmount(param);
             logisticsOrder.setDelFlag(1);
             logisticsOrder.setUpdateTime(new Date());
             logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
@@ -273,7 +284,7 @@ public class TransportCommonService {
             logisticsOrderParam.setEndTime(logisticsOrderParam.getEndTime() + " 23:59:59");
         }
         Integer page = logisticsOrderParam.getPage();
-        logisticsOrderParam.setPage(logisticsOrderParam.getPage()-1);
+        logisticsOrderParam.setPage(logisticsOrderParam.getPage() - 1);
         List<LogisticsOrderDTO> list = logisticsOrderMapper.selectLogisticOrderData(logisticsOrderParam, dictId);
         Long count = logisticsOrderMapper.selectLogisticOrderCount(logisticsOrderParam, dictId);
         if (CollectionUtils.isNotEmpty(list)) {