```mermaid
graph TD
root_id[开始] --> checkOrder[检查订单状态]
checkOrder --> |有效订单|processOrder[处理订单]
checkOrder --> |无效订单| notifyUser[通知用户订单无效]
processOrder --> |库存充足| updateInventory[更新库存]
processOrder --> |库存不足| notifyUser[通知用户库存不足]
updateInventory --> completeOrder[完成订单]
notifyUser --> |用户确认| checkOrder
notifyUser --> |用户取消| cancelOrder[取消订单]
completeOrder --> |操作成功| 结束
cancelOrder --> |取消成功| 结束```