From 989c2a4d2777f74ade9e3597a4a8c98f957cbee8 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期三, 26 一月 2022 00:09:56 +0800
Subject: [PATCH] 加日志文件
---
CLOUDWEB/CLOUDWEB.csproj | 1
CLOUDWEB/WebService1.asmx.cs | 1083 +++++++++++++++++++++++++++--------------------------
CLOUDWEB/Log.cs | 91 ++++
3 files changed, 643 insertions(+), 532 deletions(-)
diff --git a/CLOUDWEB/CLOUDWEB.csproj b/CLOUDWEB/CLOUDWEB.csproj
index 5a64f38..d3b714e 100644
--- a/CLOUDWEB/CLOUDWEB.csproj
+++ b/CLOUDWEB/CLOUDWEB.csproj
@@ -317,6 +317,7 @@
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
+ <Compile Include="Log.cs" />
<Compile Include="LogService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Site.Master.cs">
diff --git a/CLOUDWEB/Log.cs b/CLOUDWEB/Log.cs
new file mode 100644
index 0000000..782fb7a
--- /dev/null
+++ b/CLOUDWEB/Log.cs
@@ -0,0 +1,91 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Web;
+
+namespace CLOUDWEB
+{
+ public class Log
+ {
+ public static void WriteListToTextFile(List<string> list)
+ {
+ string uploadPath = System.Web.HttpContext.Current.Server.MapPath("./") + "Log\\";
+ if (!Directory.Exists(uploadPath))
+ {
+ Directory.CreateDirectory(uploadPath);
+ }
+ string fileName = DateTime.Now.ToString("yyyy-MM-dd") + "_sql.log";
+ string txtFile = uploadPath + fileName;
+ //鍒涘缓涓�涓枃浠舵祦锛岀敤浠ュ啓鍏ユ垨鑰呭垱寤轰竴涓猄treamWriter
+ FileStream fs = new FileStream(txtFile, FileMode.OpenOrCreate, FileAccess.Write);
+ StreamWriter sw = new StreamWriter(fs);
+ sw.Flush();
+ // 浣跨敤StreamWriter鏉ュ線鏂囦欢涓啓鍏ュ唴瀹�
+ sw.BaseStream.Seek(0, SeekOrigin.Begin);
+ for (int i = 0; i < list.Count; i++) sw.WriteLine(list[i]);
+ //鍏抽棴姝ゆ枃浠秚
+ sw.Flush();
+ sw.Close();
+ fs.Close();
+ }
+ public static void LogInfo(string msg)
+ {
+ string uploadPath = System.Web.HttpContext.Current.Server.MapPath("./") + "Log\\";
+
+ if (!Directory.Exists(uploadPath))
+ {
+ Directory.CreateDirectory(uploadPath);
+ }
+ string fileName = DateTime.Now.Ticks.ToString() + ".log";
+
+ FileStream fs;
+ StreamWriter sw;
+ string sFileName = uploadPath + fileName;
+ if (File.Exists(sFileName))
+ //楠岃瘉鏂囦欢鏄惁瀛樺湪锛屾湁鍒欒拷鍔狅紝鏃犲垯鍒涘缓
+ {
+ fs = new FileStream(sFileName, FileMode.Append, FileAccess.Write);
+ }
+ else
+ {
+ fs = new FileStream(sFileName, FileMode.Create, FileAccess.Write);
+ }
+ sw = new StreamWriter(fs);
+ msg = String.Format("------------------------{0}------------------------------\r\n", DateTime.Now) + msg;
+ msg += "\r\n";
+ sw.WriteLine(msg);
+ sw.Close();
+ fs.Close();
+ }
+ public static void LogSaveInfo(string msg)
+ {
+ string uploadPath = System.Web.HttpContext.Current.Server.MapPath("./") + "Log\\";
+
+ if (!Directory.Exists(uploadPath))
+ {
+ Directory.CreateDirectory(uploadPath);
+ }
+ string fileName = DateTime.Now.ToString("yyyy-MM-dd") + ".log";
+
+ FileStream fs;
+ StreamWriter sw;
+ string sFileName = uploadPath + fileName;
+ if (File.Exists(sFileName))
+ //楠岃瘉鏂囦欢鏄惁瀛樺湪锛屾湁鍒欒拷鍔狅紝鏃犲垯鍒涘缓
+ {
+ fs = new FileStream(sFileName, FileMode.Append, FileAccess.Write);
+ }
+ else
+ {
+ fs = new FileStream(sFileName, FileMode.Create, FileAccess.Write);
+ }
+ sw = new StreamWriter(fs);
+ msg = String.Format("------------------------{0}------------------------------\r\n", DateTime.Now) + msg;
+ msg += "\r\n";
+ sw.WriteLine(msg);
+ sw.Close();
+ fs.Close();
+ }
+ }
+}
\ No newline at end of file
diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs
index a12b9be..727a5cf 100644
--- a/CLOUDWEB/WebService1.asmx.cs
+++ b/CLOUDWEB/WebService1.asmx.cs
@@ -5469,6 +5469,7 @@
[WebMethod]
public bool set_SaveICMOProductReportBill_LayuiYqn(Model.ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType,string HProcID, ref string sErrMsg)
{
+ Log.LogInfo(workcode.ToString()); //璁板綍鎻愪氦鏁版嵁
//鑾峰彇绯荤粺鍙傛暟
Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
if (oSystemParameter.ShowBill(ref sErrMsg) == false)
@@ -5580,9 +5581,10 @@
//鏍规嵁鐢熶骇璁㈠崟鍙锋煡璇㈢敓浜ц鍗曡〃锛屾嬁鍒扮粍缁囥�佽溅闂�
DataSet ds0 = oCn.RunProcReturn("select HPRDORGID,HDeptID from Sc_ICMOBillMain with(nolock) where HBillNo='" + workcode + "'", "Sc_ICMOBillMain");
-
//鏌ヨ浜ч噺姹囨姤涓存椂琛�
DataSet ds = oCn.RunProcReturn("select top 1 * from Sc_ICMOBillWorkQtyStatus_Tmp with(nolock) where HICMOReportInterID='" + oMain.HInterID + "' and HICMOReportBillNo='" + oMain.HBillNo + "' and HProcID='" + HProcID + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
+
+
if (ds.Tables[0].Rows.Count <= 0)
{
sErrMsg = "褰撳墠鍗曟嵁鏃犱骇閲忔眹鎶ヨ褰曪紒";
@@ -5594,32 +5596,36 @@
oMain.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]);
//鎻掑叆瀛愯〃
oCn.RunProc("exec h_p_Sc_ICMOReportBillSub_Insert_WorkQtyYqn " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + sHSourceType + "'");
+ //Log.LogInfo("鎵ц閫氳繃2");
//鎻掑叆涓昏〃
- oCn.RunProc("Insert Into Sc_ICMOReportBillMain " +
- "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
- ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
- ",HEmpID,HGroupID,HDeptID,HPRDORGID" +
- ") " +
- " values('3711','3711'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "',convert(varchar(10),getdate(),120)" +
- ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)" +
- ", " + oMain.HEmpID.ToString() + "," + oMain.HGroupID.ToString() + "," + oMain.HDeptID.ToString() + "," + oMain.HPRDORGID.ToString() +
- ") ");
-
+ oCn.RunProc("Insert Into Sc_ProcessReportMain" +
+ "(HYear,HPeriod,HBillType,HBillSubType,HInterID" +
+ ",HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID" +
+ ",HICMOInterID,HICMOBillNo ,HDeptID ,HDeptNumber,HGroupID" +
+ ",HGroupNumber,HMaterID,HMaterNumber,HUnitID,HUnitNumber" +
+ ",HPlanQty,HInStockQty,HSumTimes,HExplanation,HRemark" +
+ ",HInnerBillNo,HMaker,HMakeDate,HSupID,HMarker" +
+ ") " +
+ " values('" + oMain.HYear.ToString() + "','"+ oMain.HPeriod.ToString() + "','3714','3714','"+ oMain.HInterID.ToString() + "'" +
+ ", convert(varchar(10),getdate(),120),'"+oMain.HBillNo+"','2','0','0'" +
+ ", '"+oMain.HMainSourceInterID+"','','" + oMain.HDeptID.ToString() + "','','"+ ds.Tables[0].Rows[0]["HGroupID"].ToString() +"'" +
+ ", '','" + ds.Tables[0].Rows[0]["HMaterID"].ToString() + "','','0',''" +
+ ", '" + ds.Tables[0].Rows[0]["HPlanQty"].ToString() + "','0','0','鍚屾erp鐢熶骇姹囨姤鍗�','鎶ュ伐鍙板悓姝ュ伐搴忔眹鎶ュ崟'" +
+ ",'','" +oMain.HMaker+ "','" + oMain.HDate + "','0',''" +
+ ") ");
+
//鏇存柊鐢熶骇鐘舵�佷复鏃惰〃(褰撴棩瀹屽伐鏁伴噺)HDateFinishQty h_p_JIT_Sc_ICMOBillStatus_Tmp_Qty
- oCn.RunProc("exec h_p_JIT_Sc_ICMOBillStatus_Tmp_QtyYqn '" + workcode + "','" + HSourceID + "','"+HProcID+"','" + oMain.HMainSourceInterID + "','" + oMain.HMainSourceEntryID + "'");
- //string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set
- // HICMOReportInterID ='" + oMain.HInterID + "', HICMOReportBillNo='" + oMain.HBillNo + "' from Sc_ICMOBillWorkQtyStatus_Tmp a where a.HICMOBillNo='" + workcode + "' and a.HSourceID='" + HSourceID + "' and HICMOInterID='" + oMain.HMainSourceInterID + "' and a.HICMOEntryID='" + oMain.HMainSourceEntryID + "' and a.HMaker='" + oMain.HMaker + "' and HRelationInterID='0'");
- //oCn.RunProc(sql1);
- //string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp ");
+ //oCn.RunProc("exec h_p_JIT_Sc_ICMOBillStatus_Tmp_QtyYqn '" + workcode + "','" + HSourceID + "','"+HProcID+"','" + oMain.HMainSourceInterID + "','" + oMain.HMainSourceEntryID + "'");
+
//鏇存柊鍏宠仈鏁伴噺
- oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToICMOReport_Add " + oMain.HInterID.ToString());
+ oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToICMOReport_AddYqn " + oMain.HInterID.ToString());
if (oSystemParameterMain.Sc_ICMOReportBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
{
//瀹℃牳鍗曟嵁
- oCn.RunProc("Update Sc_ICMOReportBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString());
+ oCn.RunProc("Update Sc_ProcessReportMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString());
}
//鏍规嵁TMP琛� 杩斿洖 瀛愯〃淇℃伅
@@ -5632,6 +5638,7 @@
}
else
{
+ Log.LogInfo("鎵ц閫氳繃s");
string sJson_ZYMESFLAG = ""; //鐢熶骇姹囨姤鍗曞悓姝ES鏍囪
sJson_ZYMESFLAG = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FHZYMESFLAG"]);
@@ -5691,6 +5698,7 @@
" \"FREPORTTYPE\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREPORTTYPE"]) + "\"}," +
" \"FUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUNITID"]) + "\"}," +
" \"FWORKSHIPID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FWORKSHOPID"]) + "\"}," +
+ " \"FShiftGroupId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HGROUPID"]) + "\"}," +
//\"FShiftGroupId\":{\"FNumber\":\"\"},
sJson_BatchNo +
//\"FDeptId\":{\"FNumber\":\"\"},
@@ -5729,6 +5737,8 @@
" \"FSTOCKID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKID"]) + "\"}," +
" \"FCOSTRATE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTRATE"]) + "," +
" \"FSNUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUNITID"]) + "\"}," +
+ " \"F_zzzz_procedure\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HSOURCENAME"]) + "\"," +
+ " \"F_zzzz_equipment\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HPROCNAME"]) + "\"," +
//\"FSNQty\":\"0\",
//\"FProduceDate\":\"1900-01-01\",
//\"FExpiryDate\":\"1900-01-01\",
@@ -5852,7 +5862,7 @@
}
catch (Exception e)
{
- sErrMsg = "鐢熸垚鐢熶骇姹囨姤鍗曞け璐ワ紒" + e.Message;
+ sErrMsg = "鐢熸垚鐢熶骇姹囨姤鍗曞け璐rro锛�" + e.Message+e.StackTrace;
oCn.RollBack();
return false;
}
@@ -32661,199 +32671,67 @@
[WebMethod]
public Model.ClsKf_ICStockBill_WMS get_CheckTypeByBarCode_All(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, string HExpressNumber, ref string sErrMsg)
{
- SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
- Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
- DAL.ClsKF_PonderationBillMain_Temp_Ctl tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
- Model.ClsKF_PonderationBillMain_Temp model = new Model.ClsKF_PonderationBillMain_Temp();
- string sHSourceBillType = "";
- string sHSourceBillNo = "";
- Int64 sHSupID = 0;
- string sHSupName = "";
- Int64 sHDeptID = 0;
- string sHDeptName = "";
- string sHBarType = "";
- sBarCode = sBarCode.Trim();
- string sBarCodePrefix = sBarCode.Substring(0, Math.Min(3, sBarCode.Length));//鎴彇鏉$爜鍓嶄笁浣嶅瓧绗︿覆
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
+ DAL.ClsKF_PonderationBillMain_Temp_Ctl tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
+ Model.ClsKF_PonderationBillMain_Temp model = new Model.ClsKF_PonderationBillMain_Temp();
+ string sHSourceBillType = "";
+ string sHSourceBillNo = "";
+ Int64 sHSupID = 0;
+ string sHSupName = "";
+ Int64 sHDeptID = 0;
+ string sHDeptName = "";
+ string sHBarType = "";
+ sBarCode = sBarCode.Trim();
+ string sBarCodePrefix = sBarCode.Substring(0, Math.Min(3, sBarCode.Length));//鎴彇鏉$爜鍓嶄笁浣嶅瓧绗︿覆
- //鑾峰彇绯荤粺鍙傛暟
- Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
- if (oSystemParameter.ShowBill(ref sErrMsg) == false)
- {
- sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
- return null;
- }
- //閿�鍞嚭搴撱�侀攢鍞��搴撴ā鍧楁壂鐮佹祦绋� 椋為緳涓撶敤
- if ((HBillType == "1205" || HBillType == "1247") && oSystemParameter.omodel.WMS_CampanyName == "椋為緳") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
- {
- //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
- if (set_SavePonderationBillMain_Temp_FeiLong(sBarCode, 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 sHBarType, ref sErrMsg))
+ //鑾峰彇绯荤粺鍙傛暟
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+ if (oSystemParameter.ShowBill(ref sErrMsg) == false)
{
- oBar.HBarType = sHBarType;
- oBar.HSourceBillType = sHSourceBillType;
- oBar.HSourceBillNo = sHSourceBillNo;
- oBar.HSupID = sHSupID;
- oBar.HSupName = sHSupName;
- oBar.HDeptID = sHDeptID;
- oBar.HDeptName = sHDeptName;
- }
- else
- {
- sErrMsg = "锛�" + sErrMsg;
+ sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
return null;
}
- return oBar;
- }
- //鐢熶骇鍏ュ簱 澶氭簮鍗曟ā寮�
- else if (HBillType == "1202" && oSystemParameter.omodel.Kf_ProductInBill_MulSourceBill == "Y")
- {
- oBar = get_CheckTypeByBarCode_MulSourceBill(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameter.omodel, ref sErrMsg);
- if (oBar == null)
+ //閿�鍞嚭搴撱�侀攢鍞��搴撴ā鍧楁壂鐮佹祦绋� 椋為緳涓撶敤
+ if ((HBillType == "1205" || HBillType == "1247") && oSystemParameter.omodel.WMS_CampanyName == "椋為緳") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
{
- return null;
- }
- else
- {
+ //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+ if (set_SavePonderationBillMain_Temp_FeiLong(sBarCode, 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 sHBarType, ref sErrMsg))
+ {
+ oBar.HBarType = sHBarType;
+ oBar.HSourceBillType = sHSourceBillType;
+ oBar.HSourceBillNo = sHSourceBillNo;
+ oBar.HSupID = sHSupID;
+ oBar.HSupName = sHSupName;
+ oBar.HDeptID = sHDeptID;
+ oBar.HDeptName = sHDeptName;
+ }
+ else
+ {
+ sErrMsg = "锛�" + sErrMsg;
+ return null;
+ }
return oBar;
}
- }
- else
- {
- //鍒ゆ柇鏄惁鍚敤涓�閿壂鐮佹ā寮忥紝Y涓哄惎鐢紝鏈惎鐢ㄦ椂鍙壂鎻忕墿鏂欐潯鐮�
- if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N")
+ //鐢熶骇鍏ュ簱 澶氭簮鍗曟ā寮�
+ else if (HBillType == "1202" && oSystemParameter.omodel.Kf_ProductInBill_MulSourceBill == "Y")
{
- if (oSystemParameter.omodel.WMS_CampanyName == "鍗氭棩绉戞妧" || oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏅鸿" || oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�" || oSystemParameter.omodel.WMS_CampanyName == "濂ラ偊") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ oBar = get_CheckTypeByBarCode_MulSourceBill(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameter.omodel, ref sErrMsg);
+ if (oBar == null)
{
- DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
- if (dal.GetInfoByNumber_View(sBarCode))
- {
- //濡傛灉鏄墭鐩樻潯鐮佸垎瑙e苟妯℃嫙鎵爜
- if (dal.omodel_View.HBarCodeType == "鎵樼洏鏉$爜")
- {
- //鍒嗚В鎵樻潯鐮佸緱鍒版槑缁嗘潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
- DataSet dsTBarCode;
- string sBarCode_MX;
- dsTBarCode = oCn.RunProcReturn("select HBarCode HBarCodeMX from Sc_PackUnionBillSub_Sum " +
- " Where HBarCode_Pack = '" + sBarCode + "'", "Sc_PackUnionBillSub_Sum");
- if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
- {
- sErrMsg = "娌℃湁鎵惧埌鎵樼洏鏉$爜瀵瑰簲瀛愭潯鐮佽褰曪紒";
- return null;
- }
- else
- {
- for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
- {
- sBarCode_MX = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeMX"]);
- if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_MX, 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_MX + sErrMsg;
- //sErrMsg = "鎵弿澶辫触锛�" + sErrMsg;
- return null;
- }
- }
- return oBar;
- }
- }
- else
- {
- //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
- if (set_SavePonderationBillMain_Temp_BarCode(sBarCode, 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 + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
- return null;
- }
- return oBar;
- }
- }
- else
- {
- sErrMsg = "娌℃湁鎵惧埌璇ユ潯鐮侊紒";
- return null;
- }
+ return null;
}
else
{
- if (sBarCodePrefix == "PAK")
- {
- //灏嗘ā娌诲叿淇℃伅鍐欏叆妯℃不鍏峰嚭鍏ュ簱涓存椂琛�
- DataSet Mould = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HRedBlueFlag + "','" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddMouldBarCode");
- if (Mould == null || Mould.Tables[0].Rows.Count == 0)
- {
- sErrMsg = "灏嗘ā娌诲叿淇℃伅鍐欏叆妯℃不鍏峰嚭鍏ュ簱涓存椂琛ㄥけ璐ワ紒";
- return null;
- }
- else
- {
- if (DBUtility.ClsPub.isLong(Mould.Tables[0].Rows[0][0]) == 0)
- {
- oBar.HBarType = "妯℃不鍏锋潯鐮�";
- return oBar;
- }
- else
- {
- sErrMsg = DBUtility.ClsPub.isStrNull(Mould.Tables[0].Rows[0]["HRemark"]);
- return null;
- }
- }
- }
- else
- {
- //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
- if (set_SavePonderationBillMain_Temp_BarCode(sBarCode, 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 + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
- return null;
- }
- return oBar;
- }
+ 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");
-
- //鏃犺繑鍥炴暟鎹垯涓虹墿鏂欐潯鐮�
- if (Dss == null || Dss.Tables[0].Rows.Count == 0)
+ //鍒ゆ柇鏄惁鍚敤涓�閿壂鐮佹ā寮忥紝Y涓哄惎鐢紝鏈惎鐢ㄦ椂鍙壂鎻忕墿鏂欐潯鐮�
+ if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N")
{
if (oSystemParameter.omodel.WMS_CampanyName == "鍗氭棩绉戞妧" || oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏅鸿" || oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�" || oSystemParameter.omodel.WMS_CampanyName == "濂ラ偊") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
{
@@ -32970,373 +32848,514 @@
}
}
}
+ //涓�閿壂鐮佹ā寮忥紝鏍规嵁鏉$爜鍓嶇紑璧� 涓嶅悓鏂规硶锛堜粨搴撱�佷粨浣嶃�侀儴闂級锛堟簮鍗曘�佺墿鏂欐潯鐮侊級
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 == "鍩虹璧勬枡鏉$爜")
+ string sRedBlue = "钃濆瓧";
+ if (HRedBlueFlag)
{
- //浠撳簱鏉$爜
- 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;
- }
+ sRedBlue = "绾㈠瓧";
}
- //婧愬崟鏉$爜
- else if (sBarBillType == "婧愬崟鏉$爜")
+ else
{
- //褰撹鍗曟嵁绫诲瀷鐨勭郴缁熷弬鏁帮細澶氭簮鍗曟ā寮� 鏃讹紝涓嶅厑璁告壂鎻忓師鍗�
+ sRedBlue = "钃濆瓧";
+ }
+ DataSet Dss;
+ //鏍规嵁閫掑叆鐨勬潯鐮佸墠涓変綅锛屽垽鏂潯鐮佺被鍨嬶紙浠撳簱銆佷粨浣嶃�侀儴闂ㄣ�佹簮鍗曘�佺墿鏂欐潯鐮侊級
+ Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType from Xt_BarCodeType where HSourceNumber= '" + sBarCodePrefix + "'", "Xt_BarCodeType");
-
- //=======================
- 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)
+ //鏃犺繑鍥炴暟鎹垯涓虹墿鏂欐潯鐮�
+ if (Dss == null || Dss.Tables[0].Rows.Count == 0)
+ {
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍗氭棩绉戞妧" || oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏅鸿" || oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�" || oSystemParameter.omodel.WMS_CampanyName == "濂ラ偊") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
{
- sErrMsg = "鎵�鎵簮鍗曟潯鐮佷笉灞炰簬姝ゆā鍧楁簮鍗曡寖鍥达紒";
- return null;
- }
- else
- {
- sBarBillName = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceName"]);
- //鎵弿婧愬崟鏉$爜鏃跺垽鏂槸鍚﹀凡缁忔壂鎻忚繃婧愬崟淇℃伅
- if (SourceFlag)
+ DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
+ if (dal.GetInfoByNumber_View(sBarCode))
{
- sErrMsg = "鏄庣粏淇℃伅鍒楄〃宸叉湁鎵爜璁板綍锛屼笉鍏佽澶氭鎵弿婧愬崟鏉$爜锛�";
- return null;
+ //濡傛灉鏄墭鐩樻潯鐮佸垎瑙e苟妯℃嫙鎵爜
+ if (dal.omodel_View.HBarCodeType == "鎵樼洏鏉$爜")
+ {
+ //鍒嗚В鎵樻潯鐮佸緱鍒版槑缁嗘潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+ DataSet dsTBarCode;
+ string sBarCode_MX;
+ dsTBarCode = oCn.RunProcReturn("select HBarCode HBarCodeMX from Sc_PackUnionBillSub_Sum " +
+ " Where HBarCode_Pack = '" + sBarCode + "'", "Sc_PackUnionBillSub_Sum");
+ if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
+ {
+ sErrMsg = "娌℃湁鎵惧埌鎵樼洏鏉$爜瀵瑰簲瀛愭潯鐮佽褰曪紒";
+ return null;
+ }
+ else
+ {
+ for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+ {
+ sBarCode_MX = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeMX"]);
+ if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_MX, 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_MX + sErrMsg;
+ //sErrMsg = "鎵弿澶辫触锛�" + sErrMsg;
+ return null;
+ }
+ }
+ return oBar;
+ }
+ }
+ else
+ {
+ //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+ if (set_SavePonderationBillMain_Temp_BarCode(sBarCode, 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 + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
+ return null;
+ }
+ return oBar;
+ }
}
else
{
- //浜у搧鍏ュ簱鍗� 婧愬崟锛氱敓浜т换鍔″崟
- if (sBarBillName == "鐢熶骇浠诲姟鍗�" && HBillType == "1202")
+ sErrMsg = "娌℃湁鎵惧埌璇ユ潯鐮侊紒";
+ return null;
+ }
+ }
+ else
+ {
+ if (sBarCodePrefix == "PAK")
+ {
+ //灏嗘ā娌诲叿淇℃伅鍐欏叆妯℃不鍏峰嚭鍏ュ簱涓存椂琛�
+ DataSet Mould = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HRedBlueFlag + "','" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddMouldBarCode");
+ if (Mould == null || Mould.Tables[0].Rows.Count == 0)
{
- DAL.Cls_S_IF_ICMOBill_Lite dal = new DAL.Cls_S_IF_ICMOBill_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"]);
- }
- //浜у搧鍏ュ簱鍗� 婧愬崟锛氱敓浜ф眹鎶ュ崟
- else if (sBarBillName == "鐢熶骇姹囨姤鍗�" && HBillType == "1202")
- {
- DAL.Cls_S_IF_ICMOReportBill_Lite dal = new DAL.Cls_S_IF_ICMOReportBill_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"]);
- }
- //澶栬喘鍏ュ簱鍗� 婧愬崟锛氶噰璐鍗�
- else if (sBarBillName == "閲囪喘璁㈠崟" && HBillType == "1201")
- {
- DAL.Cls_S_IF_POOrderBill_Lite dal = new DAL.Cls_S_IF_POOrderBill_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"]);
- }
- //澶栬喘鍏ュ簱鍗� 婧愬崟锛氭敹鏂欓�氱煡鍗�
- else if (sBarBillName == "鏀舵枡閫氱煡鍗�" && HBillType == "1201")
- {
- DAL.Cls_S_IF_POInStockBill_Lite dal = new DAL.Cls_S_IF_POInStockBill_Lite();
- DataSet DS;
- //鏍规嵁鍗曟嵁鍙疯幏鍙栬繃婊ゆ潯浠�
- string sWhere = " Where 鍗曟嵁鍙� like '" + sBarCode + "' and isnull(HBillSubType,0)=12510 ";
- 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"]);
- }
- //濮斿鍏ュ簱鍗� 婧愬崟锛氬澶栬鍗�
- else if (sBarBillName == "濮斿璁㈠崟" && HBillType == "1210")
- {
- DAL.Cls_S_IF_WWOrderBill_Lite dal = new DAL.Cls_S_IF_WWOrderBill_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"]);
- }
- //濮斿鍏ュ簱鍗� 婧愬崟锛氭敹鏂欓�氱煡鍗�-濮斿
- else if (sBarBillName == "鏀舵枡閫氱煡鍗�-濮斿" && HBillType == "1210")
- {
- DAL.Cls_S_IF_POStockInBill_Lite dal = new DAL.Cls_S_IF_POStockInBill_Lite();
- DataSet DS;
- //鏍规嵁鍗曟嵁鍙疯幏鍙栬繃婊ゆ潯浠�
- string sWhere = " Where 鍗曟嵁鍙� like '" + sBarCode + "' and isnull(HBillSubType,0)=12511 ";
- 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"]);
- }
- //棰嗘枡鍑哄簱 婧愬崟锛氱敓浜т换鍔″崟-鎶曟枡
- else if (sBarBillName == "鐢熶骇浠诲姟鍗�-鎶曟枡" && HBillType == "1204")
- {
- DAL.Cls_S_IF_PPBomBillList_Lite dal = new DAL.Cls_S_IF_PPBomBillList_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"]);
- }
- //閿�鍞嚭搴� 婧愬崟锛氶攢鍞鍗�
- else if (sBarBillName == "閿�鍞鍗�" && HBillType == "1205")
- {
- DAL.Cls_S_IF_SEOrderBill_Lite dal = new DAL.Cls_S_IF_SEOrderBill_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 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 if (sBarBillName == "濮斿璁㈠崟-鎶曟枡" && HBillType == "1211")
- {
- DAL.Cls_S_IF_WWPPBomBill_Lite dal = new DAL.Cls_S_IF_WWPPBomBill_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"]);
+ sErrMsg = "灏嗘ā娌诲叿淇℃伅鍐欏叆妯℃不鍏峰嚭鍏ュ簱涓存椂琛ㄥけ璐ワ紒";
+ return null;
}
else
{
- sErrMsg = "婧愬崟绫诲瀷鍚嶇О璁剧疆涓嶆纭紒";
- return null;
+ if (DBUtility.ClsPub.isLong(Mould.Tables[0].Rows[0][0]) == 0)
+ {
+ oBar.HBarType = "妯℃不鍏锋潯鐮�";
+ return oBar;
+ }
+ else
+ {
+ sErrMsg = DBUtility.ClsPub.isStrNull(Mould.Tables[0].Rows[0]["HRemark"]);
+ return null;
+ }
}
- // 灏嗘簮鍗曚俊鎭啓鍏� 涓存椂缂撳瓨琛�
- if (tem.AddNew_Source(HBillID, HBillNo, HBillType, oBar.HSourceBillNo, oBar.HSourceBillType, sRedBlue, ref sErrMsg))
+ }
+ else
+ {
+ //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+ if (set_SavePonderationBillMain_Temp_BarCode(sBarCode, 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))
{
- return oBar;
+ oBar.HSourceBillType = sHSourceBillType;
+ oBar.HSourceBillNo = sHSourceBillNo;
+ oBar.HSupID = sHSupID;
+ oBar.HSupName = sHSupName;
+ oBar.HDeptID = sHDeptID;
+ oBar.HDeptName = sHDeptName;
}
else
{
- sErrMsg = "淇濆瓨婧愬崟淇℃伅澶辫触锛�" + sErrMsg;
+ sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
return null;
}
+ return oBar;
}
}
}
else
{
- sErrMsg = "鏃犳晥鏉$爜绫诲瀷锛�";
- return null;
+ 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 == "1202")
+ {
+ DAL.Cls_S_IF_ICMOBill_Lite dal = new DAL.Cls_S_IF_ICMOBill_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"]);
+ }
+ //浜у搧鍏ュ簱鍗� 婧愬崟锛氱敓浜ф眹鎶ュ崟
+ else if (sBarBillName == "鐢熶骇姹囨姤鍗�" && HBillType == "1202")
+ {
+ DAL.Cls_S_IF_ICMOReportBill_Lite dal = new DAL.Cls_S_IF_ICMOReportBill_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"]);
+ }
+ //澶栬喘鍏ュ簱鍗� 婧愬崟锛氶噰璐鍗�
+ else if (sBarBillName == "閲囪喘璁㈠崟" && HBillType == "1201")
+ {
+ DAL.Cls_S_IF_POOrderBill_Lite dal = new DAL.Cls_S_IF_POOrderBill_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"]);
+ }
+ //澶栬喘鍏ュ簱鍗� 婧愬崟锛氭敹鏂欓�氱煡鍗�
+ else if (sBarBillName == "鏀舵枡閫氱煡鍗�" && HBillType == "1201")
+ {
+ DAL.Cls_S_IF_POInStockBill_Lite dal = new DAL.Cls_S_IF_POInStockBill_Lite();
+ DataSet DS;
+ //鏍规嵁鍗曟嵁鍙疯幏鍙栬繃婊ゆ潯浠�
+ string sWhere = " Where 鍗曟嵁鍙� like '" + sBarCode + "' and isnull(HBillSubType,0)=12510 ";
+ 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"]);
+ }
+ //濮斿鍏ュ簱鍗� 婧愬崟锛氬澶栬鍗�
+ else if (sBarBillName == "濮斿璁㈠崟" && HBillType == "1210")
+ {
+ DAL.Cls_S_IF_WWOrderBill_Lite dal = new DAL.Cls_S_IF_WWOrderBill_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"]);
+ }
+ //濮斿鍏ュ簱鍗� 婧愬崟锛氭敹鏂欓�氱煡鍗�-濮斿
+ else if (sBarBillName == "鏀舵枡閫氱煡鍗�-濮斿" && HBillType == "1210")
+ {
+ DAL.Cls_S_IF_POStockInBill_Lite dal = new DAL.Cls_S_IF_POStockInBill_Lite();
+ DataSet DS;
+ //鏍规嵁鍗曟嵁鍙疯幏鍙栬繃婊ゆ潯浠�
+ string sWhere = " Where 鍗曟嵁鍙� like '" + sBarCode + "' and isnull(HBillSubType,0)=12511 ";
+ 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"]);
+ }
+ //棰嗘枡鍑哄簱 婧愬崟锛氱敓浜т换鍔″崟-鎶曟枡
+ else if (sBarBillName == "鐢熶骇浠诲姟鍗�-鎶曟枡" && HBillType == "1204")
+ {
+ DAL.Cls_S_IF_PPBomBillList_Lite dal = new DAL.Cls_S_IF_PPBomBillList_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"]);
+ }
+ //閿�鍞嚭搴� 婧愬崟锛氶攢鍞鍗�
+ else if (sBarBillName == "閿�鍞鍗�" && HBillType == "1205")
+ {
+ DAL.Cls_S_IF_SEOrderBill_Lite dal = new DAL.Cls_S_IF_SEOrderBill_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 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 if (sBarBillName == "濮斿璁㈠崟-鎶曟枡" && HBillType == "1211")
+ {
+ DAL.Cls_S_IF_WWPPBomBill_Lite dal = new DAL.Cls_S_IF_WWPPBomBill_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"]);
+ }
+ 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;
+ }
}
}
}
}
+ catch (Exception e)
+ {
+ sErrMsg = e.Message+";"+e.StackTrace;
+ return null;
+ }
+
}
#endregion
--
Gitblit v1.9.1