From 4ad5c8d6a75ca57dcdd0461aea9dcdc9fd8f9e78 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期五, 17 九月 2021 16:40:06 +0800
Subject: [PATCH] 新增模治具扫码功能

---
 Pub_Class.dll                |    0 
 DLL/Pub_Class.dll            |    0 
 CLOUDWEB/WebService1.asmx.cs |  189 ++++++++++++++++++++++++++++++++++++++++------
 3 files changed, 163 insertions(+), 26 deletions(-)

diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs
index 120320a..3f031af 100644
--- a/CLOUDWEB/WebService1.asmx.cs
+++ b/CLOUDWEB/WebService1.asmx.cs
@@ -12516,6 +12516,11 @@
                     oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString());
                 }
 
+                if (oSystemParameterMain.WMS_MouldManagerCtl == "Y") //绯荤粺鍙傛暟  鍚敤鍣ㄥ叿绠$悊
+                {
+                    oCn.RunProc("EXEC h_p_Sc_MouldProdOutBill_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillType + "'," + oMain.HSupID.ToString() + "," + oMain.HKeeperID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HDeptID.ToString());
+                }
+
                 //鏍规嵁TMP琛� 杩斿洖 瀛愯〃淇℃伅
                 Ds = oCn.RunProcReturn("exec h_p_Kf_GetSellOutBill_CLD " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetSellOutBill_CLD");
                 if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0)
@@ -28480,6 +28485,7 @@
         //鏍规嵁鏉$爜寰楀埌鐩稿簲淇℃伅(鏉$爜妗f)
         public Model.ClsGy_BarCodeBill_WMS_Model_View get_InfoByBarCode_Source(string sBarCode,Int64 sInterID,ref bool sBool, ref string sErrMsg)
         {
+            sBarCode = sBarCode.Trim();
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
             DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
             if (dal.GetInfoByNumber_View(sBarCode))
@@ -30324,6 +30330,7 @@
         [WebMethod]
         public Model.ClsKf_ICStockBill_WMS get_CheckTypeByBarCode_MulSource(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, string HSourceBillType, Int64 HOWNERID, bool sXFFlag, bool sJDPFlag, ref string sErrMsg)
         {
+            sBarCode = sBarCode.Trim();
             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
             Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
 
@@ -31607,6 +31614,7 @@
             Int64 sHDeptID = 0;
             string sHDeptName = "";
             string sHBarType = "";
+            sBarCode = sBarCode.Trim();
 
             //鑾峰彇绯荤粺鍙傛暟
             Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
@@ -31725,22 +31733,48 @@
                     }
                     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))
+                        if (sBarCode.Substring(0, 3) == "PAK")
                         {
-                            oBar.HSourceBillType = sHSourceBillType;
-                            oBar.HSourceBillNo = sHSourceBillNo;
-                            oBar.HSupID = sHSupID;
-                            oBar.HSupName = sHSupName;
-                            oBar.HDeptID = sHDeptID;
-                            oBar.HDeptName = sHDeptName;
+                            //灏嗘ā娌诲叿淇℃伅鍐欏叆妯℃不鍏峰嚭鍏ュ簱涓存椂琛�
+                            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
                         {
-                            sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
-                            return null;
+                            //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+                            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;
                     }
                 }
                 //涓�閿壂鐮佹ā寮忥紝鏍规嵁鏉$爜鍓嶇紑璧� 涓嶅悓鏂规硶锛堜粨搴撱�佷粨浣嶃�侀儴闂級锛堟簮鍗曘�佺墿鏂欐潯鐮侊級
@@ -31833,22 +31867,48 @@
                         }
                         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))
+                            if (sBarCode.Substring(0, 3) == "PAK")
                             {
-                                oBar.HSourceBillType = sHSourceBillType;
-                                oBar.HSourceBillNo = sHSourceBillNo;
-                                oBar.HSupID = sHSupID;
-                                oBar.HSupName = sHSupName;
-                                oBar.HDeptID = sHDeptID;
-                                oBar.HDeptName = sHDeptName;
+                                //灏嗘ā娌诲叿淇℃伅鍐欏叆妯℃不鍏峰嚭鍏ュ簱涓存椂琛�
+                                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
                             {
-                                sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涙壂鎻忓け璐ワ紒" + sErrMsg;
-                                return null;
+                                //灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+                                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
@@ -32851,11 +32911,11 @@
                 if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0)
                 {
                     //鍏堣繘鍏堝嚭鎺у埗
-                    if ((HBillType == "1204" && oSystemParameterMain.Kf_MateOutBill_FIFOCtl == "Y")     //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
-                        || (HBillType == "1205" && oSystemParameterMain.Kf_SellOutBill_FIFOCtl == "Y")  //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗
-                        || (HBillType == "1211" && oSystemParameterMain.Kf_EntrustOutBill_FIFOCtl == "Y")) //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗
+                    if ((HBillType == "1204" && oSystemParameterMain.Kf_MateOutBill_FIFOCtl == "Y")         //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
+                        || (HBillType == "1205" && oSystemParameterMain.Kf_SellOutBill_FIFOCtl == "Y")      //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗
+                        || (HBillType == "1211" && oSystemParameterMain.Kf_EntrustOutBill_FIFOCtl == "Y"))  //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗
                     {
-                        DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_Add " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_Add");
+                        DataSet FIFO = oCn.RunProcReturn("exec h_p_WMS_AddSourceFIFO_New " + HInterID.ToString() + ",'" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + HFIFOWhID.ToString(), "h_p_WMS_AddSourceFIFO_New");
                         if (FIFO == null || FIFO.Tables[0].Rows.Count == 0)
                         {
                             sErrMsg = "瀛樺叆鍏堣繘鍏堝嚭涓存椂琛ㄥけ璐ワ紒";
@@ -32931,10 +32991,87 @@
         #endregion
 
 
+        #endregion
+
+
+        #region 鍗曟嵁鍒楄〃鏁版嵁澶勭悊
+
+        //鏄剧ず鐗╂枡鏄庣粏鍒楄〃銆佹ā娌诲叿鍒楄〃銆佸厛杩涘厛鍑哄垪琛ㄤ俊鎭�
+        [WebMethod]
+        public DataSet GetBillEntry_TmpList(long HInterID, string HBillNo, string HBillType, ref string sMouldManagerCtl, ref string sFIFOCtl, ref string sErrMsg)
+        {
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            string sSimpleMode = "N";  //鏄惁鍚敤鎵爜绠�鏄撴ā寮忥紝鍙樉绀哄凡鎵爜婧愬崟璁板綍(Y,N)
+
+            //鑾峰彇绯荤粺鍙傛暟
+            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
+            {
+                sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涜繑鍥炵墿鏂欐槑缁嗗垪琛ㄦ椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                return null;
+            }
+
+            //鍒ゆ柇鏄惁鍚敤鍣ㄥ叿绠$悊(Y,N)
+            if (oSystemParameter.omodel.WMS_MouldManagerCtl == "Y")   //鍚敤妯℃不鍏风鐞�
+            {
+                sMouldManagerCtl = "Y";
+            }
+
+            //鍒ゆ柇鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊(Y,N)锛屾槸鍚﹀惎鐢ㄦ壂鐮佺畝鏄撴ā寮忥紝鍙樉绀哄凡鎵爜婧愬崟璁板綍(Y,N)
+            if (HBillType == "1204")   //鐢熶骇棰嗘枡鍗�
+            {
+                if (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y")   //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
+                {
+                    sFIFOCtl = "Y";
+                }
+                if (oSystemParameter.omodel.Kf_MateOutBill_SimpleMode == "Y")   //鐢熶骇棰嗘枡鍗�-鎵爜绠�鏄撴ā寮�
+                {
+                    sSimpleMode = "Y";
+                }
+            }
+            if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl == "Y")   //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗
+            {
+                sFIFOCtl = "Y";
+            }
+            if (HBillType == "1211" && oSystemParameter.omodel.Kf_EntrustOutBill_FIFOCtl == "Y")   //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗
+            {
+                sFIFOCtl = "Y";
+            }
+
+            DataSet DS = oCn.RunProcReturn("exec h_p_WMS_BillEntryTmpList " + HInterID.ToString() + ",'" + HBillType + "','" + sMouldManagerCtl + "','" + sFIFOCtl + "','" + sSimpleMode + "'", "h_p_WMS_BillEntryTmpList");
+            if (DS == null || DS.Tables[0].Rows.Count == 0)
+            {
+                sErrMsg = "娌℃湁杩斿洖浠讳綍鐗╂枡鏄庣粏鏁版嵁锛�";
+                return null;
+            }
+            else
+            {
+                return DS;
+            }
+        }
+
+        //鍒犻櫎妯℃不鍏峰垪琛ㄤ腑閫変腑琛岃褰�
+        [WebMethod]
+        public bool set_DelSc_MouldStockBillMain_Temp(long HInterID, long HMouldInterID, string sHBillType, ref string sErrMsg)
+        {
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            try
+            {
+                oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + sHBillType + "' and HMouldID=" + HMouldInterID.ToString(), ref DBUtility.ClsPub.sExeReturnInfo);
+                return true;
+            }
+            catch (Exception e)
+            {
+                sErrMsg = "鍒犻櫎妯℃不鍏峰嚭鍏ュ簱涓存椂琛ㄨ褰曞け璐ワ紒" + e.Message;
+                return false;
+            }
+        }
 
         #endregion
 
 
+
+
         #region  妗岄潰鏉$爜鐢熸垚澶栫綉鐗�
 
         [WebMethod]
diff --git a/DLL/Pub_Class.dll b/DLL/Pub_Class.dll
index ee62d42..04f4edd 100644
--- a/DLL/Pub_Class.dll
+++ b/DLL/Pub_Class.dll
Binary files differ
diff --git a/Pub_Class.dll b/Pub_Class.dll
index 2be5256..ee62d42 100644
--- a/Pub_Class.dll
+++ b/Pub_Class.dll
Binary files differ

--
Gitblit v1.9.1