From 32db7992dd4ed10d97707f428ee8a0499988ffec Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 24 三月 2023 15:22:29 +0800
Subject: [PATCH] 采购到货:采购订单带物料信息过滤已全部到货物料
---
VueWebApi/DLL/DAL/AppPurchManagementDAL.cs | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs b/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
index 711b69a..c3c3b74 100644
--- a/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
@@ -79,7 +79,7 @@
left join TUom U on M.uom_code=U.code
left join TCustomer C on B.customercode=C.code
left join TOrganization T on A.departmentcode=T.org_code
- where A.ordercode=@purchordercode";
+ where B.quantity>B.countarrivalquantity and A.ordercode=@purchordercode";
dynamicParams.Add("@purchordercode", purchordercode);
var data = DapperHelper.selectdata(sql, dynamicParams);
if (data.Rows.Count > 0)
@@ -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