作者 陈志颖

refactor:调整订单导入

@@ -11,19 +11,19 @@ import ( @@ -11,19 +11,19 @@ import (
11 // ReqImportDividendsOrder 导入订单数据 11 // ReqImportDividendsOrder 导入订单数据
12 type ( 12 type (
13 ImportDividendsOrderData struct { 13 ImportDividendsOrderData struct {
14 - DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称  
15 - OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号  
16 - OrderGoodName string `json:"orderGoodName"` //订单产品名称  
17 - DividendsReturnedDate string `json:"dividendsReturnedDate"` //退货日期  
18 - RegionName string `json:"regionName"` //退货区域名称  
19 - OrderGoodPrice string `json:"orderGoodPrice"` //订单产品单价  
20 - OrderGoodQuantity string `json:"orderGoodQuantity"` //订单产品数量  
21 - CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号  
22 - OrderTime string `json:"orderTime"` //订单日期 14 + OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
  15 + DividendsCustomerName string `json:"dividendsCustomerName"` //订单客户名称
  16 + OrderGoodName string `json:"orderGoodName"` //订单产品名称
  17 + OrderTime string `json:"orderTime"` //订单日期
  18 + RegionName string `json:"regionName"` //订单区域名称
  19 + OrderGoodQuantity string `json:"orderGoodQuantity"` //订单产品数量
  20 + OrderGoodPrice string `json:"orderGoodPrice"` //订单产品单价
  21 + Expense string `json:"expense"` //费用
  22 + CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
23 } 23 }
24 // ReqImportDividendsOrder 请求参数 24 // ReqImportDividendsOrder 请求参数
25 ReqImportDividendsOrder struct { 25 ReqImportDividendsOrder struct {
26 - // 分红退货单数据 26 + // 分红单数据
27 DividendsOrderData []ImportDividendsOrderData `json:"dividendsOrderData"` //分红订单数据列表 27 DividendsOrderData []ImportDividendsOrderData `json:"dividendsOrderData"` //分红订单数据列表
28 } 28 }
29 // DataImportDividendsOrder 响应参数 29 // DataImportDividendsOrder 响应参数
@@ -41,8 +41,8 @@ type ( @@ -41,8 +41,8 @@ type (
41 //ReqImportDividendsReturnedOrder 导入退货单数据 41 //ReqImportDividendsReturnedOrder 导入退货单数据
42 type ( 42 type (
43 ImportDividendsReturnedOrderData struct { 43 ImportDividendsReturnedOrderData struct {
44 - DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称  
45 OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号 44 OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
  45 + DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称
46 OrderGoodName string `json:"orderGoodName"` //订单产品名称 46 OrderGoodName string `json:"orderGoodName"` //订单产品名称
47 DividendsReturnedDate string `json:"dividendsReturnedDate"` //退货日期 47 DividendsReturnedDate string `json:"dividendsReturnedDate"` //退货日期
48 RegionName string `json:"regionName"` //退货区域名称 48 RegionName string `json:"regionName"` //退货区域名称
@@ -98,14 +98,14 @@ func (controller ExcelDataController) ImportDividendsOrder() { @@ -98,14 +98,14 @@ func (controller ExcelDataController) ImportDividendsOrder() {
98 excelImport := excel.NewExcelImport() 98 excelImport := excel.NewExcelImport()
99 excelImport.RowBegin = 2 //第二行开始读取 99 excelImport.RowBegin = 2 //第二行开始读取
100 excelImport.DataFields = []excel.DataField{ 100 excelImport.DataFields = []excel.DataField{
101 - {EnName: "OriginalOrderNum", CnName: "*来源源单号"},  
102 - {EnName: "DividendsReturnedCustomerName", CnName: "*客户名称"}, 101 + {EnName: "OriginalOrderNum", CnName: "*来源单号"},
  102 + {EnName: "DividendsCustomerName", CnName: "*客户名称"},
103 {EnName: "OrderGoodName", CnName: "*产品名称"}, 103 {EnName: "OrderGoodName", CnName: "*产品名称"},
104 - {EnName: "DividendsReturnedDate", CnName: "*退货日期"},  
105 {EnName: "OrderTime", CnName: "*订单日期"}, 104 {EnName: "OrderTime", CnName: "*订单日期"},
106 - {EnName: "RegionName", CnName: "*退货区域"},  
107 - {EnName: "OrderGoodQuantity", CnName: "*退货数量"},  
108 - {EnName: "OrderGoodPrice", CnName: "*退货价格"}, 105 + {EnName: "RegionName", CnName: "*订单区域"},
  106 + {EnName: "OrderGoodQuantity", CnName: "*产品数量"},
  107 + {EnName: "OrderGoodPrice", CnName: "*产品价格"},
  108 + {EnName: "Expense", CnName: "*费用"},
109 {EnName: "CooperationContractNumber", CnName: "项目合约编号"}, 109 {EnName: "CooperationContractNumber", CnName: "项目合约编号"},
110 } 110 }
111 excelData, err := excelImport.OpenExcelFromIoReader(excelFile) 111 excelData, err := excelImport.OpenExcelFromIoReader(excelFile)
@@ -119,15 +119,15 @@ func (controller ExcelDataController) ImportDividendsOrder() { @@ -119,15 +119,15 @@ func (controller ExcelDataController) ImportDividendsOrder() {
119 for _, v := range excelData { 119 for _, v := range excelData {
120 //TODO 按需转化 120 //TODO 按需转化
121 item := allied_creation_cooperation.ImportDividendsOrderData{ 121 item := allied_creation_cooperation.ImportDividendsOrderData{
122 - OriginalOrderNum: v["OriginalOrderNum"],  
123 - DividendsReturnedCustomerName: v["DividendsReturnedCustomerName"],  
124 - OrderGoodName: v["OrderGoodName"],  
125 - DividendsReturnedDate: v["DividendsReturnedDate"],  
126 - OrderTime: v["OrderTime"],  
127 - RegionName: v["RegionName"],  
128 - OrderGoodQuantity: v["OrderGoodQuantity"],  
129 - OrderGoodPrice: v["OrderGoodPrice"],  
130 - CooperationContractNumber: v["CooperationContractNumber"], 122 + OriginalOrderNum: v["OriginalOrderNum"],
  123 + DividendsCustomerName: v["DividendsCustomerName"],
  124 + OrderGoodName: v["OrderGoodName"],
  125 + OrderTime: v["OrderTime"],
  126 + RegionName: v["RegionName"],
  127 + OrderGoodQuantity: v["OrderGoodQuantity"],
  128 + OrderGoodPrice: v["OrderGoodPrice"],
  129 + Expense: v["Expense"],
  130 + CooperationContractNumber: v["CooperationContractNumber"],
131 } 131 }
132 returnedOrderData = append(returnedOrderData, item) 132 returnedOrderData = append(returnedOrderData, item)
133 } 133 }
@@ -157,7 +157,7 @@ func (controller ExcelDataController) ImportDividendsReturnedOrder() { @@ -157,7 +157,7 @@ func (controller ExcelDataController) ImportDividendsReturnedOrder() {
157 excelImport := excel.NewExcelImport() 157 excelImport := excel.NewExcelImport()
158 excelImport.RowBegin = 2 //第二行开始读取 158 excelImport.RowBegin = 2 //第二行开始读取
159 excelImport.DataFields = []excel.DataField{ 159 excelImport.DataFields = []excel.DataField{
160 - {EnName: "OriginalOrderNum", CnName: "*来源单号"}, 160 + {EnName: "OriginalOrderNum", CnName: "*来源单号"},
161 {EnName: "DividendsReturnedCustomerName", CnName: "*客户名称"}, 161 {EnName: "DividendsReturnedCustomerName", CnName: "*客户名称"},
162 {EnName: "OrderGoodName", CnName: "*产品名称"}, 162 {EnName: "OrderGoodName", CnName: "*产品名称"},
163 {EnName: "DividendsReturnedDate", CnName: "*退货日期"}, 163 {EnName: "DividendsReturnedDate", CnName: "*退货日期"},