34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package service
|
|
|
|
import (
|
|
"fmt"
|
|
"hospital-admin-api/api/dao"
|
|
"hospital-admin-api/api/responses/orderProductLogisticsResponse"
|
|
)
|
|
|
|
type OrderProductLogisticsService struct {
|
|
}
|
|
|
|
// GetOrderProductLogisticsByOrderProductId 获取物流数据-药品订单id
|
|
func (r *OrderProductLogisticsService) GetOrderProductLogisticsByOrderProductId(orderProductId int64) (u *orderProductLogisticsResponse.OrderProductLogistics, err error) {
|
|
orderProductLogisticsDao := dao.OrderProductLogisticsDao{}
|
|
orderProductLogistics, err := orderProductLogisticsDao.GetOrderProductLogisticsByOrderProductId(orderProductId)
|
|
if orderProductLogistics == nil {
|
|
return nil, nil
|
|
}
|
|
|
|
u = &orderProductLogisticsResponse.OrderProductLogistics{
|
|
LogisticsId: fmt.Sprintf("%d", orderProductLogistics.LogisticsId),
|
|
OrderProductId: fmt.Sprintf("%d", orderProductLogistics.OrderProductId),
|
|
LogisticsStatus: orderProductLogistics.LogisticsStatus,
|
|
LogisticsNo: orderProductLogistics.LogisticsNo,
|
|
CompanyName: orderProductLogistics.CompanyName,
|
|
CompanyCode: orderProductLogistics.CompanyCode,
|
|
LogisticsContent: orderProductLogistics.LogisticsContent,
|
|
CreatedAt: orderProductLogistics.CreatedAt,
|
|
UpdatedAt: orderProductLogistics.UpdatedAt,
|
|
}
|
|
|
|
return u, nil
|
|
}
|