...
|
...
|
@@ -561,24 +561,24 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
hashValue := md5.Sum([]byte(dividendsOrder.OriginalOrderNum))
|
|
|
hashString := hex.EncodeToString(hashValue[:])
|
|
|
|
|
|
if _, ok := dividendsOrderCommands[hashString]; !ok {
|
|
|
// 订单日期时间格式转换
|
|
|
timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "无效的订单日期",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
if _, ok := dividendsOrderCommands[hashString]; !ok {
|
|
|
|
|
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
|
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品数量类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
...
|
...
|
@@ -589,8 +589,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -600,8 +600,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "费用类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
} else {
|
...
|
...
|
@@ -636,14 +636,26 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
UserBaseId: importDividendsOrderCommand.UserBaseId,
|
|
|
LineNumbers: []int{i}, // 记录行号
|
|
|
}
|
|
|
} else { // 聚合同一笔订单产品
|
|
|
|
|
|
} else if _, exist := dividendsOrderCommands[hashString]; exist { // 聚合同一笔订单产品
|
|
|
// 订单日期时间格式转换
|
|
|
timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "无效的订单日期",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
|
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品数量类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -652,8 +664,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -663,8 +675,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "费用类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
} else {
|
...
|
...
|
@@ -686,7 +698,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
})
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "同一笔订单的订单时间必须相同",
|
|
|
ImportDividendsOrderData: ÷ndsOrder,
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
log.Logger.Info("聚合订单错误:", map[string]interface{}{
|
...
|
...
|
|