正在显示
1 个修改的文件
包含
37 行增加
和
102 行删除
@@ -16,7 +16,6 @@ import ( | @@ -16,7 +16,6 @@ import ( | ||
16 | "reflect" | 16 | "reflect" |
17 | "regexp" | 17 | "regexp" |
18 | "strconv" | 18 | "strconv" |
19 | - "strings" | ||
20 | "time" | 19 | "time" |
21 | ) | 20 | ) |
22 | 21 | ||
@@ -309,7 +308,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -309,7 +308,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
309 | rowCnt++ | 308 | rowCnt++ |
310 | nullCell := make([]interface{}, 0) | 309 | nullCell := make([]interface{}, 0) |
311 | //var myRow []string | 310 | //var myRow []string |
312 | - var myRow []interface{} | 311 | + var myRow interface{} |
313 | t := reflect.TypeOf(dividendsOrder) | 312 | t := reflect.TypeOf(dividendsOrder) |
314 | v := reflect.ValueOf(dividendsOrder) | 313 | v := reflect.ValueOf(dividendsOrder) |
315 | for k := 0; k < t.NumField(); k++ { | 314 | for k := 0; k < t.NumField(); k++ { |
@@ -324,12 +323,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -324,12 +323,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
324 | } | 323 | } |
325 | if nullFlag { | 324 | if nullFlag { |
326 | s := strconv.Itoa(i + 1) | 325 | s := strconv.Itoa(i + 1) |
327 | - b := strings.Replace(strings.Trim(fmt.Sprint(nullCell), "[]"), " ", ",", -1) | ||
328 | - //myRow = append(myRow, "第"+s+"行的第"+b+"列必填项为空") // 错误信息 | ||
329 | - //myRow = append(myRow, s) // 行号 | ||
330 | - //myRow = append(myRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
331 | - myRow = append(myRow, map[string]interface{}{ | ||
332 | - "failReason": "第" + s + "行第" + b + "列订单日期格式错误,请输入正确的订单日期", | 326 | + myRow = map[string]interface{}{ |
327 | + "failReason": "第" + s + "行订单日期格式错误,请输入正确的订单日期", | ||
333 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 328 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
334 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 329 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
335 | "orderGoodName": dividendsOrder.OrderGoodName, | 330 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -339,7 +334,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -339,7 +334,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
339 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 334 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
340 | "expense": dividendsOrder.Expense, | 335 | "expense": dividendsOrder.Expense, |
341 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 336 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
342 | - }) | 337 | + } |
343 | nullCellError = append(nullCellError, myRow) | 338 | nullCellError = append(nullCellError, myRow) |
344 | nullFlag = false | 339 | nullFlag = false |
345 | } | 340 | } |
@@ -359,26 +354,21 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -359,26 +354,21 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
359 | // 单元格类型校验 | 354 | // 单元格类型校验 |
360 | typeError := make([]interface{}, 0) | 355 | typeError := make([]interface{}, 0) |
361 | for i, dividendsOrder := range importDividendsOrderCommand.DividendsOrderData { // 行 | 356 | for i, dividendsOrder := range importDividendsOrderCommand.DividendsOrderData { // 行 |
362 | - var myRow []interface{} | 357 | + var myRow interface{} |
363 | //var myRow []string | 358 | //var myRow []string |
364 | t := reflect.TypeOf(dividendsOrder) | 359 | t := reflect.TypeOf(dividendsOrder) |
365 | v := reflect.ValueOf(dividendsOrder) | 360 | v := reflect.ValueOf(dividendsOrder) |
366 | for k := 0; k < t.NumField(); k++ { // 列 | 361 | for k := 0; k < t.NumField(); k++ { // 列 |
367 | r := strconv.Itoa(i + 1) | 362 | r := strconv.Itoa(i + 1) |
368 | - col := strconv.Itoa(k + 1) | 363 | + //col := strconv.Itoa(k + 1) |
369 | switch k { | 364 | switch k { |
370 | case 3: // 订单日期校验 | 365 | case 3: // 订单日期校验 |
371 | { | 366 | { |
372 | regexpStr := `(\d{4})/(\d{2})/(\d{2})` | 367 | regexpStr := `(\d{4})/(\d{2})/(\d{2})` |
373 | ok := regexp.MustCompile(regexpStr).MatchString(fmt.Sprintf("%v", v.Field(k).Interface())) | 368 | ok := regexp.MustCompile(regexpStr).MatchString(fmt.Sprintf("%v", v.Field(k).Interface())) |
374 | if !ok { | 369 | if !ok { |
375 | - //var tmpRow []string | ||
376 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列订单日期格式错误,请输入正确的订单日期") // 错误信息 | ||
377 | - //tmpRow = append(tmpRow, r) // 行号 | ||
378 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
379 | - var tmpRow []interface{} | ||
380 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
381 | - "failReason": "第" + r + "行第" + col + "列订单日期格式错误,请输入正确的订单日期", | 370 | + tmpRow := map[string]interface{}{ |
371 | + "failReason": "第" + r + "行订单日期格式错误,请输入正确的订单日期", | ||
382 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 372 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
383 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 373 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
384 | "orderGoodName": dividendsOrder.OrderGoodName, | 374 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -388,7 +378,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -388,7 +378,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
388 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 378 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
389 | "expense": dividendsOrder.Expense, | 379 | "expense": dividendsOrder.Expense, |
390 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 380 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
391 | - }) | 381 | + } |
392 | myRow = tmpRow | 382 | myRow = tmpRow |
393 | } | 383 | } |
394 | } | 384 | } |
@@ -397,13 +387,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -397,13 +387,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
397 | //参数类型转换 | 387 | //参数类型转换 |
398 | orderGoodQuantity, err := strconv.ParseInt(fmt.Sprintf("%v", v.Field(k).Interface()), 10, 64) | 388 | orderGoodQuantity, err := strconv.ParseInt(fmt.Sprintf("%v", v.Field(k).Interface()), 10, 64) |
399 | if err != nil { | 389 | if err != nil { |
400 | - //var tmpRow []string | ||
401 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列产品数量格式错误,产品数量必须整数") // 错误信息 | ||
402 | - //tmpRow = append(tmpRow, r) // 行号 | ||
403 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
404 | - var tmpRow []interface{} | ||
405 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
406 | - "failReason": "第" + r + "行第" + col + "列产品数量格式错误,产品数量必须整数", | 390 | + tmpRow := map[string]interface{}{ |
391 | + "failReason": "第" + r + "行产品数量格式错误,产品数量必须整数", | ||
407 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 392 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
408 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 393 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
409 | "orderGoodName": dividendsOrder.OrderGoodName, | 394 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -413,18 +398,13 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -413,18 +398,13 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
413 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 398 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
414 | "expense": dividendsOrder.Expense, | 399 | "expense": dividendsOrder.Expense, |
415 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 400 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
416 | - }) | 401 | + } |
417 | myRow = tmpRow | 402 | myRow = tmpRow |
418 | } | 403 | } |
419 | // 正负判断 | 404 | // 正负判断 |
420 | if orderGoodQuantity < 0 { | 405 | if orderGoodQuantity < 0 { |
421 | - //var tmpRow []string | ||
422 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列产品数量必须大于0,请重新填写") // 错误信息 | ||
423 | - //tmpRow = append(tmpRow, r) // 行号 | ||
424 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
425 | - var tmpRow []interface{} | ||
426 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
427 | - "failReason": "第" + r + "行第" + col + "列产品数量必须大于0,请重新填写", | 406 | + tmpRow := map[string]interface{}{ |
407 | + "failReason": "第" + r + "行产品数量必须大于0,请重新填写", | ||
428 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 408 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
429 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 409 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
430 | "orderGoodName": dividendsOrder.OrderGoodName, | 410 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -434,7 +414,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -434,7 +414,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
434 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 414 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
435 | "expense": dividendsOrder.Expense, | 415 | "expense": dividendsOrder.Expense, |
436 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 416 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
437 | - }) | 417 | + } |
438 | myRow = tmpRow | 418 | myRow = tmpRow |
439 | } | 419 | } |
440 | } | 420 | } |
@@ -443,13 +423,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -443,13 +423,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
443 | // 参数类型转换 | 423 | // 参数类型转换 |
444 | univalent, typeErr := strconv.ParseFloat(fmt.Sprintf("%v", v.Field(k).Interface()), 64) | 424 | univalent, typeErr := strconv.ParseFloat(fmt.Sprintf("%v", v.Field(k).Interface()), 64) |
445 | if typeErr != nil { | 425 | if typeErr != nil { |
446 | - //var tmpRow []string | ||
447 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列产品价格格式错误,产品价格必须为数字类型") // 错误信息 | ||
448 | - //tmpRow = append(tmpRow, r) // 行号 | ||
449 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
450 | - var tmpRow []interface{} | ||
451 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
452 | - "failReason": "第" + r + "行第" + col + "列产品价格格式错误,产品价格必须为数字类型", | 426 | + tmpRow := map[string]interface{}{ |
427 | + "failReason": "第" + r + "行产品价格格式错误,产品价格必须为数字类型", | ||
453 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 428 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
454 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 429 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
455 | "orderGoodName": dividendsOrder.OrderGoodName, | 430 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -459,19 +434,14 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -459,19 +434,14 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
459 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 434 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
460 | "expense": dividendsOrder.Expense, | 435 | "expense": dividendsOrder.Expense, |
461 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 436 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
462 | - }) | 437 | + } |
463 | myRow = tmpRow | 438 | myRow = tmpRow |
464 | } | 439 | } |
465 | 440 | ||
466 | // 长度校验 | 441 | // 长度校验 |
467 | if univalent >= 1e16 { | 442 | if univalent >= 1e16 { |
468 | - //var tmpRow []string | ||
469 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数") // 错误信息 | ||
470 | - //tmpRow = append(tmpRow, r) // 行号 | ||
471 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) | ||
472 | - var tmpRow []interface{} | ||
473 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
474 | - "failReason": "第" + r + "行第" + col + "列产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数", | 443 | + tmpRow := map[string]interface{}{ |
444 | + "failReason": "第" + r + "行产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数", | ||
475 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 445 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
476 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 446 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
477 | "orderGoodName": dividendsOrder.OrderGoodName, | 447 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -481,7 +451,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -481,7 +451,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
481 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 451 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
482 | "expense": dividendsOrder.Expense, | 452 | "expense": dividendsOrder.Expense, |
483 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 453 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
484 | - }) | 454 | + } |
485 | // 错误行数据 | 455 | // 错误行数据 |
486 | myRow = tmpRow | 456 | myRow = tmpRow |
487 | } | 457 | } |
@@ -492,13 +462,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -492,13 +462,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
492 | // 参数类型转换 | 462 | // 参数类型转换 |
493 | univalent, typeErr := strconv.ParseFloat(fmt.Sprintf("%v", v.Field(k).Interface()), 64) | 463 | univalent, typeErr := strconv.ParseFloat(fmt.Sprintf("%v", v.Field(k).Interface()), 64) |
494 | if typeErr != nil { | 464 | if typeErr != nil { |
495 | - //var tmpRow []string | ||
496 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列费用格式错误,费用必须为数字类型") // 错误信息 | ||
497 | - //tmpRow = append(tmpRow, r) // 行号 | ||
498 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
499 | - var tmpRow []interface{} | ||
500 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
501 | - "failReason": "第" + r + "行第" + col + "列费用格式错误,费用必须为数字类型", | 465 | + tmpRow := map[string]interface{}{ |
466 | + "failReason": "第" + r + "行费用格式错误,费用必须为数字类型", | ||
502 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 467 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
503 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 468 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
504 | "orderGoodName": dividendsOrder.OrderGoodName, | 469 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -508,19 +473,14 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -508,19 +473,14 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
508 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 473 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
509 | "expense": dividendsOrder.Expense, | 474 | "expense": dividendsOrder.Expense, |
510 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 475 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
511 | - }) | 476 | + } |
512 | myRow = tmpRow | 477 | myRow = tmpRow |
513 | } | 478 | } |
514 | 479 | ||
515 | // 长度校验 | 480 | // 长度校验 |
516 | if univalent >= 1e16 { | 481 | if univalent >= 1e16 { |
517 | - //var tmpRow []string | ||
518 | - //tmpRow = append(tmpRow, "第"+r+"行第"+col+"列费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数") // 错误信息 | ||
519 | - //tmpRow = append(tmpRow, r) // 行号 | ||
520 | - //tmpRow = append(tmpRow, fmt.Sprintf("%v", v.Interface())) // 错误行数据 | ||
521 | - var tmpRow []interface{} | ||
522 | - tmpRow = append(tmpRow, map[string]interface{}{ | ||
523 | - "failReason": "第" + r + "行第" + col + "列费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数", | 482 | + tmpRow := map[string]interface{}{ |
483 | + "failReason": "第" + r + "行费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数", | ||
524 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 484 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
525 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 485 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
526 | "orderGoodName": dividendsOrder.OrderGoodName, | 486 | "orderGoodName": dividendsOrder.OrderGoodName, |
@@ -530,7 +490,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -530,7 +490,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
530 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 490 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
531 | "expense": dividendsOrder.Expense, | 491 | "expense": dividendsOrder.Expense, |
532 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 492 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
533 | - }) | 493 | + } |
534 | myRow = tmpRow | 494 | myRow = tmpRow |
535 | } | 495 | } |
536 | } | 496 | } |
@@ -564,13 +524,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -564,13 +524,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
564 | // 订单日期时间格式转换 | 524 | // 订单日期时间格式转换 |
565 | timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local) | 525 | timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local) |
566 | if err != nil { | 526 | if err != nil { |
567 | - //var tmpRow []string | ||
568 | - //tmpRow = append(tmpRow, "无效的订单日期") // 错误信息 | ||
569 | s := strconv.Itoa(i + 1) | 527 | s := strconv.Itoa(i + 1) |
570 | - //tmpRow = append(tmpRow, s) // 行号 | ||
571 | - //tmpRow = append(tmpRow, dividendsOrder.OriginalOrderNum) | ||
572 | - var tmpRow []interface{} | ||
573 | - tmpRow = append(tmpRow, map[string]interface{}{ | 528 | + tmpRow := map[string]interface{}{ |
574 | "failReason": "第" + s + "行无效的订单日期", | 529 | "failReason": "第" + s + "行无效的订单日期", |
575 | "originalOrderNum": dividendsOrder.OriginalOrderNum, | 530 | "originalOrderNum": dividendsOrder.OriginalOrderNum, |
576 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, | 531 | "dividendsCustomerName": dividendsOrder.DividendsCustomerName, |
@@ -581,7 +536,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -581,7 +536,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
581 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, | 536 | "orderGoodPrice": dividendsOrder.OrderGoodPrice, |
582 | "expense": dividendsOrder.Expense, | 537 | "expense": dividendsOrder.Expense, |
583 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, | 538 | "cooperationContractNumber": dividendsOrder.CooperationContractNumber, |
584 | - }) | 539 | + } |
585 | aggregateErrorList = append(aggregateErrorList, tmpRow) | 540 | aggregateErrorList = append(aggregateErrorList, tmpRow) |
586 | break | 541 | break |
587 | } | 542 | } |
@@ -704,13 +659,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -704,13 +659,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
704 | for _, errorData := range errorDataList { | 659 | for _, errorData := range errorDataList { |
705 | if len(errorData.GoodLine) == 0 { // 订单错误 | 660 | if len(errorData.GoodLine) == 0 { // 订单错误 |
706 | for _, line := range errorData.LineNumbers { | 661 | for _, line := range errorData.LineNumbers { |
707 | - //var tmpRow []string5 | ||
708 | - //tmpRow = append(tmpRow, errorData.Error.Error()) // 错误信息 | ||
709 | s := strconv.Itoa(line + 1) | 662 | s := strconv.Itoa(line + 1) |
710 | - //tmpRow = append(tmpRow, s) // 行号 | ||
711 | - //tmpRow = append(tmpRow, importDividendsOrderCommand.DividendsOrderData[line]...) // 错误行数据 | ||
712 | - var tmpRow []interface{} | ||
713 | - tmpRow = append(tmpRow, map[string]interface{}{ | 663 | + tmpRow := map[string]interface{}{ |
714 | "failReason": "第" + s + "行数据校验错误:" + errorData.Error.Error(), | 664 | "failReason": "第" + s + "行数据校验错误:" + errorData.Error.Error(), |
715 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, | 665 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, |
716 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, | 666 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, |
@@ -721,18 +671,13 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -721,18 +671,13 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
721 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, | 671 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, |
722 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, | 672 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, |
723 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, | 673 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, |
724 | - }) | 674 | + } |
725 | failureDataList = append(failureDataList, tmpRow) | 675 | failureDataList = append(failureDataList, tmpRow) |
726 | } | 676 | } |
727 | } else if len(errorData.GoodLine) > 0 { // 订单产品错误 | 677 | } else if len(errorData.GoodLine) > 0 { // 订单产品错误 |
728 | for line := range errorData.GoodLine { | 678 | for line := range errorData.GoodLine { |
729 | - //var tmpRow []string | ||
730 | - //tmpRow = append(tmpRow, errorData.Error.Error()) // 错误信息 | ||
731 | s := strconv.Itoa(line + 1) | 679 | s := strconv.Itoa(line + 1) |
732 | - //tmpRow = append(tmpRow, s) // 行号 | ||
733 | - //tmpRow = append(tmpRow, importDividendsOrderCommand.DividendsOrderData[line]...) // 错误行数据 | ||
734 | - var tmpRow []interface{} | ||
735 | - tmpRow = append(tmpRow, map[string]interface{}{ | 680 | + tmpRow := map[string]interface{}{ |
736 | "failReason": "第" + s + "行订单产品信息错误:" + errorData.Error.Error(), | 681 | "failReason": "第" + s + "行订单产品信息错误:" + errorData.Error.Error(), |
737 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, | 682 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, |
738 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, | 683 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, |
@@ -743,7 +688,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -743,7 +688,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
743 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, | 688 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, |
744 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, | 689 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, |
745 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, | 690 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, |
746 | - }) | 691 | + } |
747 | failureDataList = append(failureDataList, tmpRow) | 692 | failureDataList = append(failureDataList, tmpRow) |
748 | } | 693 | } |
749 | } | 694 | } |
@@ -862,13 +807,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -862,13 +807,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
862 | for _, errorData := range errorDataList { | 807 | for _, errorData := range errorDataList { |
863 | if len(errorData.GoodLine) == 0 { // 订单错误 | 808 | if len(errorData.GoodLine) == 0 { // 订单错误 |
864 | for _, line := range errorData.LineNumbers { | 809 | for _, line := range errorData.LineNumbers { |
865 | - //var tmpRow []string | ||
866 | - //tmpRow = append(tmpRow, errorData.Error.Error()) // 错误信息 | ||
867 | s := strconv.Itoa(line + 1) | 810 | s := strconv.Itoa(line + 1) |
868 | - //tmpRow = append(tmpRow, s) // 行号 | ||
869 | - //tmpRow = append(tmpRow, importDividendsOrderCommand.DividendsOrderData[line]...) // 错误行数据 | ||
870 | - var tmpRow []interface{} | ||
871 | - tmpRow = append(tmpRow, map[string]interface{}{ | 811 | + tmpRow := map[string]interface{}{ |
872 | "failReason": "第" + s + "行订单数据新增错误:" + errorData.Error.Error(), | 812 | "failReason": "第" + s + "行订单数据新增错误:" + errorData.Error.Error(), |
873 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, | 813 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, |
874 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, | 814 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, |
@@ -879,18 +819,13 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -879,18 +819,13 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
879 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, | 819 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, |
880 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, | 820 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, |
881 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, | 821 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, |
882 | - }) | 822 | + } |
883 | failureDataList = append(failureDataList, tmpRow) | 823 | failureDataList = append(failureDataList, tmpRow) |
884 | } | 824 | } |
885 | } else if len(errorData.GoodLine) > 0 { // 订单产品错误 | 825 | } else if len(errorData.GoodLine) > 0 { // 订单产品错误 |
886 | for line := range errorData.GoodLine { | 826 | for line := range errorData.GoodLine { |
887 | - //var tmpRow []string | ||
888 | - //tmpRow = append(tmpRow, errorData.Error.Error()) // 错误信息 | ||
889 | s := strconv.Itoa(line + 1) | 827 | s := strconv.Itoa(line + 1) |
890 | - //tmpRow = append(tmpRow, s) // 行号 | ||
891 | - //tmpRow = append(tmpRow, importDividendsOrderCommand.DividendsOrderData[line]...) // 错误行数据 | ||
892 | - var tmpRow []interface{} | ||
893 | - tmpRow = append(tmpRow, map[string]interface{}{ | 828 | + tmpRow := map[string]interface{}{ |
894 | "failReason": "第" + s + "行订单数据新增错误:" + errorData.Error.Error(), | 829 | "failReason": "第" + s + "行订单数据新增错误:" + errorData.Error.Error(), |
895 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, | 830 | "originalOrderNum": importDividendsOrderCommand.DividendsOrderData[line].OriginalOrderNum, |
896 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, | 831 | "dividendsCustomerName": importDividendsOrderCommand.DividendsOrderData[line].DividendsCustomerName, |
@@ -901,7 +836,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -901,7 +836,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
901 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, | 836 | "orderGoodPrice": importDividendsOrderCommand.DividendsOrderData[line].OrderGoodPrice, |
902 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, | 837 | "expense": importDividendsOrderCommand.DividendsOrderData[line].Expense, |
903 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, | 838 | "cooperationContractNumber": importDividendsOrderCommand.DividendsOrderData[line].CooperationContractNumber, |
904 | - }) | 839 | + } |
905 | failureDataList = append(failureDataList, tmpRow) | 840 | failureDataList = append(failureDataList, tmpRow) |
906 | } | 841 | } |
907 | } | 842 | } |
-
请 注册 或 登录 后发表评论