...
|
...
|
@@ -224,6 +224,7 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord |
|
|
orderBestshop.Goods[i].CopyToOrderGood(&good)
|
|
|
good.OrderId = orderbase.Id
|
|
|
good.Compute()
|
|
|
good.CurrentBonusStatus.WartPayPartnerBonus(&good)
|
|
|
ordergoods = append(ordergoods, good)
|
|
|
}
|
|
|
orderbase.Goods = ordergoods
|
...
|
...
|
@@ -292,45 +293,51 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord |
|
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "获取orderBestshop(order_code=%s)数据失败,err=%s", cmd.OrderCode, err.Error())
|
|
|
// }
|
|
|
|
|
|
// orderData.OrderCode= cmd.OrderCode,
|
|
|
// orderData.OrderTime=cmd.OrderTime,
|
|
|
// orderData.OrderState: cmd.OrderState,
|
|
|
// orderData.OrderCount: cmd.OrderCount,
|
|
|
// orderData.OrderAmount: cmd.OrderAmount,
|
|
|
// orderData.CreateTime: time.Now(),
|
|
|
// orderData.PartnerId: cmd.PartnerId,
|
|
|
// BuyerName: cmd.BuyerName,
|
|
|
// BuyerPhone: cmd.BuyerPhone,
|
|
|
// BuyerAddress: cmd.BuyerAddress,
|
|
|
// BuyerRemark: cmd.BuyerRemark,
|
|
|
// BuyerId: cmd.BuyerId,
|
|
|
// DeliveryState: cmd.DeliveryState,
|
|
|
// DeliveryTime: cmd.DeliveryTime,
|
|
|
// IsCopy: false,
|
|
|
// CompanyId: cmd.CompanyId,
|
|
|
// }
|
|
|
// err = orderBestshopRepository.Add(&order)
|
|
|
// orderData.OrderCode = cmd.OrderCode
|
|
|
// orderData.OrderTime = cmd.OrderTime
|
|
|
// orderData.OrderState = cmd.OrderState
|
|
|
// orderData.OrderCount = cmd.OrderCount
|
|
|
// orderData.OrderAmount = cmd.OrderAmount
|
|
|
// orderData.PartnerId = cmd.PartnerId
|
|
|
// orderData.BuyerName = cmd.BuyerName
|
|
|
// orderData.BuyerPhone = cmd.BuyerPhone
|
|
|
// orderData.BuyerAddress = cmd.BuyerAddress
|
|
|
// orderData.BuyerRemark = cmd.BuyerRemark
|
|
|
// orderData.BuyerId = cmd.BuyerId
|
|
|
// orderData.DeliveryState = cmd.DeliveryState
|
|
|
// orderData.DeliveryTime = cmd.DeliveryTime
|
|
|
// orderData.CompanyId = cmd.CompanyId
|
|
|
// err = orderBestshopRepository.Edit(orderData)
|
|
|
// if err != nil {
|
|
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "添加order_bestshop失败:"+err.Error())
|
|
|
// }
|
|
|
// goods := []domain.OrderGoodBestShop{}
|
|
|
// for i := range cmd.Goods {
|
|
|
// good := domain.OrderGoodBestShop{
|
|
|
// OrderId: order.Id,
|
|
|
// Sn: cmd.Goods[i].Sn,
|
|
|
// Bn: cmd.Goods[i].Bn,
|
|
|
// Name: cmd.Goods[i].Name,
|
|
|
// Price: cmd.Goods[i].Price,
|
|
|
// Nums: cmd.Goods[i].Nums,
|
|
|
// Amount: cmd.Goods[i].Amount,
|
|
|
// orderGoods, err = orderGoodBestshopRepository.Find(domain.OrderGoodBestshopFindQuery{
|
|
|
// OrderId: orderData.Id,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "获取orderGoodBestshop(order_id=%s)数据失败,err=%s", orderData.Id, err.Error())
|
|
|
// }
|
|
|
|
|
|
// for i := range orderGoods {
|
|
|
// var updated bool
|
|
|
// for ii := range cmd.Goods {
|
|
|
// if cmd.Goods[ii].Sn != orderGoods[i].Sn {
|
|
|
// continue
|
|
|
// }
|
|
|
// good := orderGoods[i]
|
|
|
// good.Sn= cmd.Goods[i].Sn,
|
|
|
// good.Bn= cmd.Goods[i].Bn,
|
|
|
// good.Name= cmd.Goods[i].Name,
|
|
|
// good.Price cmd.Goods[i].Price,
|
|
|
// good.Nums: cmd.Goods[i].Nums,
|
|
|
// good.Amount: cmd.Goods[i].Amount,
|
|
|
// }
|
|
|
// err = orderGoodBestshopRepository.Add(&good)
|
|
|
// err = orderGoodBestshopRepository.Edit(&orderGoods[i])
|
|
|
// if err != nil {
|
|
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "添加order_good失败:"+err.Error())
|
|
|
// logs.Error("更新order_good_bestshop失败:" + err.Error())
|
|
|
|
|
|
// }
|
|
|
// goods = append(goods, good)
|
|
|
// }
|
|
|
// order.Goods = goods
|
|
|
// err = transactionContext.CommitTransaction()
|
|
|
// if err != nil {
|
|
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
|