From c0cee04d997030777bd85d198d82cc2567f4773f Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 02 二月 2024 18:18:01 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/POStockInBillController.cs |  693 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 451 insertions(+), 242 deletions(-)

diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 324bca1..8c671f1 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -78,49 +78,101 @@
         /// <returns></returns>
         [Route("POStockInBill/get_CheckTypeByBarCode_Json")]
         [HttpGet]
-        public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string sBillNo, string sBillType, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID)
+        //public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string sBillNo, string sBillType, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID)
+        //{
+        //    try
+        //    {
+        //        string sErrMsg = "";
+        //        string sJXCode = "";
+        //        if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+        //        {
+        //            sJXCode = POStockInBillController.JX_Json(sCode, sInterID, HBillType, HOWNERID, sBillNo, sMaker);
+        //            SourceFlag = true;
+        //        }
+        //        else
+        //        {
+        //            sJXCode = sCode;
+        //        }
+
+
+
+        //        //var sJXCode = POStockInBillController.JX_Json(sCode, sInterID, HBillType, HOWNERID, HBillNo, sMaker);
+        //        //if (sRedBlue == true)
+        //        //{
+        //        //    HBillType = "1239";
+        //        //}
+        //        //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
+        //        WebS.WebService1 oWebs = new WebS.WebService1();
+        //        WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
+        //        string sExpressNumber = "";
+        //        WebSoBar = oWebs.get_CheckTypeByBarCode_All(sJXCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
+        //        //WebSoBar = oWebs.get_ba(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
+        //        if (WebSoBar == null)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+        //            objJsonResult.data = WebSoBar;
+        //            return objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = e.Message + ";" + e.StackTrace;
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+
+        //}
+
+
+        public object get_CheckTypeByBarCode_Json(string sCode, long sInterID, string sBillNo, string sBillType, string sMaker, long WhID, long SPID, double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, long HOWNERID)
         {
+            object result;
             try
             {
-                var sJXCode = POStockInBillController.JX_Json(sCode, sInterID, HBillType, HOWNERID, HBillNo, sMaker);
-                //if (sRedBlue == true)
-                //{
-                //    HBillType = "1239";
-                //}
-                //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
                 WebS.WebService1 oWebs = new WebS.WebService1();
                 WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
-                string sExpressNumber = "";
-                WebSoBar = oWebs.get_CheckTypeByBarCode_All(sJXCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
-                //WebSoBar = oWebs.get_ba(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
-                if (WebSoBar == null)
+                string hexpressNumber = "";
+                WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, this.HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, hexpressNumber, ref ClsPub.sErrInfo);
+                bool flag = WebSoBar == null;
+                if (flag)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    this.objJsonResult.code = "0";
+                    this.objJsonResult.count = 0;
+                    this.objJsonResult.Message = ClsPub.sErrInfo;
+                    this.objJsonResult.data = null;
+                    result = this.objJsonResult;
                 }
                 else
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
-                    objJsonResult.data = WebSoBar;
-                    return objJsonResult;
+                    this.objJsonResult.code = "0";
+                    this.objJsonResult.count = 1;
+                    this.objJsonResult.Message = ClsPub.sErrInfo;
+                    this.objJsonResult.data = WebSoBar;
+                    result = this.objJsonResult;
                 }
             }
-            catch (Exception e)
+            catch (Exception ex)
             {
-                objJsonResult.code = "0";
-                objJsonResult.count = 1;
-                objJsonResult.Message = e.Message + ";" + e.StackTrace;
-                objJsonResult.data = null;
-                return objJsonResult;
+                this.objJsonResult.code = "0";
+                this.objJsonResult.count = 1;
+                this.objJsonResult.Message = ex.Message + ";" + ex.StackTrace;
+                this.objJsonResult.data = null;
+                result = this.objJsonResult;
             }
-
+            return result;
         }
-
 
 
 
@@ -876,14 +928,15 @@
                 WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
                 string text = "";
                 string text1 = "";
-                bool flag = HBillType == "1201";
+                //gy_billnumber 鍗曟嵁绫诲瀷琛�
+                bool flag = HBillType == "1201"; //WMS 閲囪喘鍏ュ簱
                 if (flag)
                 {
                     string[] array = sBarCodeNew.Split(new char[]
                     {
                 '@'
                     });
-                    string str = array[0];
+                    string str = array[0]; //鐗╂枡浠g爜
                     long num = (long)ClsPub.isInt(array[4]);
                     string text2 = array[6];
                     DateTime dateTime = ClsPub.isDate(array[3]);
@@ -894,11 +947,12 @@
                     string str3 = ClsPub.isStrNull(dataSet.Tables[0].Rows[0]["HNumber"]);
 
 
-
+                    //鐢ㄦ媶鍒嗗嚭鏉ョ殑鐗╂枡浠g爜鏌ヨ鐗╂枡琛ㄩ噷鐨勬柊鐗╂枡缂栫爜
                     DataSet Dss7;
                     Dss7 = clsCN.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + str + "'", "T_BD_MATERIAL");
                     if (Dss7 == null || Dss7.Tables[0].Rows.Count == 0)
                     {
+                        //鏂扮墿鏂欒〃閲屾病鏈夎繑鍥炴暟鎹垯鏌ヨ鐗╂枡琛ㄩ噷鐨勬棫鐗╂枡缂栫爜
                         DataSet Dss8;
                         Dss8 = clsCN.RunProcReturn(" select * from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + str + "'", "T_BD_MATERIAL");
                         str = DBUtility.ClsPub.isStrNull(Dss8.Tables[0].Rows[0]["FNumber"]);
@@ -916,6 +970,7 @@
                     long num3 = (long)ClsPub.isInt(dataSet2.Tables[0].Rows[0]["HUnitID"]);
                     text = str3 + num2.ToString() + text2  + "#" + num;
                     text1 = str3 + num2.ToString() + text2;
+                    //鎵炬簮鍗�
                     DataSet dataSet3 = clsCN.RunProcReturn(" select fid,FMATERIALID,FENTRYID,FBILLNO from h_v_RECEIVEQuery where FSRCBILLNO= '" + str2 + "' and  FLOT_TEXT = '" + text2 + "' and  FMATERIALID = " + num2.ToString(), "h_v_RECEIVEQuery");
                     //DataSet dataSet3 = clsCN.RunProcReturn(" select fid,FMATERIALID,FENTRYID,FBILLNO from h_v_RECEIVEQuery where FLOT_TEXT= '" + text2 + "' and FPRODUCEDATE = '" + dateTime + "' and  FMATERIALID = " + num2.ToString(), "h_v_RECEIVEQuery");
                     num2 = ClsPub.isLong(dataSet3.Tables[0].Rows[0]["FMATERIALID"]);
@@ -928,6 +983,7 @@
                     {
                         DataSet dataSet5 = clsCN.RunProcReturn(string.Concat(new string[]
                         {
+                    //鎵爜涓存椂璁板綍琛�
                     " select * from KF_PonderationBillMain_Temp where  HInterID = ",
                     hinterid.ToString(),
                     " and HBillType = '",
@@ -940,12 +996,13 @@
                         if (!flag3)
                         {
                             //POStockInBillController postockInBillController = new POStockInBillController();
+                            ////鎵簮鍗曟柟娉�
                             //postockInBillController.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo);
 
                             WEBSController webscontroller4 = new WEBSController();
-                            object obj4 = webscontroller4.Get_SourceBarCode_PoStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID,1, oSystemParameterMain, ref DBUtility.ClsPub.sErrInfo);
+                            object obj4 = webscontroller4.get_SourceBarCode_POStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID);
 
-                           
+
 
                         }
                     }
@@ -1009,12 +1066,15 @@
                         bool flag4 = dataSet6.Tables[0].Rows.Count > 0;
                         if (!flag4)
                         {
-                            POStockInBillController postockInBillController2 = new POStockInBillController();
-                            postockInBillController2.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo);
+                            //POStockInBillController postockInBillController2 = new POStockInBillController();
+                            //postockInBillController2.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo);
+
+                            WEBSController webscontroller4 = new WEBSController();
+                            object obj4 = webscontroller4.get_SourceBarCode_POStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID);
                         }
                     }
                 }
-                bool flag5 = HBillType == "1202";
+                bool flag5 = HBillType == "1202"; //WMS 鐢熶骇鍏ュ簱
                 if (flag5)
                 {
                     string text6 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 4);
@@ -1022,14 +1082,14 @@
                     bool flag6 = text7.Contains("W") || text7.Contains("N");
                     if (flag6)
                     {
-                        string text8 = sBarCodeNew.Substring(0, 10);
-                        string str4 = sBarCodeNew.Substring(10, 10);
+                        string text8 = sBarCodeNew.Substring(0, 10);//鍟嗗搧鐮�    鍟嗗搧鐮�+鐗╂枡浠g爜+鐢熶骇鏃ユ湡+鎵规+澶辨晥鏃ユ湡+涓�浣嶅瓧姣�+涓変綅鏁板瓧
+                        string str4 = sBarCodeNew.Substring(10, 10);//鐗╂枡浠g爜
                         string text9 = "20" + sBarCodeNew.Substring(20, 6);
-                        long num8 = (long)ClsPub.isInt(text9.Substring(0, 4));
-                        long num9 = (long)ClsPub.isInt(text9.Substring(4, 2));
-                        long num10 = (long)ClsPub.isInt(text9.Substring(6, 2));
-                        long num11 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3));
-                        string text10 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10);
+                        long num8 = (long)ClsPub.isInt(text9.Substring(0, 4));  //骞�
+                        long num9 = (long)ClsPub.isInt(text9.Substring(4, 2));  //鏈�
+                        long num10 = (long)ClsPub.isInt(text9.Substring(6, 2)); //鏃�
+                        long num11 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3));//鍚庝笁浣嶆案杩滈兘鏄暟瀛�
+                        string text10 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10);//澶辨晥鏃ユ湡+涓�浣嶅瓧姣�+涓変綅鏁板瓧
                         string text11 = "20" + text10.Substring(0, 6);
                         long num12 = (long)ClsPub.isInt(text11.Substring(0, 4));
                         long num13 = (long)ClsPub.isInt(text11.Substring(4, 2));
@@ -1059,7 +1119,6 @@
                         {
                             str4 = DBUtility.ClsPub.isStrNull(Dss7.Tables[0].Rows[0]["FNumber"]);
                         }
-
 
                         DataSet dataSet7 = clsCN2.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str4 + "' and  huseorgid = " + HOrgID.ToString(), "Gy_Material");
                         long num15 = ClsPub.isLong(dataSet7.Tables[0].Rows[0]["HItemID"]);
@@ -1185,7 +1244,8 @@
                     }
                     else
                     {
-                        string str6 = sBarCodeNew.Substring(0, 10);
+                        /*鍓嶅崄浣嶇墿鏂欎唬鐮侊紝鍚庡叚浣嶇敓鏁堟棩鏈燂紝鍊掓暟鍓嶄笁浣嶆槸鏁板瓧鍓嶅叚浣嶆槸澶辨晥鏃ユ湡 */
+                        string str6 = sBarCodeNew.Substring(0, 10);//鐗╂枡浠g爜
                         string text17 = "20" + sBarCodeNew.Substring(10, 6);
                         long num21 = (long)ClsPub.isInt(text17.Substring(0, 4));
                         long num22 = (long)ClsPub.isInt(text17.Substring(4, 2));
@@ -1204,9 +1264,9 @@
                     "-",
                     num27.ToString()
                         }));
-                        string text20 = sBarCodeNew.Remove(0, 16);
-                        string text21 = text20.Remove(text20.Length - 9, 9);
-                        ClsCN clsCN3 = new ClsCN();
+                        string text20 = sBarCodeNew.Remove(0, 16); //SAE1300100 230309 2303704 250308 010
+                        string text21 = text20.Remove(text20.Length - 9 , 9); //SAE1300100230309 2303704 250308010
+                         ClsCN clsCN3 = new ClsCN();
                         DataSet dataSet13 = clsCN3.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str6 + "' and  huseorgid = " + HOrgID.ToString(), "Gy_Material");
                         long num28 = ClsPub.isLong(dataSet13.Tables[0].Rows[0]["HItemID"]);
                         string text22 = ClsPub.isStrNull(dataSet13.Tables[0].Rows[0]["HName"]);
@@ -1241,7 +1301,7 @@
                     "-",
                     num23.ToString()
                         }));
-                        DataSet dataSet16 = clsCN3.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill");
+                        DataSet dataSet16 = clsCN3.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); 
                         bool flag10 = dataSet16.Tables[0].Rows.Count > 0;
                         if (flag10)
                         {
@@ -1266,6 +1326,7 @@
                         }
                         else
                         {
+                            //鍙兘鍜屼粬浠殑鐧诲綍缁勭粐鏈夊叧绯�
                             string billCode3 = "85";
                             long num32 = ClsPub.CreateBillID_Prod(billCode3, ref ClsPub.sExeReturnInfo);
                             long num33 = 0L;
@@ -1330,7 +1391,7 @@
                         }
                     }
                 }
-                bool flag13 = HBillType == "1244";
+                bool flag13 = HBillType == "1244"; //WMS 鐢熶骇閫�鏂欏崟
                 if (flag13)
                 {
                     bool flag14 = sBarCodeNew.Contains("@");
@@ -1621,7 +1682,7 @@
                         }
                     }
                 }
-                bool flag19 = HBillType == "1207";
+                bool flag19 = HBillType == "1207"; //WMS 鐩存帴璋冩嫧
                 if (flag19)
                 {
                     bool flag20 = sBarCodeNew.Contains("@");
@@ -1632,7 +1693,8 @@
                     '@'
                         });
                         string str14 = array3[0];
-                        long num61 = (long)ClsPub.isInt(array3[4]);
+                        //long num61 = (long)ClsPub.isInt(array3[4]);
+                        Double num61 = ClsPub.isDoule(array3[4]);
                         string text46 = array3[6];
                         DateTime dateTime13 = ClsPub.isDate(array3[3]);
                         DateTime dateTime14 = ClsPub.isDate(array3[5]);
@@ -1895,7 +1957,7 @@
                         }
                     }
                 }
-                bool flag25 = HBillType == "1206";
+                bool flag25 = HBillType == "1206"; //WMS 閿�鍞嚭搴�
                 if (flag25)
                 {
                     bool flag26 = sBarCodeNew.Contains("@");
@@ -2183,8 +2245,8 @@
                             }
                         }
                     }
-                }
-                bool flag31 = HBillType == "1204";
+                } 
+                bool flag31 = HBillType == "1204"; //WMS 鐢熶骇棰嗘枡
                 if (flag31)
                 {
                     bool flag32 = sBarCodeNew.Contains("@");
@@ -2474,7 +2536,7 @@
                         }
                     }
                 }
-                bool flag37 = HBillType == "1254" || HBillType == "1211" || HBillType == "1255";
+                bool flag37 = HBillType == "1254" /*鐢熶骇琛ユ枡*/ || HBillType == "1211" || HBillType == "1255";
                 if (flag37)
                 {
                     bool flag38 = sBarCodeNew.Contains("@");
@@ -2763,7 +2825,7 @@
                         }
                     }
                 }
-                bool flag43 = HBillType == "1205";
+                bool flag43 = HBillType == "1205"; 
                 if (flag43)
                 {
                     bool flag44 = sBarCodeNew.Contains("@");
@@ -3051,7 +3113,7 @@
                         }
                     }
                 }
-                result = text;
+                 result = text;
             }
             catch (Exception ex)
             {
@@ -3859,8 +3921,8 @@
                 List<Model.ClsKf_POStockInBillMain> lsmain = new List<Model.ClsKf_POStockInBillMain>();
                 ListModels oListModels = new ListModels();
                 lsmain = oListModels.getPOStockInBillMainByJson(msg1);
-                lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
-                lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                 string sSourceBillType = lsmain[0].HBillType;
 
                 WebAPI.WebS.ClsKf_POStockInBillMain websLsmain = new WebS.ClsKf_POStockInBillMain();
@@ -3892,7 +3954,8 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
-                    objJsonResult.Message = "鎴愬姛锛佸崟鎹彿涓猴細";
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
+                    //objJsonResult.Message = "鎴愬姛锛佸崟鎹彿涓猴細";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -3900,7 +3963,8 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    //objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -3914,6 +3978,70 @@
                 return objJsonResult;
             }
         }
+
+
+        //[Route("POStockInBill/set_SavePOStockInBill_Json")]
+        //[HttpPost]
+        //public object set_SavePOStockInBill_Json([FromBody] JObject oMain)
+        //{
+        //    string text = oMain["oMain"].ToString();
+        //    string jsonString = text.ToString();
+        //    object result;
+        //    try
+        //    {
+        //        List<ClsKf_POStockInBillMain> list = new List<ClsKf_POStockInBillMain>();
+        //        ListModels listModels = new ListModels();
+        //        list = listModels.getPOStockInBillMainByJson(jsonString);
+        //        list[0].HYear = ClsPub.isLong(DateTime.Now.Year);
+        //        list[0].HDate = ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+        //        string hbillType = list[0].HBillType;
+        //        WebAPI.WebS.ClsKf_POStockInBillMain clsKf_POStockInBillMain = new WebAPI.WebS.ClsKf_POStockInBillMain();
+        //        clsKf_POStockInBillMain.HInterID = list[0].HInterID;
+        //        clsKf_POStockInBillMain.HBillNo = list[0].HBillNo;
+        //        clsKf_POStockInBillMain.HBillType = "1201";
+        //        clsKf_POStockInBillMain.HDate = list[0].HDate;
+        //        clsKf_POStockInBillMain.HDeptID = list[0].HDeptID;
+        //        clsKf_POStockInBillMain.HWHID = list[0].HWHID;
+        //        clsKf_POStockInBillMain.HSCWHID = 0L;
+        //        clsKf_POStockInBillMain.HSupID = list[0].HSupID;
+        //        clsKf_POStockInBillMain.HKeeperID = list[0].HKeeperID;
+        //        clsKf_POStockInBillMain.HSecManagerID = list[0].HSecManagerID;
+        //        clsKf_POStockInBillMain.HEmpID = 0L;
+        //        clsKf_POStockInBillMain.HManagerID = 0L;
+        //        clsKf_POStockInBillMain.HBillerID = list[0].HBillerID;
+        //        clsKf_POStockInBillMain.HRemark = "";
+        //        clsKf_POStockInBillMain.HInnerBillNo = "";
+        //        clsKf_POStockInBillMain.HRedBlueFlag = false;
+        //        clsKf_POStockInBillMain.HMainSourceBillType = list[0].HBillType;
+        //        clsKf_POStockInBillMain.HExplanation = list[0].HExplanation;
+        //        bool flag = this.webserver.set_SavePOStockInBill_New(clsKf_POStockInBillMain, hbillType, ref ClsPub.sErrInfo);
+        //        if (flag)
+        //        {
+        //            this.objJsonResult.code = "0";
+        //            this.objJsonResult.count = 1;
+        //            this.objJsonResult.Message = "鎴愬姛锛佸崟鎹彿涓猴細";
+        //            this.objJsonResult.data = null;
+        //            result = this.objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            this.objJsonResult.code = "0";
+        //            this.objJsonResult.count = 0;
+        //            this.objJsonResult.Message = "涓婁紶澶辫触锛�" + ClsPub.sErrInfo;
+        //            this.objJsonResult.data = null;
+        //            result = this.objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        this.objJsonResult.code = "0";
+        //        this.objJsonResult.count = 0;
+        //        this.objJsonResult.Message = "涓婁紶澶辫触锛�" + ex.ToString();
+        //        this.objJsonResult.data = null;
+        //        result = this.objJsonResult;
+        //    }
+        //    return result;
+        //}
 
 
         /// <summary>
@@ -4158,6 +4286,7 @@
 
         [Route("POStockInBillList/AuditPOInStockBillPost_AR")]
         [HttpPost]
+
         public object AuditPOInStockBillPost_AR([FromBody] JObject msg)
         {
             object result;
@@ -4167,7 +4296,7 @@
                 text = text.Replace("\\", "");
                 text = text.Replace("\n", "");
                 List<ReciveBill_FastModel> list = JsonConvert.DeserializeObject<List<ReciveBill_FastModel>>(text);
-                DAL.ClsCg_POInStockBill clsCg_POInStockBill = new DAL.ClsCg_POInStockBill();
+                ClsCg_POInStockBill clsCg_POInStockBill = new ClsCg_POInStockBill();
                 string hinterID = list[0].HInterID;
                 string text2 = list[0].FID;
                 string singleSystemParameter = this.oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref ClsPub.sExeReturnInfo);
@@ -4178,12 +4307,24 @@
                 this.oCn.BeginTran();
                 this.oCn.Commit();
                 bool flag = singleSystemParameter.Contains("瀹夌憺");
-                if (flag)
+                bool flag2 = flag;
+                bool flag3 = flag2;
+                if (flag3)
                 {
                     DataSet dataSet = this.oCn.RunProcReturn("exec h_p_ReceiveBill_Fast " + hinterID, "h_p_ReceiveBill_Fast");
                     DataRow dataRow = dataSet.Tables[0].Rows[0];
-                    bool flag2 = dataSet.Tables[0].Rows.Count <= 0;
-                    if (flag2)
+                    if (dataSet.Tables[0].Rows.Count == 1 && dataSet.Tables[0].Rows[0]["FRECEIVENumber"].ToString() == "0")
+                    {
+                        this.objJsonResult.code = "0";
+                        this.objJsonResult.count = 0;
+                        this.objJsonResult.Message = "瀛樺湪澶氫釜閲囪喘璁㈠崟鍗曟嵁绫诲瀷锛屼笉鍏佽鎻愪氦锛�";
+                        this.objJsonResult.data = null;
+                        return this.objJsonResult;
+                    }
+                    bool flag4 = dataSet.Tables[0].Rows.Count <= 0;
+                    bool flag5 = flag4;
+                    bool flag6 = flag5;
+                    if (flag6)
                     {
                         this.objJsonResult.code = "0";
                         this.objJsonResult.count = 0;
@@ -4191,186 +4332,192 @@
                         this.objJsonResult.data = null;
                         return this.objJsonResult;
                     }
-                    bool flag3 = dataSet.Tables[0].Rows.Count >= 0;
-                    if (flag3)
+                    bool flag7 = dataSet.Tables[0].Rows.Count >= 0;
+                    bool flag8 = flag7;
+                    bool flag9 = flag8;
+                    if (flag9)
                     {
                         JObject jobject = new JObject();
-                        string value = "SLD01_SYS";
-                        string value2 = "CG";
-                        bool flag4 = dataRow["FTYPENAME"].ToString().Contains("濮斿");
-                        if (flag4)
+                        string text3 = "SLD01_SYS";
+                        string text4 = "CG";
+                        bool flag10 = dataRow["FTYPENAME"].ToString().Contains("濮斿");
+                        bool flag11 = flag10;
+                        bool flag12 = flag11;
+                        if (flag12)
                         {
-                            value = "SLD03_SYS";
-                            value2 = "WW";
+                            text3 = "SLD03_SYS";
+                            text4 = "WW";
                         }
-                        bool flag5 = dataRow["FTYPENAME"].ToString().Contains("璧勪骇");
-                        if (flag5)
+                        bool flag13 = dataRow["FTYPENAME"].ToString().Contains("璧勪骇");
+                        bool flag14 = flag13;
+                        bool flag15 = flag14;
+                        if (flag15)
                         {
-                            value = "SLD04_SYS";
-                            value2 = "ZCCG";
+                            text3 = "SLD04_SYS";
+                            text4 = "ZCCG";
                         }
                         JObject jobject2 = jobject;
-                        string propertyName = "FBILLTYPEID";
+                        string text5 = "FBILLTYPEID";
                         JObject jobject3 = new JObject();
-                        jobject3["Fnumber"] = value;
-                        jobject2.Add(propertyName, jobject3);
-                        jobject.Add("FBusinessType", value2);
+                        jobject3["Fnumber"] = text3;
+                        jobject2.Add(text5, jobject3);
+                        jobject.Add("FBusinessType", text4);
                         jobject.Add("FBILLNO", dataRow["HBillNo"].ToString());
                         jobject.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd"));
                         JObject jobject4 = jobject;
-                        string propertyName2 = "FStockOrgId";
+                        string text6 = "FStockOrgId";
                         JObject jobject5 = new JObject();
                         jobject5["Fnumber"] = dataRow["FRECEIVENUMBER"].ToString();
-                        jobject4.Add(propertyName2, jobject5);
+                        jobject4.Add(text6, jobject5);
                         JObject jobject6 = jobject;
-                        string propertyName3 = "FPurOrgId";
+                        string text7 = "FPurOrgId";
                         JObject jobject7 = new JObject();
                         jobject7["Fnumber"] = dataRow["FPURCHASEORGNUMBER"].ToString();
-                        jobject6.Add(propertyName3, jobject7);
+                        jobject6.Add(text7, jobject7);
                         JObject jobject8 = jobject;
-                        string propertyName4 = "FSupplierId";
+                        string text8 = "FSupplierId";
                         JObject jobject9 = new JObject();
                         jobject9["Fnumber"] = dataRow["FSUPPLIERNUMBER"].ToString();
-                        jobject8.Add(propertyName4, jobject9);
+                        jobject8.Add(text8, jobject9);
                         JObject jobject10 = jobject;
-                        string propertyName5 = "FPURCHASERID";
+                        string text9 = "FPURCHASERID";
                         JObject jobject11 = new JObject();
                         jobject11["Fnumber"] = dataRow["FPURCHASERNUMBER"].ToString();
-                        jobject10.Add(propertyName5, jobject11);
+                        jobject10.Add(text9, jobject11);
                         jobject.Add("FOwnerTypeIdHead", "BD_Supplier");
                         JObject jobject12 = jobject;
-                        string propertyName6 = "FOwnerIdHead";
+                        string text10 = "FOwnerIdHead";
                         JObject jobject13 = new JObject();
                         jobject13["Fnumber"] = dataRow["FSUPPLIERNUMBER"].ToString();
-                        jobject12.Add(propertyName6, jobject13);
-                        jobject.Add("F_RYMA_Assistant", new JObject() { ["Fnumber"] = dataRow["F_UJDY_Assistant"].ToString() });
+                        jobject12.Add(text10, jobject13);
+                        JObject jobject14 = jobject;
+                        string text11 = "F_RYMA_Assistant";
+                        JObject jobject15 = new JObject();
+                        jobject15["Fnumber"] = dataRow["F_UJDY_Assistant"].ToString();
+                        jobject14.Add(text11, jobject15);
                         JArray jarray = new JArray();
                         foreach (object obj in dataSet.Tables[0].Rows)
                         {
                             DataRow dataRow2 = (DataRow)obj;
-                            JObject jobject14 = new JObject();
-                            JObject jobject15 = jobject14;
-                            string propertyName7 = "FMaterialId";
                             JObject jobject16 = new JObject();
-                            jobject16["Fnumber"] = dataRow2["FMATERIALNUMBER"].ToString();
-                            jobject15.Add(propertyName7, jobject16);
-                            JObject jobject17 = jobject14;
-                            string propertyName8 = "FUnitID";
+                            JObject jobject17 = jobject16;
+                            string text12 = "FMaterialId";
                             JObject jobject18 = new JObject();
-                            jobject18["Fnumber"] = dataRow2["FUNITNUMBER"].ToString();
-                            jobject17.Add(propertyName8, jobject18);
-                            jobject14.Add("FPreDeliveryDate", DateTime.Now.ToString("yyyy-MM-dd"));
-                            JObject jobject19 = jobject14;
-                            string propertyName9 = "FPriceUnitId";
+                            jobject18["Fnumber"] = dataRow2["FMATERIALNUMBER"].ToString();
+                            jobject17.Add(text12, jobject18);
+                            JObject jobject19 = jobject16;
+                            string text13 = "FUnitID";
                             JObject jobject20 = new JObject();
                             jobject20["Fnumber"] = dataRow2["FUNITNUMBER"].ToString();
-                            jobject19.Add(propertyName9, jobject20);
-                            JObject jobject21 = jobject14;
-                            string propertyName10 = "FStockUnitID";
+                            jobject19.Add(text13, jobject20);
+                            jobject16.Add("FPreDeliveryDate", DateTime.Now.ToString("yyyy-MM-dd"));
+                            JObject jobject21 = jobject16;
+                            string text14 = "FPriceUnitId";
                             JObject jobject22 = new JObject();
                             jobject22["Fnumber"] = dataRow2["FUNITNUMBER"].ToString();
-                            jobject21.Add(propertyName10, jobject22);
-                            JObject jobject23 = jobject14;
-                            string propertyName11 = "FStockID";
+                            jobject21.Add(text14, jobject22);
+                            JObject jobject23 = jobject16;
+                            string text15 = "FStockUnitID";
                             JObject jobject24 = new JObject();
-                            jobject24["Fnumber"] = "BJCK-SH.01.005";
-                            jobject23.Add(propertyName11, jobject24);
-                            jobject14.Add("FActReceiveQty", Convert.ToDecimal(dataRow2["HQTY"]));
-                            jobject14.Add("FOwnerTypeId", "BD_OwnerOrg");
-                            JObject jobject25 = jobject14;
-                            string propertyName12 = "FOwnerID";
+                            jobject24["Fnumber"] = dataRow2["FUNITNUMBER"].ToString();
+                            jobject23.Add(text15, jobject24);
+                            JObject jobject25 = jobject16;
+                            string text16 = "FStockID";
                             JObject jobject26 = new JObject();
-                            jobject26["Fnumber"] = dataRow["FPURCHASEORGNUMBER"].ToString();
-                            jobject25.Add(propertyName12, jobject26);
-                            jobject14.Add("FSrcId", dataRow2["FID"].ToString());
-                            jobject14.Add("FSRCFORMID", "PUR_PurchaseOrder");
-                            jobject14.Add("FSrcBillNo", dataRow2["FBILLNO"].ToString());
-                            jobject14.Add("FSRCENTRYID", dataRow2["FENTRYID"].ToString());
-                            jobject14.Add("FORDERBILLNO", dataRow2["FBILLNO"].ToString());
-                            jobject14.Add("FPOORDERENTRYID", dataRow2["FENTRYID"].ToString());
-                            jobject14.Add("FPrice", dataRow2["FPRICE"].ToString());
-                            jobject14.Add("FTaxPrice", dataRow2["FTAXPRICE"].ToString());
-                            jobject14.Add("FEntryTaxRate", dataRow2["FTAXRATE"].ToString());
-                            JObject jobject27 = jobject14;
-                            string propertyName13 = "FLOT";
+                            jobject26["Fnumber"] = "BJCK-SH.01.005";
+                            jobject25.Add(text16, jobject26);
+                            jobject16.Add("FActReceiveQty", Convert.ToDecimal(dataRow2["HQTY"]));
+                            jobject16.Add("FOwnerTypeId", "BD_OwnerOrg");
+                            JObject jobject27 = jobject16;
+                            string text17 = "FOwnerID";
                             JObject jobject28 = new JObject();
-                            jobject28["Fnumber"] = dataRow2["hbatchno"].ToString();
-                            jobject27.Add(propertyName13, jobject28);
-                            jobject14.Add("FLOT_TEXT", dataRow2["hbatchno"].ToString());
-                            jobject14.Add("FProduceDate", dataRow2["HBeginDate"].ToString());
-                            jobject14.Add("FExpiryDate", dataRow2["HEndDate"].ToString());
-                            jobject14.Add("F_BGP_ShouldQty", dataRow2["F_BGP_ShouldQty"].ToString());
-                            //jobject14.Add("F_RYMA_Assistant", dataRow2["F_RYMA_Assistant"].ToString());
-                            jobject14.Add("FDetailEntity_Link", new JArray
-                            {
-                                new JObject
-                                {
-                                    {
-                                        "FDetailEntity_Link_FRULEID",
-                                        "PUR_PurchaseOrder-PUR_ReceiveBill"
-                                    },
-                                    {
-                                        "FDetailEntity_Link_FSTableName",
-                                        "t_PUR_POOrderEntry"
-                                    },
-                                    {
-                                        "FDetailEntity_Link_FSBillId",
-                                        dataRow2["FID"].ToString()
-                                    },
-                                    {
-                                        "FDetailEntity_Link_FSId",
-                                        dataRow2["FEntryID"].ToString()
-                                    }
-                                }
-                            });
-                            jarray.Add(jobject14);
+                            jobject28["Fnumber"] = dataRow["FPURCHASEORGNUMBER"].ToString();
+                            jobject27.Add(text17, jobject28);
+                            jobject16.Add("FSrcId", dataRow2["FID"].ToString());
+                            jobject16.Add("FSRCFORMID", "PUR_PurchaseOrder");
+                            jobject16.Add("FSrcBillNo", dataRow2["FBILLNO"].ToString());
+                            jobject16.Add("FSRCENTRYID", dataRow2["FENTRYID"].ToString());
+                            jobject16.Add("FORDERBILLNO", dataRow2["FBILLNO"].ToString());
+                            jobject16.Add("FPOORDERENTRYID", dataRow2["FENTRYID"].ToString());
+                            jobject16.Add("FGiveAway", dataRow2["FGIVEAWAY"].ToString());//鏄惁璧犲搧
+                            //jobject16.Add("FPrice", dataRow2["FPRICE"].ToString());
+                            //jobject16.Add("FTaxPrice", dataRow2["FTAXPRICE"].ToString());
+                            //jobject16.Add("FEntryTaxRate", dataRow2["FTAXRATE"].ToString());
+                            JObject jobject29 = jobject16;
+                            string text18 = "FLOT";
+                            JObject jobject30 = new JObject();
+                            jobject30["Fnumber"] = dataRow2["hbatchno"].ToString();
+                            jobject29.Add(text18, jobject30);
+                            jobject16.Add("FLOT_TEXT", dataRow2["hbatchno"].ToString());
+                            jobject16.Add("FProduceDate", dataRow2["HBeginDate"].ToString());
+                            jobject16.Add("FExpiryDate", dataRow2["HEndDate"].ToString());
+                            jobject16.Add("F_BGP_ShouldQty", dataRow2["F_BGP_ShouldQty"].ToString());
+                            jobject16.Add("FPrice", dataRow2["FPRICE"].ToString());
+                            jobject16.Add("FTaxPrice", dataRow2["FTAXPRICE"].ToString());
+                            jobject16.Add("FEntryTaxRate", dataRow2["FTAXRATE"].ToString());
+                            //jobject16.Add("F_UJDY_Qty", dataRow2["HQTY"].ToString());
+                            JObject jobject31 = jobject16;
+                            string text19 = "FDetailEntity_Link";
+                            JArray jarray2 = new JArray();
+                            JObject jobject32 = new JObject();
+                            jobject32.Add("FDetailEntity_Link_FRULEID", "PUR_PurchaseOrder-PUR_ReceiveBill");
+                            jobject32.Add("FDetailEntity_Link_FSTableName", "t_PUR_POOrderEntry");
+                            jobject32.Add("FDetailEntity_Link_FSBillId", dataRow2["FID"].ToString());
+                            jobject32.Add("FDetailEntity_Link_FSId", dataRow2["FEntryID"].ToString());
+                            jarray2.Add(jobject32);
+                            jobject31.Add(text19, jarray2);
+                            jarray.Add(jobject16);
                         }
                         jobject.Add("FDetailEntity", jarray);
-                        JObject jobject29 = new JObject();
-                        JObject jobject30 = jobject29;
-                        string propertyName14 = "FSettleOrgId";
-                        JObject jobject31 = new JObject();
-                        jobject31["Fnumber"] = dataRow["FSETTLEORGNUMBER"].ToString();
-                        jobject30.Add(propertyName14, jobject31);
-                        JObject jobject32 = jobject29;
-                        string propertyName15 = "FSettleCurrId";
                         JObject jobject33 = new JObject();
-                        jobject33["Fnumber"] = dataRow["FSETTLECURRNUMBER"].ToString();
-                        jobject32.Add(propertyName15, jobject33);
-                        jobject29.Add("FPricePoint", 0);
-                        jobject.Add("FinanceEntity ", jobject29);
-                        JObject jobject34 = new JObject();
-                        jobject34["Creator"] = "";
-                        jobject34["NeedUpDateFields"] = new JArray();
-                        jobject34["NeedReturnFields"] = new JArray();
-                        jobject34["IsDeleteEntry"] = "false";
-                        jobject34["SubSystemId"] = "";
-                        jobject34["IsVerifyBaseDataField"] = "false";
-                        jobject34["Model"] = jobject;
-                        JObject jobject35 = jobject34;
-                        string text3 = InvokeHelper.Login();
-                        int num = JObject.Parse(text3)["LoginResultType"].Value<int>();
-                        bool flag6 = num == 0;
-                        if (flag6)
+                        JObject jobject34 = jobject33;
+                        string text20 = "FSettleOrgId";
+                        JObject jobject35 = new JObject();
+                        jobject35["Fnumber"] = dataRow["FSETTLEORGNUMBER"].ToString();
+                        jobject34.Add(text20, jobject35);
+                        JObject jobject36 = jobject33;
+                        string text21 = "FSettleCurrId";
+                        JObject jobject37 = new JObject();
+                        jobject37["Fnumber"] = dataRow["FSETTLECURRNUMBER"].ToString();
+                        jobject36.Add(text21, jobject37);
+                        jobject33.Add("FPricePoint", 0);
+                        jobject.Add("FinanceEntity ", jobject33);
+                        JObject jobject38 = new JObject();
+                        jobject38["Creator"] = "";
+                        jobject38["NeedUpDateFields"] = new JArray();
+                        jobject38["NeedReturnFields"] = new JArray();
+                        jobject38["IsDeleteEntry"] = "false";
+                        jobject38["SubSystemId"] = "";
+                        jobject38["IsVerifyBaseDataField"] = "false";
+                        jobject38["Model"] = jobject;
+                        JObject jobject39 = jobject38;
+                        string text22 = InvokeHelper.Login();
+                        int num = Extensions.Value<int>(JObject.Parse(text22)["LoginResultType"]);
+                        bool flag16 = num == 0;
+                        bool flag17 = flag16;
+                        bool flag18 = flag17;
+                        if (flag18)
                         {
                             this.objJsonResult.code = "0";
                             this.objJsonResult.count = 0;
-                            this.objJsonResult.Message = text3;
+                            this.objJsonResult.Message = text22;
                             this.objJsonResult.data = null;
                             return this.objJsonResult;
                         }
-                        string text4 = InvokeHelper.Save("PUR_ReceiveBill", jobject35.ToString());
-                        bool flag7 = JObject.Parse(text4)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE";
-                        if (!flag7)
+                        string text23 = InvokeHelper.Save("PUR_ReceiveBill", jobject39.ToString());
+                        bool flag19 = JObject.Parse(text23)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE";
+                        bool flag20 = !flag19;
+                        bool flag21 = flag20;
+                        if (flag21)
                         {
                             this.objJsonResult.code = "0";
                             this.objJsonResult.count = 0;
-                            this.objJsonResult.Message = text4;
+                            this.objJsonResult.Message = text23;
                             this.objJsonResult.data = null;
                             return this.objJsonResult;
                         }
-                        string text5 = JObject.Parse(text4)["Result"]["Number"].ToString();
-                        text2 = JObject.Parse(text4)["Result"]["Id"].ToString();
+                        string text24 = JObject.Parse(text23)["Result"]["Number"].ToString();
+                        text2 = JObject.Parse(text23)["Result"]["Id"].ToString();
                     }
                     else
                     {
@@ -4379,55 +4526,55 @@
                 }
                 else
                 {
-                    JObject jobject36 = new JObject();
-                    jobject36.Add("Creator", "");
-                    jobject36.Add("NeedUpDateFields", new JArray());
-                    jobject36.Add("NeedReturnFields", new JArray());
-                    jobject36.Add("IsDeleteEntry", "false");
-                    jobject36.Add("SubSystemId", "");
-                    jobject36.Add("IsVerifyBaseDataField", "");
-                    JObject jobject37 = new JObject();
-                    jobject37.Add("FID", text2);
-                    JArray jarray2 = new JArray();
+                    JObject jobject40 = new JObject();
+                    jobject40.Add("Creator", "");
+                    jobject40.Add("NeedUpDateFields", new JArray());
+                    jobject40.Add("NeedReturnFields", new JArray());
+                    jobject40.Add("IsDeleteEntry", "false");
+                    jobject40.Add("SubSystemId", "");
+                    jobject40.Add("IsVerifyBaseDataField", "");
+                    JObject jobject41 = new JObject();
+                    jobject41.Add("FID", text2);
+                    JArray jarray3 = new JArray();
                     foreach (ReciveBill_FastModel reciveBill_FastModel in list)
                     {
-                        bool flag8 = reciveBill_FastModel.HSQty == 0m;
-                        if (!flag8)
+                        bool flag22 = reciveBill_FastModel.HSQty == 0m;
+                        bool flag23 = !flag22;
+                        bool flag24 = flag23;
+                        if (flag24)
                         {
-                            jarray2.Add(new JObject
-                            {
-                                {
-                                    "FEntryID",
-                                    reciveBill_FastModel.FEntryID
-                                },
-                                {
-                                    "FActReceiveQty ",
-                                    reciveBill_FastModel.HSQty
-                                }
-                            });
+                            JArray jarray4 = jarray3;
+                            JObject jobject42 = new JObject();
+                            jobject42.Add("FEntryID", reciveBill_FastModel.FEntryID);
+                            jobject42.Add("FActReceiveQty ", reciveBill_FastModel.HSQty);
+                            jarray4.Add(jobject42);
                         }
                     }
-                    jobject37.Add("FDetailEntity", jarray2);
-                    jobject36.Add("Model", jobject37);
-                    string text6 = InvokeHelper.Login();
-                    int num2 = JObject.Parse(text6)["LoginResultType"].Value<int>();
-                    bool flag9 = num2 <= 0;
-                    if (flag9)
+                    jobject41.Add("FDetailEntity", jarray3);
+                    jobject40.Add("Model", jobject41);
+                    string text25 = InvokeHelper.Login();
+                    int num2 = Extensions.Value<int>(JObject.Parse(text25)["LoginResultType"]);
+                    bool flag25 = num2 <= 0;
+                    bool flag26 = flag25;
+                    bool flag27 = flag26;
+                    if (flag27)
                     {
                         this.objJsonResult.code = "0";
                         this.objJsonResult.count = 0;
-                        this.objJsonResult.Message = text6;
+                        this.objJsonResult.Message = text25;
                         this.objJsonResult.data = null;
                         return this.objJsonResult;
                     }
-                    string text7 = InvokeHelper.Save("PUR_ReceiveBill", jobject36.ToString());
-                    bool flag10 = JObject.Parse(text7)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE";
-                    if (flag10)
+                    string text26 = InvokeHelper.Save("PUR_ReceiveBill", jobject40.ToString());
+                    bool flag28 = JObject.Parse(text26)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE";
+                    bool flag29 = flag28;
+                    bool flag30 = flag29;
+                    if (flag30)
                     {
-                        LogService.Write("鏀舵枡閫氱煡鍗曚慨鏀瑰け璐sonRoot:" + jobject36.ToString(), "Vlog", true);
+                        LogService.Write("鏀舵枡閫氱煡鍗曚慨鏀瑰け璐sonRoot:" + jobject40.ToString(), "Vlog", true);
                         this.objJsonResult.code = "0";
                         this.objJsonResult.count = 0;
-                        this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟洿鏂板け璐�" + text7;
+                        this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟洿鏂板け璐�" + text26;
                         this.objJsonResult.data = null;
                         return this.objJsonResult;
                     }
@@ -4436,29 +4583,33 @@
                 {
                     Ids = text2
                 };
-                string text8 = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject( f__AnonymousType));
-                JObject jobject38 = JObject.Parse(text8);
-                bool flag11 = jobject38["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE";
-                if (flag11)
+                string text27 = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject(f__AnonymousType));
+                JObject jobject43 = JObject.Parse(text27);
+                bool flag31 = jobject43["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE";
+                bool flag32 = flag31;
+                bool flag33 = flag32;
+                if (flag33)
                 {
-                    LogService.Write("鏀舵枡閫氱煡鍗曟彁浜ゅけ璐sonRoot:" +  f__AnonymousType.ToString(), "Vlog", true);
+                    LogService.Write("鏀舵枡閫氱煡鍗曟彁浜ゅけ璐sonRoot:" + f__AnonymousType.ToString(), "Vlog", true);
                     this.objJsonResult.code = "0";
                     this.objJsonResult.count = 0;
-                    this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟彁浜ゅけ璐�" + text8;
+                    this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟彁浜ゅけ璐�" + text27;
                     this.objJsonResult.data = null;
                     result = this.objJsonResult;
                 }
                 else
                 {
-                    text8 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject( f__AnonymousType));
-                    jobject38 = JObject.Parse(text8);
-                    bool flag12 = jobject38["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE";
-                    if (flag12)
+                    text27 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(f__AnonymousType));
+                    jobject43 = JObject.Parse(text27);
+                    bool flag34 = jobject43["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE";
+                    bool flag35 = flag34;
+                    bool flag36 = flag35;
+                    if (flag36)
                     {
-                        LogService.Write("鏀舵枡閫氱煡鍗曞鏍稿け璐sonRoot:" +  f__AnonymousType.ToString(), "Vlog", true);
+                        LogService.Write("鏀舵枡閫氱煡鍗曞鏍稿け璐sonRoot:" + f__AnonymousType.ToString(), "Vlog", true);
                         this.objJsonResult.code = "0";
                         this.objJsonResult.count = 0;
-                        this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曞鏍稿け璐sonRoot" + text8;
+                        this.objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曞鏍稿け璐sonRoot" + text27;
                         this.objJsonResult.data = null;
                         result = this.objJsonResult;
                     }
@@ -4483,6 +4634,62 @@
             return result;
         }
 
+
+
+        //public object AuditPOInStockBillPost_AR([FromBody] JObject msg)
+        //{     
+        //    string msg1 = msg["msg"].ToString();
+        //    msg1 = msg1.Replace("\\", "");
+        //    msg1 = msg1.Replace("\n", "");
+        //    msg1 = msg1.Substring(1, msg1.Length-2);
+        //    try
+        //    {
+        //        List<Model.ClsCg_POInStockBillMain> lsmain = new List<Model.ClsCg_POInStockBillMain>();
+        //        ListModels oListModels = new ListModels();
+        //        lsmain = oListModels.getPOInStockBillMainByJson(msg1);
+        //        lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+        //        lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+        //        string sSourceBillType = "1103";
+
+        //        WebAPI.WebS.ClsCg_POInStockBillMain websLsmain = new WebS.ClsCg_POInStockBillMain();
+
+        //        websLsmain.HInterID = lsmain[0].HInterID;
+        //        websLsmain.HBillNo = lsmain[0].HBillNo;
+        //        //websLsmain.HBillType = "1103";//鍥哄畾鍊�
+        //        websLsmain.HDate = lsmain[0].HDate;
+        //        //websLsmain.HDeptID = lsmain[0].HDeptID;
+        //        //websLsmain.HEmpID = 0;
+        //        //websLsmain.HBillerID = lsmain[0].HBillerID;
+        //        //websLsmain.HRemark = "";
+        //        //websLsmain.HMainSourceBillType = lsmain[0].HBillType;
+
+
+        //        if (webserver.set_SavePOInStockBill_NEW_Json(websLsmain, ref DBUtility.ClsPub.sErrInfo))
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = "鎴愬姛锛佸崟鎹彿涓猴細";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "涓婁紶澶辫触锛�" + e.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
 
 
         #region PDA鍏朵粬鍑哄簱
@@ -4572,7 +4779,7 @@
                         '@'
                     });
                     string text = array[0];
-                    long num = ClsPub.isLong(array[4]);
+                    Double num = ClsPub.isDoule(array[4]);
                     string text2 = array[6];
                     DateTime dateTime = ClsPub.isDate(array[3]);
                     DateTime dateTime2 = ClsPub.isDate(array[5]);
@@ -4854,6 +5061,7 @@
 ,D.FSUPPLIERID,DS.FNUMBER AS FSUPPLIERNUMBER,D.FPURCHASEORGID,DOO.FNUMBER AS FPURCHASEORGNUMBER,CROO.FNUMBER  AS FSETTLEORGNUMBER,
 E.FPRICETIMEPOINT,E.FSETTLECURRID,EC.FNUMBER AS FSETTLECURRNUMBER,C.FMATERIALID,CM.FNUMBER AS FMATERIALNUMBER ,C.FUNITID 
 ,CU.FNUMBER AS FUNITNUMBER,CR.FPRICE,CR.FTAXPRICE,CR.FTAXRATE,D.FPURCHASERID,isnull(T4.FNUMBER,'') AS FPURCHASERNUMBER
+,C.FGIVEAWAY AS FGIVEAWAY   
 FROM CG_POINSTOCKBILLSUB B  
 JOIN CG_POINSTOCKBILLMAIN M ON B.HINTERID = M.HINTERID
 JOIN {0}..T_PUR_POORDERENTRY C ON B.HSOURCEINTERID = C.FID AND B.HSOURCEENTRYID = C.FENTRYID
@@ -4937,6 +5145,7 @@
                                 FentityModel.Add("FPrice", item["FPRICE"].ToString());//鍗曚环
                                 FentityModel.Add("FTaxPrice", item["FTAXPRICE"].ToString());//鍚◣鍗曚环
                                 FentityModel.Add("FEntryTaxRate", item["FTAXRATE"].ToString());//绋庣巼
+                                FentityModel.Add("FGiveAway", item["FGIVEAWAY"].ToString());//鏄惁璧犲搧
 
                                 JArray Fentity2 = new JArray();
                                 JObject FentityModel2 = new JObject();
@@ -5222,7 +5431,7 @@
                 };
                 string result1 = string.Empty;
                 string result2 = string.Empty;
-                DataSet Ds = oCn.RunProcReturn("select FDOCUMENTSTATUS,FID from  AIS20210811135644..T_PUR_RECEIVE where FBILLNO='" + HBarCode + "'", "AIS20210811135644..T_PUR_RECEIVE");
+                DataSet Ds = oCn.RunProcReturn("select FDOCUMENTSTATUS,FID from  AIS20220914133941..T_PUR_RECEIVE where FBILLNO='" + HBarCode + "'", "AIS20220914133941..T_PUR_RECEIVE");
                 //鍒ゆ柇褰撳墠鏀舵枡閫氱煡鍗曠姸鎬佲�斺�斿凡鍒涘缓鍒欏厛鎻愪氦鍐嶅鏍搞�佷互鎻愪氦鍒欏彧瀹℃牳
                 if (Ds.Tables[0].Rows[0][0].ToString() == "A" || Ds.Tables[0].Rows[0][0].ToString() == "D")
                 {

--
Gitblit v1.9.1