2026-11-14-product-order-gap-sequence.mermaid 1.1 KB

12345678910111213141516171819202122232425262728
  1. sequenceDiagram
  2. participant U as 买家小程序
  3. participant OD as order-detail.vue
  4. participant RC as ProductReviewController
  5. participant RS as ProductReviewServiceImpl
  6. participant UM as ProductReviewMapper
  7. participant OM as ProductOrderMapper
  8. U->>OD: onLoad(orderNo)
  9. OD->>RC: POST /api/product/review/detail {orderNo}
  10. RC->>RS: detail(orderNo, userId)
  11. RS->>OM: select order
  12. RS->>UM: findByOrderId
  13. RS-->>OD: {review, canReview}
  14. OD-->>U: completed 且可评 → 显示「去评价」
  15. U->>OD: 点「去评价」→ order-review 页
  16. U->>RC: POST /api/product/review/create {orderId,rating,reviewText,images}
  17. RC->>RS: createReview(req, userId)
  18. RS->>OM: 校验 status=completed / productType!='activity' / 90天内 / buyer本人
  19. RS->>UM: findByOrderId → null 才允许(一单一评)
  20. RS->>UM: insert product_reviews
  21. RS-->>U: Result.success
  22. Note over U,RC: 商品详情页匿名读评价
  23. U->>RC: POST /api/product/review/list {productId,page,size}
  24. RC->>RS: listByProduct(productId) → {total,avgRating,records}
  25. RS-->>U: 评价列表 + 商家回复