Pu Zhibing
2025-01-14 b622b5ad2620366472ba76a98fb8c74d65b88018
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -368,13 +368,11 @@
    /**
     * 确认发货操作
     * @param orderId
     * @param code
     * @return
     */
    @Override
    public R confirmDelivery(Long orderId, String code) {
        Order order = this.getById(orderId);
    public R confirmDelivery(ConfirmDelivery confirmDelivery) {
        Order order = this.getById(confirmDelivery.getOrderId());
        if(1 == order.getPayStatus()){
            return R.fail("订单还未完成支付");
        }
@@ -385,7 +383,13 @@
            return R.fail("无效的操作");
        }
        //添加快递号和修改订单状态
        order.setExpressJson(code);
        order.setExpressJson(confirmDelivery.getCode());
        order.setDeliverProvince(confirmDelivery.getDeliverProvince());
        order.setDeliverProvinceCode(confirmDelivery.getDeliverProvinceCode());
        order.setDeliverCity(confirmDelivery.getDeliverCity());
        order.setDeliverCityCode(confirmDelivery.getDeliverCityCode());
        order.setDeliverDistrict(confirmDelivery.getDeliverDistrict());
        order.setDeliverDistrictCode(confirmDelivery.getDeliverDistrictCode());
        order.setOrderStatus(2);
        //添加查询快递信息队列
        //一小时后定时查询快递信息
@@ -394,7 +398,7 @@
        Integer waitTime = jsonObject.getInteger("waitTime");
        redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC));
    
        JSONObject jsonObject1 = JSON.parseObject(code);
        JSONObject jsonObject1 = JSON.parseObject(confirmDelivery.getCode());
        String com = jsonObject1.getString("com");
        String num = jsonObject1.getString("num");
        UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class);