|
@@ -235,9 +235,12 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) ( |
|
@@ -235,9 +235,12 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) ( |
235
|
}); err != nil {
|
235
|
}); err != nil {
|
236
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
236
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
237
|
}
|
237
|
}
|
238
|
-
|
238
|
+ goodNames := []string{}
|
|
|
239
|
+ for _, v := range cmd.Goods {
|
|
|
240
|
+ goodNames = append(goodNames, v.GoodName)
|
|
|
241
|
+ }
|
239
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
242
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
240
|
- cmd.PartnerCategory, cmd.PartnerId, 0); err != nil {
|
243
|
+ cmd.PartnerCategory, cmd.PartnerId, 0, goodNames); err != nil {
|
241
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
244
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
242
|
} else if ok {
|
245
|
} else if ok {
|
243
|
return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单已存在")
|
246
|
return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单已存在")
|
|
@@ -447,8 +450,13 @@ func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) |
|
@@ -447,8 +450,13 @@ func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) |
447
|
// return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单号已存在")
|
450
|
// return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单号已存在")
|
448
|
// }
|
451
|
// }
|
449
|
// }
|
452
|
// }
|
|
|
453
|
+ goodNames := []string{}
|
|
|
454
|
+ for _, v := range cmd.Goods {
|
|
|
455
|
+ goodNames = append(goodNames, v.GoodName)
|
|
|
456
|
+ }
|
450
|
//检查delivery_code是否重复
|
457
|
//检查delivery_code是否重复
|
451
|
- if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode, cmd.PartnerCategory, cmd.PartnerId, cmd.Id); err != nil {
|
458
|
+ if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
|
|
459
|
+ cmd.PartnerCategory, cmd.PartnerId, cmd.Id, goodNames); err != nil {
|
452
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
460
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
453
|
} else if ok {
|
461
|
} else if ok {
|
454
|
return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单已存在")
|
462
|
return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单已存在")
|
|
@@ -1056,10 +1064,13 @@ func (service OrderInfoService) CreateNewOrderByImport(createOrderCommands []*co |
|
@@ -1056,10 +1064,13 @@ func (service OrderInfoService) CreateNewOrderByImport(createOrderCommands []*co |
1056
|
errorDataList = append(errorDataList, row)
|
1064
|
errorDataList = append(errorDataList, row)
|
1057
|
continue
|
1065
|
continue
|
1058
|
}
|
1066
|
}
|
1059
|
-
|
1067
|
+ goodNames := []string{}
|
|
|
1068
|
+ for _, v := range cmd.Goods {
|
|
|
1069
|
+ goodNames = append(goodNames, v.GoodName)
|
|
|
1070
|
+ }
|
1060
|
// 批量校验订单
|
1071
|
// 批量校验订单
|
1061
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
1072
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
1062
|
- cmd.PartnerCategory, cmd.PartnerId, 0); err != nil {
|
1073
|
+ cmd.PartnerCategory, cmd.PartnerId, 0, goodNames); err != nil {
|
1063
|
row := &domain.ImportInfo{
|
1074
|
row := &domain.ImportInfo{
|
1064
|
Error: lib.ThrowError(lib.TRANSACTION_ERROR, err.Error()),
|
1075
|
Error: lib.ThrowError(lib.TRANSACTION_ERROR, err.Error()),
|
1065
|
LineNumbers: cmd.LineNumbers, // 错误影响的行
|
1076
|
LineNumbers: cmd.LineNumbers, // 错误影响的行
|