/// <summary> /// 发放物资 /// </summary> /// <param name="shopId"></param> /// <param name="req"></param> /// <returns></returns> public bool ReleaseOrder(long shopId, OrderReleaseReq req) { using (var db = DBFactory.nCoVMS()) { var shopEnable = shopService.IsShopEnable(shopId); if (shopEnable) { throw new Exception("店铺未启用"); } var order = db.Torder.FirstOrDefault(a => a.Code == req.Code && a.ShopId == shopId); if (order == null) { throw new Exception("订单不存在"); } order.Status = (int)EOrderStatus.RELEASE; order.Num = req.Num; db.Torder.Update(order); return(true); } }
public bool ReleaseOrder([FromBody] OrderReleaseReq req) { long shopId = HttpContext.User.Identity.ShopId(); return(orderService.ReleaseOrder(shopId, req)); }