From bdc9a678092e8571da7754f1afd48a5055a2a0e5 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 08 二月 2023 09:18:13 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/POStockInBillController.cs | 3926 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 3,353 insertions(+), 573 deletions(-) diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs index b0bbedd..324bca1 100644 --- a/WebAPI/Controllers/POStockInBillController.cs +++ b/WebAPI/Controllers/POStockInBillController.cs @@ -172,698 +172,2897 @@ } - [Route("kf_PoStockInBill/JX_Json")] - [HttpGet] - public static string JX_Json(string sBarCodeNew, Int64 hinterid, string HBillType,Int64 HOrgID,string HBillNo,string HMaker) - { - try - { - //1.鍒ゆ柇绯荤粺鍙傛暟鏄惁瀹夌憺 涓嶆槸瀹夌憺 鐩存帴璺虫帀 - //濡傛灉鏄畨鐟� 璧颁笅闈� + //[Route("kf_PoStockInBill/JX_Json")] + //[HttpGet] + //public static string JX_Json(string sBarCodeNew, Int64 hinterid, string HBillType,Int64 HOrgID,string HBillNo,string HMaker) + //{ + // try + // { + // //1.鍒ゆ柇绯荤粺鍙傛暟鏄惁瀹夌憺 涓嶆槸瀹夌憺 鐩存帴璺虫帀 + // //濡傛灉鏄畨鐟� 璧颁笅闈� - //瑙f瀽鏉$爜 - //濡傛灉鍦ㄦ潯鐮佹。妗堥噷闈� 涓嶅鐞� 娌℃湁鐨勮瘽 瀛樺叆鏉$爜妗f + // //瑙f瀽鏉$爜 + // //濡傛灉鍦ㄦ潯鐮佹。妗堥噷闈� 涓嶅鐞� 娌℃湁鐨勮瘽 瀛樺叆鏉$爜妗f - //鏍规嵁瑙f瀽鐨勭墿鏂� + 鎵规 鍒ゆ柇 鏉$爜涓存椂琛� 璁板綍鏄惁瀛樺湪 娌℃湁鐨勮瘽 杩涜鎵簮鍗曠殑鍔ㄤ綔 + // //鏍规嵁瑙f瀽鐨勭墿鏂� + 鎵规 鍒ゆ柇 鏉$爜涓存椂琛� 璁板綍鏄惁瀛樺湪 娌℃湁鐨勮瘽 杩涜鎵簮鍗曠殑鍔ㄤ綔 - //鍔犱簡 鐢熶骇鏃ユ湡 鏈夋晥鏈熻嚦 淇濊川鏈熸爣蹇� + // //鍔犱簡 鐢熶骇鏃ユ湡 鏈夋晥鏈熻嚦 淇濊川鏈熸爣蹇� - Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); - //if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") - //{ - string HTM = ""; - //閲囪喘鍏ュ簱 - if (HBillType == "1201") - { - string[] sArray = sBarCodeNew.Split('@'); - string HMaterNumber = ""; - HMaterNumber = sArray[0]; - Int64 HQty = 0; - HQty = ClsPub.isInt(sArray[4]); - string HBarchNo = ""; - HBarchNo = sArray[6]; + // Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + // //if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") + // //{ + // string HTM = ""; + // //閲囪喘鍏ュ簱 + // if (HBillType == "1201") + // { + // string[] sArray = sBarCodeNew.Split('@'); + // string HMaterNumber = ""; + // HMaterNumber = sArray[0]; + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sArray[4]); + // string HBarchNo = ""; + // HBarchNo = sArray[6]; - DateTime HSCRQ = ClsPub.isDate(sArray[3]); - DateTime HYXQZ = ClsPub.isDate(sArray[5]); + // DateTime HSCRQ = ClsPub.isDate(sArray[3]); + // DateTime HYXQZ = ClsPub.isDate(sArray[5]); - //閲囪喘璁㈠崟鍙� - string HPOOrderBillNo = ""; - HPOOrderBillNo = ClsPub.isStrNull(sArray[8]); + // //閲囪喘璁㈠崟鍙� + // string HPOOrderBillNo = ""; + // HPOOrderBillNo = ClsPub.isStrNull(sArray[8]); - Int64 HMaterID = 0; + // Int64 HMaterID = 0; - SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - DataSet Dss; - Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + // DataSet Dss; + // Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - DataSet Dss1; - Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss1; + // Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - HTM = HOrgNumber + HMaterID + HBarchNo; + // HTM = HOrgNumber + HMaterID + HBarchNo; - //濡傛灉鏉$爜妗f涓嶅瓨鍦� 杩涜瀛樺叆鏉$爜妗f鐨勫姩浣� - //鏍规嵁鐗╂枡 + 鎵规 + 閲囪喘璁㈠崟鍙� 鎵惧埌瀵瑰簲鐨勬敹鏂欓�氱煡鍗曞彿 - DataSet Dss2; - Dss2 = oCn.RunProcReturn(" select fid,FMATERIALID,FENTRYID,FBILLNO from h_v_RECEIVEQuery where FSRCBILLNO= '" + HPOOrderBillNo + "' and FMATERIALID = " + HMaterID, "h_v_RECEIVEQuery"); - HMaterID = Pub_Class.ClsPub.isLong(Dss2.Tables[0].Rows[0]["FMATERIALID"]); - Int64 HSourceInterID = Pub_Class.ClsPub.isLong(Dss2.Tables[0].Rows[0]["fid"]); - Int64 HSourceEntryID = Pub_Class.ClsPub.isLong(Dss2.Tables[0].Rows[0]["FENTRYID"]); - string HSourceBillNo = Pub_Class.ClsPub.isStrNull(Dss2.Tables[0].Rows[0]["FBILLNO"]); - //鍒ゆ柇鏉$爜妗f鏄惁瀛樺湪璇ユ潯鐮� - //濡傛灉瀛樺湪 鍐嶅垽鏂壂鐮佷复鏃惰〃鏄惁瀛樺湪璇ユ潯鐮� - //濡傛灉涓嶅瓨鍦� 杩涜鎵簮鍗曠殑鏂规硶 - DataSet Dss5; - Dss5 = oCn.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { - DataSet Dss6; - Dss6 = oCn.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); - if (Dss6.Tables[0].Rows.Count > 0) - { + // //濡傛灉鏉$爜妗f涓嶅瓨鍦� 杩涜瀛樺叆鏉$爜妗f鐨勫姩浣� + // //鏍规嵁鐗╂枡 + 鎵规 + 閲囪喘璁㈠崟鍙� 鎵惧埌瀵瑰簲鐨勬敹鏂欓�氱煡鍗曞彿 + // DataSet Dss2; + // Dss2 = oCn.RunProcReturn(" select fid,FMATERIALID,FENTRYID,FBILLNO from h_v_RECEIVEQuery where FSRCBILLNO= '" + HPOOrderBillNo + "' and FMATERIALID = " + HMaterID, "h_v_RECEIVEQuery"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss2.Tables[0].Rows[0]["FMATERIALID"]); + // Int64 HSourceInterID = Pub_Class.ClsPub.isLong(Dss2.Tables[0].Rows[0]["fid"]); + // Int64 HSourceEntryID = Pub_Class.ClsPub.isLong(Dss2.Tables[0].Rows[0]["FENTRYID"]); + // string HSourceBillNo = Pub_Class.ClsPub.isStrNull(Dss2.Tables[0].Rows[0]["FBILLNO"]); + // //鍒ゆ柇鏉$爜妗f鏄惁瀛樺湪璇ユ潯鐮� + // //濡傛灉瀛樺湪 鍐嶅垽鏂壂鐮佷复鏃惰〃鏄惁瀛樺湪璇ユ潯鐮� + // //濡傛灉涓嶅瓨鍦� 杩涜鎵簮鍗曠殑鏂规硶 + // DataSet Dss5; + // Dss5 = oCn.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { + // DataSet Dss6; + // Dss6 = oCn.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); + // if (Dss6.Tables[0].Rows.Count > 0) + // { - } - else - { - POStockInBillController POStockInBill = new POStockInBillController(); - POStockInBill.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", HSourceBillNo, hinterid, HBillNo); + // } + // else + // { + // POStockInBillController POStockInBill = new POStockInBillController(); + // POStockInBill.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", HSourceBillNo, hinterid, HBillNo); - } - } - else - { + // } + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','1103',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ.ToShortDateString() + "','" + HYXQZ.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - DataSet Dss7; - Dss7 = oCn.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); - if (Dss7.Tables[0].Rows.Count > 0) - { + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','1103',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ.ToShortDateString() + "','" + HYXQZ.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // DataSet Dss7; + // Dss7 = oCn.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); + // if (Dss7.Tables[0].Rows.Count > 0) + // { - } - else - { - POStockInBillController POStockInBill = new POStockInBillController(); - POStockInBill.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", HSourceBillNo, hinterid, HBillNo); + // } + // else + // { + // POStockInBillController POStockInBill = new POStockInBillController(); + // POStockInBill.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", HSourceBillNo, hinterid, HBillNo); - } + // } - } - } - //浜у搧鍏ュ簱 - if(HBillType == "1202") - { - string HMaterNumber = ""; - HMaterNumber = sBarCodeNew.Substring(0, 10); - string HSCRQ = ""; - HSCRQ = "20" + sBarCodeNew.Substring(10, 6); - Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); - Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); - Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); + // } + // } + // //浜у搧鍏ュ簱 + // if(HBillType == "1202") + // { + // string HMaterNumber = ""; + // HMaterNumber = sBarCodeNew.Substring(0, 10); + // string HSCRQ = ""; + // HSCRQ = "20" + sBarCodeNew.Substring(10, 6); + // Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); + // Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); + // Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); - string HBatchNo = ""; - HBatchNo = sBarCodeNew.Substring(16, 11); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - DataSet ds; - Int64 HMaterID = 0; - DataSet Dss1; - Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - ds = oCN.RunProcReturn("select * from h_v_SCStockInCheckBill_Json where HYear =" + Year + " and HMonth = " + Month + " and HDay = " + Day + " and HMaterID = " + HMaterID.ToString() + "and 鎵规 = '" + HBatchNo.ToString() + "'", "h_v_SCStockInCheckBill_Json"); - Int64 HSourceInterID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceInterID"]); - Int64 HSourceEntryID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceEntryID"]); - string HSourceBillNo = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBillNo"]); - DataSet Dss; - Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - HTM = HOrgNumber + HMaterID + HBatchNo; + // string HBatchNo = ""; + // HBatchNo = sBarCodeNew.Substring(16, 11); + // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + // DataSet ds; + // Int64 HMaterID = 0; + // DataSet Dss1; + // Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // ds = oCN.RunProcReturn("select * from h_v_SCStockInCheckBill_Json where HYear =" + Year + " and HMonth = " + Month + " and HDay = " + Day + " and HMaterID = " + HMaterID.ToString() + "and 鎵规 = '" + HBatchNo.ToString() + "'", "h_v_SCStockInCheckBill_Json"); + // Int64 HSourceInterID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceInterID"]); + // Int64 HSourceEntryID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceEntryID"]); + // string HSourceBillNo = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBillNo"]); + // DataSet Dss; + // Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // HTM = HOrgNumber + HMaterID + HBatchNo; - DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); + // DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); - string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); - Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); - Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); - Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); - DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); + // string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); + // Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); + // Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); + // Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); + // DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); - Int64 HQty = 0; - HQty = ClsPub.isInt(sBarCodeNew.Substring(33,3)); + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sBarCodeNew.Substring(33,3)); - DataSet Dss5; - Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { - DataSet Dss6; - Dss6 = oCN.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); - if (Dss6.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { + // DataSet Dss6; + // Dss6 = oCN.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); + // if (Dss6.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - WEBSController WEBS = new WEBSController(); - WEBS.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, HSourceBillNo, "3714", HMaker,HOrgID); + // WEBSController WEBS = new WEBSController(); + // WEBS.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, HSourceBillNo, "3714", HMaker,HOrgID); - } - } - else - { + // } + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','3714',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - DataSet Dss7; - Dss7 = oCN.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); - if (Dss7.Tables[0].Rows.Count > 0) - { + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','3714',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // DataSet Dss7; + // Dss7 = oCN.RunProcReturn(" select * from KF_PonderationBillMain_Temp where HBarCode= '" + HTM + "' and HInterID = " + hinterid.ToString() + " and HBillType = '" + HBillType + "' and hsourcebillno = '" + HSourceBillNo + "' ", "KF_PonderationBillMain_Temp"); + // if (Dss7.Tables[0].Rows.Count > 0) + // { - } - else - { - WEBSController WEBS = new WEBSController(); - WEBS.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, HSourceBillNo, "3714", HMaker, HOrgID); + // } + // else + // { + // WEBSController WEBS = new WEBSController(); + // WEBS.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, HSourceBillNo, "3714", HMaker, HOrgID); - } + // } - } + // } - } - //鐢熶骇閫�鏂� - if (HBillType == "1244") - { - string HMaterNumber = ""; - HMaterNumber = sBarCodeNew.Substring(0, 10); - string HSCRQ = ""; - HSCRQ = "20" + sBarCodeNew.Substring(10, 6); - Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); - Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); - Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); + // } + // //鐢熶骇閫�鏂� + // if (HBillType == "1244") + // { + // string HMaterNumber = ""; + // HMaterNumber = sBarCodeNew.Substring(0, 10); + // string HSCRQ = ""; + // HSCRQ = "20" + sBarCodeNew.Substring(10, 6); + // Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); + // Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); + // Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); - string HBatchNo = ""; - HBatchNo = sBarCodeNew.Substring(16, 11); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + // string HBatchNo = ""; + // HBatchNo = sBarCodeNew.Substring(16, 11); + // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - Int64 HMaterID = 0; - DataSet Dss1; - Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - DataSet Dss; - Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - HTM = HOrgNumber + HMaterID + HBatchNo; + // Int64 HMaterID = 0; + // DataSet Dss1; + // Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss; + // Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // HTM = HOrgNumber + HMaterID + HBatchNo; - DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); + // DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); - string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); - Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); - Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); - Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); - DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); + // string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); + // Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); + // Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); + // Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); + // DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); - Int64 HQty = 0; - HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); - DataSet Dss5; - Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", 0,0,'','',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", 0,0,'','',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - } + // } - } - //璋冩嫧鍗� - if (HBillType == "1207") - { - string HMaterNumber = ""; - HMaterNumber = sBarCodeNew.Substring(0, 10); - string HSCRQ = ""; - HSCRQ = "20" + sBarCodeNew.Substring(10, 6); - Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); - Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); - Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); + // } + // //璋冩嫧鍗� + // if (HBillType == "1207") + // { + // string HMaterNumber = ""; + // HMaterNumber = sBarCodeNew.Substring(0, 10); + // string HSCRQ = ""; + // HSCRQ = "20" + sBarCodeNew.Substring(10, 6); + // Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); + // Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); + // Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); - string HBatchNo = ""; - HBatchNo = sBarCodeNew.Substring(16, 11); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + // string HBatchNo = ""; + // HBatchNo = sBarCodeNew.Substring(16, 11); + // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - Int64 HMaterID = 0; - DataSet Dss1; - Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - DataSet Dss; - Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - HTM = HOrgNumber + HMaterID + HBatchNo; + // Int64 HMaterID = 0; + // DataSet Dss1; + // Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss; + // Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // HTM = HOrgNumber + HMaterID + HBatchNo; - DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); + // DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); - string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); - Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); - Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); - Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); - DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); + // string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); + // Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); + // Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); + // Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); + // DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); - Int64 HQty = 0; - HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); - DataSet Dss5; - Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", 0,0,'','',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", 0,0,'','',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - } + // } - } - //鍏朵粬鍑哄簱鍗� - if (HBillType == "1206") - { - string HMaterNumber = ""; - HMaterNumber = sBarCodeNew.Substring(0, 10); - string HSCRQ = ""; - HSCRQ = "20" + sBarCodeNew.Substring(10, 6); - Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); - Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); - Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); + // } + // //鍏朵粬鍑哄簱鍗� + // if (HBillType == "1206") + // { + // string HMaterNumber = ""; + // HMaterNumber = sBarCodeNew.Substring(0, 10); + // string HSCRQ = ""; + // HSCRQ = "20" + sBarCodeNew.Substring(10, 6); + // Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); + // Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); + // Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); - string HBatchNo = ""; - HBatchNo = sBarCodeNew.Substring(16, 11); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + // string HBatchNo = ""; + // HBatchNo = sBarCodeNew.Substring(16, 11); + // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - Int64 HMaterID = 0; - DataSet Dss1; - Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - DataSet Dss; - Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - HTM = HOrgNumber + HMaterID + HBatchNo; + // Int64 HMaterID = 0; + // DataSet Dss1; + // Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss; + // Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // HTM = HOrgNumber + HMaterID + HBatchNo; - DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); + // DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); - string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); - Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); - Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); - Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); - DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); + // string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); + // Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); + // Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); + // Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); + // DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); - Int64 HQty = 0; - HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); - DataSet Dss5; - Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", 0,0,'','',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", 0,0,'','',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - } + // } - } - //棰嗘枡鍑哄簱鏍¢獙 - if (HBillType == "1204") - { - string[] sArray = sBarCodeNew.Split('@'); - string HMaterNumber = ""; - HMaterNumber = sArray[0]; - Int64 HQty = 0; - HQty = ClsPub.isInt(sArray[4]); - string HBarchNo = ""; - HBarchNo = sArray[6]; + // } + // //棰嗘枡鍑哄簱鏍¢獙 + // if (HBillType == "1204") + // { + // string[] sArray = sBarCodeNew.Split('@'); + // string HMaterNumber = ""; + // HMaterNumber = sArray[0]; + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sArray[4]); + // string HBarchNo = ""; + // HBarchNo = sArray[6]; - DateTime HSCRQ = ClsPub.isDate(sArray[3]); - DateTime HYXQZ = ClsPub.isDate(sArray[5]); + // DateTime HSCRQ = ClsPub.isDate(sArray[3]); + // DateTime HYXQZ = ClsPub.isDate(sArray[5]); - //閲囪喘璁㈠崟鍙� - string HPOOrderBillNo = ""; - HPOOrderBillNo = ClsPub.isStrNull(sArray[8]); + // //閲囪喘璁㈠崟鍙� + // string HPOOrderBillNo = ""; + // HPOOrderBillNo = ClsPub.isStrNull(sArray[8]); - Int64 HMaterID = 0; + // Int64 HMaterID = 0; - SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - DataSet Dss; - Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + // DataSet Dss; + // Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - DataSet Dss1; - Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss1; + // Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - HTM = HOrgNumber + HMaterID + HBarchNo; + // HTM = HOrgNumber + HMaterID + HBarchNo; - DataSet Dss5; - Dss5 = oCn.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCn.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", " + 0 + "," + 0 + ",'','',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ.ToShortDateString() + "','" + HYXQZ.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", " + 0 + "," + 0 + ",'','',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ.ToShortDateString() + "','" + HYXQZ.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - } + // } - } - //鐢熶骇琛ユ枡鏍¢獙 - if (HBillType == "1254") - { - string[] sArray = sBarCodeNew.Split('@'); - string HMaterNumber = ""; - HMaterNumber = sArray[0]; - Int64 HQty = 0; - HQty = ClsPub.isInt(sArray[4]); - string HBarchNo = ""; - HBarchNo = sArray[6]; + // } + // //鐢熶骇琛ユ枡鏍¢獙 + // if (HBillType == "1254") + // { + // string[] sArray = sBarCodeNew.Split('@'); + // string HMaterNumber = ""; + // HMaterNumber = sArray[0]; + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sArray[4]); + // string HBarchNo = ""; + // HBarchNo = sArray[6]; - DateTime HSCRQ = ClsPub.isDate(sArray[3]); - DateTime HYXQZ = ClsPub.isDate(sArray[5]); + // DateTime HSCRQ = ClsPub.isDate(sArray[3]); + // DateTime HYXQZ = ClsPub.isDate(sArray[5]); - //閲囪喘璁㈠崟鍙� - string HPOOrderBillNo = ""; - HPOOrderBillNo = ClsPub.isStrNull(sArray[8]); + // //閲囪喘璁㈠崟鍙� + // string HPOOrderBillNo = ""; + // HPOOrderBillNo = ClsPub.isStrNull(sArray[8]); - Int64 HMaterID = 0; + // Int64 HMaterID = 0; - SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - DataSet Dss; - Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + // DataSet Dss; + // Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - DataSet Dss1; - Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss1; + // Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - HTM = HOrgNumber + HMaterID + HBarchNo; + // HTM = HOrgNumber + HMaterID + HBarchNo; - DataSet Dss5; - Dss5 = oCn.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCn.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", " + 0 + "," + 0 + ",'','',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ.ToShortDateString() + "','" + HYXQZ.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", " + 0 + "," + 0 + ",'','',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ.ToShortDateString() + "','" + HYXQZ.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - } + // } - } - //閿�鍞嚭搴撴牎楠� - if (HBillType == "1205") - { - string HMaterNumber = ""; - HMaterNumber = sBarCodeNew.Substring(0, 10); - string HSCRQ = ""; - HSCRQ = "20" + sBarCodeNew.Substring(10, 6); - Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); - Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); - Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); + // } + // //閿�鍞嚭搴撴牎楠� + // if (HBillType == "1205") + // { + // string HMaterNumber = ""; + // HMaterNumber = sBarCodeNew.Substring(0, 10); + // string HSCRQ = ""; + // HSCRQ = "20" + sBarCodeNew.Substring(10, 6); + // Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); + // Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); + // Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); - string HBatchNo = ""; - HBatchNo = sBarCodeNew.Substring(16, 11); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + // string HBatchNo = ""; + // HBatchNo = sBarCodeNew.Substring(16, 11); + // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - Int64 HMaterID = 0; - DataSet Dss1; - Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); - HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); - string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); - string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); - Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - DataSet Dss; - Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); - string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); - HTM = HOrgNumber + HMaterID + HBatchNo; + // Int64 HMaterID = 0; + // DataSet Dss1; + // Dss1 = oCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and huseorgid = " + HOrgID, "Gy_Material"); + // HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]); + // string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]); + // string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]); + // Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); + // DataSet Dss; + // Dss = oCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList"); + // string HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]); + // HTM = HOrgNumber + HMaterID + HBatchNo; - DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); + // DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); - string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); - Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); - Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); - Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); - DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); + // string HYXQZ = "20" + sBarCodeNew.Substring(27, 6); + // Int64 Year1 = ClsPub.isInt(HYXQZ.Substring(0, 4)); + // Int64 Month1 = ClsPub.isInt(HYXQZ.Substring(4, 2)); + // Int64 Day1 = ClsPub.isInt(HYXQZ.Substring(6, 2)); + // DateTime HYXQZ1 = ClsPub.isDate(Year1 + "-" + Month1 + "-" + Day1); - Int64 HQty = 0; - HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); + // Int64 HQty = 0; + // HQty = ClsPub.isInt(sBarCodeNew.Substring(33, 3)); - DataSet Dss5; - Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); - if (Dss5.Tables[0].Rows.Count > 0) - { + // DataSet Dss5; + // Dss5 = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + HTM + "'", "Gy_BarCodeBill"); + // if (Dss5.Tables[0].Rows.Count > 0) + // { - } - else - { + // } + // else + // { - string ModName = "85"; - var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); - Int64 HSupID = 0; - oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + - ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + - ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + - ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + - ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + - ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + - ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + - ") values (" - + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() - + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() - + ", 0,0,'','',0" - + ", 0,'',0,0,0,''" - + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" - + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" - + ",0,0,0" - + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); + // string ModName = "85"; + // var HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); + // Int64 HSupID = 0; + // oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + + // ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + + // ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + + // ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + + // ",HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate " + + // ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + + // ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + + // ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag " + + // ") values (" + // + "'" + HTM + "','鎵规鏉$爜'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() + // + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString() + // + ", 0,0,'','',0" + // + ", 0,'',0,0,0,''" + // + ",0,'','','" + HSCRQ1.ToShortDateString() + "','" + HYXQZ1.ToShortDateString() + "','',getdate()" + // + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1" + // + ",0,0,0" + // + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','',1)"); - } + // } - } - //objJsonResult.code = "0"; - //objJsonResult.count = 1; - //objJsonResult.Message = DBUtility.ClsPub.sErrInfo; - //objJsonResult.data = ; - return HTM; + // } + // //objJsonResult.code = "0"; + // //objJsonResult.count = 1; + // //objJsonResult.Message = DBUtility.ClsPub.sErrInfo; + // //objJsonResult.data = ; + // return HTM; - } - catch (Exception e) - { - //objJsonResult.code = "0"; - //objJsonResult.count = 1; - //objJsonResult.Message = e.Message + ";" + e.StackTrace; - //objJsonResult.data = null; - return e.Message + ";" + e.StackTrace; - } + // } + // catch (Exception e) + // { + // //objJsonResult.code = "0"; + // //objJsonResult.count = 1; + // //objJsonResult.Message = e.Message + ";" + e.StackTrace; + // //objJsonResult.data = null; + // return e.Message + ";" + e.StackTrace; + // } + //} + + + + + + [Route("kf_PoStockInBill/JX_Json")] + [HttpGet] + public static string JX_Json(string sBarCodeNew, long hinterid, string HBillType, long HOrgID, string HBillNo, string HMaker) + { + string result; + try + { + Pub_Class.ClsXt_SystemParameter clsXt_SystemParameter = new Pub_Class.ClsXt_SystemParameter(); + WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); + string text = ""; + string text1 = ""; + bool flag = HBillType == "1201"; + if (flag) + { + string[] array = sBarCodeNew.Split(new char[] + { + '@' + }); + string str = array[0]; + long num = (long)ClsPub.isInt(array[4]); + string text2 = array[6]; + DateTime dateTime = ClsPub.isDate(array[3]); + DateTime dateTime2 = ClsPub.isDate(array[5]); + string str2 = ClsPub.isStrNull(array[8]); + ClsCN clsCN = new ClsCN(); + DataSet dataSet = clsCN.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str3 = ClsPub.isStrNull(dataSet.Tables[0].Rows[0]["HNumber"]); + + + + DataSet Dss7; + Dss7 = clsCN.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str + "'", "T_BD_MATERIAL"); + str = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + + DataSet dataSet2 = clsCN.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num2 = ClsPub.isLong(dataSet2.Tables[0].Rows[0]["HItemID"]); + string text3 = ClsPub.isStrNull(dataSet2.Tables[0].Rows[0]["HName"]); + string text4 = ClsPub.isStrNull(dataSet2.Tables[0].Rows[0]["HModel"]); + long num3 = (long)ClsPub.isInt(dataSet2.Tables[0].Rows[0]["HUnitID"]); + text = str3 + num2.ToString() + text2 + "#" + num; + text1 = str3 + num2.ToString() + text2; + DataSet dataSet3 = clsCN.RunProcReturn(" select fid,FMATERIALID,FENTRYID,FBILLNO from h_v_RECEIVEQuery where FSRCBILLNO= '" + str2 + "' and FLOT_TEXT = '" + text2 + "' and FMATERIALID = " + num2.ToString(), "h_v_RECEIVEQuery"); + //DataSet dataSet3 = clsCN.RunProcReturn(" select fid,FMATERIALID,FENTRYID,FBILLNO from h_v_RECEIVEQuery where FLOT_TEXT= '" + text2 + "' and FPRODUCEDATE = '" + dateTime + "' and FMATERIALID = " + num2.ToString(), "h_v_RECEIVEQuery"); + num2 = ClsPub.isLong(dataSet3.Tables[0].Rows[0]["FMATERIALID"]); + long num4 = ClsPub.isLong(dataSet3.Tables[0].Rows[0]["fid"]); + long num5 = ClsPub.isLong(dataSet3.Tables[0].Rows[0]["FENTRYID"]); + string text5 = ClsPub.isStrNull(dataSet3.Tables[0].Rows[0]["FBILLNO"]); + DataSet dataSet4 = clsCN.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag2 = dataSet4.Tables[0].Rows.Count > 0; + if (flag2) + { + DataSet dataSet5 = clsCN.RunProcReturn(string.Concat(new string[] + { + " select * from KF_PonderationBillMain_Temp where HInterID = ", + hinterid.ToString(), + " and HBillType = '", + HBillType, + "' and hsourcebillno = '", + text5, + "' " + }), "KF_PonderationBillMain_Temp"); + bool flag3 = dataSet5.Tables[0].Rows.Count > 0; + if (!flag3) + { + //POStockInBillController postockInBillController = new POStockInBillController(); + //postockInBillController.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo); + + WEBSController webscontroller4 = new WEBSController(); + object obj4 = webscontroller4.Get_SourceBarCode_PoStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID,1, oSystemParameterMain, ref DBUtility.ClsPub.sErrInfo); + + + + } + } + else + { + string billCode = "85"; + long num6 = ClsPub.CreateBillID_Prod(billCode, ref ClsPub.sExeReturnInfo); + long num7 = 0L; + clsCN.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num2.ToString(), + ",", + num3.ToString(), + ",", + num.ToString(), + ",'", + text2, + "',", + num7.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num.ToString(), + ", ", + num4.ToString(), + ",", + num5.ToString(), + ",'", + text5.ToString(), + "','1103',0, 0,'',0,0,0,'',0,'','','", + dateTime.ToShortDateString(), + "','", + dateTime2.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num6.ToString(), + ",1,0,0,0,'", + text3, + "','", + text4, + "','',0,'','',1)" + })); + DataSet dataSet6 = clsCN.RunProcReturn(string.Concat(new string[] + { + " select * from KF_PonderationBillMain_Temp where HBarCode= '", + text1, + "' and HInterID = ", + hinterid.ToString(), + " and HBillType = '", + HBillType, + "' and hsourcebillno = '", + text5, + "' " + }), "KF_PonderationBillMain_Temp"); + bool flag4 = dataSet6.Tables[0].Rows.Count > 0; + if (!flag4) + { + POStockInBillController postockInBillController2 = new POStockInBillController(); + postockInBillController2.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo); + } + } + } + bool flag5 = HBillType == "1202"; + if (flag5) + { + string text6 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text7 = text6.Substring(0, 1); + bool flag6 = text7.Contains("W") || text7.Contains("N"); + if (flag6) + { + string text8 = sBarCodeNew.Substring(0, 10); + string str4 = sBarCodeNew.Substring(10, 10); + string text9 = "20" + sBarCodeNew.Substring(20, 6); + long num8 = (long)ClsPub.isInt(text9.Substring(0, 4)); + long num9 = (long)ClsPub.isInt(text9.Substring(4, 2)); + long num10 = (long)ClsPub.isInt(text9.Substring(6, 2)); + long num11 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text10 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text11 = "20" + text10.Substring(0, 6); + long num12 = (long)ClsPub.isInt(text11.Substring(0, 4)); + long num13 = (long)ClsPub.isInt(text11.Substring(4, 2)); + long num14 = (long)ClsPub.isInt(text11.Substring(6, 2)); + DateTime dateTime3 = ClsPub.isDate(string.Concat(new string[] + { + num12.ToString(), + "-", + num13.ToString(), + "-", + num14.ToString() + })); + string text12 = sBarCodeNew.Remove(0, 26); + string text13 = text12.Remove(text12.Length - 10, 10); + ClsCN clsCN2 = new ClsCN(); + + + DataSet Dss7; + Dss7 = clsCN2.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str4 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN2.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str4 + "'", "T_BD_MATERIAL"); + str4 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str4 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + + DataSet dataSet7 = clsCN2.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str4 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num15 = ClsPub.isLong(dataSet7.Tables[0].Rows[0]["HItemID"]); + string text14 = ClsPub.isStrNull(dataSet7.Tables[0].Rows[0]["HName"]); + string text15 = ClsPub.isStrNull(dataSet7.Tables[0].Rows[0]["HModel"]); + long num16 = (long)ClsPub.isInt(dataSet7.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet8 = clsCN2.RunProcReturn(string.Concat(new string[] + { + "select * from h_v_SCStockInCheckBill_Json where HYear =", + num8.ToString(), + " and HMonth = ", + num9.ToString(), + " and HDay = ", + num10.ToString(), + " and HMaterID = ", + num15.ToString(), + "and 鎵规 = '", + text13.ToString(), + "'" + }), "h_v_SCStockInCheckBill_Json"); + long num17 = ClsPub.isLong(dataSet8.Tables[0].Rows[0]["HSourceInterID"]); + long num18 = ClsPub.isLong(dataSet8.Tables[0].Rows[0]["HSourceEntryID"]); + string text16 = ClsPub.isStrNull(dataSet8.Tables[0].Rows[0]["HBillNo"]); + DataSet dataSet9 = clsCN2.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str5 = ClsPub.isStrNull(dataSet9.Tables[0].Rows[0]["HNumber"]); + text = str5 + num15.ToString() + text13 + text9 + "#" + num11; + text1 = str5 + num15.ToString() + text13 + text9; + DateTime dateTime4 = ClsPub.isDate(string.Concat(new string[] + { + num8.ToString(), + "-", + num9.ToString(), + "-", + num10.ToString() + })); + DataSet dataSet10 = clsCN2.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag7 = dataSet10.Tables[0].Rows.Count > 0; + if (flag7) + { + DataSet dataSet11 = clsCN2.RunProcReturn(string.Concat(new string[] + { + " select * from KF_PonderationBillMain_Temp where HBarCode= '", + text1, + "' and HInterID = ", + hinterid.ToString(), + " and HBillType = '", + HBillType, + "' and hsourcebillno = '", + text16, + "' " + }), "KF_PonderationBillMain_Temp"); + bool flag8 = dataSet11.Tables[0].Rows.Count > 0; + if (!flag8) + { + WEBSController webscontroller = new WEBSController(); + object obj = webscontroller.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, text16, "3714", HMaker, HOrgID); + } + } + else + { + string billCode2 = "85"; + long num19 = ClsPub.CreateBillID_Prod(billCode2, ref ClsPub.sExeReturnInfo); + long num20 = 0L; + clsCN2.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num15.ToString(), + ",", + num16.ToString(), + ",", + num11.ToString(), + ",'", + text13, + "',", + num20.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num11.ToString(), + ", ", + num17.ToString(), + ",", + num18.ToString(), + ",'", + text16.ToString(), + "','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime4.ToShortDateString(), + "','", + dateTime3.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num19.ToString(), + ",1,0,0,0,'", + text14, + "','", + text15, + "','',0,'','',1)" + })); + DataSet dataSet12 = clsCN2.RunProcReturn(string.Concat(new string[] + { + " select * from KF_PonderationBillMain_Temp where HBarCode= '", + text1, + "' and HInterID = ", + hinterid.ToString(), + " and HBillType = '", + HBillType, + "' and hsourcebillno = '", + text16, + "' " + }), "KF_PonderationBillMain_Temp"); + bool flag9 = dataSet12.Tables[0].Rows.Count > 0; + if (!flag9) + { + WEBSController webscontroller2 = new WEBSController(); + object obj2 = webscontroller2.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, text16, "3714", HMaker, HOrgID); + } + } + } + else + { + string str6 = sBarCodeNew.Substring(0, 10); + string text17 = "20" + sBarCodeNew.Substring(10, 6); + long num21 = (long)ClsPub.isInt(text17.Substring(0, 4)); + long num22 = (long)ClsPub.isInt(text17.Substring(4, 2)); + long num23 = (long)ClsPub.isInt(text17.Substring(6, 2)); + long num24 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text18 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text19 = "20" + text18.Substring(0, 6); + long num25 = (long)ClsPub.isInt(text19.Substring(0, 4)); + long num26 = (long)ClsPub.isInt(text19.Substring(4, 2)); + long num27 = (long)ClsPub.isInt(text19.Substring(6, 2)); + DateTime dateTime5 = ClsPub.isDate(string.Concat(new string[] + { + num25.ToString(), + "-", + num26.ToString(), + "-", + num27.ToString() + })); + string text20 = sBarCodeNew.Remove(0, 16); + string text21 = text20.Remove(text20.Length - 9, 9); + ClsCN clsCN3 = new ClsCN(); + DataSet dataSet13 = clsCN3.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str6 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num28 = ClsPub.isLong(dataSet13.Tables[0].Rows[0]["HItemID"]); + string text22 = ClsPub.isStrNull(dataSet13.Tables[0].Rows[0]["HName"]); + string text23 = ClsPub.isStrNull(dataSet13.Tables[0].Rows[0]["HModel"]); + long num29 = (long)ClsPub.isInt(dataSet13.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet14 = clsCN3.RunProcReturn(string.Concat(new string[] + { + "select * from h_v_SCStockInCheckBill_Json where HYear =", + num21.ToString(), + " and HMonth = ", + num22.ToString(), + " and HDay = ", + num23.ToString(), + " and HMaterID = ", + num28.ToString(), + "and 鎵规 = '", + text21.ToString(), + "'" + }), "h_v_SCStockInCheckBill_Json"); + long num30 = ClsPub.isLong(dataSet14.Tables[0].Rows[0]["HSourceInterID"]); + long num31 = ClsPub.isLong(dataSet14.Tables[0].Rows[0]["HSourceEntryID"]); + string text24 = ClsPub.isStrNull(dataSet14.Tables[0].Rows[0]["HBillNo"]); + DataSet dataSet15 = clsCN3.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str7 = ClsPub.isStrNull(dataSet15.Tables[0].Rows[0]["HNumber"]); + text = str7 + num28.ToString() + text21 + text17 + "#" + num24; + text1 = str7 + num28.ToString() + text21 + text17; + DateTime dateTime6 = ClsPub.isDate(string.Concat(new string[] + { + num21.ToString(), + "-", + num22.ToString(), + "-", + num23.ToString() + })); + DataSet dataSet16 = clsCN3.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag10 = dataSet16.Tables[0].Rows.Count > 0; + if (flag10) + { + DataSet dataSet17 = clsCN3.RunProcReturn(string.Concat(new string[] + { + " select * from KF_PonderationBillMain_Temp where HBarCode= '", + text1, + "' and HInterID = ", + hinterid.ToString(), + " and HBillType = '", + HBillType, + "' and hsourcebillno = '", + text24, + "' " + }), "KF_PonderationBillMain_Temp"); + bool flag11 = dataSet17.Tables[0].Rows.Count > 0; + if (!flag11) + { + WEBSController webscontroller3 = new WEBSController(); + object obj3 = webscontroller3.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, text24, "3714", HMaker, HOrgID); + } + } + else + { + string billCode3 = "85"; + long num32 = ClsPub.CreateBillID_Prod(billCode3, ref ClsPub.sExeReturnInfo); + long num33 = 0L; + clsCN3.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num28.ToString(), + ",", + num29.ToString(), + ",", + num24.ToString(), + ",'", + text21, + "',", + num33.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num24.ToString(), + ", ", + num30.ToString(), + ",", + num31.ToString(), + ",'", + text24.ToString(), + "','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime6.ToShortDateString(), + "','", + dateTime5.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num32.ToString(), + ",1,0,0,0,'", + text22, + "','", + text23, + "','',0,'','',1)" + })); + DataSet dataSet18 = clsCN3.RunProcReturn(string.Concat(new string[] + { + " select * from KF_PonderationBillMain_Temp where HBarCode= '", + text1, + "' and HInterID = ", + hinterid.ToString(), + " and HBillType = '", + HBillType, + "' and hsourcebillno = '", + text24, + "' " + }), "KF_PonderationBillMain_Temp"); + bool flag12 = dataSet18.Tables[0].Rows.Count > 0; + if (!flag12) + { + WEBSController webscontroller4 = new WEBSController(); + object obj4 = webscontroller4.get_SourceBarCode_ProductIn_Json(hinterid, HBillNo, HBillType, text24, "3714", HMaker, HOrgID); + } + } + } + } + bool flag13 = HBillType == "1244"; + if (flag13) + { + bool flag14 = sBarCodeNew.Contains("@"); + if (flag14) + { + string[] array2 = sBarCodeNew.Split(new char[] + { + '@' + }); + string str8 = array2[0]; + Double num34 = (long)ClsPub.isDoule(array2[4]); + string text25 = array2[6]; + DateTime dateTime7 = ClsPub.isDate(array2[3]); + DateTime dateTime8 = ClsPub.isDate(array2[5]); + string text26 = ClsPub.isStrNull(array2[8]); + ClsCN clsCN4 = new ClsCN(); + DataSet dataSet19 = clsCN4.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str9 = ClsPub.isStrNull(dataSet19.Tables[0].Rows[0]["HNumber"]); + + DataSet Dss7; + Dss7 = clsCN4.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str8 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN4.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str8 + "'", "T_BD_MATERIAL"); + str8 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str8 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + + + DataSet dataSet20 = clsCN4.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str8 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num35 = ClsPub.isLong(dataSet20.Tables[0].Rows[0]["HItemID"]); + string text27 = ClsPub.isStrNull(dataSet20.Tables[0].Rows[0]["HName"]); + string text28 = ClsPub.isStrNull(dataSet20.Tables[0].Rows[0]["HModel"]); + long num36 = (long)ClsPub.isInt(dataSet20.Tables[0].Rows[0]["HUnitID"]); + //鏉$爜鐢熸垚瑙勫垯 缁勭粐浠g爜 + 鐗╂枡ID + 鎵规鍙� + # + 鏁伴噺 鐢ㄤ簬鎵规鐮� 姣忔鎵爜绱鏁伴噺 + text = str9 + num35.ToString() + text25 + "#" + num34; + text1 = str9 + num35.ToString() + text25; + DataSet dataSet21 = clsCN4.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag15 = dataSet21.Tables[0].Rows.Count > 0; + if (!flag15) + { + string billCode4 = "85"; + long num37 = ClsPub.CreateBillID_Prod(billCode4, ref ClsPub.sExeReturnInfo); + long num38 = 0L; + clsCN4.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num35.ToString(), + ",", + num36.ToString(), + ",", + num34.ToString(), + ",'", + text25, + "',", + num38.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num34.ToString(), + ", 0,0,'','1244',0, 0,'',0,0,0,'',0,'','','", + dateTime7.ToShortDateString(), + "','", + dateTime8.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num37.ToString(), + ",1,0,0,0,'", + text27, + "','", + text28, + "','',0,'','',1)" + })); + } + } + else + { + string text29 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text30 = text29.Substring(0, 1); + bool flag16 = text30.Contains("W") || text30.Contains("N"); + if (flag16) + { + string text31 = sBarCodeNew.Substring(0, 10); + string str10 = sBarCodeNew.Substring(10, 10); + string text32 = "20" + sBarCodeNew.Substring(20, 6); + long num39 = (long)ClsPub.isInt(text32.Substring(0, 4)); + long num40 = (long)ClsPub.isInt(text32.Substring(4, 2)); + long num41 = (long)ClsPub.isInt(text32.Substring(6, 2)); + long num42 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text33 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text34 = "20" + text33.Substring(0, 6); + long num43 = (long)ClsPub.isInt(text34.Substring(0, 4)); + long num44 = (long)ClsPub.isInt(text34.Substring(4, 2)); + long num45 = (long)ClsPub.isInt(text34.Substring(6, 2)); + DateTime dateTime9 = ClsPub.isDate(string.Concat(new string[] + { + num43.ToString(), + "-", + num44.ToString(), + "-", + num45.ToString() + })); + string text35 = sBarCodeNew.Remove(0, 26); + string text36 = text35.Remove(text35.Length - 10, 10); + ClsCN clsCN5 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN5.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str10 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN5.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str10 + "'", "T_BD_MATERIAL"); + str10 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str10 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + + DataSet dataSet22 = clsCN5.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str10 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num46 = ClsPub.isLong(dataSet22.Tables[0].Rows[0]["HItemID"]); + string text37 = ClsPub.isStrNull(dataSet22.Tables[0].Rows[0]["HName"]); + string text38 = ClsPub.isStrNull(dataSet22.Tables[0].Rows[0]["HModel"]); + long num47 = (long)ClsPub.isInt(dataSet22.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet23 = clsCN5.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str11 = ClsPub.isStrNull(dataSet23.Tables[0].Rows[0]["HNumber"]); + text = str11 + num46.ToString() + text36 + "#" + num42; + text1 = str11 + num46.ToString() + text36; + DateTime dateTime10 = ClsPub.isDate(string.Concat(new string[] + { + num39.ToString(), + "-", + num40.ToString(), + "-", + num41.ToString() + })); + DataSet dataSet24 = clsCN5.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag17 = dataSet24.Tables[0].Rows.Count > 0; + if (!flag17) + { + string billCode5 = "85"; + long num48 = ClsPub.CreateBillID_Prod(billCode5, ref ClsPub.sExeReturnInfo); + long num49 = 0L; + clsCN5.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num46.ToString(), + ",", + num47.ToString(), + ",", + num42.ToString(), + ",'", + text36, + "',", + num49.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num42.ToString(), + ", 0,0,'','',0, 0,'',0,0,0,'',0,'','','", + dateTime10.ToShortDateString(), + "','", + dateTime9.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num48.ToString(), + ",1,0,0,0,'", + text37, + "','", + text38, + "','',0,'','',1)" + })); + } + } + else + { + string str12 = sBarCodeNew.Substring(0, 10); + string text39 = "20" + sBarCodeNew.Substring(10, 6); + long num50 = (long)ClsPub.isInt(text39.Substring(0, 4)); + long num51 = (long)ClsPub.isInt(text39.Substring(4, 2)); + long num52 = (long)ClsPub.isInt(text39.Substring(6, 2)); + long num53 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text40 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text41 = "20" + text40.Substring(0, 6); + long num54 = (long)ClsPub.isInt(text41.Substring(0, 4)); + long num55 = (long)ClsPub.isInt(text41.Substring(4, 2)); + long num56 = (long)ClsPub.isInt(text41.Substring(6, 2)); + DateTime dateTime11 = ClsPub.isDate(string.Concat(new string[] + { + num54.ToString(), + "-", + num55.ToString(), + "-", + num56.ToString() + })); + string text42 = sBarCodeNew.Remove(0, 16); + string text43 = text42.Remove(text42.Length - 9, 9); + ClsCN clsCN6 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN6.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str12 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN6.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str12 + "'", "T_BD_MATERIAL"); + str12 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str12 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet25 = clsCN6.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str12 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num57 = ClsPub.isLong(dataSet25.Tables[0].Rows[0]["HItemID"]); + string text44 = ClsPub.isStrNull(dataSet25.Tables[0].Rows[0]["HName"]); + string text45 = ClsPub.isStrNull(dataSet25.Tables[0].Rows[0]["HModel"]); + long num58 = (long)ClsPub.isInt(dataSet25.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet26 = clsCN6.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str13 = ClsPub.isStrNull(dataSet26.Tables[0].Rows[0]["HNumber"]); + text = str13 + num57.ToString() + text43 + "#" + num53; + text1 = str13 + num57.ToString() + text43; + DateTime dateTime12 = ClsPub.isDate(string.Concat(new string[] + { + num50.ToString(), + "-", + num51.ToString(), + "-", + num52.ToString() + })); + DataSet dataSet27 = clsCN6.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag18 = dataSet27.Tables[0].Rows.Count > 0; + if (!flag18) + { + string billCode6 = "85"; + long num59 = ClsPub.CreateBillID_Prod(billCode6, ref ClsPub.sExeReturnInfo); + long num60 = 0L; + clsCN6.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num57.ToString(), + ",", + num58.ToString(), + ",", + num53.ToString(), + ",'", + text43, + "',", + num60.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num53.ToString(), + ", 0,0,'','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime12.ToShortDateString(), + "','", + dateTime11.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num59.ToString(), + ",1,0,0,0,'", + text44, + "','", + text45, + "','',0,'','',1)" + })); + } + } + } + } + bool flag19 = HBillType == "1207"; + if (flag19) + { + bool flag20 = sBarCodeNew.Contains("@"); + if (flag20) + { + string[] array3 = sBarCodeNew.Split(new char[] + { + '@' + }); + string str14 = array3[0]; + long num61 = (long)ClsPub.isInt(array3[4]); + string text46 = array3[6]; + DateTime dateTime13 = ClsPub.isDate(array3[3]); + DateTime dateTime14 = ClsPub.isDate(array3[5]); + string text47 = ClsPub.isStrNull(array3[8]); + ClsCN clsCN7 = new ClsCN(); + DataSet dataSet28 = clsCN7.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str15 = ClsPub.isStrNull(dataSet28.Tables[0].Rows[0]["HNumber"]); + + DataSet Dss7; + Dss7 = clsCN7.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str14 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN7.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str14 + "'", "T_BD_MATERIAL"); + str14 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str14 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet29 = clsCN7.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str14 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num62 = ClsPub.isLong(dataSet29.Tables[0].Rows[0]["HItemID"]); + string text48 = ClsPub.isStrNull(dataSet29.Tables[0].Rows[0]["HName"]); + string text49 = ClsPub.isStrNull(dataSet29.Tables[0].Rows[0]["HModel"]); + long num63 = (long)ClsPub.isInt(dataSet29.Tables[0].Rows[0]["HUnitID"]); + + text = str15 + num62.ToString() + text46 + dateTime13.Year.ToString() + dateTime13.Month.ToString() + dateTime13.Day.ToString() + "#" + num61; + text1 = str15 + num62.ToString() + text46 + dateTime13.Year.ToString() + dateTime13.Month.ToString() + dateTime13.Day.ToString(); + DataSet dataSet30 = clsCN7.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag21 = dataSet30.Tables[0].Rows.Count > 0; + if (!flag21) + { + string billCode7 = "85"; + long num64 = ClsPub.CreateBillID_Prod(billCode7, ref ClsPub.sExeReturnInfo); + long num65 = 0L; + clsCN7.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num62.ToString(), + ",", + num63.ToString(), + ",", + num61.ToString(), + ",'", + text46, + "',", + num65.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num61.ToString(), + ", 0,0,'','1207',0, 0,'',0,0,0,'',0,'','','", + dateTime13.ToShortDateString(), + "','", + dateTime14.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num64.ToString(), + ",1,0,0,0,'", + text48, + "','", + text49, + "','',0,'','',1)" + })); + } + } + else + { + string text50 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text51 = text50.Substring(0, 1); + bool flag22 = text51.Contains("W") || text51.Contains("N"); + if (flag22) + { + string text52 = sBarCodeNew.Substring(0, 10); + string str16 = sBarCodeNew.Substring(10, 10); + string text53 = "20" + sBarCodeNew.Substring(20, 6); + long num66 = (long)ClsPub.isInt(text53.Substring(0, 4)); + long num67 = (long)ClsPub.isInt(text53.Substring(4, 2)); + long num68 = (long)ClsPub.isInt(text53.Substring(6, 2)); + long num69 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text54 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text55 = "20" + text54.Substring(0, 6); + long num70 = (long)ClsPub.isInt(text55.Substring(0, 4)); + long num71 = (long)ClsPub.isInt(text55.Substring(4, 2)); + long num72 = (long)ClsPub.isInt(text55.Substring(6, 2)); + DateTime dateTime15 = ClsPub.isDate(string.Concat(new string[] + { + num70.ToString(), + "-", + num71.ToString(), + "-", + num72.ToString() + })); + string text56 = sBarCodeNew.Remove(0, 26); + string text57 = text56.Remove(text56.Length - 10, 10); + ClsCN clsCN8 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN8.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str16 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN8.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str16 + "'", "T_BD_MATERIAL"); + str16 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str16 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet31 = clsCN8.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str16 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num73 = ClsPub.isLong(dataSet31.Tables[0].Rows[0]["HItemID"]); + string text58 = ClsPub.isStrNull(dataSet31.Tables[0].Rows[0]["HName"]); + string text59 = ClsPub.isStrNull(dataSet31.Tables[0].Rows[0]["HModel"]); + long num74 = (long)ClsPub.isInt(dataSet31.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet32 = clsCN8.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str17 = ClsPub.isStrNull(dataSet32.Tables[0].Rows[0]["HNumber"]); + text = str17 + num73.ToString() + text57 + text53 + "#" + num69; + text1 = str17 + num73.ToString() + text57 + text53; + DateTime dateTime16 = ClsPub.isDate(string.Concat(new string[] + { + num66.ToString(), + "-", + num67.ToString(), + "-", + num68.ToString() + })); + DataSet dataSet33 = clsCN8.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag23 = dataSet33.Tables[0].Rows.Count > 0; + if (!flag23) + { + string billCode8 = "85"; + long num75 = ClsPub.CreateBillID_Prod(billCode8, ref ClsPub.sExeReturnInfo); + long num76 = 0L; + clsCN8.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num73.ToString(), + ",", + num74.ToString(), + ",", + num69.ToString(), + ",'", + text57, + "',", + num76.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num69.ToString(), + ", 0,0,'','',0, 0,'',0,0,0,'',0,'','','", + dateTime16.ToShortDateString(), + "','", + dateTime15.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num75.ToString(), + ",1,0,0,0,'", + text58, + "','", + text59, + "','',0,'','',1)" + })); + } + } + else + { + string str18 = sBarCodeNew.Substring(0, 10); + string text60 = "20" + sBarCodeNew.Substring(10, 6); + long num77 = (long)ClsPub.isInt(text60.Substring(0, 4)); + long num78 = (long)ClsPub.isInt(text60.Substring(4, 2)); + long num79 = (long)ClsPub.isInt(text60.Substring(6, 2)); + long num80 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text61 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text62 = "20" + text61.Substring(0, 6); + long num81 = (long)ClsPub.isInt(text62.Substring(0, 4)); + long num82 = (long)ClsPub.isInt(text62.Substring(4, 2)); + long num83 = (long)ClsPub.isInt(text62.Substring(6, 2)); + DateTime dateTime17 = ClsPub.isDate(string.Concat(new string[] + { + num81.ToString(), + "-", + num82.ToString(), + "-", + num83.ToString() + })); + string text63 = sBarCodeNew.Remove(0, 16); + string text64 = text63.Remove(text63.Length - 9, 9); + ClsCN clsCN9 = new ClsCN(); + DataSet dataSet34 = clsCN9.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str18 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num84 = ClsPub.isLong(dataSet34.Tables[0].Rows[0]["HItemID"]); + string text65 = ClsPub.isStrNull(dataSet34.Tables[0].Rows[0]["HName"]); + string text66 = ClsPub.isStrNull(dataSet34.Tables[0].Rows[0]["HModel"]); + long num85 = (long)ClsPub.isInt(dataSet34.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet35 = clsCN9.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str19 = ClsPub.isStrNull(dataSet35.Tables[0].Rows[0]["HNumber"]); + text = str19 + num84.ToString() + text64 + text60 + "#" + num80; + text1 = str19 + num84.ToString() + text64 + text60; + DateTime dateTime18 = ClsPub.isDate(string.Concat(new string[] + { + num77.ToString(), + "-", + num78.ToString(), + "-", + num79.ToString() + })); + DataSet dataSet36 = clsCN9.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "' and HProduceDate = '" + dateTime18 + "'", "Gy_BarCodeBill"); + bool flag24 = dataSet36.Tables[0].Rows.Count > 0; + if (!flag24) + { + string billCode9 = "85"; + long num86 = ClsPub.CreateBillID_Prod(billCode9, ref ClsPub.sExeReturnInfo); + long num87 = 0L; + clsCN9.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num84.ToString(), + ",", + num85.ToString(), + ",", + num80.ToString(), + ",'", + text64, + "',", + num87.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num80.ToString(), + ", 0,0,'','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime18.ToShortDateString(), + "','", + dateTime17.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num86.ToString(), + ",1,0,0,0,'", + text65, + "','", + text66, + "','',0,'','',1)" + })); + } + } + } + } + bool flag25 = HBillType == "1206"; + if (flag25) + { + bool flag26 = sBarCodeNew.Contains("@"); + if (flag26) + { + string[] array4 = sBarCodeNew.Split(new char[] + { + '@' + }); + string str20 = array4[0]; + long num88 = (long)ClsPub.isInt(array4[4]); + string text67 = array4[6]; + DateTime dateTime19 = ClsPub.isDate(array4[3]); + DateTime dateTime20 = ClsPub.isDate(array4[5]); + string text68 = ClsPub.isStrNull(array4[8]); + ClsCN clsCN10 = new ClsCN(); + DataSet dataSet37 = clsCN10.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str21 = ClsPub.isStrNull(dataSet37.Tables[0].Rows[0]["HNumber"]); + + DataSet Dss7; + Dss7 = clsCN10.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str20 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN10.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str20 + "'", "T_BD_MATERIAL"); + str20 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str20 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet38 = clsCN10.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str20 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num89 = ClsPub.isLong(dataSet38.Tables[0].Rows[0]["HItemID"]); + string text69 = ClsPub.isStrNull(dataSet38.Tables[0].Rows[0]["HName"]); + string text70 = ClsPub.isStrNull(dataSet38.Tables[0].Rows[0]["HModel"]); + long num90 = (long)ClsPub.isInt(dataSet38.Tables[0].Rows[0]["HUnitID"]); + text = str21 + num89.ToString() + text67 + "#" + num88; + text1 = str21 + num89.ToString() + text67; + DataSet dataSet39 = clsCN10.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag27 = dataSet39.Tables[0].Rows.Count > 0; + if (!flag27) + { + string billCode10 = "85"; + long num91 = ClsPub.CreateBillID_Prod(billCode10, ref ClsPub.sExeReturnInfo); + long num92 = 0L; + clsCN10.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num89.ToString(), + ",", + num90.ToString(), + ",", + num88.ToString(), + ",'", + text67, + "',", + num92.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num88.ToString(), + ", 0,0,'','1206',0, 0,'',0,0,0,'',0,'','','", + dateTime19.ToShortDateString(), + "','", + dateTime20.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num91.ToString(), + ",1,0,0,0,'", + text69, + "','", + text70, + "','',0,'','',1)" + })); + } + } + else + { + string text71 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text72 = text71.Substring(0, 1); + bool flag28 = text72.Contains("W") || text72.Contains("N"); + if (flag28) + { + string text73 = sBarCodeNew.Substring(0, 10); + string str22 = sBarCodeNew.Substring(10, 10); + string text74 = "20" + sBarCodeNew.Substring(20, 6); + long num93 = (long)ClsPub.isInt(text74.Substring(0, 4)); + long num94 = (long)ClsPub.isInt(text74.Substring(4, 2)); + long num95 = (long)ClsPub.isInt(text74.Substring(6, 2)); + long num96 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text75 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text76 = "20" + text75.Substring(0, 6); + long num97 = (long)ClsPub.isInt(text76.Substring(0, 4)); + long num98 = (long)ClsPub.isInt(text76.Substring(4, 2)); + long num99 = (long)ClsPub.isInt(text76.Substring(6, 2)); + DateTime dateTime21 = ClsPub.isDate(string.Concat(new string[] + { + num97.ToString(), + "-", + num98.ToString(), + "-", + num99.ToString() + })); + string text77 = sBarCodeNew.Remove(0, 26); + string text78 = text77.Remove(text77.Length - 10, 10); + ClsCN clsCN11 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN11.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str22 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN11.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str22 + "'", "T_BD_MATERIAL"); + str22 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str22 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet40 = clsCN11.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str22 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num100 = ClsPub.isLong(dataSet40.Tables[0].Rows[0]["HItemID"]); + string text79 = ClsPub.isStrNull(dataSet40.Tables[0].Rows[0]["HName"]); + string text80 = ClsPub.isStrNull(dataSet40.Tables[0].Rows[0]["HModel"]); + long num101 = (long)ClsPub.isInt(dataSet40.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet41 = clsCN11.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str23 = ClsPub.isStrNull(dataSet41.Tables[0].Rows[0]["HNumber"]); + text = str23 + num100.ToString() + text78 + "#" + num96; + text1 = str23 + num100.ToString() + text78; + DateTime dateTime22 = ClsPub.isDate(string.Concat(new string[] + { + num93.ToString(), + "-", + num94.ToString(), + "-", + num95.ToString() + })); + DataSet dataSet42 = clsCN11.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag29 = dataSet42.Tables[0].Rows.Count > 0; + if (!flag29) + { + string billCode11 = "85"; + long num102 = ClsPub.CreateBillID_Prod(billCode11, ref ClsPub.sExeReturnInfo); + long num103 = 0L; + clsCN11.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num100.ToString(), + ",", + num101.ToString(), + ",", + num96.ToString(), + ",'", + text78, + "',", + num103.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num96.ToString(), + ", 0,0,'','',0, 0,'',0,0,0,'',0,'','','", + dateTime22.ToShortDateString(), + "','", + dateTime21.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num102.ToString(), + ",1,0,0,0,'", + text79, + "','", + text80, + "','',0,'','',1)" + })); + } + } + else + { + string str24 = sBarCodeNew.Substring(0, 10); + string text81 = "20" + sBarCodeNew.Substring(10, 6); + long num104 = (long)ClsPub.isInt(text81.Substring(0, 4)); + long num105 = (long)ClsPub.isInt(text81.Substring(4, 2)); + long num106 = (long)ClsPub.isInt(text81.Substring(6, 2)); + long num107 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text82 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text83 = "20" + text82.Substring(0, 6); + long num108 = (long)ClsPub.isInt(text83.Substring(0, 4)); + long num109 = (long)ClsPub.isInt(text83.Substring(4, 2)); + long num110 = (long)ClsPub.isInt(text83.Substring(6, 2)); + DateTime dateTime23 = ClsPub.isDate(string.Concat(new string[] + { + num108.ToString(), + "-", + num109.ToString(), + "-", + num110.ToString() + })); + string text84 = sBarCodeNew.Remove(0, 16); + string text85 = text84.Remove(text84.Length - 9, 9); + ClsCN clsCN12 = new ClsCN(); + + + DataSet Dss7; + Dss7 = clsCN12.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str24 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN12.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str24 + "'", "T_BD_MATERIAL"); + str24 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str24 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + + DataSet dataSet43 = clsCN12.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str24 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num111 = ClsPub.isLong(dataSet43.Tables[0].Rows[0]["HItemID"]); + string text86 = ClsPub.isStrNull(dataSet43.Tables[0].Rows[0]["HName"]); + string text87 = ClsPub.isStrNull(dataSet43.Tables[0].Rows[0]["HModel"]); + long num112 = (long)ClsPub.isInt(dataSet43.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet44 = clsCN12.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str25 = ClsPub.isStrNull(dataSet44.Tables[0].Rows[0]["HNumber"]); + text = str25 + num111.ToString() + text85 + "#" + num107; + text1 = str25 + num111.ToString() + text85; + DateTime dateTime24 = ClsPub.isDate(string.Concat(new string[] + { + num104.ToString(), + "-", + num105.ToString(), + "-", + num106.ToString() + })); + DataSet dataSet45 = clsCN12.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag30 = dataSet45.Tables[0].Rows.Count > 0; + if (!flag30) + { + string billCode12 = "85"; + long num113 = ClsPub.CreateBillID_Prod(billCode12, ref ClsPub.sExeReturnInfo); + long num114 = 0L; + clsCN12.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num111.ToString(), + ",", + num112.ToString(), + ",", + num107.ToString(), + ",'", + text85, + "',", + num114.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num107.ToString(), + ", 0,0,'','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime24.ToShortDateString(), + "','", + dateTime23.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num113.ToString(), + ",1,0,0,0,'", + text86, + "','", + text87, + "','',0,'','',1)" + })); + } + } + } + } + bool flag31 = HBillType == "1204"; + if (flag31) + { + bool flag32 = sBarCodeNew.Contains("@"); + if (flag32) + { + string[] array5 = sBarCodeNew.Split(new char[] + { + '@' + }); + string str26 = array5[0]; + long num115 = (long)ClsPub.isInt(array5[4]); + string text88 = array5[6]; + DateTime dateTime25 = ClsPub.isDate(array5[3]); + DateTime dateTime26 = ClsPub.isDate(array5[5]); + string text89 = ClsPub.isStrNull(array5[8]); + ClsCN clsCN13 = new ClsCN(); + DataSet dataSet46 = clsCN13.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str27 = ClsPub.isStrNull(dataSet46.Tables[0].Rows[0]["HNumber"]); + + + DataSet Dss7; + Dss7 = clsCN13.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str26 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN13.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str26 + "'", "T_BD_MATERIAL"); + str26 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str26 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet47 = clsCN13.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str26 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num116 = ClsPub.isLong(dataSet47.Tables[0].Rows[0]["HItemID"]); + string text90 = ClsPub.isStrNull(dataSet47.Tables[0].Rows[0]["HName"]); + string text91 = ClsPub.isStrNull(dataSet47.Tables[0].Rows[0]["HModel"]); + long num117 = (long)ClsPub.isInt(dataSet47.Tables[0].Rows[0]["HUnitID"]); + text = str27 + num116.ToString() + text88 + "#" + num115; + text1 = str27 + num116.ToString() + text88; + DataSet dataSet48 = clsCN13.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag33 = dataSet48.Tables[0].Rows.Count > 0; + if (!flag33) + { + string billCode13 = "85"; + long num118 = ClsPub.CreateBillID_Prod(billCode13, ref ClsPub.sExeReturnInfo); + long num119 = 0L; + clsCN13.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num116.ToString(), + ",", + num117.ToString(), + ",", + num115.ToString(), + ",'", + text88, + "',", + num119.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num115.ToString(), + ", 0,0,'','1103',0, 0,'',0,0,0,'',0,'','','", + dateTime25.ToShortDateString(), + "','", + dateTime26.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num118.ToString(), + ",1,0,0,0,'", + text90, + "','", + text91, + "','',0,'','',1)" + })); + } + } + else + { + string text92 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text93 = text92.Substring(0, 1); + bool flag34 = text93.Contains("W") || text93.Contains("N"); + if (flag34) + { + string text94 = sBarCodeNew.Substring(0, 10); + string str28 = sBarCodeNew.Substring(10, 10); + string text95 = "20" + sBarCodeNew.Substring(20, 6); + long num120 = (long)ClsPub.isInt(text95.Substring(0, 4)); + long num121 = (long)ClsPub.isInt(text95.Substring(4, 2)); + long num122 = (long)ClsPub.isInt(text95.Substring(6, 2)); + long num123 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text96 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text97 = "20" + text96.Substring(0, 6); + long num124 = (long)ClsPub.isInt(text97.Substring(0, 4)); + long num125 = (long)ClsPub.isInt(text97.Substring(4, 2)); + long num126 = (long)ClsPub.isInt(text97.Substring(6, 2)); + DateTime dateTime27 = ClsPub.isDate(string.Concat(new string[] + { + num124.ToString(), + "-", + num125.ToString(), + "-", + num126.ToString() + })); + string text98 = sBarCodeNew.Remove(0, 26); + string text99 = text98.Remove(text98.Length - 10, 10); + ClsCN clsCN14 = new ClsCN(); + + + DataSet Dss7; + Dss7 = clsCN14.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str28 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN14.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str28 + "'", "T_BD_MATERIAL"); + str28 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str28 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + + DataSet dataSet49 = clsCN14.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str28 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num127 = ClsPub.isLong(dataSet49.Tables[0].Rows[0]["HItemID"]); + string text100 = ClsPub.isStrNull(dataSet49.Tables[0].Rows[0]["HName"]); + string text101 = ClsPub.isStrNull(dataSet49.Tables[0].Rows[0]["HModel"]); + long num128 = (long)ClsPub.isInt(dataSet49.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet50 = clsCN14.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str29 = ClsPub.isStrNull(dataSet50.Tables[0].Rows[0]["HNumber"]); + text = str29 + num127.ToString() + text99 + "#" + num123; + text1 = str29 + num127.ToString() + text99; + DateTime dateTime28 = ClsPub.isDate(string.Concat(new string[] + { + num120.ToString(), + "-", + num121.ToString(), + "-", + num122.ToString() + })); + DataSet dataSet51 = clsCN14.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag35 = dataSet51.Tables[0].Rows.Count > 0; + if (!flag35) + { + string billCode14 = "85"; + long num129 = ClsPub.CreateBillID_Prod(billCode14, ref ClsPub.sExeReturnInfo); + long num130 = 0L; + clsCN14.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num127.ToString(), + ",", + num128.ToString(), + ",", + num123.ToString(), + ",'", + text99, + "',", + num130.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num123.ToString(), + ", 0,0,'','',0, 0,'',0,0,0,'',0,'','','", + dateTime28.ToShortDateString(), + "','", + dateTime27.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num129.ToString(), + ",1,0,0,0,'", + text100, + "','", + text101, + "','',0,'','',1)" + })); + } + } + else + { + string str30 = sBarCodeNew.Substring(0, 10); + string text102 = "20" + sBarCodeNew.Substring(10, 6); + long num131 = (long)ClsPub.isInt(text102.Substring(0, 4)); + long num132 = (long)ClsPub.isInt(text102.Substring(4, 2)); + long num133 = (long)ClsPub.isInt(text102.Substring(6, 2)); + long num134 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text103 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text104 = "20" + text103.Substring(0, 6); + long num135 = (long)ClsPub.isInt(text104.Substring(0, 4)); + long num136 = (long)ClsPub.isInt(text104.Substring(4, 2)); + long num137 = (long)ClsPub.isInt(text104.Substring(6, 2)); + DateTime dateTime29 = ClsPub.isDate(string.Concat(new string[] + { + num135.ToString(), + "-", + num136.ToString(), + "-", + num137.ToString() + })); + string text105 = sBarCodeNew.Remove(0, 16); + string text106 = text105.Remove(text105.Length - 9, 9); + ClsCN clsCN15 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN15.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str30 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN15.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str30 + "'", "T_BD_MATERIAL"); + str30 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str30 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet52 = clsCN15.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str30 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num138 = ClsPub.isLong(dataSet52.Tables[0].Rows[0]["HItemID"]); + string text107 = ClsPub.isStrNull(dataSet52.Tables[0].Rows[0]["HName"]); + string text108 = ClsPub.isStrNull(dataSet52.Tables[0].Rows[0]["HModel"]); + long num139 = (long)ClsPub.isInt(dataSet52.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet53 = clsCN15.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str31 = ClsPub.isStrNull(dataSet53.Tables[0].Rows[0]["HNumber"]); + text = str31 + num138.ToString() + text106 + "#" + num134; + text1 = str31 + num138.ToString() + text106; + DateTime dateTime30 = ClsPub.isDate(string.Concat(new string[] + { + num131.ToString(), + "-", + num132.ToString(), + "-", + num133.ToString() + })); + DataSet dataSet54 = clsCN15.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag36 = dataSet54.Tables[0].Rows.Count > 0; + if (!flag36) + { + string billCode15 = "85"; + long num140 = ClsPub.CreateBillID_Prod(billCode15, ref ClsPub.sExeReturnInfo); + long num141 = 0L; + clsCN15.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num138.ToString(), + ",", + num139.ToString(), + ",", + num134.ToString(), + ",'", + text106, + "',", + num141.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num134.ToString(), + ", 0,0,'','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime30.ToShortDateString(), + "','", + dateTime29.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num140.ToString(), + ",1,0,0,0,'", + text107, + "','", + text108, + "','',0,'','',1)" + })); + } + } + } + } + bool flag37 = HBillType == "1254" || HBillType == "1211" || HBillType == "1255"; + if (flag37) + { + bool flag38 = sBarCodeNew.Contains("@"); + if (flag38) + { + string[] array6 = sBarCodeNew.Split(new char[] + { + '@' + }); + string str32 = array6[0]; + long num142 = (long)ClsPub.isInt(array6[4]); + string text109 = array6[6]; + DateTime dateTime31 = ClsPub.isDate(array6[3]); + DateTime dateTime32 = ClsPub.isDate(array6[5]); + string text110 = ClsPub.isStrNull(array6[8]); + ClsCN clsCN16 = new ClsCN(); + DataSet dataSet55 = clsCN16.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str33 = ClsPub.isStrNull(dataSet55.Tables[0].Rows[0]["HNumber"]); + + + DataSet Dss7; + Dss7 = clsCN16.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str32 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN16.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str32 + "'", "T_BD_MATERIAL"); + str32 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str32 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet56 = clsCN16.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str32 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num143 = ClsPub.isLong(dataSet56.Tables[0].Rows[0]["HItemID"]); + string text111 = ClsPub.isStrNull(dataSet56.Tables[0].Rows[0]["HName"]); + string text112 = ClsPub.isStrNull(dataSet56.Tables[0].Rows[0]["HModel"]); + long num144 = (long)ClsPub.isInt(dataSet56.Tables[0].Rows[0]["HUnitID"]); + text = str33 + num143.ToString() + text109 + "#" + num142; + text1 = str33 + num143.ToString() + text109; + DataSet dataSet57 = clsCN16.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag39 = dataSet57.Tables[0].Rows.Count > 0; + if (!flag39) + { + string billCode16 = "85"; + long num145 = ClsPub.CreateBillID_Prod(billCode16, ref ClsPub.sExeReturnInfo); + long num146 = 0L; + clsCN16.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num143.ToString(), + ",", + num144.ToString(), + ",", + num142.ToString(), + ",'", + text109, + "',", + num146.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num142.ToString(), + ", 0,0,'','1103',0, 0,'',0,0,0,'',0,'','','", + dateTime31.ToShortDateString(), + "','", + dateTime32.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num145.ToString(), + ",1,0,0,0,'", + text111, + "','", + text112, + "','',0,'','',1)" + })); + } + } + else + { + string text113 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text114 = text113.Substring(0, 1); + bool flag40 = text114.Contains("W") || text114.Contains("N"); + if (flag40) + { + string text115 = sBarCodeNew.Substring(0, 10); + string str34 = sBarCodeNew.Substring(10, 10); + string text116 = "20" + sBarCodeNew.Substring(20, 6); + long num147 = (long)ClsPub.isInt(text116.Substring(0, 4)); + long num148 = (long)ClsPub.isInt(text116.Substring(4, 2)); + long num149 = (long)ClsPub.isInt(text116.Substring(6, 2)); + long num150 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text117 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text118 = "20" + text117.Substring(0, 6); + long num151 = (long)ClsPub.isInt(text118.Substring(0, 4)); + long num152 = (long)ClsPub.isInt(text118.Substring(4, 2)); + long num153 = (long)ClsPub.isInt(text118.Substring(6, 2)); + DateTime dateTime33 = ClsPub.isDate(string.Concat(new string[] + { + num151.ToString(), + "-", + num152.ToString(), + "-", + num153.ToString() + })); + string text119 = sBarCodeNew.Remove(0, 26); + string text120 = text119.Remove(text119.Length - 10, 10); + ClsCN clsCN17 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN17.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str34 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN17.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str34 + "'", "T_BD_MATERIAL"); + str34 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str34 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet58 = clsCN17.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str34 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num154 = ClsPub.isLong(dataSet58.Tables[0].Rows[0]["HItemID"]); + string text121 = ClsPub.isStrNull(dataSet58.Tables[0].Rows[0]["HName"]); + string text122 = ClsPub.isStrNull(dataSet58.Tables[0].Rows[0]["HModel"]); + long num155 = (long)ClsPub.isInt(dataSet58.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet59 = clsCN17.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str35 = ClsPub.isStrNull(dataSet59.Tables[0].Rows[0]["HNumber"]); + text = str35 + num154.ToString() + text120 + "#" + num150; + text1 = str35 + num154.ToString() + text120; + DateTime dateTime34 = ClsPub.isDate(string.Concat(new string[] + { + num147.ToString(), + "-", + num148.ToString(), + "-", + num149.ToString() + })); + DataSet dataSet60 = clsCN17.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag41 = dataSet60.Tables[0].Rows.Count > 0; + if (!flag41) + { + string billCode17 = "85"; + long num156 = ClsPub.CreateBillID_Prod(billCode17, ref ClsPub.sExeReturnInfo); + long num157 = 0L; + clsCN17.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num154.ToString(), + ",", + num155.ToString(), + ",", + num150.ToString(), + ",'", + text120, + "',", + num157.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num150.ToString(), + ", 0,0,'','',0, 0,'',0,0,0,'',0,'','','", + dateTime34.ToShortDateString(), + "','", + dateTime33.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num156.ToString(), + ",1,0,0,0,'", + text121, + "','", + text122, + "','',0,'','',1)" + })); + } + } + else + { + string str36 = sBarCodeNew.Substring(0, 10); + string text123 = "20" + sBarCodeNew.Substring(10, 6); + long num158 = (long)ClsPub.isInt(text123.Substring(0, 4)); + long num159 = (long)ClsPub.isInt(text123.Substring(4, 2)); + long num160 = (long)ClsPub.isInt(text123.Substring(6, 2)); + long num161 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text124 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text125 = "20" + text124.Substring(0, 6); + long num162 = (long)ClsPub.isInt(text125.Substring(0, 4)); + long num163 = (long)ClsPub.isInt(text125.Substring(4, 2)); + long num164 = (long)ClsPub.isInt(text125.Substring(6, 2)); + DateTime dateTime35 = ClsPub.isDate(string.Concat(new string[] + { + num162.ToString(), + "-", + num163.ToString(), + "-", + num164.ToString() + })); + string text126 = sBarCodeNew.Remove(0, 16); + string text127 = text126.Remove(text126.Length - 9, 9); + ClsCN clsCN18 = new ClsCN(); + + + DataSet Dss7; + Dss7 = clsCN18.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str36 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN18.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str36 + "'", "T_BD_MATERIAL"); + str36 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str36 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet61 = clsCN18.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str36 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num165 = ClsPub.isLong(dataSet61.Tables[0].Rows[0]["HItemID"]); + string text128 = ClsPub.isStrNull(dataSet61.Tables[0].Rows[0]["HName"]); + string text129 = ClsPub.isStrNull(dataSet61.Tables[0].Rows[0]["HModel"]); + long num166 = (long)ClsPub.isInt(dataSet61.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet62 = clsCN18.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str37 = ClsPub.isStrNull(dataSet62.Tables[0].Rows[0]["HNumber"]); + text = str37 + num165.ToString() + text127 + "#" + num161; + text1 = str37 + num165.ToString() + text127; + DateTime dateTime36 = ClsPub.isDate(string.Concat(new string[] + { + num158.ToString(), + "-", + num159.ToString(), + "-", + num160.ToString() + })); + DataSet dataSet63 = clsCN18.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag42 = dataSet63.Tables[0].Rows.Count > 0; + if (!flag42) + { + string billCode18 = "85"; + long num167 = ClsPub.CreateBillID_Prod(billCode18, ref ClsPub.sExeReturnInfo); + long num168 = 0L; + clsCN18.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num165.ToString(), + ",", + num166.ToString(), + ",", + num161.ToString(), + ",'", + text127, + "',", + num168.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num161.ToString(), + ", 0,0,'','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime36.ToShortDateString(), + "','", + dateTime35.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num167.ToString(), + ",1,0,0,0,'", + text128, + "','", + text129, + "','',0,'','',1)" + })); + } + } + } + } + bool flag43 = HBillType == "1205"; + if (flag43) + { + bool flag44 = sBarCodeNew.Contains("@"); + if (flag44) + { + string[] array7 = sBarCodeNew.Split(new char[] + { + '@' + }); + string str38 = array7[0]; + long num169 = (long)ClsPub.isInt(array7[4]); + string text130 = array7[6]; + DateTime dateTime37 = ClsPub.isDate(array7[3]); + DateTime dateTime38 = ClsPub.isDate(array7[5]); + string text131 = ClsPub.isStrNull(array7[8]); + ClsCN clsCN19 = new ClsCN(); + DataSet dataSet64 = clsCN19.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str39 = ClsPub.isStrNull(dataSet64.Tables[0].Rows[0]["HNumber"]); + + DataSet Dss7; + Dss7 = clsCN19.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str38 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN19.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str38 + "'", "T_BD_MATERIAL"); + str38 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str38 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet65 = clsCN19.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str38 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num170 = ClsPub.isLong(dataSet65.Tables[0].Rows[0]["HItemID"]); + string text132 = ClsPub.isStrNull(dataSet65.Tables[0].Rows[0]["HName"]); + string text133 = ClsPub.isStrNull(dataSet65.Tables[0].Rows[0]["HModel"]); + long num171 = (long)ClsPub.isInt(dataSet65.Tables[0].Rows[0]["HUnitID"]); + text = str39 + num170.ToString() + text130 + "#" + num169; + text1 = str39 + num170.ToString() + text130; + DataSet dataSet66 = clsCN19.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag45 = dataSet66.Tables[0].Rows.Count > 0; + if (!flag45) + { + string billCode19 = "85"; + long num172 = ClsPub.CreateBillID_Prod(billCode19, ref ClsPub.sExeReturnInfo); + long num173 = 0L; + clsCN19.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num170.ToString(), + ",", + num171.ToString(), + ",", + num169.ToString(), + ",'", + text130, + "',", + num173.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num169.ToString(), + ", 0,0,'','1103',0, 0,'',0,0,0,'',0,'','','", + dateTime37.ToShortDateString(), + "','", + dateTime38.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num172.ToString(), + ",1,0,0,0,'", + text132, + "','", + text133, + "','',0,'','',1)" + })); + } + } + else + { + string text134 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4); + string text135 = text134.Substring(0, 1); + bool flag46 = text135.Contains("W") || text135.Contains("N"); + if (flag46) + { + string text136 = sBarCodeNew.Substring(0, 10); + string str40 = sBarCodeNew.Substring(10, 10); + string text137 = "20" + sBarCodeNew.Substring(20, 6); + long num174 = (long)ClsPub.isInt(text137.Substring(0, 4)); + long num175 = (long)ClsPub.isInt(text137.Substring(4, 2)); + long num176 = (long)ClsPub.isInt(text137.Substring(6, 2)); + long num177 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text138 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10); + string text139 = "20" + text138.Substring(0, 6); + long num178 = (long)ClsPub.isInt(text139.Substring(0, 4)); + long num179 = (long)ClsPub.isInt(text139.Substring(4, 2)); + long num180 = (long)ClsPub.isInt(text139.Substring(6, 2)); + DateTime dateTime39 = ClsPub.isDate(string.Concat(new string[] + { + num178.ToString(), + "-", + num179.ToString(), + "-", + num180.ToString() + })); + string text140 = sBarCodeNew.Remove(0, 26); + string text141 = text140.Remove(text140.Length - 10, 10); + ClsCN clsCN20 = new ClsCN(); + + DataSet Dss7; + Dss7 = clsCN20.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str40 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN20.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str40 + "'", "T_BD_MATERIAL"); + str40 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str40 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet67 = clsCN20.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str40 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num181 = ClsPub.isLong(dataSet67.Tables[0].Rows[0]["HItemID"]); + string text142 = ClsPub.isStrNull(dataSet67.Tables[0].Rows[0]["HName"]); + string text143 = ClsPub.isStrNull(dataSet67.Tables[0].Rows[0]["HModel"]); + long num182 = (long)ClsPub.isInt(dataSet67.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet68 = clsCN20.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str41 = ClsPub.isStrNull(dataSet68.Tables[0].Rows[0]["HNumber"]); + text = str41 + num181.ToString() + text141 + "#" + num177; + text1 = str41 + num181.ToString() + text141; + DateTime dateTime40 = ClsPub.isDate(string.Concat(new string[] + { + num174.ToString(), + "-", + num175.ToString(), + "-", + num176.ToString() + })); + DataSet dataSet69 = clsCN20.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag47 = dataSet69.Tables[0].Rows.Count > 0; + if (!flag47) + { + string billCode20 = "85"; + long num183 = ClsPub.CreateBillID_Prod(billCode20, ref ClsPub.sExeReturnInfo); + long num184 = 0L; + clsCN20.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num181.ToString(), + ",", + num182.ToString(), + ",", + num177.ToString(), + ",'", + text141, + "',", + num184.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num177.ToString(), + ", 0,0,'','',0, 0,'',0,0,0,'',0,'','','", + dateTime40.ToShortDateString(), + "','", + dateTime39.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num183.ToString(), + ",1,0,0,0,'", + text142, + "','", + text143, + "','',0,'','',1)" + })); + } + } + else + { + string str42 = sBarCodeNew.Substring(0, 10); + string text144 = "20" + sBarCodeNew.Substring(10, 6); + long num185 = (long)ClsPub.isInt(text144.Substring(0, 4)); + long num186 = (long)ClsPub.isInt(text144.Substring(4, 2)); + long num187 = (long)ClsPub.isInt(text144.Substring(6, 2)); + long num188 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3)); + string text145 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 9); + string text146 = "20" + text145.Substring(0, 6); + long num189 = (long)ClsPub.isInt(text146.Substring(0, 4)); + long num190 = (long)ClsPub.isInt(text146.Substring(4, 2)); + long num191 = (long)ClsPub.isInt(text146.Substring(6, 2)); + DateTime dateTime41 = ClsPub.isDate(string.Concat(new string[] + { + num189.ToString(), + "-", + num190.ToString(), + "-", + num191.ToString() + })); + string text147 = sBarCodeNew.Remove(0, 16); + string text148 = text147.Remove(text147.Length - 9, 9); + ClsCN clsCN21 = new ClsCN(); + + + DataSet Dss7; + Dss7 = clsCN21.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str42 + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = clsCN21.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str42 + "'", "T_BD_MATERIAL"); + str42 = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + str42 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet70 = clsCN21.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str42 + "' and huseorgid = " + HOrgID.ToString(), "Gy_Material"); + long num192 = ClsPub.isLong(dataSet70.Tables[0].Rows[0]["HItemID"]); + string text149 = ClsPub.isStrNull(dataSet70.Tables[0].Rows[0]["HName"]); + string text150 = ClsPub.isStrNull(dataSet70.Tables[0].Rows[0]["HModel"]); + long num193 = (long)ClsPub.isInt(dataSet70.Tables[0].Rows[0]["HUnitID"]); + DataSet dataSet71 = clsCN21.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID.ToString(), "h_v_CLD_ORGANIZATIONSList"); + string str43 = ClsPub.isStrNull(dataSet71.Tables[0].Rows[0]["HNumber"]); + text = str43 + num192.ToString() + text148 + "#" + num188; + text1 = str43 + num192.ToString() + text148; + DateTime dateTime42 = ClsPub.isDate(string.Concat(new string[] + { + num185.ToString(), + "-", + num186.ToString(), + "-", + num187.ToString() + })); + DataSet dataSet72 = clsCN21.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); + bool flag48 = dataSet72.Tables[0].Rows.Count > 0; + if (!flag48) + { + string billCode21 = "85"; + long num194 = ClsPub.CreateBillID_Prod(billCode21, ref ClsPub.sExeReturnInfo); + long num195 = 0L; + clsCN21.RunProc(string.Concat(new string[] + { + "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty ,HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark ,HCusID,HCusType,HEndDate,HProduceDate,HExpiryDate,HWorkLineName,HBarCodeDate ,HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID ,HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID ,HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HExpirationDateFlag ) values ('", + text1, + "','鎵规鏉$爜',", + num192.ToString(), + ",", + num193.ToString(), + ",", + num188.ToString(), + ",'", + text148, + "',", + num195.ToString(), + ",0,'", + ClsPub.CurUserName, + "',getdate(),0,", + num188.ToString(), + ", 0,0,'','3714',0, 0,'',0,0,0,'',0,'','','", + dateTime42.ToShortDateString(), + "','", + dateTime41.ToShortDateString(), + "','',getdate(), ", + HOrgID.ToString(), + ",", + HOrgID.ToString(), + ",'',", + num194.ToString(), + ",1,0,0,0,'", + text149, + "','", + text150, + "','',0,'','',1)" + })); + } + } + } + } + result = text; + } + catch (Exception ex) + { + result = ex.Message + ";" + ex.StackTrace; + } + return result; } - + @@ -1282,18 +3481,42 @@ { try { + string HMaterNumber = ""; + string HSCRQ = ""; + string HFour = HBarCode.Remove(0, HBarCode.Length - 4); + string HZM = HFour.Substring(0, 1); + string HBatchNo_Old = ""; + string HBatchNo = ""; + Int64 Year = 0; + Int64 Month = 0; + Int64 Day = 0; + if (HZM.Contains("W") || HZM.Contains("N")) + { + string HOldNumber = HBarCode.Substring(0, 10); //鍟嗗搧鐮� 涓嶆槸鐗╂枡缂栫爜 + HMaterNumber = HBarCode.Substring(10, 10); //鐗╂枡缂栫爜 + HSCRQ = "20" + HBarCode.Substring(20, 6); //鐢熶骇鏃ユ湡 + Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); //骞� + Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); //鏈� + Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); //鏃� + HBatchNo_Old = HBarCode.Remove(0, 26); + HBatchNo = HBatchNo_Old.Remove(HBatchNo_Old.Length - 10, 10); + } + else + { + HMaterNumber = HBarCode.Substring(0,10); + HSCRQ = "20" + HBarCode.Substring(10, 6); //鐢熶骇鏃ユ湡 + Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); //骞� + Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); //鏈� + Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); //鏃� + HBatchNo_Old = HBarCode.Remove(0, 16); + HBatchNo = HBatchNo_Old.Remove(HBatchNo_Old.Length - 9, 9); + } + + + //鏍规嵁鎷嗗垎鐨勭墿鏂橧D + 鎵规 + 鐢熶骇鏃ユ湡 鑳芥壘鍒板敮涓�鐨勫伐搴忔眹鎶ュ崟 - string HMaterNumber = ""; - HMaterNumber = HBarCode.Substring(0, 10); - string HSCRQ = ""; - HSCRQ = "20" + HBarCode.Substring(10, 6); - Int64 Year = ClsPub.isInt(HSCRQ.Substring(0, 4)); - Int64 Month = ClsPub.isInt(HSCRQ.Substring(4, 2)); - Int64 Day = ClsPub.isInt(HSCRQ.Substring(6, 2)); - - string HBatchNo = ""; - HBatchNo = HBarCode.Substring(16, 11); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; Int64 HMaterID = 0; @@ -1305,12 +3528,12 @@ Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]); - DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); + //DateTime HSCRQ1 = ClsPub.isDate(Year + "-" + Month + "-" + Day); - Int64 HQty = 0; - HQty = ClsPub.isInt(HBarCode.Substring(33, 3)); + //Int64 HQty = 0; + //HQty = ClsPub.isInt(HBarCode.Substring(33, 3)); ds = oCN.RunProcReturn("select * from h_v_SCStockInCheckBill_Json where HYear =" + Year.ToString() + "and HMonth = " + Month.ToString() + "and HDay = " + Day.ToString() + " and HMaterID = " + HMaterID.ToString() + "and 鎵规 = '" + HBatchNo.ToString() + "'", "h_v_SCStockInCheckBill_Json"); @@ -1932,6 +4155,563 @@ } + + [Route("POStockInBillList/AuditPOInStockBillPost_AR")] + [HttpPost] + public object AuditPOInStockBillPost_AR([FromBody] JObject msg) + { + object result; + try + { + string text = msg["msg"].ToString(); + text = text.Replace("\\", ""); + text = text.Replace("\n", ""); + List<ReciveBill_FastModel> list = JsonConvert.DeserializeObject<List<ReciveBill_FastModel>>(text); + DAL.ClsCg_POInStockBill clsCg_POInStockBill = new DAL.ClsCg_POInStockBill(); + string hinterID = list[0].HInterID; + string text2 = list[0].FID; + string singleSystemParameter = this.oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref ClsPub.sExeReturnInfo); + string singleSystemParameter2 = this.oSystemParameter.GetSingleSystemParameter("Cg_POInStockBill_ErpAduit", ref ClsPub.sExeReturnInfo); + string singleSystemParameter3 = this.oSystemParameter.GetSingleSystemParameter("Cg_POInStockBill_BarCodeCtl", ref ClsPub.sExeReturnInfo); + string configKey = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName"); + string empty = string.Empty; + this.oCn.BeginTran(); + this.oCn.Commit(); + bool flag = singleSystemParameter.Contains("瀹夌憺"); + if (flag) + { + DataSet dataSet = this.oCn.RunProcReturn("exec h_p_ReceiveBill_Fast " + hinterID, "h_p_ReceiveBill_Fast"); + DataRow dataRow = dataSet.Tables[0].Rows[0]; + bool flag2 = dataSet.Tables[0].Rows.Count <= 0; + if (flag2) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "鏈壘鍒板搴旂殑鍗曟嵁"; + this.objJsonResult.data = null; + return this.objJsonResult; + } + bool flag3 = dataSet.Tables[0].Rows.Count >= 0; + if (flag3) + { + JObject jobject = new JObject(); + string value = "SLD01_SYS"; + string value2 = "CG"; + bool flag4 = dataRow["FTYPENAME"].ToString().Contains("濮斿"); + if (flag4) + { + value = "SLD03_SYS"; + value2 = "WW"; + } + bool flag5 = dataRow["FTYPENAME"].ToString().Contains("璧勪骇"); + if (flag5) + { + value = "SLD04_SYS"; + value2 = "ZCCG"; + } + JObject jobject2 = jobject; + string propertyName = "FBILLTYPEID"; + JObject jobject3 = new JObject(); + jobject3["Fnumber"] = value; + jobject2.Add(propertyName, jobject3); + jobject.Add("FBusinessType", value2); + jobject.Add("FBILLNO", dataRow["HBillNo"].ToString()); + jobject.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); + JObject jobject4 = jobject; + string propertyName2 = "FStockOrgId"; + JObject jobject5 = new JObject(); + jobject5["Fnumber"] = dataRow["FRECEIVENUMBER"].ToString(); + jobject4.Add(propertyName2, jobject5); + JObject jobject6 = jobject; + string propertyName3 = "FPurOrgId"; + JObject jobject7 = new JObject(); + jobject7["Fnumber"] = dataRow["FPURCHASEORGNUMBER"].ToString(); + jobject6.Add(propertyName3, jobject7); + JObject jobject8 = jobject; + string propertyName4 = "FSupplierId"; + JObject jobject9 = new JObject(); + jobject9["Fnumber"] = dataRow["FSUPPLIERNUMBER"].ToString(); + jobject8.Add(propertyName4, jobject9); + JObject jobject10 = jobject; + string propertyName5 = "FPURCHASERID"; + JObject jobject11 = new JObject(); + jobject11["Fnumber"] = dataRow["FPURCHASERNUMBER"].ToString(); + jobject10.Add(propertyName5, jobject11); + jobject.Add("FOwnerTypeIdHead", "BD_Supplier"); + JObject jobject12 = jobject; + string propertyName6 = "FOwnerIdHead"; + JObject jobject13 = new JObject(); + jobject13["Fnumber"] = dataRow["FSUPPLIERNUMBER"].ToString(); + jobject12.Add(propertyName6, jobject13); + jobject.Add("F_RYMA_Assistant", new JObject() { ["Fnumber"] = dataRow["F_UJDY_Assistant"].ToString() }); + JArray jarray = new JArray(); + foreach (object obj in dataSet.Tables[0].Rows) + { + DataRow dataRow2 = (DataRow)obj; + JObject jobject14 = new JObject(); + JObject jobject15 = jobject14; + string propertyName7 = "FMaterialId"; + JObject jobject16 = new JObject(); + jobject16["Fnumber"] = dataRow2["FMATERIALNUMBER"].ToString(); + jobject15.Add(propertyName7, jobject16); + JObject jobject17 = jobject14; + string propertyName8 = "FUnitID"; + JObject jobject18 = new JObject(); + jobject18["Fnumber"] = dataRow2["FUNITNUMBER"].ToString(); + jobject17.Add(propertyName8, jobject18); + jobject14.Add("FPreDeliveryDate", DateTime.Now.ToString("yyyy-MM-dd")); + JObject jobject19 = jobject14; + string propertyName9 = "FPriceUnitId"; + JObject jobject20 = new JObject(); + jobject20["Fnumber"] = dataRow2["FUNITNUMBER"].ToString(); + jobject19.Add(propertyName9, jobject20); + JObject jobject21 = jobject14; + string propertyName10 = "FStockUnitID"; + JObject jobject22 = new JObject(); + jobject22["Fnumber"] = dataRow2["FUNITNUMBER"].ToString(); + jobject21.Add(propertyName10, jobject22); + JObject jobject23 = jobject14; + string propertyName11 = "FStockID"; + JObject jobject24 = new JObject(); + jobject24["Fnumber"] = "BJCK-SH.01.005"; + jobject23.Add(propertyName11, jobject24); + jobject14.Add("FActReceiveQty", Convert.ToDecimal(dataRow2["HQTY"])); + jobject14.Add("FOwnerTypeId", "BD_OwnerOrg"); + JObject jobject25 = jobject14; + string propertyName12 = "FOwnerID"; + JObject jobject26 = new JObject(); + jobject26["Fnumber"] = dataRow["FPURCHASEORGNUMBER"].ToString(); + jobject25.Add(propertyName12, jobject26); + jobject14.Add("FSrcId", dataRow2["FID"].ToString()); + jobject14.Add("FSRCFORMID", "PUR_PurchaseOrder"); + jobject14.Add("FSrcBillNo", dataRow2["FBILLNO"].ToString()); + jobject14.Add("FSRCENTRYID", dataRow2["FENTRYID"].ToString()); + jobject14.Add("FORDERBILLNO", dataRow2["FBILLNO"].ToString()); + jobject14.Add("FPOORDERENTRYID", dataRow2["FENTRYID"].ToString()); + jobject14.Add("FPrice", dataRow2["FPRICE"].ToString()); + jobject14.Add("FTaxPrice", dataRow2["FTAXPRICE"].ToString()); + jobject14.Add("FEntryTaxRate", dataRow2["FTAXRATE"].ToString()); + JObject jobject27 = jobject14; + string propertyName13 = "FLOT"; + JObject jobject28 = new JObject(); + jobject28["Fnumber"] = dataRow2["hbatchno"].ToString(); + jobject27.Add(propertyName13, jobject28); + jobject14.Add("FLOT_TEXT", dataRow2["hbatchno"].ToString()); + jobject14.Add("FProduceDate", dataRow2["HBeginDate"].ToString()); + jobject14.Add("FExpiryDate", dataRow2["HEndDate"].ToString()); + jobject14.Add("F_BGP_ShouldQty", dataRow2["F_BGP_ShouldQty"].ToString()); + //jobject14.Add("F_RYMA_Assistant", dataRow2["F_RYMA_Assistant"].ToString()); + jobject14.Add("FDetailEntity_Link", new JArray + { + new JObject + { + { + "FDetailEntity_Link_FRULEID", + "PUR_PurchaseOrder-PUR_ReceiveBill" + }, + { + "FDetailEntity_Link_FSTableName", + "t_PUR_POOrderEntry" + }, + { + "FDetailEntity_Link_FSBillId", + dataRow2["FID"].ToString() + }, + { + "FDetailEntity_Link_FSId", + dataRow2["FEntryID"].ToString() + } + } + }); + jarray.Add(jobject14); + } + jobject.Add("FDetailEntity", jarray); + JObject jobject29 = new JObject(); + JObject jobject30 = jobject29; + string propertyName14 = "FSettleOrgId"; + JObject jobject31 = new JObject(); + jobject31["Fnumber"] = dataRow["FSETTLEORGNUMBER"].ToString(); + jobject30.Add(propertyName14, jobject31); + JObject jobject32 = jobject29; + string propertyName15 = "FSettleCurrId"; + JObject jobject33 = new JObject(); + jobject33["Fnumber"] = dataRow["FSETTLECURRNUMBER"].ToString(); + jobject32.Add(propertyName15, jobject33); + jobject29.Add("FPricePoint", 0); + jobject.Add("FinanceEntity ", jobject29); + JObject jobject34 = new JObject(); + jobject34["Creator"] = ""; + jobject34["NeedUpDateFields"] = new JArray(); + jobject34["NeedReturnFields"] = new JArray(); + jobject34["IsDeleteEntry"] = "false"; + jobject34["SubSystemId"] = ""; + jobject34["IsVerifyBaseDataField"] = "false"; + jobject34["Model"] = jobject; + JObject jobject35 = jobject34; + string text3 = InvokeHelper.Login(); + int num = JObject.Parse(text3)["LoginResultType"].Value<int>(); + bool flag6 = num == 0; + if (flag6) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = text3; + this.objJsonResult.data = null; + return this.objJsonResult; + } + string text4 = InvokeHelper.Save("PUR_ReceiveBill", jobject35.ToString()); + bool flag7 = JObject.Parse(text4)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE"; + if (!flag7) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = text4; + this.objJsonResult.data = null; + return this.objJsonResult; + } + string text5 = JObject.Parse(text4)["Result"]["Number"].ToString(); + text2 = JObject.Parse(text4)["Result"]["Id"].ToString(); + } + else + { + LogService.Write("鏀舵枡閫氱煡鍗曞鏍告棤鏁版嵁锛�" + empty, "Vlog", true); + } + } + else + { + JObject jobject36 = new JObject(); + jobject36.Add("Creator", ""); + jobject36.Add("NeedUpDateFields", new JArray()); + jobject36.Add("NeedReturnFields", new JArray()); + jobject36.Add("IsDeleteEntry", "false"); + jobject36.Add("SubSystemId", ""); + jobject36.Add("IsVerifyBaseDataField", ""); + JObject jobject37 = new JObject(); + jobject37.Add("FID", text2); + JArray jarray2 = new JArray(); + foreach (ReciveBill_FastModel reciveBill_FastModel in list) + { + bool flag8 = reciveBill_FastModel.HSQty == 0m; + if (!flag8) + { + jarray2.Add(new JObject + { + { + "FEntryID", + reciveBill_FastModel.FEntryID + }, + { + "FActReceiveQty ", + reciveBill_FastModel.HSQty + } + }); + } + } + jobject37.Add("FDetailEntity", jarray2); + jobject36.Add("Model", jobject37); + string text6 = InvokeHelper.Login(); + int num2 = JObject.Parse(text6)["LoginResultType"].Value<int>(); + bool flag9 = num2 <= 0; + if (flag9) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = text6; + this.objJsonResult.data = null; + return this.objJsonResult; + } + string text7 = InvokeHelper.Save("PUR_ReceiveBill", jobject36.ToString()); + bool flag10 = JObject.Parse(text7)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE"; + if (flag10) + { + LogService.Write("鏀舵枡閫氱煡鍗曚慨鏀瑰け璐sonRoot:" + jobject36.ToString(), "Vlog", true); + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟洿鏂板け璐�" + text7; + this.objJsonResult.data = null; + return this.objJsonResult; + } + } + var f__AnonymousType = new + { + Ids = text2 + }; + string text8 = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject( f__AnonymousType)); + JObject jobject38 = JObject.Parse(text8); + bool flag11 = jobject38["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE"; + if (flag11) + { + LogService.Write("鏀舵枡閫氱煡鍗曟彁浜ゅけ璐sonRoot:" + f__AnonymousType.ToString(), "Vlog", true); + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟彁浜ゅけ璐�" + text8; + this.objJsonResult.data = null; + result = this.objJsonResult; + } + else + { + text8 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject( f__AnonymousType)); + jobject38 = JObject.Parse(text8); + bool flag12 = jobject38["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE"; + if (flag12) + { + LogService.Write("鏀舵枡閫氱煡鍗曞鏍稿け璐sonRoot:" + f__AnonymousType.ToString(), "Vlog", true); + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曞鏍稿け璐sonRoot" + text8; + this.objJsonResult.data = null; + result = this.objJsonResult; + } + else + { + this.objJsonResult.code = "1"; + this.objJsonResult.count = 1; + this.objJsonResult.Message = "鎿嶄綔鎴愬姛锛�"; + this.objJsonResult.data = null; + result = this.objJsonResult; + } + } + } + catch (Exception ex) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "寮傚父锛�" + ex.ToString(); + this.objJsonResult.data = null; + result = this.objJsonResult; + } + return result; + } + + + + #region PDA鍏朵粬鍑哄簱 + //鍒拌揣纭鍒犻櫎 + [Route("Kf_ReciveBill_Fast_AR/Delete_Json_AN")] + [HttpGet] + public object Delete_Json_AN(string HBillNo, Int64 HMaterID) + + { + try + { + //鏍规嵁鏉$爜鍦ㄦ潯鐮佹。妗堜腑鎵惧埌瀵瑰簲鐨勬墭鏉$爜锛屽啀鍦ㄤ复鏃惰〃涓垹闄よ鎵樻潯鐮佺殑鍏ㄩ儴璁板綍 + string sql = string.Format(@"delete from KF_PonderationBillMain_Temp where HBillType=1103 and HMaterID=" + HMaterID + " and HBillNo = '" + HBillNo + "'"); + oCn.RunProc(sql); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + + } + #endregion + + [Route("Kf_ReciveBill_Fast_AR/Display111")] + [HttpGet] + public object Display111(string HBillNo) + + { + try + { + //鏍规嵁鏉$爜鍦ㄦ潯鐮佹。妗堜腑鎵惧埌瀵瑰簲鐨勬墭鏉$爜锛屽啀鍦ㄤ复鏃惰〃涓垹闄よ鎵樻潯鐮佺殑鍏ㄩ儴璁板綍 + DataSet dataSet4 = this.oCn.RunProcReturn(" select sum(a.HQty) HQty ,a.HMaterID,b.HNumber,b.HName,b.HModel,a.HSourceBillNo,a.HInterID,a.HBillNo from KF_PonderationBillMain_Temp a inner join Gy_Material b on a.hmaterid = b.hitemid where a.HBillNo = '" + HBillNo.ToString() + "' group by a.HMaterID,b.HNumber,b.HName,b.HModel,a.HSourceBillNo,a.HInterID,a.HBillNo", "Gy_Material"); + bool flag5 = dataSet4 == null || dataSet4.Tables[0].Rows.Count == 0; + if (flag5) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = dataSet4.Tables[0]; ; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + + } + + + [Route("POStockInBillList/Get_ReciveBillByBarcode_AR")] + [HttpGet] + public object Get_ReciveBillByBarcode_AR(string HBarcode, long HOrgID, long HInterID, string HBillNo) + { + object result; + try + { + string singleSystemParameter = this.oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref ClsPub.sExeReturnInfo); + string empty = string.Empty; + bool flag = singleSystemParameter.Contains("瀹夌憺"); + if (flag) + { + string[] array = HBarcode.Split(new char[] + { + '@' + }); + string text = array[0]; + long num = ClsPub.isLong(array[4]); + string text2 = array[6]; + DateTime dateTime = ClsPub.isDate(array[3]); + DateTime dateTime2 = ClsPub.isDate(array[5]); + DataSet Dss7; + Dss7 = oCn.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + text + "'", "T_BD_MATERIAL"); + if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0) + { + DataSet Dss8; + Dss8 = oCn.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + text + "'", "T_BD_MATERIAL"); + text = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]); + } + else + { + text = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]); + } + + DataSet dataSet = this.oCn.RunProcReturn(string.Concat(new string[] + { + " select max(HItemID) HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '", + text, + "' and huseorgid = ", + HOrgID.ToString(), + " group by HName,HModel,HUnitID" + }), "Gy_Material"); + bool flag2 = dataSet == null || dataSet.Tables[0].Rows.Count == 0; + if (flag2) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "娌℃湁鐗╂枡鏁版嵁锛�"; + this.objJsonResult.data = null; + return this.objJsonResult; + } + long num2 = ClsPub.isLong(dataSet.Tables[0].Rows[0]["HItemID"]); + string text3 = ClsPub.isStrNull(dataSet.Tables[0].Rows[0]["HName"]); + string text4 = ClsPub.isStrNull(dataSet.Tables[0].Rows[0]["HModel"]); + long num3 = (long)ClsPub.isInt(dataSet.Tables[0].Rows[0]["HUnitID"]); + string text5 = ClsPub.isStrNull(array[8]); + DataSet dataSet2 = this.oCn.RunProcReturn(string.Concat(new string[] + { + "select * from KF_PonderationBillMain_Temp Where HBillNo='", + text5, + "' and HMaterID = ", + num2.ToString(), + " and HInterID = ", + HInterID.ToString(), + " and HQty = ", + num.ToString() + }), "KF_PonderationBillMain_Temp"); + bool flag3 = dataSet2.Tables[0].Rows.Count > 0; + if (flag3) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "璇ユ敹鏂欓�氱煡鍗曞凡瀛樺湪鎵爜璁板綍!"; + this.objJsonResult.data = null; + return this.objJsonResult; + } + DataSet dataSet3 = this.oCn.RunProcReturn(" select a.HInterID,b.HEntryID,a.HBillNo from Cg_POOrderBillMain a inner join Cg_POOrderBillSub b on a.hinterid = b.hinterid where a.HBillNo = '" + text5.ToString() + "' and b.HMaterID = " + num2.ToString(), "Cg_POOrderBillMain"); + bool flag4 = dataSet3 == null || dataSet3.Tables[0].Rows.Count == 0; + if (flag4) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "娌℃湁閲囪喘璁㈠崟璁板綍锛�" + text5 + num2.ToString(); + this.objJsonResult.data = null; + return this.objJsonResult; + } + long num4 = ClsPub.isLong(dataSet3.Tables[0].Rows[0]["HInterID"]); + long num5 = ClsPub.isLong(dataSet3.Tables[0].Rows[0]["HEntryID"]); + string text6 = ClsPub.isStrNull(dataSet3.Tables[0].Rows[0]["HBillNo"]); + this.oCn.RunProc(string.Concat(new string[] + { + "insert into KF_PonderationBillMain_Temp (HInterID,HBillNo,HBeginDate,HEndDate,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) values (", + HInterID.ToString(), + ",'", + HBillNo.ToString(), + "','", + dateTime.ToString(), + "','", + dateTime2.ToString(), + "','1103',", + num2.ToString(), + ",0,0,0,0,0,0,", + num.ToString(), + ",", + num.ToString(), + ",0,0,'", + text2.ToString(), + "','", + HBarcode.ToString(), + "','','System',getdate(), ", + num4.ToString(), + ",", + num5.ToString(), + ",'1102','", + text6.ToString(), + "','',0,0,'','',0,0,'',0,0)" + })); + } + DataSet dataSet4 = this.oCn.RunProcReturn(" select sum(a.HQty) HQty ,a.HMaterID,b.HNumber,b.HName,b.HModel,a.HSourceBillNo,a.HInterID,a.HBillNo from KF_PonderationBillMain_Temp a inner join Gy_Material b on a.hmaterid = b.hitemid where a.HBillNo = '" + HBillNo.ToString() + "' group by a.HMaterID,b.HNumber,b.HName,b.HModel,a.HSourceBillNo,a.HInterID,a.HBillNo", "Gy_Material"); + bool flag5 = dataSet4 == null || dataSet4.Tables[0].Rows.Count == 0; + if (flag5) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + this.objJsonResult.data = null; + result = this.objJsonResult; + } + else + { + this.objJsonResult.code = "1"; + this.objJsonResult.count = 1; + this.objJsonResult.Message = "Sucess锛�"; + this.objJsonResult.data = dataSet4.Tables[0]; + result = this.objJsonResult; + } + } + catch (Exception ex) + { + this.objJsonResult.code = "0"; + this.objJsonResult.count = 0; + this.objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + this.objJsonResult.data = null; + result = this.objJsonResult; + } + return result; + } + + + + #region 鍒拌揣纭 [Route("POStockInBillList/Get_ReciveBill")] [HttpGet] -- Gitblit v1.9.1