...
|
...
|
@@ -235,9 +235,12 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) ( |
|
|
}); err != nil {
|
|
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
goodNames := []string{}
|
|
|
for _, v := range cmd.Goods {
|
|
|
goodNames = append(goodNames, v.GoodName)
|
|
|
}
|
|
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
|
|
cmd.PartnerCategory, cmd.PartnerId, 0); err != nil {
|
|
|
cmd.PartnerCategory, cmd.PartnerId, 0, goodNames); err != nil {
|
|
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
} else if ok {
|
|
|
return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单已存在")
|
...
|
...
|
@@ -447,8 +450,13 @@ func (service OrderInfoService) UpdateOrderData(cmd command.UpdateOrderCommand) |
|
|
// return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单号已存在")
|
|
|
// }
|
|
|
// }
|
|
|
goodNames := []string{}
|
|
|
for _, v := range cmd.Goods {
|
|
|
goodNames = append(goodNames, v.GoodName)
|
|
|
}
|
|
|
//检查delivery_code是否重复
|
|
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode, cmd.PartnerCategory, cmd.PartnerId, cmd.Id); err != nil {
|
|
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
|
|
cmd.PartnerCategory, cmd.PartnerId, cmd.Id, goodNames); err != nil {
|
|
|
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
} else if ok {
|
|
|
return nil, lib.ThrowError(lib.BUSINESS_ERROR, "订单已存在")
|
...
|
...
|
@@ -1056,10 +1064,13 @@ func (service OrderInfoService) CreateNewOrderByImport(createOrderCommands []*co |
|
|
errorDataList = append(errorDataList, row)
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
goodNames := []string{}
|
|
|
for _, v := range cmd.Goods {
|
|
|
goodNames = append(goodNames, v.GoodName)
|
|
|
}
|
|
|
// 批量校验订单
|
|
|
if ok, err := orderBaseDao.CheckOrderExist(cmd.CompanyId, cmd.OrderCode, cmd.DeliveryCode,
|
|
|
cmd.PartnerCategory, cmd.PartnerId, 0); err != nil {
|
|
|
cmd.PartnerCategory, cmd.PartnerId, 0, goodNames); err != nil {
|
|
|
row := &domain.ImportInfo{
|
|
|
Error: lib.ThrowError(lib.TRANSACTION_ERROR, err.Error()),
|
|
|
LineNumbers: cmd.LineNumbers, // 错误影响的行
|
...
|
...
|
|