...
|
...
|
@@ -13,6 +13,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/dao"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
|
|
|
"reflect"
|
|
|
"regexp"
|
|
|
"strconv"
|
...
|
...
|
@@ -308,7 +309,6 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
rowCnt++
|
|
|
nullCell := make([]interface{}, 0)
|
|
|
//var myRow []string
|
|
|
var myRow interface{}
|
|
|
t := reflect.TypeOf(dividendsOrder)
|
|
|
v := reflect.ValueOf(dividendsOrder)
|
|
|
for k := 0; k < t.NumField(); k++ {
|
...
|
...
|
@@ -322,19 +322,10 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
}
|
|
|
}
|
|
|
if nullFlag {
|
|
|
s := strconv.Itoa(i + 1)
|
|
|
myRow = map[string]interface{}{
|
|
|
"failReason": "第" + s + "行订单日期格式错误,请输入正确的订单日期",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
myRow := &domain.FailInfo{
|
|
|
FailReason: "订单日期格式错误,请输入正确的订单日期",
|
|
|
}
|
|
|
myRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[i]
|
|
|
nullCellError = append(nullCellError, myRow)
|
|
|
nullFlag = false
|
|
|
}
|
...
|
...
|
@@ -354,32 +345,22 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
// 单元格类型校验
|
|
|
typeError := make([]interface{}, 0)
|
|
|
for i, dividendsOrder := range importDividendsOrderCommand.DividendsOrderData { // 行
|
|
|
var myRow interface{}
|
|
|
//var myRow []string
|
|
|
var myRow []*domain.FailInfo
|
|
|
t := reflect.TypeOf(dividendsOrder)
|
|
|
v := reflect.ValueOf(dividendsOrder)
|
|
|
for k := 0; k < t.NumField(); k++ { // 列
|
|
|
r := strconv.Itoa(i + 1)
|
|
|
//col := strconv.Itoa(k + 1)
|
|
|
switch k {
|
|
|
case 3: // 订单日期校验
|
|
|
{
|
|
|
regexpStr := `(\d{4})/(\d{2})/(\d{2})`
|
|
|
ok := regexp.MustCompile(regexpStr).MatchString(fmt.Sprintf("%v", v.Field(k).Interface()))
|
|
|
if !ok {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行订单日期格式错误,请输入正确的订单日期",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "订单日期格式错误,请输入正确的订单日期",
|
|
|
}
|
|
|
myRow = tmpRow
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
}
|
|
|
}
|
|
|
case 5: // 产品数量校验
|
...
|
...
|
@@ -387,35 +368,19 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
//参数类型转换
|
|
|
orderGoodQuantity, err := strconv.ParseInt(fmt.Sprintf("%v", v.Field(k).Interface()), 10, 64)
|
|
|
if err != nil {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行产品数量格式错误,产品数量必须整数",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
}
|
|
|
myRow = tmpRow
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "行产品数量格式错误,产品数量必须整数",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
}
|
|
|
// 正负判断
|
|
|
if orderGoodQuantity < 0 {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行产品数量必须大于0,请重新填写",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品数量必须大于0,请重新填写",
|
|
|
}
|
|
|
myRow = tmpRow
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
}
|
|
|
}
|
|
|
case 6: // 产品价格校验
|
...
|
...
|
@@ -423,37 +388,21 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
// 参数类型转换
|
|
|
univalent, typeErr := strconv.ParseFloat(fmt.Sprintf("%v", v.Field(k).Interface()), 64)
|
|
|
if typeErr != nil {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行产品价格格式错误,产品价格必须为数字类型",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格格式错误,产品价格必须为数字类型",
|
|
|
}
|
|
|
myRow = tmpRow
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
}
|
|
|
|
|
|
// 长度校验
|
|
|
if univalent >= 1e16 {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "第" + r + "行产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
// 错误行数据
|
|
|
myRow = tmpRow
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
}
|
|
|
}
|
|
|
case 7: // 费用校验
|
...
|
...
|
@@ -462,36 +411,22 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
// 参数类型转换
|
|
|
univalent, typeErr := strconv.ParseFloat(fmt.Sprintf("%v", v.Field(k).Interface()), 64)
|
|
|
if typeErr != nil {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行费用格式错误,费用必须为数字类型",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "第" + r + "行费用格式错误,费用必须为数字类型",
|
|
|
}
|
|
|
myRow = tmpRow
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
log.Logger.Info("费用类型错误", map[string]interface{}{
|
|
|
"tmpRow": tmpRow,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
// 长度校验
|
|
|
if univalent >= 1e16 {
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + r + "行费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "第" + r + "行费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数",
|
|
|
}
|
|
|
myRow = tmpRow
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
myRow = append(myRow, tmpRow)
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -524,19 +459,11 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
// 订单日期时间格式转换
|
|
|
timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
|
|
if err != nil {
|
|
|
s := strconv.Itoa(i + 1)
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + s + "行无效的订单日期",
|
|
|
"originalOrderNum": dividendsOrder.OriginalOrderNum,
|
|
|
"dividendsCustomerName": dividendsOrder.DividendsCustomerName,
|
|
|
"orderGoodName": dividendsOrder.OrderGoodName,
|
|
|
"orderTime": dividendsOrder.OrderTime,
|
|
|
"regionName": dividendsOrder.RegionName,
|
|
|
"orderGoodQuantity": dividendsOrder.OrderGoodQuantity,
|
|
|
"orderGoodPrice": dividendsOrder.OrderGoodPrice,
|
|
|
"expense": dividendsOrder.Expense,
|
|
|
"cooperationContractNumber": dividendsOrder.CooperationContractNumber,
|
|
|
//s := strconv.Itoa(i + 1)
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "无效的订单日期",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
break
|
|
|
}
|
...
|
...
|
@@ -659,36 +586,20 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
for _, errorData := range errorDataList {
|
|
|
if len(errorData.GoodLine) == 0 { // 订单错误
|
|
|
for _, line := range errorData.LineNumbers {
|
|
|
s := strconv.Itoa(line + 1)
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + s + "行数据校验错误:" + errorData.Error.Error(),
|
|
|
"originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum,
|
|
|
"dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName,
|
|
|
"orderGoodName": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodName,
|
|
|
"orderTime": importDividendsOrderCommand.DividendsOrderData[line].OrderTime,
|
|
|
"regionName": importDividendsOrderCommand.DividendsOrderData[line].RegionName,
|
|
|
"orderGoodQuantity": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodQuantity,
|
|
|
"orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice,
|
|
|
"expense": importDividendsOrderCommand.DividendsOrderData[line].Expense,
|
|
|
"cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber,
|
|
|
//s := strconv.Itoa(line + 1)
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "数据校验错误:" + errorData.Error.Error(),
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[line]
|
|
|
failureDataList = append(failureDataList, tmpRow)
|
|
|
}
|
|
|
} else if len(errorData.GoodLine) > 0 { // 订单产品错误
|
|
|
for line := range errorData.GoodLine {
|
|
|
s := strconv.Itoa(line + 1)
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + s + "行订单产品信息错误:" + errorData.Error.Error(),
|
|
|
"originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum,
|
|
|
"dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName,
|
|
|
"orderGoodName": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodName,
|
|
|
"orderTime": importDividendsOrderCommand.DividendsOrderData[line].OrderTime,
|
|
|
"regionName": importDividendsOrderCommand.DividendsOrderData[line].RegionName,
|
|
|
"orderGoodQuantity": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodQuantity,
|
|
|
"orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice,
|
|
|
"expense": importDividendsOrderCommand.DividendsOrderData[line].Expense,
|
|
|
"cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber,
|
|
|
//s := strconv.Itoa(line + 1)
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "订单产品信息错误:" + errorData.Error.Error(),
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[line]
|
|
|
failureDataList = append(failureDataList, tmpRow)
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -736,15 +647,18 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
// 新增订单产品
|
|
|
var orderGoods []*domain.OrderGood
|
|
|
var dividendsOrderAmount float64
|
|
|
for _, orderGood := range dividendsOrder.OrderGoods {
|
|
|
orderGoodErrMap := make(map[int]interface{}, 0)
|
|
|
for i, orderGood := range dividendsOrder.OrderGoods {
|
|
|
// 校验共创合约是否合法
|
|
|
if orderGood.CooperationContractNumber != "" {
|
|
|
contractNumberExist, _ := cooperationContractDao.CheckContractNumberExist(map[string]interface{}{
|
|
|
"companyId": importDividendsOrderCommand.CompanyId,
|
|
|
"orgId": importDividendsOrderCommand.OrgId,
|
|
|
"cooperationContractNumber": orderGood.CooperationContractNumber,
|
|
|
})
|
|
|
if !contractNumberExist {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "共创合约编号不存在")
|
|
|
orderGoodErrMap[dividendsOrder.OrderGoods[i].LineNumber] = application.ThrowError(application.INTERNAL_SERVER_ERROR, fmt.Sprintf("共创合约编号不存在:%s", err))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
orderGoods = append(orderGoods, &domain.OrderGood{
|
...
|
...
|
@@ -767,6 +681,15 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
// 计算分红订单金额
|
|
|
dividendsOrderAmount = dividendsOrderAmount + orderGood.OrderGoodAmount
|
|
|
}
|
|
|
if len(orderGoodErrMap) > 0 {
|
|
|
row := &domain.ImportInfo{
|
|
|
Error: application.ThrowError(application.BUSINESS_ERROR, "共创合约不存在"),
|
|
|
LineNumbers: dividendsOrder.LineNumbers, // 错误影响的行
|
|
|
GoodLine: orderGoodErrMap, // 错误产品行号记录
|
|
|
}
|
|
|
errorDataList = append(errorDataList, row)
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
// 订单时间转换
|
|
|
orderTimeInt, err := strconv.ParseInt(dividendsOrder.OrderTime, 10, 64)
|
...
|
...
|
@@ -817,7 +740,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
}
|
|
|
|
|
|
// 错误报告处理
|
|
|
if len(errorDataList) <= 0 {
|
|
|
if len(errorDataList) <= 0 { // 成功返回
|
|
|
if err3 := transactionContext.CommitTransaction(); err3 != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err3.Error())
|
|
|
}
|
...
|
...
|
@@ -825,45 +748,29 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if successDataCount == int64(rowCnt) {
|
|
|
return map[string]interface{}{
|
|
|
"successCount": successDataCount,
|
|
|
"fail": nil,
|
|
|
"fail": map[string]interface{}{},
|
|
|
}, nil
|
|
|
}
|
|
|
} else {
|
|
|
} else { // 失败返回
|
|
|
successDataCount = 0
|
|
|
// 错误记录处理
|
|
|
for _, errorData := range errorDataList {
|
|
|
if len(errorData.GoodLine) == 0 { // 订单错误
|
|
|
for _, line := range errorData.LineNumbers {
|
|
|
s := strconv.Itoa(line + 1)
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + s + "行订单数据新增错误:" + errorData.Error.Error(),
|
|
|
"originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum,
|
|
|
"dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName,
|
|
|
"orderGoodName": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodName,
|
|
|
"orderTime": importDividendsOrderCommand.DividendsOrderData[line].OrderTime,
|
|
|
"regionName": importDividendsOrderCommand.DividendsOrderData[line].RegionName,
|
|
|
"orderGoodQuantity": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodQuantity,
|
|
|
"orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice,
|
|
|
"expense": importDividendsOrderCommand.DividendsOrderData[line].Expense,
|
|
|
"cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber,
|
|
|
//s := strconv.Itoa(line + 1)
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "订单数据新增错误:" + errorData.Error.Error(),
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[line]
|
|
|
failureDataList = append(failureDataList, tmpRow)
|
|
|
}
|
|
|
} else if len(errorData.GoodLine) > 0 { // 订单产品错误
|
|
|
for line := range errorData.GoodLine {
|
|
|
s := strconv.Itoa(line + 1)
|
|
|
tmpRow := map[string]interface{}{
|
|
|
"failReason": "第" + s + "行订单数据新增错误:" + errorData.Error.Error(),
|
|
|
"originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum,
|
|
|
"dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName,
|
|
|
"orderGoodName": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodName,
|
|
|
"orderTime": importDividendsOrderCommand.DividendsOrderData[line].OrderTime,
|
|
|
"regionName": importDividendsOrderCommand.DividendsOrderData[line].RegionName,
|
|
|
"orderGoodQuantity": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodQuantity,
|
|
|
"orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice,
|
|
|
"expense": importDividendsOrderCommand.DividendsOrderData[line].Expense,
|
|
|
"cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber,
|
|
|
//s := strconv.Itoa(line + 1)
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "订单数据新增错误:" + errorData.Error.Error(),
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = &importDividendsOrderCommand.DividendsOrderData[line]
|
|
|
failureDataList = append(failureDataList, tmpRow)
|
|
|
}
|
|
|
}
|
...
|
...
|
|