cloudroam
2024-09-29 3d97e119ebec67667d6c2eeb1534282e124cc7bd
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);
    }
}