cloudroam
2024-09-29 a065b98bea77552f4b7037dc8f74f8c25b0bbb3d
src/main/java/com/mzl/flower/service/payment/OrderService.java
@@ -1685,4 +1685,24 @@
        return sb.toString();
    }
    public void operationUpdate(OrderAddressUpdateDTO dto) {
        if (StringUtils.isBlank(dto.getId())) {
            throw new ValidationException("id不能为空");
        }
        Order order = orderMapper.selectById(dto.getId());
        if (ObjectUtils.isEmpty(order)) {
            throw new ValidationException("订单不存在");
        }
        if (StringUtils.isBlank(dto.getCustomerAddress()) || StringUtils.isBlank(dto.getCustomerCity()) || StringUtils.isBlank(dto.getCustomerProvince()) || StringUtils.isBlank(dto.getCustomerRegion())) {
            throw new ValidationException("地址信息不能为空");
        }
        if (StringUtils.isBlank(dto.getCustomerTel())) {
            throw new ValidationException("联系方式不能为空");
        }
        BeanUtils.copyProperties(dto, order);
        order.update(SecurityUtils.getUserId());
        orderMapper.updateById(order);
    }
}