作者 tangxvhui

Merge branch 'dev' into test

# Config file for [Air](https://github.com/cosmtrek/air) in TOML format
# Working directory
# . or absolute path, please note that the directories following must be under root.
root = "."
tmp_dir = "tmp"
[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -o ./tmp/main ."
# Binary file yields from `cmd`.
bin = "tmp/main"
# Customize binary.
full_bin = "APP_ENV=dev APP_USER=air ./tmp/main"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html"]
# Ignore these filename extensions or directories.
exclude_dir = ["assets", "tmp", "vendor", "frontend/node_modules"]
# Watch these directories if you specified.
include_dir = []
# Exclude files.
exclude_file = []
# Exclude unchanged files.
exclude_unchanged = true
# This log file places in your tmp_dir.
log = "air.log"
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 1000 # ms
# Stop running old binary when build errors occur.
stop_on_error = true
# Send Interrupt signal before killing process (windows does not support this feature)
send_interrupt = false
# Delay after sending Interrupt signal
kill_delay = 500 # ms
[log]
# Show log time
time = false
[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"
[misc]
# Delete tmp directory on exit
clean_on_exit = true
\ No newline at end of file
... ... @@ -25,4 +25,5 @@
/*.exe~
/logs
download
\ No newline at end of file
download
partnermg
... ...
... ... @@ -2,10 +2,11 @@ package service
import (
"fmt"
"github.com/linmadan/egglib-go/core/application"
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"github.com/astaxie/beego/logs"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/event/subscriber"
... ... @@ -20,7 +21,7 @@ import (
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib"
)
//OrderService 自建订单,意向单,实发订单
// OrderService 自建订单,意向单,实发订单
type OrderInfoService struct {
}
... ... @@ -125,7 +126,7 @@ func (service OrderInfoService) PageListOrderBase(listOrderQuery query.ListOrder
return orderDataReturn, cnt, nil
}
//GetOrderDetail 获取订单详情
// GetOrderDetail 获取订单详情
func (service OrderInfoService) GetOrderDetail(getOrderQuery query.GetOrderQuery) (*domain.OrderBase, error) {
//实际业务
transactionContext, err := factory.CreateTransactionContext(nil)
... ... @@ -352,7 +353,7 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) (
return newOrder, nil
}
//DeleteOrder 删除订单
// DeleteOrder 删除订单
func (service OrderInfoService) DeleteOrder(orderId int64, companyId int64) error {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
... ... @@ -393,7 +394,7 @@ func (service OrderInfoService) DeleteOrder(orderId int64, companyId int64) erro
return nil
}
//UpdateOrderData 编辑订单
// UpdateOrderData 编辑订单
func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) (*domain.OrderBase, error) {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
... ... @@ -581,7 +582,7 @@ func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand)
return oldOrderData, nil
}
//deleteOldOrderGoods 新旧商品列表对比
// deleteOldOrderGoods 新旧商品列表对比
func (service OrderInfoService) deleteOldOrderGoods(newGoods []domain.OrderGood, oldGoods []domain.OrderGood) (goodIds []int64) {
for _, old := range oldGoods {
var hasIn bool
... ... @@ -598,7 +599,7 @@ func (service OrderInfoService) deleteOldOrderGoods(newGoods []domain.OrderGood,
return
}
//DisableOrEnable 开启关闭订单
// DisableOrEnable 开启关闭订单
func (service OrderInfoService) DisableOrEnable(cmd command.DisableOrderCommand) error {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
... ... @@ -642,7 +643,7 @@ func (service OrderInfoService) DisableOrEnable(cmd command.DisableOrderCommand)
return nil
}
//PageListOrderBouns 获取订单的分红列表
// PageListOrderBouns 获取订单的分红列表
func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrderBonusQuery) ([]map[string]interface{}, int, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
... ... @@ -726,10 +727,11 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde
goods []domain.OrderGood
hasBonusPercent bool
)
goods, _, err = orderGoodRepository.Find(domain.OrderGoodFindQuery{OrderId: orders[i].Id})
goods, _, _ = orderGoodRepository.Find(domain.OrderGoodFindQuery{OrderId: orders[i].Id})
for ii := range goods {
if goods[ii].PartnerBonusPercent >= 0 {
hasBonusPercent = true
break
}
}
listIndex := listOrderQuery.Offset + (1 + i)
... ... @@ -738,6 +740,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde
"createTime": orders[i].CreateTime.Local().Format("2006-01-02 15:04:05"),
"updateTime": orders[i].UpdateTime.Local().Format("2006-01-02 15:04:05"),
"id": fmt.Sprint(orders[i].Id),
"saleDate": orders[i].SaleDate.Local().Format("2006-01-02"),
"shipmentsId": orders[i].DeliveryCode,
"partner": orders[i].PartnerInfo.PartnerName,
"dividendsReceivable": fmt.Sprint(orders[i].GetCurrentPartnerBonus()),
... ... @@ -764,7 +767,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde
return resp, cnt, nil
}
//PayPartnerBonusWithOrderBestshop 支付分红
// PayPartnerBonusWithOrderBestshop 支付分红
func (service OrderInfoService) PayPartnerBonus(orderId int64, goodId int64, adminId int64) error {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
... ... @@ -799,7 +802,7 @@ func (service OrderInfoService) PayPartnerBonus(orderId int64, goodId int64, adm
return nil
}
//UpdateOrderRemarkBonus 订单分红详情,更新备注
// UpdateOrderRemarkBonus 订单分红详情,更新备注
func (service OrderInfoService) UpdateOrderRemarkBonus(orderId int64, adminId int64, remark string) error {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
... ...