...
|
...
|
@@ -561,24 +561,24 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
hashValue := md5.Sum([]byte(dividendsOrder.OriginalOrderNum))
|
|
|
hashString := hex.EncodeToString(hashValue[:])
|
|
|
|
|
|
// 订单日期时间格式转换
|
|
|
timeValue, err := time.ParseInLocation("2006/01/02", dividendsOrder.OrderTime, time.Local)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "无效的订单日期",
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
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],
|
|
|
}
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
// 产品相关:产品名称,产品数量、产品价格、费用
|
|
|
quantity, err := strconv.ParseFloat(dividendsOrder.OrderGoodQuantity, 64)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品数量类型错误",
|
|
|
FailReason: "产品数量类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
...
|
...
|
@@ -588,9 +588,9 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
price, err := strconv.ParseFloat(dividendsOrder.OrderGoodPrice, 64)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格类型错误",
|
|
|
FailReason: "产品价格类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -599,9 +599,9 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if dividendsOrder.Expense != "" {
|
|
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "费用类型错误",
|
|
|
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: "产品数量类型错误",
|
|
|
FailReason: "产品数量类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -651,9 +663,9 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
price, err := strconv.ParseFloat(dividendsOrder.OrderGoodPrice, 64)
|
|
|
if err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "产品价格类型错误",
|
|
|
FailReason: "产品价格类型错误",
|
|
|
ImportDividendsOrderData: &importDividendsOrderCommand.DividendsOrderData[i],
|
|
|
}
|
|
|
tmpRow.ImportDividendsOrderData = ÷ndsOrder
|
|
|
aggregateErrorList = append(aggregateErrorList, tmpRow)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -662,9 +674,9 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD |
|
|
if dividendsOrder.Expense != "" {
|
|
|
if expenseParse, err := strconv.ParseFloat(dividendsOrder.Expense, 64); err != nil {
|
|
|
tmpRow := &domain.FailInfo{
|
|
|
FailReason: "费用类型错误",
|
|
|
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{}{
|
...
|
...
|
|