作者 唐旭辉

更新

... ... @@ -181,12 +181,15 @@ func (service OrderInfoService) buildOrderBaseInfoData(orderBase *domain.OrderBa
"partner": orderBase.PartnerInfo.PartnerName,
"phone": "",
"orderTime": orderBase.CreateTime.Local().Format("2006-01-02 15:04:05"),
"shippingStatus": orderBase.CreateTime.Local().Format("2006-01-02 15:04:05"),
"shippingStatus": "",
"partnerDividends": "",
"receivedDividends": "",
"notReceivedDividend": "",
"dividendSpending": "",
"orderNumber": orderBase.OrderCode,
"deliveryCode": orderBase.DeliveryCode,
"orderArea": orderBase.RegionInfo.RegionName,
"partnerCategory": orderBase.PartnerCategory.Name,
}
if hasPartnerBonusPercent {
order["partnerDividends"] = fmt.Sprint(orderBase.GetCurrentPartnerBonus())
... ... @@ -395,6 +398,9 @@ func (service OrderInfoService) buildOrderBestshopInfoData(orderBase *domain.Ord
"notReceivedDividend": "",
"dividendSpending": "",
"orderNumber": orderBase.OrderCode,
"orderArea": orderBase.RegionInfo.RegionName,
"partnerCategory": orderBase.PartnerCategory.Name,
"deliveryCode": orderBase.DeliveryCode,
}
if hasPartnerBonusPercent {
order["partnerDividends"] = fmt.Sprint(orderBase.GetCurrentPartnerBonus())
... ...
... ... @@ -28,6 +28,7 @@ type CreateOrderFromBestshop struct {
//发货时间
DeliveryTime string `json:"deliveryTime"`
PartnerId int64 `json:"partnerId"`
OrderArea string `json:"orderArea"`
Goods []struct {
Id int64 `json:"id"`
//货品编号
... ...
... ... @@ -126,6 +126,7 @@ func (s SyncOrderService) CreateOrderFromBestshop(cmd command.CreateOrderFromBes
DeliveryTime: cmd.DeliveryTime,
IsCopy: false,
CompanyId: cmd.CompanyId,
OrderArea: cmd.OrderArea,
}
err = orderBestshopRepository.Add(&order)
if err != nil {
... ...
... ... @@ -34,8 +34,9 @@ type OrderBestShop struct {
PartnerId int64 `json:"partnerId"`
Goods []OrderGoodBestShop `json:"goods"`
//是否将数据同步到 order_base ,order_good
IsCopy bool `json:"isCopy"`
CompanyId int64 `json:"companyId"`
IsCopy bool `json:"isCopy"`
CompanyId int64 `json:"companyId"`
OrderArea string `json:"orderArea"`
}
func (order OrderBestShop) CopyToOrderBase(o *OrderBase) {
... ... @@ -54,6 +55,7 @@ func (order OrderBestShop) CopyToOrderBase(o *OrderBase) {
o.OrderCompute.PlanOrderAmount = order.OrderAmount
o.OrderCompute.PlanOrderCount = order.OrderCount
o.DeliveryTime, _ = time.Parse("2006-01-02 15:04:05", order.DeliveryTime)
o.RegionInfo.RegionName = order.OrderArea
return
}
... ...