...
|
...
|
@@ -439,10 +439,11 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
|
|
|
/***************************************************** 3.单元格类型校验 *********************************************/
|
|
|
typeError := make([]*domain.FailInfo, 0)
|
|
|
for _, dividendsOrder := range importDividendsOrderCommand.DividendsOrderData { // 行
|
|
|
var myRow []*domain.FailInfo
|
|
|
|
|
|
for j, dividendsOrder := range importDividendsOrderCommand.DividendsOrderData { // 行
|
|
|
t := reflect.TypeOf(dividendsOrder)
|
|
|
v := reflect.ValueOf(dividendsOrder)
|
|
|
var myRow []*domain.FailInfo
|
|
|
for k := 0; k < t.NumField(); k++ { // 列
|
|
|
//r := strconv.Itoa(i + 1)
|
|
|
switch k {
|
...
|
...
|
@@ -454,7 +455,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "订单日期格式错误,请输入正确的订单日期",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -467,7 +468,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "行产品数量格式错误,产品数量必须整数",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -476,7 +477,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品数量必须大于0,请重新填写",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -489,7 +490,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格格式错误,产品价格必须为数字类型",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -499,7 +500,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -508,7 +509,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格必须大于0,请重新填写",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -522,7 +523,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "费用格式错误,费用必须为数字类型",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
log.Logger.Info("费用类型错误", map[string]interface{}{
|
|
|
"tmpRow": tmpRow,
|
...
|
...
|
@@ -534,7 +535,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[j]
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
|