From ffa387e35fb64107c944508c1131046d9e6b564d Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期二, 27 二月 2024 13:55:36 +0800 Subject: [PATCH] 凯贝奈特新增收料单单据类型 --- WebAPI/Controllers/BarCodeController.cs | 40 ++++++++++++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 8 deletions(-) diff --git a/WebAPI/Controllers/BarCodeController.cs b/WebAPI/Controllers/BarCodeController.cs index ae04a00..fe0ca61 100644 --- a/WebAPI/Controllers/BarCodeController.cs +++ b/WebAPI/Controllers/BarCodeController.cs @@ -1,4 +1,5 @@ 锘縰sing DBUtility; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SQLHelper; using System; @@ -630,6 +631,7 @@ bar.HMTONO = oItemSub.HMTONO; bar.HSupBatchNo = oItemSub.HSupBatchNo; bar.HSupMaterNumber = oItemSub.HSupMaterNumber; + bar.HISKFPERIOD = oItemSub.HISKFPERIOD; ls2.Add(bar); } } @@ -712,6 +714,7 @@ bar2.HMTONO = oItemSub2.HMTONO; bar2.HSupBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HSupBatchNo); bar2.HSupMaterNumber = DBUtility.ClsPub.isStrNull(oItemSub2.HSupMaterNumber); + bar2.HISKFPERIOD = DBUtility.ClsPub.isInt(oItemSub2.HISKFPERIOD); ls3.Add(bar2); //LogService.Write("娴嬭瘯鍔�+++" + oItemSub2.HSupID); } @@ -738,6 +741,7 @@ string HMTONO = ""; string HSupBatchNo = ""; string HSupMaterNumber = ""; + Int64 HISKFPERIOD = 0; oCn.BeginTran(); foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) { @@ -768,6 +772,8 @@ HWei = ClsPub.isStrNull(oItemSub.HEndQty); HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo); HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber); + HISKFPERIOD = DBUtility.ClsPub.isInt(oItemSub.HISKFPERIOD); + if (FCusName.Contains("澶忓疂")) { HBarCode = $"{oItemSub.HMaterID}"; @@ -775,11 +781,11 @@ } string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber " + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD " + ") values (" + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" - + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "'" + + + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "','" + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; oCn.RunProc(sql); //LogService.Write(sql); @@ -811,6 +817,7 @@ HWei = ClsPub.isStrNull(oItemSub.HEndQty); HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo); HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber); + HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD); if (FCusName.Contains("澶忓疂")) { HBarCode = $"{oItemSub.HMaterID}"; @@ -818,12 +825,12 @@ } string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD" + ") values (" + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + - HSupBatchNo + "','" + HSupMaterNumber + "'" + ")"; + HSupBatchNo + "','" + HSupMaterNumber + "','" + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; oCn.RunProc(sql); //LogService.Write(sql); } @@ -1362,6 +1369,8 @@ public object GetBarCodeShowList([FromBody] JObject msg) { string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString(); + //娣诲姞鍒楀悕 + List<object> columnNameList = new List<object>(); try { string VsWhere = ""; @@ -1392,10 +1401,18 @@ } else { + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objjson.code = "0"; objjson.count = 10000; objjson.Message = "鑾峰彇鎴愬姛"; objjson.data = ds.Tables[0]; + objjson.list = columnNameList; return objjson; } } @@ -1704,6 +1721,7 @@ bar.HSupID = oItemSub.HSupID; bar.HEndQty = WeiShu; bar.HMTONO = oItemSub.HMTONO; + bar.HISKFPERIOD = oItemSub.HISKFPERIOD; ls2.Add(bar); } } @@ -1785,6 +1803,7 @@ bar2.HSupID = oItemSub2.HSupID; bar2.HEndQty = WeiShu1; bar2.HMTONO = oItemSub2.HMTONO; + bar2.HISKFPERIOD = oItemSub2.HISKFPERIOD; ls3.Add(bar2); } } @@ -1807,6 +1826,7 @@ string HKFDQDate = ""; string HWei = ""; string HMTONO = ""; + Int64 HISKFPERIOD = 0; oCn.BeginTran(); foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) { @@ -1838,6 +1858,7 @@ HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID); HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo); HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType); + HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD); HWei = ClsPub.isStrNull(oItemSub.HEndQty); if (FCusName.Contains("澶忓疂")) { @@ -1846,11 +1867,12 @@ } string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + ",HBatchNo,HBarcodeQtys,HBarcodeNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HProduceDate,HExpiryDate,HISKFPERIOD" + ") values (" + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate + "','" + HBatchNo + "','" + SubModel.Count + "','" + count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" - + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"; + + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; oCn.RunProc(sql); oCn.RunProc("exec setLSH '" + DateTime.Today + "'"); count++; @@ -1883,6 +1905,7 @@ HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo); HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType); HWei = ClsPub.isStrNull(oItemSub.HEndQty); + HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD); if (FCusName.Contains("澶忓疂")) { HBarCode = $"{oItemSub.HMaterID}"; @@ -1890,11 +1913,12 @@ } string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + ",HBatchNo,HBarcodeQtys,HBarcodeNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HProduceDate,HExpiryDate,HISKFPERIOD" + ") values (" + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate + "','" + HBatchNo + "','" + SubModel.Count + "','" + _count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" - + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"; + + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; oCn.RunProc(sql); _count++; } -- Gitblit v1.9.1