作者 陈志颖

refactor:调整订单导入

... ... @@ -11,19 +11,19 @@ import (
// ReqImportDividendsOrder 导入订单数据
type (
ImportDividendsOrderData struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称
OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
OrderGoodName string `json:"orderGoodName"` //订单产品名称
DividendsReturnedDate string `json:"dividendsReturnedDate"` //退货日期
RegionName string `json:"regionName"` //退货区域名称
OrderGoodPrice string `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity string `json:"orderGoodQuantity"` //订单产品数量
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
OrderTime string `json:"orderTime"` //订单日期
OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
DividendsCustomerName string `json:"dividendsCustomerName"` //订单客户名称
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderTime string `json:"orderTime"` //订单日期
RegionName string `json:"regionName"` //订单区域名称
OrderGoodQuantity string `json:"orderGoodQuantity"` //订单产品数量
OrderGoodPrice string `json:"orderGoodPrice"` //订单产品单价
Expense string `json:"expense"` //费用
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
}
// ReqImportDividendsOrder 请求参数
ReqImportDividendsOrder struct {
// 分红退货单数据
// 分红单数据
DividendsOrderData []ImportDividendsOrderData `json:"dividendsOrderData"` //分红订单数据列表
}
// DataImportDividendsOrder 响应参数
... ... @@ -41,8 +41,8 @@ type (
//ReqImportDividendsReturnedOrder 导入退货单数据
type (
ImportDividendsReturnedOrderData struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称
OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称
OrderGoodName string `json:"orderGoodName"` //订单产品名称
DividendsReturnedDate string `json:"dividendsReturnedDate"` //退货日期
RegionName string `json:"regionName"` //退货区域名称
... ...
... ... @@ -98,14 +98,14 @@ func (controller ExcelDataController) ImportDividendsOrder() {
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 2 //第二行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "OriginalOrderNum", CnName: "*来源源单号"},
{EnName: "DividendsReturnedCustomerName", CnName: "*客户名称"},
{EnName: "OriginalOrderNum", CnName: "*来源单号"},
{EnName: "DividendsCustomerName", CnName: "*客户名称"},
{EnName: "OrderGoodName", CnName: "*产品名称"},
{EnName: "DividendsReturnedDate", CnName: "*退货日期"},
{EnName: "OrderTime", CnName: "*订单日期"},
{EnName: "RegionName", CnName: "*退货区域"},
{EnName: "OrderGoodQuantity", CnName: "*退货数量"},
{EnName: "OrderGoodPrice", CnName: "*退货价格"},
{EnName: "RegionName", CnName: "*订单区域"},
{EnName: "OrderGoodQuantity", CnName: "*产品数量"},
{EnName: "OrderGoodPrice", CnName: "*产品价格"},
{EnName: "Expense", CnName: "*费用"},
{EnName: "CooperationContractNumber", CnName: "项目合约编号"},
}
excelData, err := excelImport.OpenExcelFromIoReader(excelFile)
... ... @@ -119,15 +119,15 @@ func (controller ExcelDataController) ImportDividendsOrder() {
for _, v := range excelData {
//TODO 按需转化
item := allied_creation_cooperation.ImportDividendsOrderData{
OriginalOrderNum: v["OriginalOrderNum"],
DividendsReturnedCustomerName: v["DividendsReturnedCustomerName"],
OrderGoodName: v["OrderGoodName"],
DividendsReturnedDate: v["DividendsReturnedDate"],
OrderTime: v["OrderTime"],
RegionName: v["RegionName"],
OrderGoodQuantity: v["OrderGoodQuantity"],
OrderGoodPrice: v["OrderGoodPrice"],
CooperationContractNumber: v["CooperationContractNumber"],
OriginalOrderNum: v["OriginalOrderNum"],
DividendsCustomerName: v["DividendsCustomerName"],
OrderGoodName: v["OrderGoodName"],
OrderTime: v["OrderTime"],
RegionName: v["RegionName"],
OrderGoodQuantity: v["OrderGoodQuantity"],
OrderGoodPrice: v["OrderGoodPrice"],
Expense: v["Expense"],
CooperationContractNumber: v["CooperationContractNumber"],
}
returnedOrderData = append(returnedOrderData, item)
}
... ... @@ -157,7 +157,7 @@ func (controller ExcelDataController) ImportDividendsReturnedOrder() {
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 2 //第二行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "OriginalOrderNum", CnName: "*来源单号"},
{EnName: "OriginalOrderNum", CnName: "*来源单号"},
{EnName: "DividendsReturnedCustomerName", CnName: "*客户名称"},
{EnName: "OrderGoodName", CnName: "*产品名称"},
{EnName: "DividendsReturnedDate", CnName: "*退货日期"},
... ...