From a2a2ff05830ca29c15a9d2d9e3dc4ed27145e1f0 Mon Sep 17 00:00:00 2001 From: yxj <1qaz@123> Date: 星期六, 02 七月 2022 00:09:25 +0800 Subject: [PATCH] 直接调拨单扫描物料条码,启用库存返回值错误修正 --- CLOUDWEB/WebService1.asmx.cs | 1026 ++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 665 insertions(+), 361 deletions(-) diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs index ea6cae4..8b57615 100644 --- a/CLOUDWEB/WebService1.asmx.cs +++ b/CLOUDWEB/WebService1.asmx.cs @@ -5906,10 +5906,9 @@ [WebMethod] public bool set_SaveMoveBill_CLD(Model.ClsKf_MoveStockBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) { - //棰嗘枡璋冩嫧(婧愬崟锛氱敓浜т换鍔″崟-鎶曟枡) - if (sHSourceType == "3720") + if (sHSourceType == "3720")//鐢熶骇鐢ㄦ枡娓呭崟 { - if (SaveMoveMaterOut_CLD(oMain, oSystemParameterMain, ref sErrMsg)) + if (SaveMoveStockBill_PPBom_CLD(oMain, sHSourceType, oSystemParameterMain, ref sErrMsg)) { //"淇濆瓨鎴愬姛锛�"; sErrMsg = "淇濆瓨鎴愬姛锛�" + oMain.HBillNo; @@ -5919,10 +5918,26 @@ { //"淇濆瓨澶辫触锛�"; sErrMsg = "鍗曟嵁鍙凤細" + oMain.HBillNo + "锛屽崟鎹甀D锛�" + oMain.HInterID + "锛�" + sErrMsg; - //sErrMsg = sErrMsg; return false; } } + ////棰嗘枡璋冩嫧(婧愬崟锛氱敓浜т换鍔″崟-鎶曟枡) + //if (sHSourceType == "3720") + //{ + // if (SaveMoveMaterOut_CLD(oMain, oSystemParameterMain, ref sErrMsg)) + // { + // //"淇濆瓨鎴愬姛锛�"; + // sErrMsg = "淇濆瓨鎴愬姛锛�" + oMain.HBillNo; + // return true; + // } + // else + // { + // //"淇濆瓨澶辫触锛�"; + // sErrMsg = "鍗曟嵁鍙凤細" + oMain.HBillNo + "锛屽崟鎹甀D锛�" + oMain.HInterID + "锛�" + sErrMsg; + // //sErrMsg = sErrMsg; + // return false; + // } + //} //鍙戣揣璋冩嫧(婧愬崟锛氬彂璐ч�氱煡鍗�) else if (sHSourceType == "1402") { @@ -7416,6 +7431,13 @@ //瀹℃牳鍗曟嵁 oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString()); } + + if (oSystemParameterMain.WMS_MouldManagerCtl == "Y") //绯荤粺鍙傛暟 鍚敤鍣ㄥ叿绠$悊 + { + string HMouldBillType = "3814"; + oCn.RunProc("EXEC h_p_Sc_MouldStockBill_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillType + "','" + HMouldBillType + "'," + oMain.HSupID.ToString() + "," + oMain.HKeeperID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HDeptID.ToString() + ",3"); + } + //鏍规嵁TMP琛� 杩斿洖 瀛愯〃淇℃伅 DataSet Ds; @@ -19345,8 +19367,8 @@ "\"FKeeperTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperTypeId"]) + "\"," + //"\"FDistribution\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDistribution"]) + "," + "\"FKeeperId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperId"]) + "\"}," + - "\"FExtAuxUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExtAuxUnitId"]) + "\"}," + - "\"FExtAuxUnitQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExtAuxUnitQty"]) + "} "; + "\"FExtAuxUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExtAuxUnitId"]) + "\"}} "; + //"\"FExtAuxUnitQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExtAuxUnitQty"]) + "} "; } //"\"FInStockEntry_Link_FSId\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FInStockEntry_Link_FSId"]) + string sJson_End = " ] }}"; @@ -27666,6 +27688,10 @@ { sJson_FAUXPROPID = " \"FAUXPROPID\":{\"FAUXPROPID__FF100001\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}},"; } + else if (oSystemParameterMain.WMS_CampanyName == "妫シ") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + sJson_FAUXPROPID = " \"FAUXPROPID\":{\"FAUXPROPID__FF100003\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}},"; + } else { sJson_FAUXPROPID = " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}},"; @@ -29953,7 +29979,7 @@ public DataSet GetAGVBillList_BillNoQuery(string sBillNo) { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - DataSet Ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList '" + sBillNo + "'", "h_p_Kf_ICStockBillQueryList"); + DataSet Ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList_AGV '" + sBillNo + "'", "h_p_Kf_ICStockBillQueryList_AGV"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { return null; @@ -33771,7 +33797,7 @@ //钃濆瓧浜у搧鍏ュ簱銆佸璐叆搴撱�佸澶栧叆搴撱�佺敓浜ф眹鎶ワ紝鏍规嵁鐗╂枡鏉$爜寰楀埌瀵瑰簲婧愬崟淇℃伅锛岄潪澶氭簮鍗曟ā寮� //鏈壂鎻忔簮鍗曠殑鎯呭喌涓嬶紝绗竴娆℃壂鎻忕墿鏂欐潯鐮佽幏鍙栨簮鍗曚俊鎭苟瀛樺叆涓存椂琛� //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸叾浠栧叆搴擄紙1203锛夈�佸澶栧叆搴擄紙1210锛夈�佺敓浜ф眹鎶ワ紙3711锛� - if (SourceFlag == false && (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1210" || HBillType == "3711")) + if (SourceFlag == false && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711")) { if (HSourceBillType != "-1") { @@ -34160,8 +34186,10 @@ // sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; // return false; //} - //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 - if (HBillType == "1204" && oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + //鍏堣繘鍏堝嚭鎺у埗 + if ((HBillType == "1204" && oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + || (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗 + ) { DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_BarCode " + HBillID.ToString() + ",'" + HBillType + "','" + model.HBatchNo + "','" + model.HBarCode + "'," + model.HQty.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_BarCode"); if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) @@ -34283,6 +34311,44 @@ } else { + if (HBillType == "1203") + { + HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); + HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); + //oBar = get_SourceBarCode_OtherIn(HBillID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HOWNERID, ref sErrMsg); + //if (oBar == null) + //{ + // return null; + //} + //SourceFlag = true; + + Int64 sMulSourceFlag = 0; //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛� + if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟 鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮� + { + sMulSourceFlag = 1; + } + + //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛� + DataSet dsyd = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn"); + if (dsyd == null || dsyd.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涘皢鏉$爜瀵瑰簲婧愬崟淇℃伅瀛樺叆鏉$爜鍑哄叆搴撲复鏃惰〃澶辫触锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0][0]) == 0) + { + SourceFlag = true; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛�" + DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) { sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); @@ -34294,10 +34360,6 @@ oBar.HSupName = sHSupName; oBar.HDeptID = sHDeptID; oBar.HDeptName = sHDeptName; - if (HBillType == "1203") - { - SourceFlag = true; - } } else { @@ -35700,18 +35762,18 @@ Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS(); Int64 sMulSourceFlag = 0; //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛� - ////鑾峰彇绯荤粺鍙傛暟 - //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); - //if (oSystemParameter.ShowBill(ref sErrMsg) == false) - //{ - // sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曟椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; - // return null; - //} + //鑾峰彇绯荤粺鍙傛暟 + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + if (oSystemParameter.ShowBill(ref sErrMsg) == false) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曟椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + return null; + } - //if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟 鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮� - //{ - // sMulSourceFlag = 1; - //} + if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟 鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮� + { + sMulSourceFlag = 1; + } //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛� DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn"); @@ -35782,7 +35844,7 @@ //鍏堣繘鍏堝嚭鎺у埗 if (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 { - DataSet FIFO = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFO_MateOut " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFO_MateOut"); + DataSet FIFO = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFO_MateOut " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HPTQty.ToString() + "," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFO_MateOut"); if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) { sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘瓨鍏ュ厛杩涘厛鍑轰复鏃惰〃澶辫触锛�"; @@ -35797,11 +35859,119 @@ } } } + //鍏堣繘鍏堝嚭涓嬫灦娓呭崟 + else if (oSystemParameter.omodel.Kf_MateOutBill_FIFOList == "Y") //绯荤粺鍙傛暟 鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭涓嬫灦娓呭崟 + { + DataSet FIFOList = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFOList_MateOut " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HPTQty.ToString() + "," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFOList_MateOut"); + if (FIFOList == null || FIFOList.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘瓨鍏ュ厛杩涘厛鍑轰笅鏋舵竻鍗曞け璐ワ紒"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(FIFOList.Tables[0].Rows[0][0]) == 1) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(FIFOList.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } oBar.HMulSourceFlag = sMulSourceFlag; oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]); oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]); oBar.HDeptID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HDeptID"]); oBar.HDeptName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HDeptName"]); + return oBar; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + + #endregion + + #region 閿�鍞嚭搴� 鎵弿婧愬崟鏉$爜 + + [WebMethod] + public Model.ClsKf_ICStockBill_WMS get_SourceBarCode_SellOut(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID, ref string sErrMsg) + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS(); + Int64 sMulSourceFlag = 0; //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛� + + //鑾峰彇绯荤粺鍙傛暟 + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + if (oSystemParameter.ShowBill(ref sErrMsg) == false) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曟椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + return null; + } + + if (oSystemParameter.omodel.Kf_SellOutBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟 閿�鍞嚭搴撳崟-澶氭簮鍗曟ā寮� + { + sMulSourceFlag = 1; + } + + //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛� + DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_SellOut " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HFIFOWhID.ToString() + "," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_SellOut"); + if (ds1 == null || ds1.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘皢婧愬崟淇℃伅瀛樺叆鏉$爜鍑哄叆搴撲复鏃惰〃澶辫触锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0) + { + //鍏堣繘鍏堝嚭鎺у埗 + if (oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗 + { + DataSet FIFO = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFO_SellOut " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFO_SellOut"); + if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘瓨鍏ュ厛杩涘厛鍑轰复鏃惰〃澶辫触锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0][0]) == 1) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + //鍏堣繘鍏堝嚭涓嬫灦娓呭崟 + else if (oSystemParameter.omodel.Kf_SellOutBill_FIFOList == "Y") //绯荤粺鍙傛暟 閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭涓嬫灦娓呭崟 + { + DataSet FIFOList = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFOList_SellOut " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFOList_SellOut"); + if (FIFOList == null || FIFOList.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘瓨鍏ュ厛杩涘厛鍑轰笅鏋舵竻鍗曞け璐ワ紒"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(FIFOList.Tables[0].Rows[0][0]) == 1) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(FIFOList.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + oBar.HBarType = "婧愬崟鏉$爜"; + oBar.HMulSourceFlag = sMulSourceFlag; + oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]); + oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]); + oBar.HSupID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSupID"]); + oBar.HSupName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSupName"]); + oBar.HDeptID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HDeptID"]); + oBar.HDeptName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HDeptName"]); + oBar.HCustom = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HCustom"]); return oBar; } else @@ -35872,6 +36042,106 @@ oBar.HSupName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSupName"]); oBar.HDeptID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HDeptID"]); oBar.HDeptName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HDeptName"]); + return oBar; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + + #endregion + + #region 鐩存帴璋冩嫧 鎵弿婧愬崟鏉$爜 + + [WebMethod] + public Model.ClsKf_ICStockBill_WMS get_SourceBarCode_MoveStock(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID, ref string sErrMsg) + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS(); + Int64 sMulSourceFlag = 0; //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛� + + //鑾峰彇绯荤粺鍙傛暟 + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + if (oSystemParameter.ShowBill(ref sErrMsg) == false) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曟椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + return null; + } + + if (oSystemParameter.omodel.Kf_MoveStockBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟 鐩存帴璋冩嫧鍗�-澶氭簮鍗曟ā寮� + { + sMulSourceFlag = 1; + } + + //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛� + DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_MoveStock " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HFIFOWhID.ToString() + "," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_MoveStock"); + if (ds1 == null || ds1.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘皢婧愬崟淇℃伅瀛樺叆鏉$爜鍑哄叆搴撲复鏃惰〃澶辫触锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0) + { + //鍏堣繘鍏堝嚭鎺у埗 + if (oSystemParameter.omodel.Kf_MoveStockBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗 + { + DataSet FIFO = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFO_MoveStock " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFO_MoveStock"); + if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘瓨鍏ュ厛杩涘厛鍑轰复鏃惰〃澶辫触锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0][0]) == 1) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + //鍏堣繘鍏堝嚭涓嬫灦娓呭崟 + else if (oSystemParameter.omodel.Kf_MoveStockBill_FIFOList == "Y") //绯荤粺鍙傛暟 鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭涓嬫灦娓呭崟 + { + DataSet FIFOList = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFOList_MoveStock " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFOList_MoveStock"); + if (FIFOList == null || FIFOList.Tables[0].Rows.Count == 0) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘瓨鍏ュ厛杩涘厛鍑轰笅鏋舵竻鍗曞け璐ワ紒"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(FIFOList.Tables[0].Rows[0][0]) == 1) + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(FIFOList.Tables[0].Rows[0]["HRemark"]); + return null; + } + } + } + oBar.HBarType = "婧愬崟鏉$爜"; + oBar.HMulSourceFlag = sMulSourceFlag; + oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]); + oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]); + oBar.HSupID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSupID"]); + oBar.HSupName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSupName"]); + oBar.HDeptID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HDeptID"]); + oBar.HDeptName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HDeptName"]); + oBar.HStockOutOrgID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HStockOutOrgID"]); + oBar.HStockOutOrgName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HStockOutOrgName"]); + oBar.HStockInOrgID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HStockInOrgID"]); + oBar.HStockInOrgName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HStockInOrgName"]); + oBar.HStockStyle = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HStockStyle"]); + oBar.HWhID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HWhID"]); + oBar.HWhName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HWhName"]); + oBar.HSPFlag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HSPFlag"]); + oBar.HSCWhID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSCWhID"]); + oBar.HSCWhName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSCWhName"]); + oBar.HSCSPFlag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HSCSPFlag"]); return oBar; } else @@ -36901,6 +37171,11 @@ return false; } } + //鏃犳簮鍗曠姸鎬侊紝璁剧疆婧愬崟绫诲瀷涓�-1 + if (SourceFlag == false) + { + HSourceBillType = "-1"; + } //1銆侀娆℃壂鐮侀槻涓插崟鍒ゆ柇锛� 2銆佹簮鍗曠被鍨嬫槸鍚﹀湪婧愬崟鍒楄〃閲屽垽鏂紱3銆佸敮涓�鏉$爜鏄惁瀛樺湪鐩稿悓鏉$爜鍒ゆ柇锛� 4銆佹湁婧愬崟锛岀墿鏂欐槸鍚﹀湪婧愬崟涓垽鏂� DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_MoveStock '" + omodel_View.HBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillType + "'," + DBUtility.ClsPub.BoolToString(SourceFlag), "h_p_WMS_AddBarCode_MoveStock"); @@ -37004,8 +37279,8 @@ } else { - HSCWHID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HWhID"]); - HSCSPID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSPID"]); + HSCWHID = DBUtility.ClsPub.isLong(DsWMS.Tables[0].Rows[0]["HWhID"]); + HSCSPID = DBUtility.ClsPub.isLong(DsWMS.Tables[0].Rows[0]["HSPID"]); sWMSQty = DBUtility.ClsPub.isDoule(DsWMS.Tables[0].Rows[0]["HKFQty"]); //鍒ゆ柇鎵弿鏉$爜鏁伴噺涓庢潯鐮佸簱瀛樻暟閲� if (sRelQty > sWMSQty) @@ -37122,6 +37397,29 @@ oMain.HSTOCKORGID = HStockOutOrgID; oMain.HOWNERID = HStockInOrgID; + //鍏堣繘鍏堝嚭鎺у埗 + if ((HBillType == "1207" && oSystemParameterMain.Kf_MoveStockBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗 + ) + { + DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_BarCode " + HBillID.ToString() + ",'" + HBillType + "','" + oMain.HBatchNo + "','" + oMain.HBarCode + "'," + oMain.HQty.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_BarCode"); + if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) + { + sErrMsg = "璇锋牴鎹厛杩涘厛鍑烘竻鍗曟壂鐮侊紒"; + return false; + } + else + { + oMain.HWhID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HWHID"]); + oMain.HStockPlaceID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSPID"]); + oMain.HQty = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HQty"]); + oMain.HQtyMust = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HSumQtyMust"]); + oMain.HSourceInterID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceInterID"]); + oMain.HSourceEntryID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceEntryID"]); + oMain.HSourceBillNo = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillNo"]); + oMain.HSourceBillType = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillType"]); + } + } + oCn.RunProc("Insert into KF_PonderationBillMain_Temp " + "(HInterID,HBillNo,HBillType,HMaterID,HAuxPropID,HProcID" + ",HWhID,HSCWHID,HStockPlaceID,HOutStockPlaceID,HGroupID,HAddr" + @@ -37142,367 +37440,369 @@ #endregion - #endregion - // #region 鎵弿鐗╂枡鏉$爜璋冪敤鏂规硶 + #endregion - // #region 鎵弿鐗╂枡鏉$爜 - // [WebMethod] - // public Model.ClsKf_ICStockBill_WMS get_MaterBarCode_New(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWhID, Int64 HSCSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockOrgID, Int64 HStockOutOrgID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg) - // { - // SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - // Model.ClsKf_ICStockBill_WMS model = new Model.ClsKf_ICStockBill_WMS(); - // //鑾峰彇绯荤粺鍙傛暟 - // Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); - // if (oSystemParameter.ShowBill(ref sErrMsg) == false) - // { - // sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; - // return null; - // } - // //鍒ゆ柇鏉$爜鏄惁涓虹┖ - // if (HBarCode.Trim() == "") - // { - // sErrMsg = "鏉$爜涓嶈兘涓虹┖锛岃閲嶆柊鎵弿鐗╂枡鏉$爜锛�"; - // return null; - // } - // //鍒ゆ柇鏉$爜鏄惁鍚壒娈婄鍙� # 锛屽鏋滃惈鏈夊垯鎷嗗垎锛屾埅鍙� # 鍓嶅瓧绗︿覆 - // string[] NewBarCode; - // if (HBarCode.CompareTo("#") > 0) - // { - // NewBarCode = HBarCode.Split(Convert.ToChar("#")); - // HBarCode = NewBarCode[0]; - // } - // //鑾峰彇鏉$爜妗f淇℃伅 - // Model.ClsGy_BarCodeBill_WMS_Model_View oBar = new Model.ClsGy_BarCodeBill_WMS_Model_View(); - // DataSet ds1 = oCn.RunProcReturn("Select * from h_v_Gy_BarCodeBill_New Where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill_New"); - // if (ds1 == null || ds1.Tables[0].Rows.Count == 0) - // { - // sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 鏃犳晥锛屼笉瀛樺湪鏉$爜妗f涓紒"; - // return null; - // } - // else - // { - // oBar.HItemID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HItemID"]); - // oBar.HBarCode = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCode"]); - // oBar.HBarCodeType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCodeType"]); - // oBar.HStopflag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HStopflag"]); - // oBar.HRemark = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]); - // oBar.HMaterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HMaterID"]); - // oBar.HUnitID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HUnitID"]); - // oBar.HAuxPropID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HAuxPropID"]); - // oBar.HBatchNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBatchNo"]); - // oBar.HQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[0]["HQty"]); - // oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceInterID"]); - // oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceEntryID"]); - // oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]); - // oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]); - // oBar.HMTONo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HMTONo"]); - // oBar.HSTOCKORGID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSTOCKORGID"]); - // oBar.HOWNERID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HOWNERID"]); - // } - // //鍒ゆ柇鏉$爜鏄惁鍙敤 - // if (oBar.HStopflag) - // { - // sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 宸蹭綔搴燂紝涓嶅厑璁歌繘琛屾壂鐮佹搷浣滐紒"; - // return null; - // } - // //鍏ュ簱銆佹眹鎶ユā鍧楋紝鏈夋簮鍗曟潯鐮� 涓� 鏉$爜绫诲瀷涓哄敮涓�鏉$爜锛屾壂鎻忕墿鏂欐潯鐮佹椂鑷姩甯﹀嚭婧愬崟淇℃伅 - // //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸澶栧叆搴擄紙1210锛夈�佺敓浜ф眹鎶ワ紙3711锛� - // if (oBar.HBarCodeType == "鍞竴鏉$爜" && oBar.HSourceBillNo == "" && HSourceBillType != "-1" - // && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711")) - // { - // Int64 HAccessFlag = 1; //鏄惁鐗╂枡鏉$爜甯﹀嚭婧愬崟淇℃伅鏍囧織锛�0涓虹洿鎺ユ壂婧愬崟鏉$爜锛�1涓虹墿鏂欐潯鐮佸甫鍑烘簮鍗曚俊鎭級 - // model = getSourceBill_New(HInterID, HBillNo, HBillType, oBar.HSourceBillNo, oBar.HSourceBillType, HRedBlueFlag, HMaker, 0, 0, 0, HStockOrgID, HAccessFlag, SourceFlag, oSystemParameter.omodel, ref sErrMsg); - // if (model == null) - // { - // sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曞け璐ワ紒" + sErrMsg; - // return null; - // } - // else - // { - // HSourceBillType = model.HSourceBillType; - // SourceFlag = true; - // return model; - // } - // } + // #region 鎵弿鐗╂枡鏉$爜璋冪敤鏂规硶 - // //1銆侀娆℃壂鐮侀槻涓插崟鍒ゆ柇锛� 2銆佹簮鍗曠被鍨嬫槸鍚﹀湪婧愬崟鍒楄〃閲屽垽鏂紱3銆佸敮涓�鏉$爜鏄惁瀛樺湪鐩稿悓鏉$爜鍒ゆ柇锛� 4銆佹湁婧愬崟锛岀墿鏂欐槸鍚﹀湪婧愬崟涓垽鏂� - // DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetSourceInterID_AddBarCode " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HSourceBillType + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + oSystemParameter.omodel.WMS_BarCodeMustSameSourceBill + "'," + HStockOrgID.ToString(), "h_p_WMS_GetSourceInterID_AddBarCode"); - // if (ds2 == null || ds2.Tables[0].Rows.Count == 0) - // { - // sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂潯鐮佹槸鍚﹀湪婧愬崟涓椂鍙戠敓閿欒锛�"; - // return null; - // } - // else - // { - // if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 1) - // { - // sErrMsg = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]); - // return null; - // } - // else - // { - // oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]); - // oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]); - // oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]); - // oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillType"]); - // oBar.HMaterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HMaterID"]); - // oBar.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]); //鍓╀綑鏈壂鐮佹暟閲忥紙搴旀敹鏁伴噺-鎵爜鎬绘暟閲� 鎴�0锛夛紝闈炲敮涓�鏉$爜鐢ㄥ埌 - // } - // } + // #region 鎵弿鐗╂枡鏉$爜 - // //鑾峰彇銆佸垽鏂粨搴撱�佷粨浣� - // DataSet ds3 = oCn.RunProcReturn("exec h_p_WMS_GetWHIDandSPID_AddBarCode " + HInterID.ToString() + ",'" + HBillType + "'," + HWhID + "," + HSPID + "," + HSCWhID + "," + HSCSPID + "," + oBar.HSourceInterID + "," + oBar.HSourceEntryID + "," + oBar.HMaterID + "," + HStockOrgID + "," + HStockOutOrgID + ",'" + oBar.HBarCodeType + "','" + oSystemParameter.omodel.WMS_WMSStockCtl + "'", "h_p_WMS_GetWHIDandSPID_AddBarCode"); - // if (ds3 == null || ds3.Tables[0].Rows.Count == 0) - // { - // sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂粨搴撱�佷粨浣嶅�兼椂鍙戠敓閿欒锛�"; - // return null; - // } - // else - // { - // if (DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0][0]) == 1) - // { - // sErrMsg = DBUtility.ClsPub.isStrNull(ds3.Tables[0].Rows[0]["HRemark"]); - // return null; - // } - // else - // { - // model.HWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HWHID"]); - // model.HSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSPID"]); - // model.HSCWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCWHID"]); - // model.HSCSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCSPID"]); - // } - // } + // [WebMethod] + // public Model.ClsKf_ICStockBill_WMS get_MaterBarCode_New(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWhID, Int64 HSCSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockOrgID, Int64 HStockOutOrgID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg) + // { + // SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + // Model.ClsKf_ICStockBill_WMS model = new Model.ClsKf_ICStockBill_WMS(); + // //鑾峰彇绯荤粺鍙傛暟 + // Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + // if (oSystemParameter.ShowBill(ref sErrMsg) == false) + // { + // sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + // return null; + // } + // //鍒ゆ柇鏉$爜鏄惁涓虹┖ + // if (HBarCode.Trim() == "") + // { + // sErrMsg = "鏉$爜涓嶈兘涓虹┖锛岃閲嶆柊鎵弿鐗╂枡鏉$爜锛�"; + // return null; + // } + // //鍒ゆ柇鏉$爜鏄惁鍚壒娈婄鍙� # 锛屽鏋滃惈鏈夊垯鎷嗗垎锛屾埅鍙� # 鍓嶅瓧绗︿覆 + // string[] NewBarCode; + // if (HBarCode.CompareTo("#") > 0) + // { + // NewBarCode = HBarCode.Split(Convert.ToChar("#")); + // HBarCode = NewBarCode[0]; + // } + // //鑾峰彇鏉$爜妗f淇℃伅 + // Model.ClsGy_BarCodeBill_WMS_Model_View oBar = new Model.ClsGy_BarCodeBill_WMS_Model_View(); + // DataSet ds1 = oCn.RunProcReturn("Select * from h_v_Gy_BarCodeBill_New Where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill_New"); + // if (ds1 == null || ds1.Tables[0].Rows.Count == 0) + // { + // sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 鏃犳晥锛屼笉瀛樺湪鏉$爜妗f涓紒"; + // return null; + // } + // else + // { + // oBar.HItemID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HItemID"]); + // oBar.HBarCode = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCode"]); + // oBar.HBarCodeType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCodeType"]); + // oBar.HStopflag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HStopflag"]); + // oBar.HRemark = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]); + // oBar.HMaterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HMaterID"]); + // oBar.HUnitID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HUnitID"]); + // oBar.HAuxPropID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HAuxPropID"]); + // oBar.HBatchNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBatchNo"]); + // oBar.HQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[0]["HQty"]); + // oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceInterID"]); + // oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceEntryID"]); + // oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]); + // oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]); + // oBar.HMTONo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HMTONo"]); + // oBar.HSTOCKORGID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSTOCKORGID"]); + // oBar.HOWNERID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HOWNERID"]); + // } + // //鍒ゆ柇鏉$爜鏄惁鍙敤 + // if (oBar.HStopflag) + // { + // sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 宸蹭綔搴燂紝涓嶅厑璁歌繘琛屾壂鐮佹搷浣滐紒"; + // return null; + // } + // //鍏ュ簱銆佹眹鎶ユā鍧楋紝鏈夋簮鍗曟潯鐮� 涓� 鏉$爜绫诲瀷涓哄敮涓�鏉$爜锛屾壂鎻忕墿鏂欐潯鐮佹椂鑷姩甯﹀嚭婧愬崟淇℃伅 + // //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸澶栧叆搴擄紙1210锛夈�佺敓浜ф眹鎶ワ紙3711锛� + // if (oBar.HBarCodeType == "鍞竴鏉$爜" && oBar.HSourceBillNo == "" && HSourceBillType != "-1" + // && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711")) + // { + // Int64 HAccessFlag = 1; //鏄惁鐗╂枡鏉$爜甯﹀嚭婧愬崟淇℃伅鏍囧織锛�0涓虹洿鎺ユ壂婧愬崟鏉$爜锛�1涓虹墿鏂欐潯鐮佸甫鍑烘簮鍗曚俊鎭級 + // model = getSourceBill_New(HInterID, HBillNo, HBillType, oBar.HSourceBillNo, oBar.HSourceBillType, HRedBlueFlag, HMaker, 0, 0, 0, HStockOrgID, HAccessFlag, SourceFlag, oSystemParameter.omodel, ref sErrMsg); + // if (model == null) + // { + // sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曞け璐ワ紒" + sErrMsg; + // return null; + // } + // else + // { + // HSourceBillType = model.HSourceBillType; + // SourceFlag = true; + // return model; + // } + // } - // //鍒濇鑾峰彇鏉$爜鏁伴噺 - // if (oBar.HBarCodeType == "鍞竴鏉$爜") - // { - // if (HQty > 0 && oBar.HQty > HQty) //0<鐣岄潰閫掑叆鏁伴噺<鏉$爜妗f鏁伴噺锛屽彇閫掑叆鏁伴噺 - // { - // oBar.HQty = HQty; - // } - // } - // else - // { - // if (HQty > 0) //鐣岄潰閫掑叆鏁伴噺>0锛屽彇閫掑叆鏁伴噺 - // { - // oBar.HQty = HQty; - // } - // else if (oBar.HinitQty > 0) //鐣岄潰閫掑叆鏁伴噺<0锛屾簮鍗曞墿浣欐湭鎵爜鏁伴噺>0锛屽彇婧愬崟鍓╀綑鏈壂鐮佹暟閲� - // { - // oBar.HQty = oBar.HinitQty; - // } - // } + // //1銆侀娆℃壂鐮侀槻涓插崟鍒ゆ柇锛� 2銆佹簮鍗曠被鍨嬫槸鍚﹀湪婧愬崟鍒楄〃閲屽垽鏂紱3銆佸敮涓�鏉$爜鏄惁瀛樺湪鐩稿悓鏉$爜鍒ゆ柇锛� 4銆佹湁婧愬崟锛岀墿鏂欐槸鍚﹀湪婧愬崟涓垽鏂� + // DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetSourceInterID_AddBarCode " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HSourceBillType + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + oSystemParameter.omodel.WMS_BarCodeMustSameSourceBill + "'," + HStockOrgID.ToString(), "h_p_WMS_GetSourceInterID_AddBarCode"); + // if (ds2 == null || ds2.Tables[0].Rows.Count == 0) + // { + // sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂潯鐮佹槸鍚﹀湪婧愬崟涓椂鍙戠敓閿欒锛�"; + // return null; + // } + // else + // { + // if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 1) + // { + // sErrMsg = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]); + // return null; + // } + // else + // { + // oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]); + // oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]); + // oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]); + // oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillType"]); + // oBar.HMaterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HMaterID"]); + // oBar.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]); //鍓╀綑鏈壂鐮佹暟閲忥紙搴旀敹鏁伴噺-鎵爜鎬绘暟閲� 鎴�0锛夛紝闈炲敮涓�鏉$爜鐢ㄥ埌 + // } + // } - // //鐢熶骇棰嗘枡锛�1204锛夈�侀攢鍞嚭搴擄紙1205锛夈�佸叾浠栧嚭搴撹摑瀛楋紙1206锛夈�佸澶栧嚭搴擄紙1211锛� - // //澶栬喘閫�鏂欙紙1239锛夈�佷骇鍝侀��搴擄紙1245锛夈�佸叾浠栧叆搴撶孩瀛楋紙1248锛夈�佸澶栭��搴擄紙1246锛� - // //鐢熶骇琛ユ枡锛�1254锛� - // if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211" - // || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246" - // || HBillType == "1254") - // { - // if (oSystemParameter.omodel.WMS_ERPStockCtl == "Y") - // { + // //鑾峰彇銆佸垽鏂粨搴撱�佷粨浣� + // DataSet ds3 = oCn.RunProcReturn("exec h_p_WMS_GetWHIDandSPID_AddBarCode " + HInterID.ToString() + ",'" + HBillType + "'," + HWhID + "," + HSPID + "," + HSCWhID + "," + HSCSPID + "," + oBar.HSourceInterID + "," + oBar.HSourceEntryID + "," + oBar.HMaterID + "," + HStockOrgID + "," + HStockOutOrgID + ",'" + oBar.HBarCodeType + "','" + oSystemParameter.omodel.WMS_WMSStockCtl + "'", "h_p_WMS_GetWHIDandSPID_AddBarCode"); + // if (ds3 == null || ds3.Tables[0].Rows.Count == 0) + // { + // sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂粨搴撱�佷粨浣嶅�兼椂鍙戠敓閿欒锛�"; + // return null; + // } + // else + // { + // if (DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0][0]) == 1) + // { + // sErrMsg = DBUtility.ClsPub.isStrNull(ds3.Tables[0].Rows[0]["HRemark"]); + // return null; + // } + // else + // { + // model.HWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HWHID"]); + // model.HSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSPID"]); + // model.HSCWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCWHID"]); + // model.HSCSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCSPID"]); + // } + // } - // } + // //鍒濇鑾峰彇鏉$爜鏁伴噺 + // if (oBar.HBarCodeType == "鍞竴鏉$爜") + // { + // if (HQty > 0 && oBar.HQty > HQty) //0<鐣岄潰閫掑叆鏁伴噺<鏉$爜妗f鏁伴噺锛屽彇閫掑叆鏁伴噺 + // { + // oBar.HQty = HQty; + // } + // } + // else + // { + // if (HQty > 0) //鐣岄潰閫掑叆鏁伴噺>0锛屽彇閫掑叆鏁伴噺 + // { + // oBar.HQty = HQty; + // } + // else if (oBar.HinitQty > 0) //鐣岄潰閫掑叆鏁伴噺<0锛屾簮鍗曞墿浣欐湭鎵爜鏁伴噺>0锛屽彇婧愬崟鍓╀綑鏈壂鐮佹暟閲� + // { + // oBar.HQty = oBar.HinitQty; + // } + // } + + // //鐢熶骇棰嗘枡锛�1204锛夈�侀攢鍞嚭搴擄紙1205锛夈�佸叾浠栧嚭搴撹摑瀛楋紙1206锛夈�佸澶栧嚭搴擄紙1211锛� + // //澶栬喘閫�鏂欙紙1239锛夈�佷骇鍝侀��搴擄紙1245锛夈�佸叾浠栧叆搴撶孩瀛楋紙1248锛夈�佸澶栭��搴擄紙1246锛� + // //鐢熶骇琛ユ枡锛�1254锛� + // if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211" + // || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246" + // || HBillType == "1254") + // { + // if (oSystemParameter.omodel.WMS_ERPStockCtl == "Y") + // { + + // } - // //闈炲敮涓�鏉$爜鎵弿鏃跺垽鏂粨搴撲粨浣嶆槸鍚﹀凡閫夋嫨 - // if (dal.omodel_View.HBarCodeType != "鍞竴鏉$爜") - // { - // if (oSystemParameter.omodel.WMS_ERPStockCtl == "N") - // { + // //闈炲敮涓�鏉$爜鎵弿鏃跺垽鏂粨搴撲粨浣嶆槸鍚﹀凡閫夋嫨 + // if (dal.omodel_View.HBarCodeType != "鍞竴鏉$爜") + // { + // if (oSystemParameter.omodel.WMS_ERPStockCtl == "N") + // { - // } - // else - // { - // //鍒ゆ柇ERP搴撳瓨 杩斿洖ERP搴撳瓨鏁伴噺 - // DataSet ds6 = oCn.RunProcReturn("exec h_p_IF_CheckQtyByERPICInventory " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + dal.omodel_View.HMaterID.ToString() + "," + dal.omodel_View.HAuxPropID.ToString() + ",'" + dal.omodel_View.HBatchNo + "'," + sRelQty.ToString() + "," + HOWNERID.ToString(), "h_p_IF_CheckQtyByERPICInventory"); - // if (ds6 == null || ds6.Tables[0].Rows.Count == 0) - // { - // sErrMsg = "鍒ゆ柇ERP搴撳瓨锛屾湭鐭ラ敊璇紒"; - // return false; - // } - // else - // { - // if (DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0][0]) == 0) - // { - // dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0]["HMaterID"]); - // HQty = DBUtility.ClsPub.isDoule(ds6.Tables[0].Rows[0]["HQty"]); - // } - // else - // { - // sErrMsg = DBUtility.ClsPub.isStrNull(ds6.Tables[0].Rows[0]["HRemark"]); - // return false; - // } - // } - // } - // } - // else - // { - // //鍒ゆ柇鏉$爜搴撳瓨 杩斿洖搴撳瓨鏁伴噺 浠撳簱 浠撲綅 - // DAL.ClsKF_PonderationBillMain_Temp_View Tempdal = new DAL.ClsKF_PonderationBillMain_Temp_View(); - // if (Tempdal.CheckQtyByBarCode(HBillID, HBillType, sBarCode, ref HWhID, ref HSPID, sRelQty, ref sRelQty)) - // { + // } + // else + // { + // //鍒ゆ柇ERP搴撳瓨 杩斿洖ERP搴撳瓨鏁伴噺 + // DataSet ds6 = oCn.RunProcReturn("exec h_p_IF_CheckQtyByERPICInventory " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + dal.omodel_View.HMaterID.ToString() + "," + dal.omodel_View.HAuxPropID.ToString() + ",'" + dal.omodel_View.HBatchNo + "'," + sRelQty.ToString() + "," + HOWNERID.ToString(), "h_p_IF_CheckQtyByERPICInventory"); + // if (ds6 == null || ds6.Tables[0].Rows.Count == 0) + // { + // sErrMsg = "鍒ゆ柇ERP搴撳瓨锛屾湭鐭ラ敊璇紒"; + // return false; + // } + // else + // { + // if (DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0][0]) == 0) + // { + // dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0]["HMaterID"]); + // HQty = DBUtility.ClsPub.isDoule(ds6.Tables[0].Rows[0]["HQty"]); + // } + // else + // { + // sErrMsg = DBUtility.ClsPub.isStrNull(ds6.Tables[0].Rows[0]["HRemark"]); + // return false; + // } + // } + // } + // } + // else + // { + // //鍒ゆ柇鏉$爜搴撳瓨 杩斿洖搴撳瓨鏁伴噺 浠撳簱 浠撲綅 + // DAL.ClsKF_PonderationBillMain_Temp_View Tempdal = new DAL.ClsKF_PonderationBillMain_Temp_View(); + // if (Tempdal.CheckQtyByBarCode(HBillID, HBillType, sBarCode, ref HWhID, ref HSPID, sRelQty, ref sRelQty)) + // { - // } - // else - // { - // if (sRelQty == 0) - // { - // sErrMsg = "鏃犲簱瀛橈紒"; - // return false; - // } - // else - // { - // sErrMsg = "搴撳瓨涓嶈冻锛屽凡鑾峰彇瀹為檯搴撳瓨鏁伴噺锛�"; - // } - // } - // } - // } - // //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸叾浠栧叆搴撹摑瀛楋紙1203锛夈�佸澶栧叆搴擄紙1210锛� - // //鐢熶骇閫�鏂欙紙1244锛夈�侀攢鍞��搴擄紙1247锛夈�佸叾浠栧嚭搴撶孩瀛楋紙1249锛夈�佸澶栭��鏂欙紙1238锛� - // else - // { - // //鍒ゆ柇骞惰幏鍙� 浠撳簱 浠撲綅淇℃伅 - // DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID"); - // if (ds4 == null || ds4.Tables[0].Rows.Count == 0) - // { - // sErrMsg = "鍒ゆ柇骞惰幏鍙栦粨搴撲粨浣嶄俊鎭紝鏈煡閿欒锛�"; - // return false; - // } - // else - // { - // if (DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0][0]) == 0) - // { - // HWhID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HWHID"]); - // HSPID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HSPID"]); - // } - // else - // { - // sErrMsg = DBUtility.ClsPub.isStrNull(ds4.Tables[0].Rows[0]["HRemark"]); - // return false; - // } - // } - // //鍒ゆ柇鏉$爜鎵弿鏁伴噺 杩斿洖鍓╀綑鏈壂鎻忔暟閲� - // if (tem.IsBarCode_New(sBarCode, HBillType, HRedBlueFlag, ref sRelQty, ref sErrMsg)) - // { + // } + // else + // { + // if (sRelQty == 0) + // { + // sErrMsg = "鏃犲簱瀛橈紒"; + // return false; + // } + // else + // { + // sErrMsg = "搴撳瓨涓嶈冻锛屽凡鑾峰彇瀹為檯搴撳瓨鏁伴噺锛�"; + // } + // } + // } + // } + // //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸叾浠栧叆搴撹摑瀛楋紙1203锛夈�佸澶栧叆搴擄紙1210锛� + // //鐢熶骇閫�鏂欙紙1244锛夈�侀攢鍞��搴擄紙1247锛夈�佸叾浠栧嚭搴撶孩瀛楋紙1249锛夈�佸澶栭��鏂欙紙1238锛� + // else + // { + // //鍒ゆ柇骞惰幏鍙� 浠撳簱 浠撲綅淇℃伅 + // DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID"); + // if (ds4 == null || ds4.Tables[0].Rows.Count == 0) + // { + // sErrMsg = "鍒ゆ柇骞惰幏鍙栦粨搴撲粨浣嶄俊鎭紝鏈煡閿欒锛�"; + // return false; + // } + // else + // { + // if (DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0][0]) == 0) + // { + // HWhID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HWHID"]); + // HSPID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HSPID"]); + // } + // else + // { + // sErrMsg = DBUtility.ClsPub.isStrNull(ds4.Tables[0].Rows[0]["HRemark"]); + // return false; + // } + // } + // //鍒ゆ柇鏉$爜鎵弿鏁伴噺 杩斿洖鍓╀綑鏈壂鎻忔暟閲� + // if (tem.IsBarCode_New(sBarCode, HBillType, HRedBlueFlag, ref sRelQty, ref sErrMsg)) + // { - // } - // else - // { - // sErrMsg = sErrMsg; - // return false; - // } - // } - // } + // } + // else + // { + // sErrMsg = sErrMsg; + // return false; + // } + // } + // } - // if (HExpressNumber == "宸ュ簭姹囨姤杞Щ鍗�") - // { - // model.HSubBillType = "1270"; - // HExpressNumber = ""; - // } - // model.HInterID = HBillID; - // model.HBillNo = HBillNo; - // model.HBillType = HBillType; - // model.HMaker = HMaker; - // // - // model.HMaterID = dal.omodel_View.HMaterID; - // model.HAuxPropID = dal.omodel_View.HAuxPropID; - // model.HErpClsID = dal.omodel_View.HErpClsID; - // model.HQty = sRelQty; - // model.HQtyMust = dal.omodel_View.HinitQty; - // model.HBarCode = dal.omodel_View.HBarCode; - // model.HBatchNo = dal.omodel_View.HBatchNo; - // model.HMTONo = dal.omodel_View.HMTONo; + // if (HExpressNumber == "宸ュ簭姹囨姤杞Щ鍗�") + // { + // model.HSubBillType = "1270"; + // HExpressNumber = ""; + // } + // model.HInterID = HBillID; + // model.HBillNo = HBillNo; + // model.HBillType = HBillType; + // model.HMaker = HMaker; + // // + // model.HMaterID = dal.omodel_View.HMaterID; + // model.HAuxPropID = dal.omodel_View.HAuxPropID; + // model.HErpClsID = dal.omodel_View.HErpClsID; + // model.HQty = sRelQty; + // model.HQtyMust = dal.omodel_View.HinitQty; + // model.HBarCode = dal.omodel_View.HBarCode; + // model.HBatchNo = dal.omodel_View.HBatchNo; + // model.HMTONo = dal.omodel_View.HMTONo; - // model.HWhID = HWhID; - // model.HStockPlaceID = HSPID; - // model.HSourceInterID = dal.omodel_View.HSourceInterID; - // model.HSourceEntryID = dal.omodel_View.HSourceEntryID; - // model.HSourceBillNo = dal.omodel_View.HSourceBillNo; - // model.HSourceBillType = HSourceBillType; - // model.HRedBlueFlag = HRedBlueFlag; - // model.HPieceQty = 1; - // model.HSTOCKORGID = HOWNERID; - // model.HOWNERID = HOWNERID; - // model.HCusBarCode = HExpressNumber; + // model.HWhID = HWhID; + // model.HStockPlaceID = HSPID; + // model.HSourceInterID = dal.omodel_View.HSourceInterID; + // model.HSourceEntryID = dal.omodel_View.HSourceEntryID; + // model.HSourceBillNo = dal.omodel_View.HSourceBillNo; + // model.HSourceBillType = HSourceBillType; + // model.HRedBlueFlag = HRedBlueFlag; + // model.HPieceQty = 1; + // model.HSTOCKORGID = HOWNERID; + // model.HOWNERID = HOWNERID; + // model.HCusBarCode = HExpressNumber; - // ////鑾峰彇绯荤粺鍙傛暟 - // //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); - // //if (oSystemParameter.ShowBill(ref sErrMsg) == false) - // //{ - // // sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; - // // return false; - // //} - // //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 - // if (HBillType == "1204" && oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 - // { - // DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_BarCode " + HBillID.ToString() + ",'" + HBillType + "','" + model.HBatchNo + "','" + model.HBarCode + "'," + model.HQty.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_BarCode"); - // if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) - // { - // sErrMsg = "璇锋牴鎹厛杩涘厛鍑烘竻鍗曟壂鐮侊紒"; - // return false; - // } - // else - //{ - // model.HWhID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HWHID"]); - // model.HStockPlaceID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSPID"]); - // model.HQty = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HQty"]); - // model.HQtyMust = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HSumQtyMust"]); - // model.HSourceInterID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceInterID"]); - // model.HSourceEntryID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceEntryID"]); - // model.HSourceBillNo = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillNo"]); - // model.HSourceBillType = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillType"]); - //} - // } + // ////鑾峰彇绯荤粺鍙傛暟 + // //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + // //if (oSystemParameter.ShowBill(ref sErrMsg) == false) + // //{ + // // sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + // // return false; + // //} + // //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + // if (HBillType == "1204" && oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟 鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + // { + // DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_BarCode " + HBillID.ToString() + ",'" + HBillType + "','" + model.HBatchNo + "','" + model.HBarCode + "'," + model.HQty.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_BarCode"); + // if (FIFO == null || FIFO.Tables[0].Rows.Count == 0) + // { + // sErrMsg = "璇锋牴鎹厛杩涘厛鍑烘竻鍗曟壂鐮侊紒"; + // return false; + // } + // else + //{ + // model.HWhID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HWHID"]); + // model.HStockPlaceID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSPID"]); + // model.HQty = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HQty"]); + // model.HQtyMust = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HSumQtyMust"]); + // model.HSourceInterID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceInterID"]); + // model.HSourceEntryID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceEntryID"]); + // model.HSourceBillNo = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillNo"]); + // model.HSourceBillType = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillType"]); + //} + // } - // //鐗╂枡鏉$爜鍐欏叆涓存椂琛ㄦ椂锛屽垽鏂粨搴撲粨浣嶆槸鍚︽纭� - // DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP"); - //if (ds5 == null || ds5.Tables[0].Rows.Count == 0) - //{ - // sErrMsg = "鎵弿鐗╂枡鏉$爜瀛樺叆涓存椂琛ㄦ椂鍒ゆ柇浠撳簱浠撲綅鏄惁姝g‘,鏈煡閿欒锛�"; - // return false; - //} - //else - //{ - // if (DBUtility.ClsPub.isLong(ds5.Tables[0].Rows[0][0]) == 1) - // { - // sErrMsg = DBUtility.ClsPub.isStrNull(ds5.Tables[0].Rows[0]["HRemark"]); - // return false; - // } - //} + // //鐗╂枡鏉$爜鍐欏叆涓存椂琛ㄦ椂锛屽垽鏂粨搴撲粨浣嶆槸鍚︽纭� + // DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP"); + //if (ds5 == null || ds5.Tables[0].Rows.Count == 0) + //{ + // sErrMsg = "鎵弿鐗╂枡鏉$爜瀛樺叆涓存椂琛ㄦ椂鍒ゆ柇浠撳簱浠撲綅鏄惁姝g‘,鏈煡閿欒锛�"; + // return false; + //} + //else + //{ + // if (DBUtility.ClsPub.isLong(ds5.Tables[0].Rows[0][0]) == 1) + // { + // sErrMsg = DBUtility.ClsPub.isStrNull(ds5.Tables[0].Rows[0]["HRemark"]); + // return false; + // } + //} - ////灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛� - //if (set_SavePonderationBillMain_Temp_Select_Qty(model, HQty, ref sErrMsg)) - //{ + ////灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛� + //if (set_SavePonderationBillMain_Temp_Select_Qty(model, HQty, ref sErrMsg)) + //{ - //} - //else - //{ - // sErrMsg = "鎵弿澶辫触锛�" + sErrMsg; - // return false; - //} - //return true; - // } + //} + //else + //{ + // sErrMsg = "鎵弿澶辫触锛�" + sErrMsg; + // return false; + //} + //return true; + // } - // #endregion + // #endregion - // #endregion + // #endregion - #region 妯″叿鏉$爜澶勭悊鏂规硶 + #region 妯″叿鏉$爜澶勭悊鏂规硶 - #region 鎵弿妯″叿婧愬崟鏉$爜 + #region 鎵弿妯″叿婧愬崟鏉$爜 - [WebMethod] + [WebMethod] public Model.ClsKf_ICStockBill_Mould get_CheckTypeByMouldSource(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HHMaker, Int64 HOWNERID, ref string sErrMsg) { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); @@ -37756,7 +38056,7 @@ //鍒ゆ柇鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊(Y,N)锛屾槸鍚﹀惎鐢ㄦ壂鐮佺畝鏄撴ā寮忥紝鍙樉绀哄凡鎵爜婧愬崟璁板綍(Y,N) if (HBillType == "1204") //鐢熶骇棰嗘枡鍗� { - if (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + if (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_MateOutBill_FIFOList == "Y") //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 { sFIFOCtl = "Y"; } @@ -37765,11 +38065,15 @@ sSimpleMode = "Y"; } } - if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl == "Y") //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1205" && (oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_SellOutBill_FIFOList == "Y")) //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗 { sFIFOCtl = "Y"; } - if (HBillType == "1211" && oSystemParameter.omodel.Kf_EntrustOutBill_FIFOCtl == "Y") //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1211" && oSystemParameter.omodel.Kf_EntrustOutBill_FIFOCtl == "Y") //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗 + { + sFIFOCtl = "Y"; + } + else if (HBillType == "1207" && (oSystemParameter.omodel.Kf_MoveStockBill_FIFOCtl == "Y" || oSystemParameter.omodel.Kf_MoveStockBill_FIFOList == "Y")) //鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗 { sFIFOCtl = "Y"; } -- Gitblit v1.9.1