From b53678eec74cadc4d8d5773343b10ffa2adc5330 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 03 九月 2024 09:50:27 +0800
Subject: [PATCH] 最新代码

---
 cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs |   43 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs b/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
index c0e305c..1a2bb2c 100644
--- a/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
+++ b/cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
@@ -116,11 +116,30 @@
 
             var UserID = App.User?.FindFirstValue("UserID");
             int userid = 0;
-            string ITCode = App.User?.FindFirstValue("ITCode");
+            string NickName = App.User?.FindFirstValue("NickName");
             if (!string.IsNullOrEmpty(UserID))
             {
                 userid = int.Parse(UserID);
             }
+
+
+            if (!string.IsNullOrEmpty(orderDto.OrderName) && orderDto.OrderName.Length > 100)
+            {
+                throw Oops.Oh("鎷涘伐鍚嶇О闀垮害杩囬暱锛�");
+            }
+            if (!string.IsNullOrEmpty(orderDto.Demand) && orderDto.Demand.Length > 2000)
+            {
+                throw Oops.Oh("闇�姹傞暱搴﹁繃闀匡紒");
+            }
+            if (!string.IsNullOrEmpty(orderDto.WorderAddress) && orderDto.WorderAddress.Length > 500)
+            {
+                throw Oops.Oh("宸ヤ綔鍦扮偣闀垮害杩囬暱锛�");
+            }
+            if (!string.IsNullOrEmpty(orderDto.ContactPhone) && orderDto.ContactPhone.Length > 30)
+            {
+                throw Oops.Oh("鑱旂郴鐢佃瘽闀垮害杩囬暱锛�");
+            }
+
             var userCompanyRes = new BaseRepository<UserCompany>();
             var userCompany = await userCompanyRes.GetFirstAsync(p => p.UserId == userid && p.IsEn == true && p.IsDeleted == false);
             if (userCompany == null || string.IsNullOrEmpty(userCompany.BusinessLicense))
@@ -140,6 +159,8 @@
                 order.OrderName = orderDto.OrderName;
                 order.WordStartTime = orderDto.WordStartTime;
                 order.WordEndTime = orderDto.WordEndTime;
+                order.StartTime = orderDto.StartTime;
+                order.EndTime = orderDto.EndTime;
                 order.Demand = orderDto.Demand;
                 order.WorderCount = orderDto.WorderCount;
                 order.WorderAddress = orderDto.WorderAddress;
@@ -148,7 +169,7 @@
                 order.WorkPrice = orderDto.WorkPrice;
 
 
-                order.UpDataBy = ITCode;
+                order.UpDataBy = NickName;
                 order.UpDataTime = DateTime.Now;
                 res = await orderRes.UpdateAsync(order);
 
@@ -157,9 +178,9 @@
             else
             {
                 var order = _mapper.Map<Order>(orderDto);
-                order.UpDataBy = ITCode;
+                order.UpDataBy = NickName;
                 order.UpDataTime = DateTime.Now;
-                order.CreateBy = ITCode;
+                order.CreateBy = NickName;
                 order.CreateTime = DateTime.Now;
                 order.OrderStatus = 0;
                 order.OrderUserId = userid;
@@ -188,7 +209,7 @@
 
             var UserID = App.User?.FindFirstValue("UserID");
             int userid = 0;
-            string ITCode = App.User?.FindFirstValue("ITCode");
+            string NickName = App.User?.FindFirstValue("NickName");
             if (!string.IsNullOrEmpty(UserID))
             {
                 userid = int.Parse(UserID);
@@ -225,7 +246,7 @@
 
             orderBidding.IsSelected = true;
             orderBidding.Selectedtime = DateTime.Now;
-            orderBidding.UpDataBy = ITCode;
+            orderBidding.UpDataBy = NickName;
             orderBidding.UpDataTime = DateTime.Now;
 
 
@@ -383,7 +404,7 @@
 
             var UserID = App.User?.FindFirstValue("UserID");
             int userid = 0;
-            string ITCode = App.User?.FindFirstValue("ITCode");
+            string NickName = App.User?.FindFirstValue("NickName");
             if (!string.IsNullOrEmpty(UserID))
             {
                 userid = int.Parse(UserID);
@@ -428,11 +449,11 @@
                 orderBiddingDetail.TodaySalary = dakaDto.TodaySalary;
                 orderBiddingDetail.IsShenPi = (int)IsShenPis.yishenpi;
                 orderBiddingDetail.ShenPitime = DateTime.Now;
-                orderBiddingDetail.UpDataBy = ITCode;
+                orderBiddingDetail.UpDataBy = NickName;
                 orderBiddingDetail.UpDataTime = DateTime.Now;
                 orderBiddingDetail.IsTiXian = true;
                 orderBiddingDetail.TiXiantime = DateTime.Now;
-                //orderBiddingDetail.CreateBy = ITCode;
+                //orderBiddingDetail.CreateBy = NickName;
                 //orderBiddingDetail.CreateTime = DateTime.Now;
                 res = await orderBiddingDetailRes.UpdateAsync(orderBiddingDetail);
                 if (!res)
@@ -450,9 +471,9 @@
                     userTiXianDetail.YiTiXianJine = TodaySalary;
                     userTiXianDetail.ZhiChuShouRu = (int)ZhiChuShouRus.shouru;
                     userTiXianDetail.Remark = "鎷涘伐璁㈠崟" + order.OrderName + orderBiddingDetail.WorkDate.Value.ToString("yyyy-MM-dd") + "宸ヨ祫缁撶畻";
-                    userTiXianDetail.UpDataBy = ITCode;
+                    userTiXianDetail.UpDataBy = NickName;
                     userTiXianDetail.UpDataTime = DateTime.Now;
-                    userTiXianDetail.CreateBy = ITCode;
+                    userTiXianDetail.CreateBy = NickName;
                     userTiXianDetail.CreateTime = DateTime.Now;
 
                     res = await userTiXianDetailRes.InsertAsync(userTiXianDetail);

--
Gitblit v1.9.1