From 7e5eba04d0518ad7fe842240f6c7c56d707a9a00 Mon Sep 17 00:00:00 2001 From: yxj <1qaz@123> Date: 星期二, 05 七月 2022 11:00:01 +0800 Subject: [PATCH] 森楷增加一键扫码模式 --- CLOUDWEB/WebService1.asmx.cs | 616 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 534 insertions(+), 82 deletions(-) diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs index 3333454..fa501bb 100644 --- a/CLOUDWEB/WebService1.asmx.cs +++ b/CLOUDWEB/WebService1.asmx.cs @@ -34294,86 +34294,350 @@ //鍏朵粬鍏ュ簱銆佸叾浠栧嚭搴� 妫シ涓撶敤 else if ((HBillType == "1203" || HBillType == "1206") && oSystemParameter.omodel.WMS_CampanyName == "妫シ") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { - //鏍规嵁鍗曚釜鏉$爜鑾峰彇瀵瑰簲鏁存墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃 - string sBarCode_New; - DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','鏁存墭鎵爜'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); - if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) + //鍒ゆ柇鏄惁鍚敤涓�閿壂鐮佹ā寮忥紝Y涓哄惎鐢紝鏈惎鐢ㄦ椂鍙壂鎻忕墿鏂欐潯鐮� + if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N") { - sErrMsg = "鑾峰彇鏁存墭鏉$爜淇℃伅鍙戠敓閿欒锛�"; - return null; - } - else - { - if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) + //鏍规嵁鍗曚釜鏉$爜鑾峰彇瀵瑰簲鏁存墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃 + string sBarCode_New; + DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','鏁存墭鎵爜'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); + if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) { - sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); - return null; - } - else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) - { - sErrMsg = "姝ゆā鍧椾笉鍏佽鍙嶅悜鎷嗙爜锛�"; + sErrMsg = "鑾峰彇鏁存墭鏉$爜淇℃伅鍙戠敓閿欒锛�"; return null; } else { - if (HBillType == "1203") + if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) { - 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; + sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); + return null; + } + else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) + { + sErrMsg = "姝ゆā鍧椾笉鍏佽鍙嶅悜鎷嗙爜锛�"; + return null; + } + else + { + if (HBillType == "1203") + { + HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); + HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); - 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) + Int64 sMulSourceFlag = 0; //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛� + if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟 鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮� { - SourceFlag = true; + 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 { - sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛�" + DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HRemark"]); + 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"]); + if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) + { + oBar.HSourceBillType = sHSourceBillType; + oBar.HSourceBillNo = sHSourceBillNo; + oBar.HSupID = sHSupID; + oBar.HSupName = sHSupName; + oBar.HDeptID = sHDeptID; + oBar.HDeptName = sHDeptName; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sBarCode_New + sErrMsg; return null; } } } + return oBar; + } + } + //涓�閿壂鐮佹ā寮忥紝鏍规嵁鏉$爜鍓嶇紑璧� 涓嶅悓鏂规硶锛堜粨搴撱�佷粨浣嶃�侀儴闂級锛堟簮鍗曘�佺墿鏂欐潯鐮侊級 + else + { + string sRedBlue = "钃濆瓧"; + if (HRedBlueFlag) + { + sRedBlue = "绾㈠瓧"; + } + else + { + sRedBlue = "钃濆瓧"; + } + DataSet Dss; + //鏍规嵁閫掑叆鐨勬潯鐮佸墠涓変綅锛屽垽鏂潯鐮佺被鍨嬶紙浠撳簱銆佷粨浣嶃�侀儴闂ㄣ�佹簮鍗曘�佺墿鏂欐潯鐮侊級 + Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType from Xt_BarCodeType where HSourceNumber= '" + sBarCodePrefix + "'", "Xt_BarCodeType"); - for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) + //鏃犺繑鍥炴暟鎹垯涓虹墿鏂欐潯鐮� + if (Dss == null || Dss.Tables[0].Rows.Count == 0) + { + //鏍规嵁鍗曚釜鏉$爜鑾峰彇瀵瑰簲鏁存墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃 + string sBarCode_New; + DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','鏁存墭鎵爜'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); + if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) { - sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); - if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) + sErrMsg = "鑾峰彇鏁存墭鏉$爜淇℃伅鍙戠敓閿欒锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) { - oBar.HSourceBillType = sHSourceBillType; - oBar.HSourceBillNo = sHSourceBillNo; - oBar.HSupID = sHSupID; - oBar.HSupName = sHSupName; - oBar.HDeptID = sHDeptID; - oBar.HDeptName = sHDeptName; + sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); + return null; + } + else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) + { + sErrMsg = "姝ゆā鍧椾笉鍏佽鍙嶅悜鎷嗙爜锛�"; + return null; } else { - sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sBarCode_New + sErrMsg; + if (HBillType == "1203") + { + HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); + HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); + + 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"]); + if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) + { + oBar.HSourceBillType = sHSourceBillType; + oBar.HSourceBillNo = sHSourceBillNo; + oBar.HSupID = sHSupID; + oBar.HSupName = sHSupName; + oBar.HDeptID = sHDeptID; + oBar.HDeptName = sHDeptName; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sBarCode_New + sErrMsg; + return null; + } + } + } + return oBar; + } + } + else + { + string sBarBillName = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceName"]); + string sBarBillType = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["BarCodeType"]); + + //鍒ゆ柇鏉$爜绫诲瀷涓� 鍩虹璧勬枡鏉$爜 鎴� 婧愬崟鏉$爜 + if (sBarBillType == "鍩虹璧勬枡鏉$爜") + { + //浠撳簱鏉$爜 + if (sBarBillName == "浠撳簱") + { + DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View(); + //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰,TryParse涓嶈兘杞崲鎴愭暣鏁版椂杩斿洖false锛屽苟杩斿洖ID=0 + int ID; + if (int.TryParse(sBarCode.Remove(0, 3), out ID)) + { + if (dal.GetInfoByID(ID, HOWNERID)) + { + oBar.HBarType = "浠撳簱鏉$爜"; + oBar.HWhID = dal.omodel.HItemID; + oBar.HWhNumber = dal.omodel.HNumber; + oBar.HWhName = dal.omodel.HName; + oBar.HSPFlag = dal.omodel.HIsStockMgr; + return oBar; + } + else + { + sErrMsg = "鏃犳晥浠撳簱鏉$爜锛�"; + return null; + } + } + else + { + sErrMsg = "閿欒鐨勪粨搴撴潯鐮侊紒"; + return null; + } + } + //浠撲綅鏉$爜 + else if (sBarBillName == "浠撲綅") + { + DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View(); + //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰 + int sHSPID; + int sHWHID; + string[] sArray = sBarCode.Remove(0, 3).Split(';'); + if (int.TryParse(sArray[1], out sHSPID) && int.TryParse(sArray[0], out sHWHID)) + { + if (dal.GetInfoByID(sHSPID, sHWHID, HOWNERID)) + { + oBar.HBarType = "浠撲綅鏉$爜"; + oBar.HSPID = dal.omodel.HItemID; + oBar.HSPNumber = dal.omodel.HNumber; + oBar.HSPName = dal.omodel.HName; + oBar.HWhID = dal.omodel.HWHID; + oBar.HWhNumber = dal.omodel.HWhNumber; + oBar.HWhName = dal.omodel.HWhName; + return oBar; + } + else + { + sErrMsg = "鏃犳晥浠撲綅鏉$爜锛�"; + return null; + } + } + else + { + sErrMsg = "閿欒鐨勪粨浣嶆潯鐮侊紒"; + return null; + } + } + //閮ㄩ棬鏉$爜 + else if (sBarBillName == "閮ㄩ棬") + { + DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View(); + //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰 + int ID; + if (int.TryParse(sBarCode.Remove(0, 3), out ID)) + { + if (dal.GetInfoByID(ID)) + { + oBar.HBarType = "閮ㄩ棬鏉$爜"; + oBar.HDeptID = dal.omodel.HItemID; + oBar.HDeptNumber = dal.omodel.HNumber; + oBar.HDeptName = dal.omodel.HName; + return oBar; + } + else + { + sErrMsg = "鏃犳晥閮ㄩ棬鏉$爜锛�"; + return null; + } + } + else + { + sErrMsg = "閿欒鐨勯儴闂ㄦ潯鐮侊紒"; + return null; + } + } + else + { + sErrMsg = "鏃犳晥鍩虹璧勬枡鏉$爜锛�"; return null; } } + //婧愬崟鏉$爜 + else if (sBarBillType == "婧愬崟鏉$爜") + { + DataSet Ds = oCn.RunProcReturn(" select HSourceName from Xt_BarCodeType where HSourceNumber= '" + sBarCodePrefix + "' and HBillType= '" + HBillType + "'", "Xt_BarCodeType"); + + if (Ds == null || Ds.Tables[0].Rows.Count == 0) + { + sErrMsg = "鎵�鎵簮鍗曟潯鐮佷笉灞炰簬姝ゆā鍧楁簮鍗曡寖鍥达紒"; + return null; + } + else + { + sBarBillName = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceName"]); + //鎵弿婧愬崟鏉$爜鏃跺垽鏂槸鍚﹀凡缁忔壂鎻忚繃婧愬崟淇℃伅 + if (SourceFlag) + { + sErrMsg = "鏄庣粏淇℃伅鍒楄〃宸叉湁鎵爜璁板綍锛屼笉鍏佽澶氭鎵弿婧愬崟鏉$爜锛�"; + return null; + } + else + { + if (sBarBillName == "鍙戣揣閫氱煡鍗�" && HBillType == "1205") + { + DAL.Cls_S_IF_SeOutStockBill_Lite dal = new DAL.Cls_S_IF_SeOutStockBill_Lite(); + DataSet DS; + //鏍规嵁鍗曟嵁鍙疯幏鍙栬繃婊ゆ潯浠� + string sWhere = " Where 鍗曟嵁鍙� like '" + sBarCode + "'"; + DS = dal.DisSourceBillList(sWhere); + if (DS == null || DS.Tables[0].Rows.Count <= 0) + { + sErrMsg = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + return null; + } + oBar.HBarType = "婧愬崟鏉$爜"; + oBar.HSourceBillNo = Convert.ToString(DS.Tables[0].Rows[0]["HBillNo"]); + oBar.HSourceBillType = Convert.ToString(DS.Tables[0].Rows[0]["HBillType"]); + oBar.HSupID = Convert.ToInt64(DS.Tables[0].Rows[0]["HSupID"]); + oBar.HSupName = Convert.ToString(DS.Tables[0].Rows[0]["HSupName"]); + oBar.HDeptID = Convert.ToInt64(DS.Tables[0].Rows[0]["HDeptID"]); + oBar.HDeptName = Convert.ToString(DS.Tables[0].Rows[0]["HDeptName"]); + oBar.HCustom = Convert.ToString(DS.Tables[0].Rows[0]["HCustom"]); + } + else + { + sErrMsg = "婧愬崟绫诲瀷鍚嶇О璁剧疆涓嶆纭紒"; + return null; + } + // 灏嗘簮鍗曚俊鎭啓鍏� 涓存椂缂撳瓨琛� + if (tem.AddNew_Source(HBillID, HBillNo, HBillType, oBar.HSourceBillNo, oBar.HSourceBillType, sRedBlue, ref sErrMsg)) + { + return oBar; + } + else + { + sErrMsg = "淇濆瓨婧愬崟淇℃伅澶辫触锛�" + sErrMsg; + return null; + } + } + } + } + else + { + sErrMsg = "鏃犳晥鏉$爜绫诲瀷锛�"; + return null; + } } - return oBar; } } //鐢熶骇鍏ュ簱 澶氭簮鍗曟ā寮� @@ -36304,49 +36568,237 @@ //閿�鍞嚭搴� 妫シ涓撶敤 else if (HBillType == "1205" && oSystemParameter.omodel.WMS_CampanyName == "妫シ") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { - //鏍规嵁鍗曚釜鏉$爜鑾峰彇瀵瑰簲鏁存墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃 - string sBarCode_New; - DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','" + HScanStyle + "'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); - if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) + //鍒ゆ柇鏄惁鍚敤涓�閿壂鐮佹ā寮忥紝Y涓哄惎鐢紝鏈惎鐢ㄦ椂鍙壂鎻忕墿鏂欐潯鐮� + if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N") { - sErrMsg = "鑾峰彇鏁存墭鏉$爜淇℃伅鍙戠敓閿欒锛�"; - return null; - } - else - { - if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) + //鏍规嵁鍗曚釜鏉$爜鑾峰彇瀵瑰簲鏁存墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃 + string sBarCode_New; + DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','" + HScanStyle + "'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); + if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) { - sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); + sErrMsg = "鑾峰彇鏁存墭鏉$爜淇℃伅鍙戠敓閿欒锛�"; return null; - } - else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) - { - oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HBillID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); - return oBar; } else { - for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) + if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) { - sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); - if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) + sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); + return null; + } + else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) + { + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HBillID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); + return oBar; + } + else + { + for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) { - oBar.HSourceBillType = sHSourceBillType; - oBar.HSourceBillNo = sHSourceBillNo; - oBar.HSupID = sHSupID; - oBar.HSupName = sHSupName; - oBar.HDeptID = sHDeptID; - oBar.HDeptName = sHDeptName; - SourceFlag = true; + sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); + if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) + { + oBar.HSourceBillType = sHSourceBillType; + oBar.HSourceBillNo = sHSourceBillNo; + oBar.HSupID = sHSupID; + oBar.HSupName = sHSupName; + oBar.HDeptID = sHDeptID; + oBar.HDeptName = sHDeptName; + SourceFlag = true; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sBarCode_New + sErrMsg; + return null; + } + } + } + return oBar; + } + } + //涓�閿壂鐮佹ā寮忥紝鏍规嵁鏉$爜鍓嶇紑璧� 涓嶅悓鏂规硶锛堜粨搴撱�佷粨浣嶃�侀儴闂級锛堟簮鍗曘�佺墿鏂欐潯鐮侊級 + else + { + DataSet Dss; + //鏍规嵁閫掑叆鐨勬潯鐮佸墠涓変綅锛屽垽鏂潯鐮佺被鍨嬶紙浠撳簱銆佷粨浣嶃�侀儴闂ㄣ�佹簮鍗曘�佺墿鏂欐潯鐮侊級 + Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType from Xt_BarCodeType where HSourceNumber= '" + sBarCodePrefix + "'", "Xt_BarCodeType"); + + //鏃犺繑鍥炴暟鎹垯涓虹墿鏂欐潯鐮� + if (Dss == null || Dss.Tables[0].Rows.Count == 0) + { + //鏍规嵁鍗曚釜鏉$爜鑾峰彇瀵瑰簲鏁存墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃 + string sBarCode_New; + DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','" + HScanStyle + "'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); + if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) + { + sErrMsg = "鑾峰彇鏁存墭鏉$爜淇℃伅鍙戠敓閿欒锛�"; + return null; + } + else + { + if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) + { + sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); + return null; + } + else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) + { + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HBillID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); + return oBar; } else { - sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sBarCode_New + sErrMsg; + for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) + { + sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); + if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) + { + oBar.HSourceBillType = sHSourceBillType; + oBar.HSourceBillNo = sHSourceBillNo; + oBar.HSupID = sHSupID; + oBar.HSupName = sHSupName; + oBar.HDeptID = sHDeptID; + oBar.HDeptName = sHDeptName; + SourceFlag = true; + } + else + { + sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sBarCode_New + sErrMsg; + return null; + } + } + } + return oBar; + } + } + else + { + string sBarBillName = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceName"]); + string sBarBillType = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["BarCodeType"]); + + //鍒ゆ柇鏉$爜绫诲瀷涓� 鍩虹璧勬枡鏉$爜 鎴� 婧愬崟鏉$爜 + if (sBarBillType == "鍩虹璧勬枡鏉$爜") + { + //浠撳簱鏉$爜 + if (sBarBillName == "浠撳簱") + { + DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View(); + //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰,TryParse涓嶈兘杞崲鎴愭暣鏁版椂杩斿洖false锛屽苟杩斿洖ID=0 + int ID; + if (int.TryParse(sBarCode.Remove(0, 3), out ID)) + { + if (dal.GetInfoByID(ID, HOWNERID)) + { + oBar.HBarType = "浠撳簱鏉$爜"; + oBar.HWhID = dal.omodel.HItemID; + oBar.HWhNumber = dal.omodel.HNumber; + oBar.HWhName = dal.omodel.HName; + oBar.HSPFlag = dal.omodel.HIsStockMgr; + return oBar; + } + else + { + sErrMsg = "鏃犳晥浠撳簱鏉$爜锛�"; + return null; + } + } + else + { + sErrMsg = "閿欒鐨勪粨搴撴潯鐮侊紒"; + return null; + } + } + //浠撲綅鏉$爜 + else if (sBarBillName == "浠撲綅") + { + DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View(); + //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰 + int sHSPID; + int sHWHID; + string[] sArray = sBarCode.Remove(0, 3).Split(';'); + if (int.TryParse(sArray[1], out sHSPID) && int.TryParse(sArray[0], out sHWHID)) + { + if (dal.GetInfoByID(sHSPID, sHWHID, HOWNERID)) + { + oBar.HBarType = "浠撲綅鏉$爜"; + oBar.HSPID = dal.omodel.HItemID; + oBar.HSPNumber = dal.omodel.HNumber; + oBar.HSPName = dal.omodel.HName; + oBar.HWhID = dal.omodel.HWHID; + oBar.HWhNumber = dal.omodel.HWhNumber; + oBar.HWhName = dal.omodel.HWhName; + return oBar; + } + else + { + sErrMsg = "鏃犳晥浠撲綅鏉$爜锛�"; + return null; + } + } + else + { + sErrMsg = "閿欒鐨勪粨浣嶆潯鐮侊紒"; + return null; + } + } + //閮ㄩ棬鏉$爜 + else if (sBarBillName == "閮ㄩ棬") + { + DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View(); + //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰 + int ID; + if (int.TryParse(sBarCode.Remove(0, 3), out ID)) + { + if (dal.GetInfoByID(ID)) + { + oBar.HBarType = "閮ㄩ棬鏉$爜"; + oBar.HDeptID = dal.omodel.HItemID; + oBar.HDeptNumber = dal.omodel.HNumber; + oBar.HDeptName = dal.omodel.HName; + return oBar; + } + else + { + sErrMsg = "鏃犳晥閮ㄩ棬鏉$爜锛�"; + return null; + } + } + else + { + sErrMsg = "閿欒鐨勯儴闂ㄦ潯鐮侊紒"; + return null; + } + } + else + { + sErrMsg = "鏃犳晥鍩虹璧勬枡鏉$爜锛�"; return null; } } + //婧愬崟鏉$爜 + else if (sBarBillType == "婧愬崟鏉$爜") + { + if (sBarBillName == "鍙戣揣閫氱煡鍗�") + { + oBar = get_SourceBarCode_SellOut(HBillID, HBillNo, HBillType, sBarCode, "1402", HMaker, 0, HOWNERID, ref sErrMsg); + if (oBar == null) + { + return null; + } + return oBar; + } + else + { + sErrMsg = "婧愬崟绫诲瀷鍚嶇О璁剧疆涓嶆纭紒"; + return null; + } + } + else + { + sErrMsg = "鏃犳晥鏉$爜绫诲瀷锛�"; + return null; + } } - return oBar; } } //鐢熶骇鍏ュ簱 澶氭簮鍗曟ā寮� -- Gitblit v1.9.1