正在显示
2 个修改的文件
包含
16 行增加
和
12 行删除
@@ -2,10 +2,11 @@ package service | @@ -2,10 +2,11 @@ package service | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | - "github.com/linmadan/egglib-go/core/application" | ||
6 | "strconv" | 5 | "strconv" |
7 | "time" | 6 | "time" |
8 | 7 | ||
8 | + "github.com/linmadan/egglib-go/core/application" | ||
9 | + | ||
9 | "github.com/astaxie/beego/logs" | 10 | "github.com/astaxie/beego/logs" |
10 | 11 | ||
11 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/event/subscriber" | 12 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/event/subscriber" |
@@ -20,7 +21,7 @@ import ( | @@ -20,7 +21,7 @@ import ( | ||
20 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib" | 21 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib" |
21 | ) | 22 | ) |
22 | 23 | ||
23 | -//OrderService 自建订单,意向单,实发订单 | 24 | +// OrderService 自建订单,意向单,实发订单 |
24 | type OrderInfoService struct { | 25 | type OrderInfoService struct { |
25 | } | 26 | } |
26 | 27 | ||
@@ -125,7 +126,7 @@ func (service OrderInfoService) PageListOrderBase(listOrderQuery query.ListOrder | @@ -125,7 +126,7 @@ func (service OrderInfoService) PageListOrderBase(listOrderQuery query.ListOrder | ||
125 | return orderDataReturn, cnt, nil | 126 | return orderDataReturn, cnt, nil |
126 | } | 127 | } |
127 | 128 | ||
128 | -//GetOrderDetail 获取订单详情 | 129 | +// GetOrderDetail 获取订单详情 |
129 | func (service OrderInfoService) GetOrderDetail(getOrderQuery query.GetOrderQuery) (*domain.OrderBase, error) { | 130 | func (service OrderInfoService) GetOrderDetail(getOrderQuery query.GetOrderQuery) (*domain.OrderBase, error) { |
130 | //实际业务 | 131 | //实际业务 |
131 | transactionContext, err := factory.CreateTransactionContext(nil) | 132 | transactionContext, err := factory.CreateTransactionContext(nil) |
@@ -352,7 +353,7 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) ( | @@ -352,7 +353,7 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) ( | ||
352 | return newOrder, nil | 353 | return newOrder, nil |
353 | } | 354 | } |
354 | 355 | ||
355 | -//DeleteOrder 删除订单 | 356 | +// DeleteOrder 删除订单 |
356 | func (service OrderInfoService) DeleteOrder(orderId int64, companyId int64) error { | 357 | func (service OrderInfoService) DeleteOrder(orderId int64, companyId int64) error { |
357 | var ( | 358 | var ( |
358 | transactionContext, _ = factory.CreateTransactionContext(nil) | 359 | transactionContext, _ = factory.CreateTransactionContext(nil) |
@@ -393,7 +394,7 @@ func (service OrderInfoService) DeleteOrder(orderId int64, companyId int64) erro | @@ -393,7 +394,7 @@ func (service OrderInfoService) DeleteOrder(orderId int64, companyId int64) erro | ||
393 | return nil | 394 | return nil |
394 | } | 395 | } |
395 | 396 | ||
396 | -//UpdateOrderData 编辑订单 | 397 | +// UpdateOrderData 编辑订单 |
397 | func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) (*domain.OrderBase, error) { | 398 | func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) (*domain.OrderBase, error) { |
398 | var ( | 399 | var ( |
399 | transactionContext, _ = factory.CreateTransactionContext(nil) | 400 | transactionContext, _ = factory.CreateTransactionContext(nil) |
@@ -581,7 +582,7 @@ func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) | @@ -581,7 +582,7 @@ func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) | ||
581 | return oldOrderData, nil | 582 | return oldOrderData, nil |
582 | } | 583 | } |
583 | 584 | ||
584 | -//deleteOldOrderGoods 新旧商品列表对比 | 585 | +// deleteOldOrderGoods 新旧商品列表对比 |
585 | func (service OrderInfoService) deleteOldOrderGoods(newGoods []domain.OrderGood, oldGoods []domain.OrderGood) (goodIds []int64) { | 586 | func (service OrderInfoService) deleteOldOrderGoods(newGoods []domain.OrderGood, oldGoods []domain.OrderGood) (goodIds []int64) { |
586 | for _, old := range oldGoods { | 587 | for _, old := range oldGoods { |
587 | var hasIn bool | 588 | var hasIn bool |
@@ -598,7 +599,7 @@ func (service OrderInfoService) deleteOldOrderGoods(newGoods []domain.OrderGood, | @@ -598,7 +599,7 @@ func (service OrderInfoService) deleteOldOrderGoods(newGoods []domain.OrderGood, | ||
598 | return | 599 | return |
599 | } | 600 | } |
600 | 601 | ||
601 | -//DisableOrEnable 开启关闭订单 | 602 | +// DisableOrEnable 开启关闭订单 |
602 | func (service OrderInfoService) DisableOrEnable(cmd command.DisableOrderCommand) error { | 603 | func (service OrderInfoService) DisableOrEnable(cmd command.DisableOrderCommand) error { |
603 | var ( | 604 | var ( |
604 | transactionContext, _ = factory.CreateTransactionContext(nil) | 605 | transactionContext, _ = factory.CreateTransactionContext(nil) |
@@ -642,7 +643,7 @@ func (service OrderInfoService) DisableOrEnable(cmd command.DisableOrderCommand) | @@ -642,7 +643,7 @@ func (service OrderInfoService) DisableOrEnable(cmd command.DisableOrderCommand) | ||
642 | return nil | 643 | return nil |
643 | } | 644 | } |
644 | 645 | ||
645 | -//PageListOrderBouns 获取订单的分红列表 | 646 | +// PageListOrderBouns 获取订单的分红列表 |
646 | func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrderBonusQuery) ([]map[string]interface{}, int, error) { | 647 | func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrderBonusQuery) ([]map[string]interface{}, int, error) { |
647 | transactionContext, err := factory.CreateTransactionContext(nil) | 648 | transactionContext, err := factory.CreateTransactionContext(nil) |
648 | if err != nil { | 649 | if err != nil { |
@@ -726,10 +727,11 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde | @@ -726,10 +727,11 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde | ||
726 | goods []domain.OrderGood | 727 | goods []domain.OrderGood |
727 | hasBonusPercent bool | 728 | hasBonusPercent bool |
728 | ) | 729 | ) |
729 | - goods, _, err = orderGoodRepository.Find(domain.OrderGoodFindQuery{OrderId: orders[i].Id}) | 730 | + goods, _, _ = orderGoodRepository.Find(domain.OrderGoodFindQuery{OrderId: orders[i].Id}) |
730 | for ii := range goods { | 731 | for ii := range goods { |
731 | if goods[ii].PartnerBonusPercent >= 0 { | 732 | if goods[ii].PartnerBonusPercent >= 0 { |
732 | hasBonusPercent = true | 733 | hasBonusPercent = true |
734 | + break | ||
733 | } | 735 | } |
734 | } | 736 | } |
735 | listIndex := listOrderQuery.Offset + (1 + i) | 737 | listIndex := listOrderQuery.Offset + (1 + i) |
@@ -738,6 +740,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde | @@ -738,6 +740,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde | ||
738 | "createTime": orders[i].CreateTime.Local().Format("2006-01-02 15:04:05"), | 740 | "createTime": orders[i].CreateTime.Local().Format("2006-01-02 15:04:05"), |
739 | "updateTime": orders[i].UpdateTime.Local().Format("2006-01-02 15:04:05"), | 741 | "updateTime": orders[i].UpdateTime.Local().Format("2006-01-02 15:04:05"), |
740 | "id": fmt.Sprint(orders[i].Id), | 742 | "id": fmt.Sprint(orders[i].Id), |
743 | + "saleDate": orders[i].SaleDate.Local().Format("2006-01-02"), | ||
741 | "shipmentsId": orders[i].DeliveryCode, | 744 | "shipmentsId": orders[i].DeliveryCode, |
742 | "partner": orders[i].PartnerInfo.PartnerName, | 745 | "partner": orders[i].PartnerInfo.PartnerName, |
743 | "dividendsReceivable": fmt.Sprint(orders[i].GetCurrentPartnerBonus()), | 746 | "dividendsReceivable": fmt.Sprint(orders[i].GetCurrentPartnerBonus()), |
@@ -764,7 +767,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde | @@ -764,7 +767,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde | ||
764 | return resp, cnt, nil | 767 | return resp, cnt, nil |
765 | } | 768 | } |
766 | 769 | ||
767 | -//PayPartnerBonusWithOrderBestshop 支付分红 | 770 | +// PayPartnerBonusWithOrderBestshop 支付分红 |
768 | func (service OrderInfoService) PayPartnerBonus(orderId int64, goodId int64, adminId int64) error { | 771 | func (service OrderInfoService) PayPartnerBonus(orderId int64, goodId int64, adminId int64) error { |
769 | var ( | 772 | var ( |
770 | transactionContext, _ = factory.CreateTransactionContext(nil) | 773 | transactionContext, _ = factory.CreateTransactionContext(nil) |
@@ -799,7 +802,7 @@ func (service OrderInfoService) PayPartnerBonus(orderId int64, goodId int64, adm | @@ -799,7 +802,7 @@ func (service OrderInfoService) PayPartnerBonus(orderId int64, goodId int64, adm | ||
799 | return nil | 802 | return nil |
800 | } | 803 | } |
801 | 804 | ||
802 | -//UpdateOrderRemarkBonus 订单分红详情,更新备注 | 805 | +// UpdateOrderRemarkBonus 订单分红详情,更新备注 |
803 | func (service OrderInfoService) UpdateOrderRemarkBonus(orderId int64, adminId int64, remark string) error { | 806 | func (service OrderInfoService) UpdateOrderRemarkBonus(orderId int64, adminId int64, remark string) error { |
804 | var ( | 807 | var ( |
805 | transactionContext, _ = factory.CreateTransactionContext(nil) | 808 | transactionContext, _ = factory.CreateTransactionContext(nil) |
-
请 注册 或 登录 后发表评论