作者 tangxvhui

bug 修复

@@ -266,6 +266,12 @@ func (service OrderService) RemoveOrder(id int64) error { @@ -266,6 +266,12 @@ func (service OrderService) RemoveOrder(id int64) error {
266 if err != nil { 266 if err != nil {
267 return lib.ThrowError(lib.TRANSACTION_ERROR, err.Error()) 267 return lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
268 } 268 }
  269 + if err = transactionContext.StartTransaction(); err != nil {
  270 + return lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
  271 + }
  272 + defer func() {
  273 + transactionContext.RollbackTransaction()
  274 + }()
269 var ( 275 var (
270 orderRepository domain.OrderRepository 276 orderRepository domain.OrderRepository
271 order *domain.Order 277 order *domain.Order
@@ -290,6 +296,10 @@ func (service OrderService) RemoveOrder(id int64) error { @@ -290,6 +296,10 @@ func (service OrderService) RemoveOrder(id int64) error {
290 if err != nil { 296 if err != nil {
291 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) 297 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
292 } 298 }
  299 + err = transactionContext.CommitTransaction()
  300 + if err != nil {
  301 + return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
  302 + }
293 return nil 303 return nil
294 } 304 }
295 305
@@ -166,14 +166,14 @@ func (c *OrderController) GetOrderPurpose() { @@ -166,14 +166,14 @@ func (c *OrderController) GetOrderPurpose() {
166 "updateTime": orderinfo.UpdateAt.Local().Format("2006-01-02 15:04:05"), 166 "updateTime": orderinfo.UpdateAt.Local().Format("2006-01-02 15:04:05"),
167 "buyer": orderinfo.Buyer.BuyerName, 167 "buyer": orderinfo.Buyer.BuyerName,
168 "buyerPhone": orderinfo.Buyer.ContactInfo, 168 "buyerPhone": orderinfo.Buyer.ContactInfo,
169 - "Address": orderinfo.Buyer.ShippingAddress, 169 + "address": orderinfo.Buyer.ShippingAddress,
170 "id": orderinfo.Id, 170 "id": orderinfo.Id,
171 "partner": orderinfo.PartnerInfo.Id, 171 "partner": orderinfo.PartnerInfo.Id,
172 "partnerRatio": orderinfo.PartnerBonusPercent, 172 "partnerRatio": orderinfo.PartnerBonusPercent,
173 "salesmanRatio": orderinfo.SalesmanBonusPercent, 173 "salesmanRatio": orderinfo.SalesmanBonusPercent,
174 "orderId": orderinfo.OrderCode, 174 "orderId": orderinfo.OrderCode,
175 "orderName": orderinfo.OrderName, 175 "orderName": orderinfo.OrderName,
176 - "OrderNum": orderinfo.OrderCount, 176 + "orderNum": orderinfo.OrderCount,
177 "orderPrice": orderinfo.OrderAmount, 177 "orderPrice": orderinfo.OrderAmount,
178 "orderDist": orderinfo.OrderRegionInfo.RegionName, 178 "orderDist": orderinfo.OrderRegionInfo.RegionName,
179 "orderStatue": orderinfo.OrderStatus, 179 "orderStatue": orderinfo.OrderStatus,
@@ -385,14 +385,14 @@ func (c *OrderController) GetOrderReal() { @@ -385,14 +385,14 @@ func (c *OrderController) GetOrderReal() {
385 "updateTime": orderinfo.UpdateAt.Local().Format("2006-01-02 15:04:05"), 385 "updateTime": orderinfo.UpdateAt.Local().Format("2006-01-02 15:04:05"),
386 "buyer": orderinfo.Buyer.BuyerName, 386 "buyer": orderinfo.Buyer.BuyerName,
387 "buyerPhone": orderinfo.Buyer.ContactInfo, 387 "buyerPhone": orderinfo.Buyer.ContactInfo,
388 - "Address": orderinfo.Buyer.ShippingAddress, 388 + "address": orderinfo.Buyer.ShippingAddress,
389 "id": orderinfo.Id, 389 "id": orderinfo.Id,
390 "partner": orderinfo.PartnerInfo.Id, 390 "partner": orderinfo.PartnerInfo.Id,
391 "partnerRatio": orderinfo.PartnerBonusPercent, 391 "partnerRatio": orderinfo.PartnerBonusPercent,
392 "salesmanRatio": orderinfo.SalesmanBonusPercent, 392 "salesmanRatio": orderinfo.SalesmanBonusPercent,
393 "orderId": orderinfo.OrderCode, 393 "orderId": orderinfo.OrderCode,
394 "orderName": orderinfo.OrderName, 394 "orderName": orderinfo.OrderName,
395 - "OrderNum": orderinfo.OrderActualCount, 395 + "orderNum": orderinfo.OrderActualCount,
396 "orderPrice": orderinfo.OrderActualAmount, 396 "orderPrice": orderinfo.OrderActualAmount,
397 "orderDist": orderinfo.OrderRegionInfo.RegionName, 397 "orderDist": orderinfo.OrderRegionInfo.RegionName,
398 "orderStatue": orderinfo.OrderStatus, 398 "orderStatue": orderinfo.OrderStatus,