|
@@ -224,6 +224,7 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord |
|
@@ -224,6 +224,7 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord |
224
|
orderBestshop.Goods[i].CopyToOrderGood(&good)
|
224
|
orderBestshop.Goods[i].CopyToOrderGood(&good)
|
225
|
good.OrderId = orderbase.Id
|
225
|
good.OrderId = orderbase.Id
|
226
|
good.Compute()
|
226
|
good.Compute()
|
|
|
227
|
+ good.CurrentBonusStatus.WartPayPartnerBonus(&good)
|
227
|
ordergoods = append(ordergoods, good)
|
228
|
ordergoods = append(ordergoods, good)
|
228
|
}
|
229
|
}
|
229
|
orderbase.Goods = ordergoods
|
230
|
orderbase.Goods = ordergoods
|
|
@@ -292,45 +293,51 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord |
|
@@ -292,45 +293,51 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord |
292
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "获取orderBestshop(order_code=%s)数据失败,err=%s", cmd.OrderCode, err.Error())
|
293
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "获取orderBestshop(order_code=%s)数据失败,err=%s", cmd.OrderCode, err.Error())
|
293
|
// }
|
294
|
// }
|
294
|
|
295
|
|
295
|
-// orderData.OrderCode= cmd.OrderCode,
|
|
|
296
|
-// orderData.OrderTime=cmd.OrderTime,
|
|
|
297
|
-// orderData.OrderState: cmd.OrderState,
|
|
|
298
|
-// orderData.OrderCount: cmd.OrderCount,
|
|
|
299
|
-// orderData.OrderAmount: cmd.OrderAmount,
|
|
|
300
|
-// orderData.CreateTime: time.Now(),
|
|
|
301
|
-// orderData.PartnerId: cmd.PartnerId,
|
|
|
302
|
-// BuyerName: cmd.BuyerName,
|
|
|
303
|
-// BuyerPhone: cmd.BuyerPhone,
|
|
|
304
|
-// BuyerAddress: cmd.BuyerAddress,
|
|
|
305
|
-// BuyerRemark: cmd.BuyerRemark,
|
|
|
306
|
-// BuyerId: cmd.BuyerId,
|
|
|
307
|
-// DeliveryState: cmd.DeliveryState,
|
|
|
308
|
-// DeliveryTime: cmd.DeliveryTime,
|
|
|
309
|
-// IsCopy: false,
|
|
|
310
|
-// CompanyId: cmd.CompanyId,
|
|
|
311
|
-// }
|
|
|
312
|
-// err = orderBestshopRepository.Add(&order)
|
296
|
+// orderData.OrderCode = cmd.OrderCode
|
|
|
297
|
+// orderData.OrderTime = cmd.OrderTime
|
|
|
298
|
+// orderData.OrderState = cmd.OrderState
|
|
|
299
|
+// orderData.OrderCount = cmd.OrderCount
|
|
|
300
|
+// orderData.OrderAmount = cmd.OrderAmount
|
|
|
301
|
+// orderData.PartnerId = cmd.PartnerId
|
|
|
302
|
+// orderData.BuyerName = cmd.BuyerName
|
|
|
303
|
+// orderData.BuyerPhone = cmd.BuyerPhone
|
|
|
304
|
+// orderData.BuyerAddress = cmd.BuyerAddress
|
|
|
305
|
+// orderData.BuyerRemark = cmd.BuyerRemark
|
|
|
306
|
+// orderData.BuyerId = cmd.BuyerId
|
|
|
307
|
+// orderData.DeliveryState = cmd.DeliveryState
|
|
|
308
|
+// orderData.DeliveryTime = cmd.DeliveryTime
|
|
|
309
|
+// orderData.CompanyId = cmd.CompanyId
|
|
|
310
|
+// err = orderBestshopRepository.Edit(orderData)
|
313
|
// if err != nil {
|
311
|
// if err != nil {
|
314
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "添加order_bestshop失败:"+err.Error())
|
312
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "添加order_bestshop失败:"+err.Error())
|
315
|
// }
|
313
|
// }
|
316
|
-// goods := []domain.OrderGoodBestShop{}
|
|
|
317
|
-// for i := range cmd.Goods {
|
|
|
318
|
-// good := domain.OrderGoodBestShop{
|
|
|
319
|
-// OrderId: order.Id,
|
|
|
320
|
-// Sn: cmd.Goods[i].Sn,
|
|
|
321
|
-// Bn: cmd.Goods[i].Bn,
|
|
|
322
|
-// Name: cmd.Goods[i].Name,
|
|
|
323
|
-// Price: cmd.Goods[i].Price,
|
|
|
324
|
-// Nums: cmd.Goods[i].Nums,
|
|
|
325
|
-// Amount: cmd.Goods[i].Amount,
|
314
|
+// orderGoods, err = orderGoodBestshopRepository.Find(domain.OrderGoodBestshopFindQuery{
|
|
|
315
|
+// OrderId: orderData.Id,
|
|
|
316
|
+// })
|
|
|
317
|
+// if err != nil {
|
|
|
318
|
+// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "获取orderGoodBestshop(order_id=%s)数据失败,err=%s", orderData.Id, err.Error())
|
|
|
319
|
+// }
|
|
|
320
|
+
|
|
|
321
|
+// for i := range orderGoods {
|
|
|
322
|
+// var updated bool
|
|
|
323
|
+// for ii := range cmd.Goods {
|
|
|
324
|
+// if cmd.Goods[ii].Sn != orderGoods[i].Sn {
|
|
|
325
|
+// continue
|
|
|
326
|
+// }
|
|
|
327
|
+// good := orderGoods[i]
|
|
|
328
|
+// good.Sn= cmd.Goods[i].Sn,
|
|
|
329
|
+// good.Bn= cmd.Goods[i].Bn,
|
|
|
330
|
+// good.Name= cmd.Goods[i].Name,
|
|
|
331
|
+// good.Price cmd.Goods[i].Price,
|
|
|
332
|
+// good.Nums: cmd.Goods[i].Nums,
|
|
|
333
|
+// good.Amount: cmd.Goods[i].Amount,
|
326
|
// }
|
334
|
// }
|
327
|
-// err = orderGoodBestshopRepository.Add(&good)
|
335
|
+// err = orderGoodBestshopRepository.Edit(&orderGoods[i])
|
328
|
// if err != nil {
|
336
|
// if err != nil {
|
329
|
-// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "添加order_good失败:"+err.Error())
|
337
|
+// logs.Error("更新order_good_bestshop失败:" + err.Error())
|
|
|
338
|
+
|
330
|
// }
|
339
|
// }
|
331
|
-// goods = append(goods, good)
|
|
|
332
|
// }
|
340
|
// }
|
333
|
-// order.Goods = goods
|
|
|
334
|
// err = transactionContext.CommitTransaction()
|
341
|
// err = transactionContext.CommitTransaction()
|
335
|
// if err != nil {
|
342
|
// if err != nil {
|
336
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
343
|
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|