运输服务设计
2023-09-15 16:47:51 6 举报
运输服务类设计
作者其他创作
大纲/内容
1. WaybillService.dispatch(),保存承运方信息到运单实体,发布同步领域事件WaybillDispatched。2. WaybillDispatchedEventListener接收事件,调用tenantFacade.getCarrierTenant()获取承运方对应的租户信息并关联到运单实体上。3. 运单通过租户信息和所处身份建立WaybillRelation子实体,tenantId+character运单内唯一。
Waybill
- id: WaybillId- contractNo: ContractNo- ...- relations: List<WaybillRelation>- ...- combineId
+ combine(Combine)
WaybillDispatchDTO
- waybillId- carrierId- userId- tenantId
WaybillCombinedEventListener
- waybillRepository- combineRepository
+ handle(WaybillCombined)
WaybillDivideService
- divideRepository
WaybillCreated
- waybill: Waybill- args: WaybillCreationDTO
WaybillService
- waybillRepository- waybillCombineService
+ combine(WaybillCombineDTO)
WaybillRepository
- waybillDao
+ save(Waybill)
WaybillCombineService
- combineRepository
调度
创建
- waybillRepository
+ dispatch(WaybillDispatchDTO)
+ create(WaybillCreationDTO)
DivideRepository
- divideDao
+ save(Divide)
Consignee
- consigneeId : ConsigneeId- consigneeName- consigneeType
- id: WaybillId- contractNo: ContractNo- ...- relations: List<WaybillRelation>- ...
- id: WaybillId- contractNo: ContractNo- ...- relations: List<WaybillRelation>- ...- divideId : DivideId- divideSize
+ divide(Divide)
拆单
拼单
WaybillCreationDTO
- contractNo- fromAddress- fromTime- toAddress- toTime- arguments- items: List<Item>- ...
1. WaybillService.create(),通过WaybillFactoryspan style=\"font-size: inherit;\
1. WaybillService.divide(),通过领域服务WaybillDivideService创建保存拆单实体。2. 拆单实体创建成功后,更新运单实体中的拆单信息并保存运单实体。3. 运单实体保存成功后,发布运单拆单事件。4. WaybillDividedEventListener接收事件,创建拆单子单,更新Divide实体并保存。
Carrier
- carrierId: Carrier- carrierName- carrierType
CombineRepository
- combineDao
+ save(Combine)
WaybillDividedEventListener
- waybillRepository- divideRepository
+ handle(WaybillDivided)
- waybillRepository- waybillDivideService
+ divide(WaybillDivideDTO)
WaybillDivided
- waybill: Waybill- divide: Divide- args: WaybillDivideDTO
WaybillDivideDTO
- waybillId- mode- items: List<Item>- userId- tenantId
CombineCreationDTO
- contractNo- mode- waybillIds- ...- userId- tenantId
WaybillDispatchEventListener
- waybillRepository- tenantFacade
+ handle(WaybillDispatched)
TenantFacade
- tenantService: TenantService
+ getCarrierTenant(CarrierId)
WaybillDispatched
- waybill: Waybill- carrier: Carrier- args: WaybillDispatchDTO
Customer
- customerId: CustomerId- customerName- customerType
WaybillCombined
- waybill: Waybill- combine: Combine
Divide
- id: DivideId- mode: DivideMode- items: List<DivideItem>- ...
WaybillCreatedEventListener
+ handle(WaybillCreated): 无逻辑
1. WaybillService.combine(),通过领域服务WaybillCombineService创建保存拼单实体。2. 拼单实体创建成功后,更新运单实体中的拼单信息并保存运单实体。3. 运单实体保存成功后,发布运单拼单事件和拼单创建事件。4. WaybillCombinedEventListener接收事件,处理拼 单后续业务逻辑。
Combine
- id: CombineId- mode: DivideMode- items: List<CombineItem>- ...
+ cancel()
WaybillFactory
- customerFacade: getCustomerById- consigneeFacade: getConsigneeById
+ create(WaybillCreationDTO): Waybill
0 条评论
下一页