去掉创建销售订单的根据订单id验重逻辑
This commit is contained in:
parent
319d8e02f6
commit
ec19b6bba5
@ -1422,16 +1422,17 @@ func (s *ProcessService) CreateSalesOrderWithDetail(req systemReq.SalesOrderCrea
|
||||
}
|
||||
|
||||
// 防重检查:如果 AssociationOrderID 不为0,检查是否已存在相同订单
|
||||
if req.AssociationOrderID != 0 {
|
||||
var existingOrder models.SalesOrder
|
||||
if err := tx.Where("association_order_id = ? AND is_del = 0", req.AssociationOrderID).First(&existingOrder).Error; err == nil {
|
||||
// 订单已存在,直接返回已有订单ID(幂等处理)
|
||||
salesOrderID = existingOrder.ID
|
||||
return nil
|
||||
} else if err != gorm.ErrRecordNotFound {
|
||||
return fmt.Errorf("查询重复订单失败: %v", err)
|
||||
}
|
||||
}
|
||||
// 注释:幂等防重逻辑,已交由上游调用方保证唯一性,不再由此接口处理
|
||||
//if req.AssociationOrderID != 0 {
|
||||
// var existingOrder models.SalesOrder
|
||||
// if err := tx.Where("association_order_id = ? AND is_del = 0", req.AssociationOrderID).First(&existingOrder).Error; err == nil {
|
||||
// // 订单已存在,直接返回已有订单ID(幂等处理)
|
||||
// salesOrderID = existingOrder.ID
|
||||
// return nil
|
||||
// } else if err != gorm.ErrRecordNotFound {
|
||||
// return fmt.Errorf("查询重复订单失败: %v", err)
|
||||
// }
|
||||
//}
|
||||
|
||||
var invWarehouseID int64
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user