From ca964154bcc4a8a7a617320b3c9355e0c464ad39 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 15 十一月 2022 15:09:49 +0800
Subject: [PATCH] 奥邦(新增车间报表,超产报表)
---
WebAPI/Controllers/POStockInBillController.cs | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 2690215..32d8105 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -1524,6 +1524,19 @@
var hinterID = list[0].HInterID;
var FID = list[0].FID;
+ #region 鏍¢獙鏄惁鎵弿鏉$爜
+ var HInterID = list[0].HInterID;
+ string jysql = string.Format(@"select * from KF_PonderationBillMain_Temp where HSourceInterID = {0}", HInterID);
+ DataTable jyDt =oCn.RunProcReturn(jysql, "jysql").Tables[0];
+ if (jyDt.Rows.Count == 0 || jyDt == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇锋壂鎻忔潯鐮�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ #endregion
#region 閲戣澏瀹℃牳鍚庝細閲嶆柊鍚屾鍗曟嵁鍒癿es 鏁呬笉闇�瑕佹洿鏂癿es鐨勬敹鏂欓�氱煡鍗�
/*
oCn.BeginTran();
@@ -1545,7 +1558,7 @@
//鏇存柊鎴愬姛鍚� 鍚屾鏇存柊閲戣澏
oCn.Commit();
**/
- #endregion
+ #endregion
JObject jsonRoot = new JObject();
jsonRoot.Add("Creator", "");
@@ -1654,7 +1667,7 @@
{
//var code = HBarcode.Split('#')[0];
//鏍¢獙鏉$爜鏄惁瀛樺湪
- string sql = $"select* from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}";
+ string sql = $"select HItemID,HSourceBillNo from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}";
DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList");
if (ds.Tables[0].Rows.Count == 0)
{
@@ -1664,6 +1677,29 @@
objJsonResult.data = ds.Tables[0];
return objJsonResult;
}
+ else
+ {
+ //瀛樺叆鏉$爜涓存椂琛�
+ sql = $"delete from KF_PonderationBillMain_Temp Where HBillNo='{ds.Tables[0].Rows[0]["HSourceBillNo"]}' ";
+ oCn.RunProc(sql);
+ sql = string.Format(@"Insert into KF_PonderationBillMain_Temp
+ (HInterID,HBillNo,HBillType,HMaterID,HProcID,HWhID,HSCWHID
+ ,HStockPlaceID,HOutStockPlaceID,HGroupID,HQty,HQtyMust,HPieceQty
+ ,HAuxPropID,HBatchNo,HBarCode,HAddr,HMaker,HMakeDate
+ ,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HMTONo
+ ,HSTOCKORGID,HOWNERID,HExpressNumber,HSubBillType
+ ,HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag
+ ,HCusID)
+ select HInterID,HSourceBillNo,HBillType,HMaterID,0,0,0
+ ,0,0,0,HQty,HQty,0
+ ,HAuxPropID,HBatchNo,'','','System',getdate()
+ ,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HMTONo
+ ,HSTOCKORGID,HOWNERID,'',HBillType
+ ,0,0,'',0
+ ,0 from Gy_BarCodeBill
+ where HItemID = {0}", ds.Tables[0].Rows[0]["HItemID"]);
+ oCn.RunProc(sql);
+ }
objJsonResult.code = "1";
objJsonResult.count = 1;
--
Gitblit v1.9.1