From 0ef91919ec95cd933e91224afd77ae24fa5ec12b Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期六, 06 五月 2023 15:06:32 +0800
Subject: [PATCH] 扫描物料条码调用方法修改,托条码处理调用方法修改

---
 CLOUDWEB/WebService1.asmx.cs |  380 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 241 insertions(+), 139 deletions(-)

diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs
index 4d56df0..a4a6855 100644
--- a/CLOUDWEB/WebService1.asmx.cs
+++ b/CLOUDWEB/WebService1.asmx.cs
@@ -47018,46 +47018,63 @@
                                 //鍒ゆ柇鏉$爜绫诲瀷鏄惁涓烘墭鐩樻潯鐮侊紝濡傛灉鏄墭鐩樻潯鐮佸垯鍒嗚В骞舵ā鎷熸壂鐮�
                                 if (dal.omodel_View.HBarCodeType == "鎵樼洏鏉$爜")
                                 {
-                                    //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
-                                    DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
-                                    if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
+                                    if(oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
                                     {
-                                        sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
-                                        return null;
-                                    }
-                                    else
-                                    {
-                                        if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
+                                        //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                        DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
+                                        if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                                         {
-                                            sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                            sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
                                             return null;
                                         }
                                         else
                                         {
-                                            for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+                                            if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
                                             {
-                                                dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
-                                                dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
-                                                dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
-                                                dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
-                                                dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
-                                                dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
-                                                dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
-                                                dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
-                                                dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
-                                                dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
-
-                                                //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
-                                                oBar = get_SavePonderationBillMain_Temp_BarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, SourceFlag, HSourceBillType, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
-                                                if (oBar == null)
-                                                {
-                                                    sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忓け璐ワ紒" + dal.omodel_View.HBarCode + sErrMsg;
-                                                    return null;
-                                                }
-                                                SourceFlag = true;
+                                                sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                return null;
                                             }
+                                            else
+                                            {
+                                                for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+                                                {
+                                                    dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
+                                                    dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
+                                                    dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
+                                                    dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
+                                                    dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
+                                                    dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
+                                                    dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
+                                                    dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
+                                                    dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
+                                                    dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
+
+                                                    //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                                                    oBar = get_SavePonderationBillMain_Temp_BarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, SourceFlag, HSourceBillType, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
+                                                    if (oBar == null)
+                                                    {
+                                                        sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忓け璐ワ紒" + dal.omodel_View.HBarCode + sErrMsg;
+                                                        return null;
+                                                    }
+                                                    SourceFlag = true;
+                                                }
+                                            }
+                                            return oBar;
                                         }
-                                        return oBar;
+                                    }
+                                    else
+                                    {
+                                        //灏嗘墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                        oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, 0, 0, SourceFlag, HSourceBillType, HStockOrgID, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
+                                        if (oBar == null)
+                                        {
+                                            sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
+                                            return null;
+                                        }
+                                        else
+                                        {
+                                            return oBar;
+                                        }
                                     }
                                 }
                                 else
@@ -47133,46 +47150,63 @@
                                     //鍒ゆ柇鏉$爜绫诲瀷鏄惁涓烘墭鐩樻潯鐮侊紝濡傛灉鏄墭鐩樻潯鐮佸垯鍒嗚В骞舵ā鎷熸壂鐮�
                                     if (dal.omodel_View.HBarCodeType == "鎵樼洏鏉$爜")
                                     {
-                                        //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
-                                        DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
-                                        if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
+                                        if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
                                         {
-                                            sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
-                                            return null;
-                                        }
-                                        else
-                                        {
-                                            if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
+                                            //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                            DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
+                                            if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                                             {
-                                                sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
                                                 return null;
                                             }
                                             else
                                             {
-                                                for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+                                                if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
                                                 {
-                                                    dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
-                                                    dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
-                                                    dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
-                                                    dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
-                                                    dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
-                                                    dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
-                                                    dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
-                                                    dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
-                                                    dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
-                                                    dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
-
-                                                    //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
-                                                    oBar = get_SavePonderationBillMain_Temp_BarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, SourceFlag, HSourceBillType, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
-                                                    if (oBar == null)
-                                                    {
-                                                        sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忓け璐ワ紒" + dal.omodel_View.HBarCode + sErrMsg;
-                                                        return null;
-                                                    }
-                                                    SourceFlag = true;
+                                                    sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                    return null;
                                                 }
+                                                else
+                                                {
+                                                    for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+                                                    {
+                                                        dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
+                                                        dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
+                                                        dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
+                                                        dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
+                                                        dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
+                                                        dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
+                                                        dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
+                                                        dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
+                                                        dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
+                                                        dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
+
+                                                        //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                                                        oBar = get_SavePonderationBillMain_Temp_BarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, SourceFlag, HSourceBillType, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
+                                                        if (oBar == null)
+                                                        {
+                                                            sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忓け璐ワ紒" + dal.omodel_View.HBarCode + sErrMsg;
+                                                            return null;
+                                                        }
+                                                        SourceFlag = true;
+                                                    }
+                                                }
+                                                return oBar;
                                             }
-                                            return oBar;
+                                        }
+                                        else
+                                        {
+                                            //灏嗘墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                            oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, 0, 0, SourceFlag, HSourceBillType, HStockOrgID, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
+                                            if (oBar == null)
+                                            {
+                                                sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
+                                                return null;
+                                            }
+                                            else
+                                            {
+                                                return oBar;
+                                            }
                                         }
                                     }
                                     else
@@ -47810,16 +47844,48 @@
                 if (HSourceBillType != "-1" && (SourceFlag == false || sMulSourceCtl == "Y")
                 && (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1210" || HBillType == "3711"))
                 {
-                    Int64 HAccessFlag = 1;   //鏄惁鐗╂枡鏉$爜甯﹀嚭婧愬崟淇℃伅鏍囧織锛�0涓虹洿鎺ユ壂婧愬崟鏉$爜锛�1涓虹墿鏂欐潯鐮佸甫鍑烘簮鍗曚俊鎭級
-                    oBar = get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, omodel_View.HSourceBillNo, omodel_View.HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg);
-                    if (oBar == null)
+                    //鍒ゆ柇鎵樻潯鐮佸搴旀簮鍗曟槸鍚﹀敮涓�
+                    DataSet dsSource = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_Source '" + omodel_View.HBarCode + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "'", "h_p_WMS_AddPackBarCode_Source");
+                    if (dsSource == null || dsSource.Tables[0].Rows.Count == 0)
                     {
+                        sErrMsg = "鍒ゆ柇鎵樻潯鐮佸搴旀簮鍗曟槸鍚﹀敮涓�鍙戠敓閿欒锛�";
                         oCn.RollBack();
                         return null;
                     }
                     else
                     {
-                        SourceFlag = true;
+                        if (DBUtility.ClsPub.isLong(dsSource.Tables[0].Rows[0][0]) == 1)
+                        {
+                            if(SourceFlag == false)
+                            {
+                                sErrMsg = DBUtility.ClsPub.isStrNull(dsSource.Tables[0].Rows[0]["HRemark"]);
+                                oCn.RollBack();
+                                return null;
+                            }
+                        }
+                        else
+                        {
+                            omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsSource.Tables[0].Rows[0]["HSourceBillNo"]);
+                            omodel_View.HSourceBillType = DBUtility.ClsPub.isStrNull(dsSource.Tables[0].Rows[0]["HSourceBillType"]);
+                            if(omodel_View.HSourceBillNo!="")
+                            {
+                                Int64 HAccessFlag = 1;   //鏄惁鐗╂枡鏉$爜甯﹀嚭婧愬崟淇℃伅鏍囧織锛�0涓虹洿鎺ユ壂婧愬崟鏉$爜锛�1涓虹墿鏂欐潯鐮佸甫鍑烘簮鍗曚俊鎭級
+                                oBar = get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, omodel_View.HSourceBillNo, omodel_View.HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg);
+                                if (oBar == null)
+                                {
+                                    oCn.RollBack();
+                                    return null;
+                                }
+                                else
+                                {
+                                    SourceFlag = true;
+                                }
+                            }
+                            else if (SourceFlag == false)
+                            {
+                                HSourceBillType = "-1";
+                            }
+                        }
                     }
                 }
                 else
@@ -47862,9 +47928,11 @@
 
                 //鐢熶骇棰嗘枡锛�1204锛夈�侀攢鍞嚭搴擄紙1205锛夈�佸叾浠栧嚭搴撹摑瀛楋紙1206锛夈�佸澶栧嚭搴擄紙1211锛夈�佺敓浜цˉ鏂欙紙1254锛�
                 //澶栬喘閫�鏂欙紙1239锛夈�佷骇鍝侀��搴擄紙1245锛夈�佸叾浠栧叆搴撶孩瀛楋紙1248锛夈�佸澶栭��搴擄紙1246锛�
+                //鐩存帴璋冩嫧鍗曪紙1207锛夈�佸垎姝ュ紡璋冨嚭鍗曪紙1250锛�
                 //鍑哄簱銆佺孩瀛楀叆搴擄紝鍒ゆ柇鏉$爜搴撳瓨銆丒RP搴撳瓨
                 if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211" || HBillType == "1254"
-                    || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246")
+                    || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246"
+                    || HBillType == "1207" || HBillType == "1250")
                 {
                     //搴撳瓨鎺у埗-ERP璐熷簱瀛樻帶鍒�     绉佹湁浜戞ā寮�
                     if (oSystemParameterMain.WMS_ERPStockCtl == "Y" && oSystemParameterMain.WMS_CloudMode == "Y")
@@ -48325,54 +48393,71 @@
                                     //鍒ゆ柇鏉$爜绫诲瀷鏄惁涓烘墭鐩樻潯鐮侊紝濡傛灉鏄墭鐩樻潯鐮佸垯鍒嗚В骞舵ā鎷熸壂鐮�
                                     else if (dal.omodel_View.HBarCodeType == "鎵樼洏鏉$爜")
                                     {
-                                        //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
-                                        DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
-                                        if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
+                                        if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
                                         {
-                                            sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
-                                            return null;
-                                        }
-                                        else
-                                        {
-                                            if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
+                                            //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                            DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
+                                            if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                                             {
-                                                sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
                                                 return null;
                                             }
                                             else
                                             {
-                                                for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+                                                if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
                                                 {
-                                                    dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
-                                                    dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
-                                                    dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
-                                                    dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
-                                                    dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
-                                                    dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
-                                                    dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
-                                                    dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
-                                                    dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
-                                                    dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
-                                                    //鏃犳簮鍗曠姸鎬侊紝璁剧疆婧愬崟绫诲瀷涓�-1
-                                                    if (SourceFlag == false)
+                                                    sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                    return null;
+                                                }
+                                                else
+                                                {
+                                                    for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                                                     {
-                                                        HSourceBillType = "-1";
-                                                    }
-                                                    if (i != 0)
-                                                    {
-                                                        SourceFlag = true;
-                                                    }
+                                                        dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
+                                                        dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
+                                                        dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
+                                                        dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
+                                                        dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
+                                                        dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
+                                                        dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
+                                                        dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
+                                                        dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
+                                                        dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
+                                                        //鏃犳簮鍗曠姸鎬侊紝璁剧疆婧愬崟绫诲瀷涓�-1
+                                                        if (SourceFlag == false)
+                                                        {
+                                                            HSourceBillType = "-1";
+                                                        }
+                                                        if (i != 0)
+                                                        {
+                                                            SourceFlag = true;
+                                                        }
 
-                                                    //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
-                                                    if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg))
-                                                    {
-                                                        sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忕墿鏂欐潯鐮佸け璐ワ紒" + sErrMsg;
-                                                        return null;
+                                                        //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                                                        if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg))
+                                                        {
+                                                            sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忕墿鏂欐潯鐮佸け璐ワ紒" + sErrMsg;
+                                                            return null;
+                                                        }
                                                     }
                                                 }
+                                                oBar.HBarType = "鐗╂枡鏉$爜";
+                                                return oBar;
                                             }
-                                            oBar.HBarType = "鐗╂枡鏉$爜";
-                                            return oBar;
+                                        }
+                                        else
+                                        {
+                                            //灏嗘墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                            oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
+                                            if (oBar == null)
+                                            {
+                                                sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
+                                                return null;
+                                            }
+                                            else
+                                            {
+                                                return oBar;
+                                            }
                                         }
                                     }
                                     else
@@ -48469,54 +48554,71 @@
                                         //鍒ゆ柇鏉$爜绫诲瀷鏄惁涓烘墭鐩樻潯鐮侊紝濡傛灉鏄墭鐩樻潯鐮佸垯鍒嗚В骞舵ā鎷熸壂鐮�
                                         else if (dal.omodel_View.HBarCodeType == "鎵樼洏鏉$爜")
                                         {
-                                            //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
-                                            DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
-                                            if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
+                                            if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
                                             {
-                                                sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
-                                                return null;
-                                            }
-                                            else
-                                            {
-                                                if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
+                                                //鍒嗚В鎵樼洏鏉$爜寰楀埌鏄庣粏鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                                DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode");
+                                                if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                                                 {
-                                                    sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                    sErrMsg = "鍒嗚В鎵樼洏鏉$爜鍙戠敓閿欒锛�";
                                                     return null;
                                                 }
                                                 else
                                                 {
-                                                    for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
+                                                    if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1)
                                                     {
-                                                        dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
-                                                        dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
-                                                        dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
-                                                        dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
-                                                        dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
-                                                        dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
-                                                        dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
-                                                        dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
-                                                        dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
-                                                        dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
-                                                        //鏃犳簮鍗曠姸鎬侊紝璁剧疆婧愬崟绫诲瀷涓�-1
-                                                        if (SourceFlag == false)
+                                                        sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]);
+                                                        return null;
+                                                    }
+                                                    else
+                                                    {
+                                                        for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                                                         {
-                                                            HSourceBillType = "-1";
-                                                        }
-                                                        if (i != 0)
-                                                        {
-                                                            SourceFlag = true;
-                                                        }
+                                                            dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
+                                                            dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]);
+                                                            dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]);
+                                                            dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]);
+                                                            dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]);
+                                                            dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]);
+                                                            dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]);
+                                                            dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]);
+                                                            dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]);
+                                                            dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]);
+                                                            //鏃犳簮鍗曠姸鎬侊紝璁剧疆婧愬崟绫诲瀷涓�-1
+                                                            if (SourceFlag == false)
+                                                            {
+                                                                HSourceBillType = "-1";
+                                                            }
+                                                            if (i != 0)
+                                                            {
+                                                                SourceFlag = true;
+                                                            }
 
-                                                        //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
-                                                        if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg))
-                                                        {
-                                                            sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忕墿鏂欐潯鐮佸け璐ワ紒" + sErrMsg;
-                                                            return null;
+                                                            //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                                                            if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg))
+                                                            {
+                                                                sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忕墿鏂欐潯鐮佸け璐ワ紒" + sErrMsg;
+                                                                return null;
+                                                            }
                                                         }
                                                     }
+                                                    oBar.HBarType = "鐗╂枡鏉$爜";
+                                                    return oBar;
                                                 }
-                                                oBar.HBarType = "鐗╂枡鏉$爜";
-                                                return oBar;
+                                            }
+                                            else
+                                            {
+                                                //灏嗘墭鏉$爜淇℃伅鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
+                                                oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg);
+                                                if (oBar == null)
+                                                {
+                                                    sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
+                                                    return null;
+                                                }
+                                                else
+                                                {
+                                                    return oBar;
+                                                }
                                             }
                                         }
                                         else

--
Gitblit v1.9.1