|
@@ -280,63 +280,63 @@ func (postData *postOrderGood) Valid() error { |
|
@@ -280,63 +280,63 @@ func (postData *postOrderGood) Valid() error { |
280
|
// return
|
280
|
// return
|
281
|
// }
|
281
|
// }
|
282
|
|
282
|
|
283
|
-func (c *OrderInfoController) addOrderPurpose(param postPurposeOrderDetail) error {
|
283
|
+// func (c *OrderInfoController) addOrderPurpose(param postPurposeOrderDetail) error {
|
284
|
|
284
|
|
285
|
- newGoods := []orderCmd.OrderGoodData{}
|
|
|
286
|
- for _, v := range param.Product {
|
|
|
287
|
- g := orderCmd.OrderGoodData{
|
|
|
288
|
- GoodName: v.ProductName,
|
|
|
289
|
- PlanGoodNumber: v.OrderNum,
|
|
|
290
|
- Price: v.Univalence,
|
|
|
291
|
- PartnerBonusPercent: v.PartnerRatio,
|
|
|
292
|
- }
|
|
|
293
|
- newGoods = append(newGoods, g)
|
|
|
294
|
- }
|
|
|
295
|
- companyId := c.GetUserCompany()
|
|
|
296
|
- createcmd := orderCmd.CreateOrderCommand{
|
|
|
297
|
- OrderType: domain.OrderIntention,
|
|
|
298
|
- OrderCode: param.OrderId,
|
|
|
299
|
- DeliveryCode: "",
|
|
|
300
|
- BuyerName: param.BuyerName,
|
|
|
301
|
- OrderRegion: param.OrderDist,
|
|
|
302
|
- PartnerId: param.PartnerId,
|
|
|
303
|
- SalesmanBonusPercent: param.CommissionProportion,
|
|
|
304
|
- Goods: newGoods,
|
|
|
305
|
- CompanyId: companyId,
|
|
|
306
|
- }
|
|
|
307
|
- orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
308
|
- _, err := orderSrv.CreateNewOrder(createcmd)
|
|
|
309
|
- return err
|
|
|
310
|
-}
|
285
|
+// newGoods := []orderCmd.OrderGoodData{}
|
|
|
286
|
+// for _, v := range param.Product {
|
|
|
287
|
+// g := orderCmd.OrderGoodData{
|
|
|
288
|
+// GoodName: v.ProductName,
|
|
|
289
|
+// PlanGoodNumber: v.OrderNum,
|
|
|
290
|
+// Price: v.Univalence,
|
|
|
291
|
+// PartnerBonusPercent: v.PartnerRatio,
|
|
|
292
|
+// }
|
|
|
293
|
+// newGoods = append(newGoods, g)
|
|
|
294
|
+// }
|
|
|
295
|
+// companyId := c.GetUserCompany()
|
|
|
296
|
+// createcmd := orderCmd.CreateOrderCommand{
|
|
|
297
|
+// OrderType: domain.OrderIntention,
|
|
|
298
|
+// OrderCode: param.OrderId,
|
|
|
299
|
+// DeliveryCode: "",
|
|
|
300
|
+// BuyerName: param.BuyerName,
|
|
|
301
|
+// OrderRegion: param.OrderDist,
|
|
|
302
|
+// PartnerId: param.PartnerId,
|
|
|
303
|
+// SalesmanBonusPercent: param.CommissionProportion,
|
|
|
304
|
+// Goods: newGoods,
|
|
|
305
|
+// CompanyId: companyId,
|
|
|
306
|
+// }
|
|
|
307
|
+// orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
308
|
+// _, err := orderSrv.CreateNewOrder(createcmd)
|
|
|
309
|
+// return err
|
|
|
310
|
+// }
|
311
|
|
311
|
|
312
|
-func (c *OrderInfoController) editOrderPurpose(param postPurposeOrderDetail) error {
|
|
|
313
|
- orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
314
|
- newGoods := []orderCmd.OrderGoodData{}
|
|
|
315
|
- for _, v := range param.Product {
|
|
|
316
|
- g := orderCmd.OrderGoodData{
|
|
|
317
|
- GoodName: v.ProductName,
|
|
|
318
|
- PlanGoodNumber: v.OrderNum,
|
|
|
319
|
- Price: v.Univalence,
|
|
|
320
|
- PartnerBonusPercent: v.PartnerRatio,
|
|
|
321
|
- }
|
|
|
322
|
- newGoods = append(newGoods, g)
|
|
|
323
|
- }
|
|
|
324
|
- companyId := c.GetUserCompany()
|
|
|
325
|
- updatecmd := orderCmd.UpdateOrderCommand{
|
|
|
326
|
- Id: param.Id,
|
|
|
327
|
- OrderType: domain.OrderIntention,
|
|
|
328
|
- OrderCode: param.OrderId,
|
|
|
329
|
- DeliveryCode: "",
|
|
|
330
|
- BuyerName: param.BuyerName,
|
|
|
331
|
- OrderRegion: param.OrderDist,
|
|
|
332
|
- PartnerId: param.PartnerId,
|
|
|
333
|
- SalesmanBonusPercent: param.CommissionProportion,
|
|
|
334
|
- Goods: newGoods,
|
|
|
335
|
- CompanyId: companyId,
|
|
|
336
|
- }
|
|
|
337
|
- _, err := orderSrv.UpdateOrderData(updatecmd)
|
|
|
338
|
- return err
|
|
|
339
|
-}
|
312
|
+// func (c *OrderInfoController) editOrderPurpose(param postPurposeOrderDetail) error {
|
|
|
313
|
+// orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
314
|
+// newGoods := []orderCmd.OrderGoodData{}
|
|
|
315
|
+// for _, v := range param.Product {
|
|
|
316
|
+// g := orderCmd.OrderGoodData{
|
|
|
317
|
+// GoodName: v.ProductName,
|
|
|
318
|
+// PlanGoodNumber: v.OrderNum,
|
|
|
319
|
+// Price: v.Univalence,
|
|
|
320
|
+// PartnerBonusPercent: v.PartnerRatio,
|
|
|
321
|
+// }
|
|
|
322
|
+// newGoods = append(newGoods, g)
|
|
|
323
|
+// }
|
|
|
324
|
+// companyId := c.GetUserCompany()
|
|
|
325
|
+// updatecmd := orderCmd.UpdateOrderCommand{
|
|
|
326
|
+// Id: param.Id,
|
|
|
327
|
+// OrderType: domain.OrderIntention,
|
|
|
328
|
+// OrderCode: param.OrderId,
|
|
|
329
|
+// DeliveryCode: "",
|
|
|
330
|
+// BuyerName: param.BuyerName,
|
|
|
331
|
+// OrderRegion: param.OrderDist,
|
|
|
332
|
+// PartnerId: param.PartnerId,
|
|
|
333
|
+// SalesmanBonusPercent: param.CommissionProportion,
|
|
|
334
|
+// Goods: newGoods,
|
|
|
335
|
+// CompanyId: companyId,
|
|
|
336
|
+// }
|
|
|
337
|
+// _, err := orderSrv.UpdateOrderData(updatecmd)
|
|
|
338
|
+// return err
|
|
|
339
|
+// }
|
340
|
|
340
|
|
341
|
type postOrderPurposeDelivery struct {
|
341
|
type postOrderPurposeDelivery struct {
|
342
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
342
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
|
@@ -543,6 +543,8 @@ func (c *OrderInfoController) GetOrderReal() { |
|
@@ -543,6 +543,8 @@ func (c *OrderInfoController) GetOrderReal() { |
543
|
"product": allGoods,
|
543
|
"product": allGoods,
|
544
|
"create_time": orderinfo.CreateTime.Local().Format("2006-01-02 15:04:06"),
|
544
|
"create_time": orderinfo.CreateTime.Local().Format("2006-01-02 15:04:06"),
|
545
|
"update_time": orderinfo.UpdateTime.Local().Format("2006-01-02 15:04:06"),
|
545
|
"update_time": orderinfo.UpdateTime.Local().Format("2006-01-02 15:04:06"),
|
|
|
546
|
+ "partnerCategoryId": orderinfo.PartnerCategory.Id,
|
|
|
547
|
+ "partnerCategoryName": orderinfo.PartnerCategory.Name,
|
546
|
}
|
548
|
}
|
547
|
if orderinfo.OrderCompute.UseOrderAmount >= 0 {
|
549
|
if orderinfo.OrderCompute.UseOrderAmount >= 0 {
|
548
|
rsp["orderNumCountControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderCount)
|
550
|
rsp["orderNumCountControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderCount)
|
|
@@ -557,6 +559,7 @@ func (c *OrderInfoController) GetOrderReal() { |
|
@@ -557,6 +559,7 @@ func (c *OrderInfoController) GetOrderReal() { |
557
|
//实际订单
|
559
|
//实际订单
|
558
|
type postRealOrderDetail struct {
|
560
|
type postRealOrderDetail struct {
|
559
|
postPurposeOrderDetail
|
561
|
postPurposeOrderDetail
|
|
|
562
|
+ PartnerCategory int64 `json:"partner_category"`
|
560
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
563
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
561
|
}
|
564
|
}
|
562
|
|
565
|
|
|
@@ -622,6 +625,7 @@ func (c *OrderInfoController) addOrderReal(param postRealOrderDetail) error { |
|
@@ -622,6 +625,7 @@ func (c *OrderInfoController) addOrderReal(param postRealOrderDetail) error { |
622
|
SalesmanBonusPercent: param.CommissionProportion,
|
625
|
SalesmanBonusPercent: param.CommissionProportion,
|
623
|
Goods: newGoods,
|
626
|
Goods: newGoods,
|
624
|
CompanyId: companyId,
|
627
|
CompanyId: companyId,
|
|
|
628
|
+ PartnerCategory: param.PartnerCategory,
|
625
|
}
|
629
|
}
|
626
|
_, err := orderSrv.CreateNewOrder(createcmd)
|
630
|
_, err := orderSrv.CreateNewOrder(createcmd)
|
627
|
return err
|
631
|
return err
|
|
@@ -651,6 +655,7 @@ func (c *OrderInfoController) editOrderReal(param postRealOrderDetail) error { |
|
@@ -651,6 +655,7 @@ func (c *OrderInfoController) editOrderReal(param postRealOrderDetail) error { |
651
|
SalesmanBonusPercent: param.CommissionProportion,
|
655
|
SalesmanBonusPercent: param.CommissionProportion,
|
652
|
Goods: newGoods,
|
656
|
Goods: newGoods,
|
653
|
CompanyId: companyId,
|
657
|
CompanyId: companyId,
|
|
|
658
|
+ PartnerCategory: param.PartnerCategory,
|
654
|
}
|
659
|
}
|
655
|
orderSrv := orderService.NewOrderInfoService(nil)
|
660
|
orderSrv := orderService.NewOrderInfoService(nil)
|
656
|
_, err := orderSrv.UpdateOrderData(updatecmd)
|
661
|
_, err := orderSrv.UpdateOrderData(updatecmd)
|