8.6
luodangjia
2024-08-06 1529842471c8c07a5181a10404b6dff2a0944500
ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/OrderController.java
@@ -104,21 +104,21 @@
    })
    public R<BigDecimal> estimate(@RequestParam String orderId, String city) {
        Order order = orderClient.detail(orderId).getData();
        RecoveryServe recoveryServe = recoveryServeService.lambdaQuery()
                .eq(RecoveryServe::getId, order.getServeId())
                .eq(RecoveryServe::getIsDelete, 0).one();
        BigDecimal money = recoveryServe.getDefaultPrice();
        if (StringUtils.isNotBlank(city)) {
            CityInfoVO info = GaoDeMapUtil.getAddressInfo(city).getDatas();
            RecoveryServePrice price = recoveryServePriceService.lambdaQuery()
                    .eq(RecoveryServePrice::getRecoveryServeId, recoveryServe.getId())
                    .eq(RecoveryServePrice::getCityCode, info.getCode())
                    .eq(RecoveryServePrice::getIsDelete, Constants.ZERO).one();
            if (null != price) {
                money = price.getRecoveryPrice();
            }
        }
        return R.ok(money);
//        RecoveryServe recoveryServe = recoveryServeService.lambdaQuery()
//                .eq(RecoveryServe::getId, order.getServeId())
//                .eq(RecoveryServe::getIsDelete, 0).one();
//        BigDecimal money = recoveryServe.getDefaultPrice();
//        if (StringUtils.isNotBlank(city)) {
//            CityInfoVO info = GaoDeMapUtil.getAddressInfo(city).getDatas();
//            RecoveryServePrice price = recoveryServePriceService.lambdaQuery()
//                    .eq(RecoveryServePrice::getRecoveryServeId, recoveryServe.getId())
//                    .eq(RecoveryServePrice::getCity, info.getCode())
//                    .eq(RecoveryServePrice::getIsDelete, Constants.ZERO).one();
//            if (null != price) {
//                money = price.getRecoveryPrice();
//            }
//        }
        return R.ok(order.getServePrice());
    }
    @GetMapping("/detail")