作者 tangxvhui

bug 修复

... ... @@ -335,21 +335,24 @@ func (c *OrderController) OrderPurposeToReal() {
c.ResponseError(errors.New("json数据解析失败"))
return
}
cmd := orderCmd.UpdateOrderRealCommand{
Id: param.Id,
OrderCode: param.OrderId,
OrderName: param.OrderName,
OrderActualCount: param.OrderNum,
OrderActualAmount: param.OrderPrice,
BuyerPhone: param.BuyerPhone,
BuyerAddress: param.Address,
OrderRegion: param.OrderDist,
PartnerBonusPercent: param.PartnerRatio,
SalesmanBonusPercent: param.SalesmanRatio,
OrderStatus: param.OrderStatue,
}
orderSrv := orderService.NewOrderService(nil)
err = orderSrv.UpdateOrderReal(cmd)
if param.Id == 0 {
err = orderSrv.UpdateOrderReal(orderCmd.UpdateOrderRealCommand{
Id: param.Id,
OrderCode: param.OrderId,
OrderName: param.OrderName,
OrderActualCount: param.OrderNum,
OrderActualAmount: param.OrderPrice,
BuyerPhone: param.BuyerPhone,
BuyerAddress: param.Address,
OrderRegion: param.OrderDist,
PartnerBonusPercent: param.PartnerRatio,
SalesmanBonusPercent: param.SalesmanRatio,
OrderStatus: param.OrderStatue,
})
} else {
err = c.addOrderReal(param)
}
if err != nil {
c.ResponseError(err)
return
... ...