From 5a72c00dca19dd6dd9be9db9e14f00f512f93f02 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 29 十月 2024 13:10:22 +0800
Subject: [PATCH] 小修改

---
 cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs          |    6 ++++++
 cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs |    8 ++++++++
 cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs  |    4 ++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs b/cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs
index d041cfe..9ac7c36 100644
--- a/cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs
+++ b/cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs
@@ -18,6 +18,12 @@
         /// </summary>
         public int Id { get; set; }
 
+
+        /// <summary>
+        /// 鎷涘伐OldId
+        /// </summary>
+        public int OldId { get; set; }
+
         /// <summary>
         /// 鎷涘伐鐢ㄦ埛id
         /// </summary>
diff --git a/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs b/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
index 5dec3a9..ec6c8b1 100644
--- a/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
+++ b/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
@@ -226,6 +226,14 @@
             }
             else
             {
+                if (orderDto.OldId > 0)
+                {
+                    //鍒犻櫎鏃х殑涓嬫灦璁㈠崟
+                    var order1 = await orderRes.GetByIdAsync(orderDto.OldId);
+                    order1.IsDeleted = true;
+                    res = await orderRes.UpdateAsync(order1);
+                }
+
                 var order = _mapper.Map<Order>(orderDto);
                 order.UpDataBy = NickName;
                 order.UpDataTime = DateTime.Now;
diff --git a/cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs b/cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs
index 0c43d87..ecb7c12 100644
--- a/cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs
+++ b/cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs
@@ -263,6 +263,10 @@
             var orderBiddingWorkPriceRepository = new BaseRepository<OrderBiddingWorkPrice>();
             var userRes = new BaseRepository<User>();
             var order = await orderRes.GetByIdAsync(orderid);
+            if (order.IsDeleted == true)
+            {
+                throw Oops.Oh("璁㈠崟宸茬粡鍒犻櫎鏃犳硶鏌ョ湅锛�");
+            }
             orderDto = _mapper.Map<OrderDto>(order);
             switch (orderDto.OrderStatus)
             {

--
Gitblit v1.9.1