正在显示
1 个修改的文件
包含
17 行增加
和
14 行删除
@@ -335,21 +335,24 @@ func (c *OrderController) OrderPurposeToReal() { | @@ -335,21 +335,24 @@ func (c *OrderController) OrderPurposeToReal() { | ||
335 | c.ResponseError(errors.New("json数据解析失败")) | 335 | c.ResponseError(errors.New("json数据解析失败")) |
336 | return | 336 | return |
337 | } | 337 | } |
338 | - cmd := orderCmd.UpdateOrderRealCommand{ | ||
339 | - Id: param.Id, | ||
340 | - OrderCode: param.OrderId, | ||
341 | - OrderName: param.OrderName, | ||
342 | - OrderActualCount: param.OrderNum, | ||
343 | - OrderActualAmount: param.OrderPrice, | ||
344 | - BuyerPhone: param.BuyerPhone, | ||
345 | - BuyerAddress: param.Address, | ||
346 | - OrderRegion: param.OrderDist, | ||
347 | - PartnerBonusPercent: param.PartnerRatio, | ||
348 | - SalesmanBonusPercent: param.SalesmanRatio, | ||
349 | - OrderStatus: param.OrderStatue, | ||
350 | - } | ||
351 | orderSrv := orderService.NewOrderService(nil) | 338 | orderSrv := orderService.NewOrderService(nil) |
352 | - err = orderSrv.UpdateOrderReal(cmd) | 339 | + if param.Id == 0 { |
340 | + err = orderSrv.UpdateOrderReal(orderCmd.UpdateOrderRealCommand{ | ||
341 | + Id: param.Id, | ||
342 | + OrderCode: param.OrderId, | ||
343 | + OrderName: param.OrderName, | ||
344 | + OrderActualCount: param.OrderNum, | ||
345 | + OrderActualAmount: param.OrderPrice, | ||
346 | + BuyerPhone: param.BuyerPhone, | ||
347 | + BuyerAddress: param.Address, | ||
348 | + OrderRegion: param.OrderDist, | ||
349 | + PartnerBonusPercent: param.PartnerRatio, | ||
350 | + SalesmanBonusPercent: param.SalesmanRatio, | ||
351 | + OrderStatus: param.OrderStatue, | ||
352 | + }) | ||
353 | + } else { | ||
354 | + err = c.addOrderReal(param) | ||
355 | + } | ||
353 | if err != nil { | 356 | if err != nil { |
354 | c.ResponseError(err) | 357 | c.ResponseError(err) |
355 | return | 358 | return |
-
请 注册 或 登录 后发表评论