...
|
...
|
@@ -132,6 +132,14 @@ func (service OrderService) CreateOrder(command command.CreateOrderCommand) erro |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
orderDao, _ := factory.CreateOrderDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
ok, err := orderDao.OrderCodeIsExist(command.OrderCode, 0)
|
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if ok {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, "订单编号已存在")
|
|
|
}
|
|
|
var PartnerInfoRepository domain.PartnerInfoRepository
|
|
|
if PartnerInfoRepository, err = factory.CreatePartnerInfoRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -210,6 +218,14 @@ func (service OrderService) UpdateOrderPurpose(command command.UpdateOrderComman |
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
orderDao, _ := factory.CreateOrderDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
ok, err := orderDao.OrderCodeIsExist(command.OrderCode, command.Id)
|
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if ok {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, "订单编号已存在")
|
|
|
}
|
|
|
var (
|
|
|
orderRepository domain.OrderRepository
|
|
|
orderData *domain.Order
|
...
|
...
|
@@ -318,6 +334,14 @@ func (service OrderService) UpdateOrderReal(command command.UpdateOrderRealComma |
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
orderDao, _ := factory.CreateOrderDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
ok, err := orderDao.OrderCodeIsExist(command.OrderCode, command.Id)
|
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if ok {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, "订单编号已存在")
|
|
|
}
|
|
|
var (
|
|
|
orderRepository domain.OrderRepository
|
|
|
orderData *domain.Order
|
...
|
...
|
|