From 84d5c5743141fa9c35b5f41758b544dc48803668 Mon Sep 17 00:00:00 2001 From: SteveChan <steve.d.chan@qq.com> Date: Fri, 29 Jan 2021 19:30:41 +0800 Subject: [PATCH] fix:修改导入订单销售日期格式 --- pkg/application/orderinfo/service/order_info.go | 1 + pkg/port/beego/controllers/order_info_controlller.go | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/application/orderinfo/service/order_info.go b/pkg/application/orderinfo/service/order_info.go index a796b5a..ea910f9 100644 --- a/pkg/application/orderinfo/service/order_info.go +++ b/pkg/application/orderinfo/service/order_info.go @@ -1179,6 +1179,7 @@ func (service OrderInfoService) CreateNewOrderByImport(createOrderCommands []*co PartnerInfo: partnerData.Partner, SalesmanBonusPercent: cmd.SalesmanBonusPercent, CompanyId: cmd.CompanyId, + SaleDate: cmd.SaleDate, } // 批量校验合伙人分类数据 diff --git a/pkg/port/beego/controllers/order_info_controlller.go b/pkg/port/beego/controllers/order_info_controlller.go index ce2d923..354803a 100644 --- a/pkg/port/beego/controllers/order_info_controlller.go +++ b/pkg/port/beego/controllers/order_info_controlller.go @@ -1151,7 +1151,10 @@ func (c *OrderInfoController) ImportOrderFromExcel() { return } - fmt.Print(timeValue, "\n") + //saleDate, err := time.ParseInLocation("2006-01-02 15:04:05", param.SaleDate, time.Local) + saleDateWithTz := time.Date(timeValue.Year(), timeValue.Month(), timeValue.Day(), time.Now().Hour(), time.Now().Minute(), time.Now().Second(), time.Now().Nanosecond(), time.Local) + + fmt.Print("销售日期:", saleDateWithTz, "\n") // 初始化建订单命令集 orderCommands[hashString] = &orderCmd.CreateOrderCommand{ @@ -1160,7 +1163,7 @@ func (c *OrderInfoController) ImportOrderFromExcel() { DeliveryCode: row[1], BuyerName: row[2], OrderRegion: row[3], - SaleDate: timeValue, + SaleDate: saleDateWithTz, PartnerId: 0, // 根据合伙人类型+合伙人编号查找合伙人id SalesmanBonusPercent: sbPercent, Goods: []orderCmd.OrderGoodData{ -- libgit2 0.24.0