2026-11-14-product-order-gap-class.mermaid 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. classDiagram
  2. class ProductOrder {
  3. +Long id
  4. +String orderNo
  5. +Long productId
  6. +String productType
  7. +Long buyerId
  8. +String status
  9. +Date shippedAt
  10. +Date receiptRemindAt
  11. +Date confirmTime
  12. }
  13. class ProductReview {
  14. +Long id
  15. +Long orderId
  16. +Long productId
  17. +Long reviewerId
  18. +Integer rating
  19. +String reviewText
  20. +String images
  21. +String replyText
  22. +Date repliedAt
  23. +Long replyBy
  24. +Integer status
  25. +Date reviewAt
  26. }
  27. class ProductReviewMapper {
  28. +ProductReview findByOrderId(orderId)
  29. +List~ProductReview~ listByProduct(pid, offset, size)
  30. +Map statsByProduct(pid)
  31. }
  32. class ProductReviewService <<interface>> {
  33. +String createReview(ProductReviewRequest, Long reviewerId)
  34. +ProductReviewResponse detail(Long orderId, Long userId)
  35. +Map listByProduct(Long productId, int page, int size)
  36. +String reply(Long reviewId, String replyText, Long operatorId)
  37. +Map my(Long userId, int page, int size)
  38. }
  39. class ProductReviewServiceImpl {
  40. -ProductReviewMapper reviewMapper
  41. -ProductOrderMapper orderMapper
  42. -UserMapper userMapper
  43. }
  44. class ProductReviewController {
  45. +Result create(req, userId)
  46. +Result detail(params, userId)
  47. +Result list(params)
  48. +Result reply(params, userId)
  49. +Result my(params, userId)
  50. }
  51. class ProductOrderService {
  52. +Result~String~ ship(orderNo, shipType, trackingNumber, expressCompany, shippingCost, receiverContact, operatorId, operatorRoles)
  53. +Result confirmReceive(orderNo, userId)
  54. +Result~Map~ myOrderCounts(userId)
  55. }
  56. class AdminProductOrderController {
  57. +Result ship(params, userId, roles)
  58. }
  59. class OrderReceiptTimeoutTask {
  60. +void processTimeoutOrders()
  61. -void autoComplete()
  62. -void sendRemind()
  63. -String resolveShipTimeBase(ProductOrder)
  64. }
  65. class DatabaseInitializer {
  66. +void runMigrations()
  67. -void migrateProductReviewsTable()
  68. -void migrateProductOrderShippedColumns()
  69. }
  70. ProductReview o-- ProductOrder : order_id 唯一
  71. ProductReviewMapper --> ProductReview : CRUD
  72. ProductReviewServiceImpl --> ProductReviewMapper
  73. ProductReviewServiceImpl --> ProductReviewService : implements
  74. ProductReviewController --> ProductReviewService
  75. ProductOrderService --> ProductOrder : 读改写
  76. AdminProductOrderController --> ProductOrderService : 透传 operatorId/roles
  77. OrderReceiptTimeoutTask --> ProductOrder : 扫描/置状态
  78. DatabaseInitializer --> ProductReview : 建表(迁移464)
  79. DatabaseInitializer --> ProductOrder : 加列(迁移465)