|
|
@@ -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());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|