...
|
...
|
@@ -82,15 +82,12 @@ func (serve *OrderBonusService) UpdateBounsByGoodNumber(orderId int64, adminId i |
|
|
updateGood = oldOrder.Goods[i]
|
|
|
formerNumber = updateGood.GetCurrentGoodNumber()
|
|
|
formerAmount = updateGood.GetCurrentAmount()
|
|
|
err := new(domain.OrderGoodWithBestshop).UpdateBonusByGoodNumber(&updateGood, goodWithNumber)
|
|
|
err := new(domain.OrderGoodWithBestshop).
|
|
|
UpdateBonusByGoodNumber(&updateGood, goodWithNumber)
|
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
updateGood.RemarkReason.ModifyGoodNumber = reason
|
|
|
//计算
|
|
|
if err := updateGood.Compute(); err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "核算商品数据失败"+err.Error())
|
|
|
}
|
|
|
newAmount = updateGood.GetCurrentAmount()
|
|
|
goodExist = true
|
|
|
oldOrder.Goods[i] = updateGood
|
...
|
...
|
@@ -185,15 +182,12 @@ func (serve *OrderBonusService) UpdateBounsByPartnerBonusPercent(orderId int64, |
|
|
updateGood = oldOrder.Goods[i]
|
|
|
formerPartnerBonusPercent = updateGood.PartnerBonusPercent
|
|
|
formerPartnerBonus = updateGood.GetCurrentPartnerBonus()
|
|
|
err := new(domain.OrderGoodWithBestshop).UpdateBonusByPertnerBonusPercent(&updateGood, partnerPercent)
|
|
|
err := new(domain.OrderGoodWithBestshop).
|
|
|
UpdateBonusByPertnerBonusPercent(&updateGood, partnerPercent)
|
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
updateGood.RemarkReason.ModifyPartnerBonusPercent = reason
|
|
|
//计算
|
|
|
if err := updateGood.Compute(); err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "核算商品数据失败"+err.Error())
|
|
|
}
|
|
|
newPartnerBonus = updateGood.GetCurrentPartnerBonus()
|
|
|
goodExist = true
|
|
|
oldOrder.Goods[i] = updateGood
|
...
|
...
|
@@ -289,10 +283,6 @@ func (serve *OrderBonusService) PayOrderGoodBonus(orderId int64, goodId int64, a |
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
//计算
|
|
|
if err := updateGood.Compute(); err != nil {
|
|
|
return errors.New("核算商品数据失败" + err.Error())
|
|
|
}
|
|
|
goodExist = true
|
|
|
oldOrder.Goods[i] = updateGood
|
|
|
}
|
...
|
...
|
|