移动系统liao
2024-09-29 2ccb8c94fcfe6891b6db60995e83cd7b54e389a6
Merge branch 'master' of http://47.108.235.38:8080/r/cylsg
1个文件已修改
39 ■■■■■ 已修改文件
cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
@@ -739,5 +739,44 @@
            return res;
        }
        /// <summary>
        /// 职位删除功能
        /// </summary>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        public async Task<bool> deleteOrder(BaoMingDto baoMingDto)
        {
            var UserID = App.User?.FindFirstValue("UserID");
            int userid = 0;
            string NickName = App.User?.FindFirstValue("NickName");
            if (!string.IsNullOrEmpty(UserID))
            {
                userid = int.Parse(UserID);
            }
            var orderBiddingRes = new BaseRepository<OrderBidding>();
            var orderRes = new BaseRepository<Order>();
            var userWorkerRes = new BaseRepository<UserWorker>();
            var order = await orderRes.GetByIdAsync(baoMingDto.OrderId);
            if (order.OrderStatus > 0)
            {
                throw Oops.Oh("已经招工完毕或者结算,无法删除");
            }
            bool res;
            res = await orderRes.DeleteAsync(order);
            return res;
        }
    }
}