From dfe8c5343eefa07dffe6b07981c179cb72c6b9cb Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期四, 23 三月 2023 15:55:59 +0800
Subject: [PATCH] nothing

---
 VueWebApi/DLL/DAL/AppPurchManagementDAL.cs |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs b/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
index 711b69a..3d6c562 100644
--- a/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
@@ -143,10 +143,10 @@
                     mes.data = null;
                     return mes;
                 }
-                //Lambda琛ㄨ揪寮忚繃婊よ幏鍙栭璁″埌璐ф棩鏈熴�侀儴闂ㄣ�佷緵搴斿晢
-                string hacceptdate = json.Select(p => p.hacceptdate).ToList().Distinct().ToString(); //棰勮鍒拌揣鏃ユ湡
-                string dpartment = json.Select(p => p.hdepartmentcode).ToList().Distinct().ToString(); //閮ㄩ棬
-                string customercode = json.Select(p => p.hcustomercode).ToList().Distinct().ToString(); //渚涘簲鍟�
+                //Lambda琛ㄨ揪寮忚繃婊よ幏鍙栭璁″埌璐ф棩鏈熴�侀儴闂ㄣ�佷緵搴斿晢鍙栫涓�涓�
+                string hacceptdate = json.Select(p => p.hacceptdate).Distinct().ToList().First().ToString(); //棰勮鍒拌揣鏃ユ湡
+                string dpartment = json.Select(p => p.hdepartmentcode).Distinct().ToList().First().ToString(); //閮ㄩ棬
+                string customercode = json.Select(p => p.hcustomercode).Distinct().ToList().First().ToString(); //渚涘簲鍟�
                 //鍐欏叆閲囪喘鍒拌揣鍗曚富琛�
                 sql = @"insert into T_PurchaseArrivalOrder(hbillno,hdate,hacceptdate,hbillstaus,hdepartmentcode,hcustomercode,hsourcebillno,lm_user,lm_date) 
                         values(@hbillno,@hdate,@hacceptdate,@hbillstaus,@hdepartmentcode,@hcustomercode,@hsourcebillno,@lm_user,@lm_date)";
@@ -157,7 +157,7 @@
                     {
                         hbillno = djwo,
                         hdate = DateTime.Now.ToString(),
-                        hacceptdate = Convert.ToDateTime(hacceptdate),
+                        hacceptdate =hacceptdate==""?null:hacceptdate,
                         hbillstaus = orderstaus,
                         hdepartmentcode = dpartment,
                         hcustomercode = customercode,
@@ -170,8 +170,8 @@
                 for (int i = 0; i < json.Count; i++)
                 {
                     //鍐欏叆閲囪喘鍒拌揣鍗曞瓙琛�
-                    sql = @"insert into T_PurchaseArrivalOrder_sub(hbillno,rownumber,hpartcode,hplanqty,hqty,hacceptdate,hischeck,hbatchno) 
-                        values(@hbillno,@hpartcode,@hplanqty,@hqty,@hacceptdate,@hischeck,@hbatchno)";
+                    sql = @"insert into T_PurchaseArrivalOrder_sub(hbillno,rownumber,hpartcode,hplanqty,hqty,hacceptdate,hcheckstaus,hbatchno) 
+                        values(@hbillno,@rownumber,@hpartcode,@hplanqty,@hqty,@hacceptdate,@hcheckstaus,@hbatchno)";
                     list.Add(new
                     {
                         str = sql,
@@ -182,8 +182,8 @@
                             hpartcode = json[i].hpartcode,
                             hplanqty = decimal.Parse(json[i].hplanqty),
                             hqty = decimal.Parse(json[i].hqty),
-                            hacceptdate = Convert.ToDateTime(hacceptdate),
-                            hischeck = json[i].hischeck,
+                            hacceptdate = hacceptdate == "" ? null : hacceptdate,
+                            hcheckstaus = json[i].hischeck,
                             hbatchno = json[i].hbatchno
                         }
                     });
@@ -193,7 +193,7 @@
                     {
                         //鍐欏叆鏉$爜妗f琛�
                         sql = @"insert into T_BarCodeBill(rightcode,hbillno,hbilltype,hbarcode,hbarcodestatus,hbarcodetype,hmaterialcode,hqty,hbatchno,hcustomercode,hdeptcode,hsourcebillno,hsourcebilltype,barcodeposition,lm_user,lm_date) 
-                        values(@rightcode,hbillno,@hbilltype,@hbarcode,@hbarcodestatus,@hbarcodetype,@hmaterialcode,@hqty,@hbatchno,@hcustomercode,@hdeptcode,@hsourcebillno,@hsourcebilltype,@barcodeposition,@lm_user,@lm_date)";
+                        values(@rightcode,@hbillno,@hbilltype,@hbarcode,@hbarcodestatus,@hbarcodetype,@hmaterialcode,@hqty,@hbatchno,@hcustomercode,@hdeptcode,@hsourcebillno,@hsourcebilltype,@barcodeposition,@lm_user,@lm_date)";
                         list.Add(new
                         {
                             str = sql,
@@ -219,7 +219,7 @@
                         });
                     }
                     //鏇存柊閲囪喘璁㈠崟瀛愯〃锛氱疮璁″埌璐ф暟閲�
-                    sql = @"update T_PurchaseOrder_sub set countarrivalquantity=countarrivalquantity+@hqty where ordercode=@purordercode and materiel_code=@materiel_code and rownumber=@rownumber";
+                    sql = @"update T_PurchaseOrder_sub set countarrivalquantity=countarrivalquantity+@hqty where purchaseorder_code=@purordercode and materiel_code=@materiel_code and rownumber=@rownumber";
                     list.Add(new
                     {
                         str = sql,
@@ -233,7 +233,7 @@
                     });
                 }
                 //鏇存柊閲囪喘璁㈠崟涓昏〃锛氳鍗曠姸鎬�
-                sql = @"update T_PurchaseOrder set status=@status where ordercode=@purordercode";
+                sql = @"update T_PurchaseOrder set status=@status where ordercode=@ordercode";
                 list.Add(new
                 {
                     str = sql,

--
Gitblit v1.9.3