|
@@ -36,6 +36,7 @@ import com.sckw.transport.model.vo.OrderTotalTakeVo;
|
|
|
import com.sckw.transport.model.vo.StatisticsWaybillResp;
|
|
import com.sckw.transport.model.vo.StatisticsWaybillResp;
|
|
|
import com.sckw.transport.repository.*;
|
|
import com.sckw.transport.repository.*;
|
|
|
import com.sckw.transport.service.KwtWaybillOrderV1Service;
|
|
import com.sckw.transport.service.KwtWaybillOrderV1Service;
|
|
|
|
|
+import com.sckw.transport.service.ParkingPlateInfoService;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -78,6 +79,8 @@ public class WaybillOrderService {
|
|
|
private final KwtWaybillOrderNodeRepository waybillOrderNodeRepository;
|
|
private final KwtWaybillOrderNodeRepository waybillOrderNodeRepository;
|
|
|
private final KwtWaybillOrderWeighbridgeRepository waybillOrderWeighbridgeRepository;
|
|
private final KwtWaybillOrderWeighbridgeRepository waybillOrderWeighbridgeRepository;
|
|
|
private final KwtLogisticsOrderContractRepository logisticsOrderContractRepository;
|
|
private final KwtLogisticsOrderContractRepository logisticsOrderContractRepository;
|
|
|
|
|
+ private final KwtParkingStrategySwitchRepository parkingStrategySwitchRepository;
|
|
|
|
|
+ private final ParkingPlateInfoService parkingPlateInfoService;
|
|
|
|
|
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
|
RemoteSystemService remoteSystemService;
|
|
RemoteSystemService remoteSystemService;
|
|
@@ -1597,7 +1600,7 @@ public class WaybillOrderService {
|
|
|
checkIdempotent(param);
|
|
checkIdempotent(param);
|
|
|
|
|
|
|
|
// 5. 执行接单
|
|
// 5. 执行接单
|
|
|
- return takingOrderHandler.handler(param);
|
|
|
|
|
|
|
+ return takingOrder(param);
|
|
|
|
|
|
|
|
} finally {
|
|
} finally {
|
|
|
// 6. 释放分布式锁
|
|
// 6. 释放分布式锁
|
|
@@ -1608,6 +1611,47 @@ public class WaybillOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 接单
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ */
|
|
|
|
|
+ private OrderTakingResp takingOrder(OrderCirculateTakingQueryParam param) {
|
|
|
|
|
+ // 访问第三方接口,校验车辆费用情况
|
|
|
|
|
+ ParkingPlatformResult<PlateInfoResp> result = checkTruckFee(param);
|
|
|
|
|
+ boolean isAvailable = (result == null || Objects.equals(1, result.getData().getAcceptOrder()));
|
|
|
|
|
+ log.info("调用第三方接口校验车辆是否可以通行,reslt:{}", isAvailable);
|
|
|
|
|
+ if (isAvailable) {
|
|
|
|
|
+ return takingOrderHandler.handler(param);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ OrderTakingResp resp = new OrderTakingResp();
|
|
|
|
|
+ resp.setChargeUrl(result.getData().getChargeUrl());
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 校验车辆是否在车场有效期、充值缴费、是否是免费车
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ */
|
|
|
|
|
+ private ParkingPlatformResult<PlateInfoResp> checkTruckFee(OrderCirculateTakingQueryParam param) {
|
|
|
|
|
+ KwtParkingStrategySwitch strategySwitch = parkingStrategySwitchRepository.queryParkingStrategySwitch();
|
|
|
|
|
+ // 入场收费开关关闭,不校验
|
|
|
|
|
+ if (strategySwitch == null || Objects.equals(strategySwitch.getIntoStatus(), 0)) {
|
|
|
|
|
+ log.info("入场收费开关,reslt:{}", "关闭");
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 校验
|
|
|
|
|
+ PlateInfoQueryParam queryParam = new PlateInfoQueryParam();
|
|
|
|
|
+ queryParam.setCarLicense(param.getTruckNo());
|
|
|
|
|
+ ParkingPlatformResult<PlateInfoResp> parkingPlatformResult = parkingPlateInfoService.queryPlateInfo(queryParam);
|
|
|
|
|
+ if (parkingPlatformResult == null || parkingPlatformResult.getData() == null) {
|
|
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_UNFINISHED, "第三发车辆信息查询接口,当前车辆未查出信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("校验车辆是否在车场有效期,reslt:{}", JSON.toJSONString(parkingPlatformResult));
|
|
|
|
|
+ return parkingPlatformResult;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 幂等性校验:检查是否已经存在该车辆针对该物流订单的有效运单
|
|
* 幂等性校验:检查是否已经存在该车辆针对该物流订单的有效运单
|
|
|
* @param param 接单参数
|
|
* @param param 接单参数
|