|
@@ -561,24 +561,24 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -561,24 +561,24 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
561
|
hashValue := md5.Sum([]byte(dividendsOrder.OriginalOrderNum))
|
561
|
hashValue := md5.Sum([]byte(dividendsOrder.OriginalOrderNum))
|
562
|
hashString := hex.EncodeToString(hashValue[:])
|
562
|
hashString := hex.EncodeToString(hashValue[:])
|
563
|
|
563
|
|
|
|
564
|
+ if _, ok := dividendsOrderCommands[hashString]; !ok {
|
564
|
// 订单日期时间格式转换
|
565
|
// 订单日期时间格式转换
|
565
|
timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
566
|
timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
566
|
if err != nil {
|
567
|
if err != nil {
|
567
|
tmpRow := &domain.FailInfo{
|
568
|
tmpRow := &domain.FailInfo{
|
568
|
FailReason: "无效的订单日期",
|
569
|
FailReason: "无效的订单日期",
|
|
|
570
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
569
|
}
|
571
|
}
|
570
|
- tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
571
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
572
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
572
|
continue
|
573
|
continue
|
573
|
}
|
574
|
}
|
574
|
|
575
|
|
575
|
- if _, ok := dividendsOrderCommands[hashString]; !ok {
|
|
|
576
|
-
|
|
|
577
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
576
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
578
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
577
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
579
|
if err != nil {
|
578
|
if err != nil {
|
580
|
tmpRow := &domain.FailInfo{
|
579
|
tmpRow := &domain.FailInfo{
|
581
|
FailReason: "产品数量类型错误",
|
580
|
FailReason: "产品数量类型错误",
|
|
|
581
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
582
|
}
|
582
|
}
|
583
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
583
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
584
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
584
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
@@ -589,8 +589,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -589,8 +589,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
589
|
if err != nil {
|
589
|
if err != nil {
|
590
|
tmpRow := &domain.FailInfo{
|
590
|
tmpRow := &domain.FailInfo{
|
591
|
FailReason: "产品价格类型错误",
|
591
|
FailReason: "产品价格类型错误",
|
|
|
592
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
592
|
}
|
593
|
}
|
593
|
- tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
594
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
594
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
595
|
continue
|
595
|
continue
|
596
|
}
|
596
|
}
|
|
@@ -600,8 +600,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -600,8 +600,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
600
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
600
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
601
|
tmpRow := &domain.FailInfo{
|
601
|
tmpRow := &domain.FailInfo{
|
602
|
FailReason: "费用类型错误",
|
602
|
FailReason: "费用类型错误",
|
|
|
603
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
603
|
}
|
604
|
}
|
604
|
- tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
605
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
605
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
606
|
continue
|
606
|
continue
|
607
|
} else {
|
607
|
} else {
|
|
@@ -636,14 +636,26 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -636,14 +636,26 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
636
|
UserBaseId: importDividendsOrderCommand.UserBaseId,
|
636
|
UserBaseId: importDividendsOrderCommand.UserBaseId,
|
637
|
LineNumbers: []int{i}, // 记录行号
|
637
|
LineNumbers: []int{i}, // 记录行号
|
638
|
}
|
638
|
}
|
639
|
- } else { // 聚合同一笔订单产品
|
639
|
+
|
|
|
640
|
+ } else if _, exist := dividendsOrderCommands[hashString]; exist { // 聚合同一笔订单产品
|
|
|
641
|
+ // 订单日期时间格式转换
|
|
|
642
|
+ timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
|
|
643
|
+ if err != nil {
|
|
|
644
|
+ tmpRow := &domain.FailInfo{
|
|
|
645
|
+ FailReason: "无效的订单日期",
|
|
|
646
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
647
|
+ }
|
|
|
648
|
+ aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
649
|
+ continue
|
|
|
650
|
+ }
|
|
|
651
|
+
|
640
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
652
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
641
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
653
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
642
|
if err != nil {
|
654
|
if err != nil {
|
643
|
tmpRow := &domain.FailInfo{
|
655
|
tmpRow := &domain.FailInfo{
|
644
|
FailReason: "产品数量类型错误",
|
656
|
FailReason: "产品数量类型错误",
|
|
|
657
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
645
|
}
|
658
|
}
|
646
|
- tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
647
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
659
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
648
|
continue
|
660
|
continue
|
649
|
}
|
661
|
}
|
|
@@ -652,8 +664,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -652,8 +664,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
652
|
if err != nil {
|
664
|
if err != nil {
|
653
|
tmpRow := &domain.FailInfo{
|
665
|
tmpRow := &domain.FailInfo{
|
654
|
FailReason: "产品价格类型错误",
|
666
|
FailReason: "产品价格类型错误",
|
|
|
667
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
655
|
}
|
668
|
}
|
656
|
- tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
657
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
669
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
658
|
continue
|
670
|
continue
|
659
|
}
|
671
|
}
|
|
@@ -663,8 +675,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -663,8 +675,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
663
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
675
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
664
|
tmpRow := &domain.FailInfo{
|
676
|
tmpRow := &domain.FailInfo{
|
665
|
FailReason: "费用类型错误",
|
677
|
FailReason: "费用类型错误",
|
|
|
678
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
666
|
}
|
679
|
}
|
667
|
- tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
668
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
680
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
669
|
continue
|
681
|
continue
|
670
|
} else {
|
682
|
} else {
|
|
@@ -686,7 +698,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
@@ -686,7 +698,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
686
|
})
|
698
|
})
|
687
|
tmpRow := &domain.FailInfo{
|
699
|
tmpRow := &domain.FailInfo{
|
688
|
FailReason: "同一笔订单的订单时间必须相同",
|
700
|
FailReason: "同一笔订单的订单时间必须相同",
|
689
|
- ImportDividendsOrderData: ÷ndsOrder,
|
701
|
+ ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
690
|
}
|
702
|
}
|
691
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
703
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
692
|
log.Logger.Info("聚合订单错误:", map[string]interface{}{
|
704
|
log.Logger.Info("聚合订单错误:", map[string]interface{}{
|