From 3de884ee5ba5d4a5f037a3e410246e14a819def9 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期二, 13 九月 2022 17:32:39 +0800
Subject: [PATCH] 到货确认

---
 WebAPI/Controllers/POStockInBillController.cs |  128 +++++++++++++++++++++++++++++++++---------
 1 files changed, 101 insertions(+), 27 deletions(-)

diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index da59411..e0deca2 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -709,6 +709,7 @@
                 websLsmain.HDeptID = lsmain[0].HDeptID;
                 websLsmain.HWHID = lsmain[0].HWHID;
                 websLsmain.HSCWHID = 0;
+                //websLsmain.HSPID = lsmain[0].HSPID;
                 websLsmain.HSupID = lsmain[0].HSupID;
                 websLsmain.HKeeperID = lsmain[0].HKeeperID;
                 websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
@@ -716,11 +717,13 @@
                 websLsmain.HManagerID = 0;
                 websLsmain.HBillerID = lsmain[0].HBillerID;
                 websLsmain.HRemark = "";
+                websLsmain.HExplanation = lsmain[0].HExplanation;
                 websLsmain.HInnerBillNo = "";
                 websLsmain.HRedBlueFlag = false;//false钃濆瓧 true绾㈠瓧
                 websLsmain.HMainSourceBillType = lsmain[0].HBillType;
-                websLsmain.HExplanation = lsmain[0].HExplanation;
-
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
 
                 if (webserver.set_SavePOStockInBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
                 {
@@ -844,8 +847,6 @@
                 return objJsonResult;
             }
         }
-
-
         [Route("POStockInBill/Delete_Json")]
         [HttpGet]
         public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType)
@@ -982,7 +983,6 @@
             }
             catch (Exception)
             {
-
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "鍒犻櫎澶辫触锛�";
@@ -1000,25 +1000,27 @@
         {
             try
             {
-                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
-                string sql = $"select * from H_v_SRM_POInStockBillList where 鍗曟嵁鍙� ='{HBillno}'";
-                ds = oCn.RunProcReturn(sql, "H_v_SRM_POInStockBillList");
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "Sucess锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+                json result = Get_ReciveBillCheckDate(HBillno);
+                return result;
+                //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                //string sql = $"select * from H_v_SRM_POInStockBillList where 鍗曟嵁鍙� ='{HBillno}'";
+                //ds = oCn.RunProcReturn(sql, "H_v_SRM_POInStockBillList");
+                //if (ds == null || ds.Tables[0].Rows.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //else
+                //{
+                //    objJsonResult.code = "1";
+                //    objJsonResult.count = 1;
+                //    objJsonResult.Message = "Sucess锛�";
+                //    objJsonResult.data = ds.Tables[0];
+                //    return objJsonResult;
+                //}
             }
             catch (Exception e)
             {
@@ -1172,7 +1174,7 @@
                                 };
                                 var loginRet = InvokeHelper.Login();
                                 var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
-                                if (isSuccess == 0)
+                                if (isSuccess <= 0)
                                 {
                                     objjson.code = "0";
                                     objjson.count = 0;
@@ -1328,7 +1330,7 @@
                                 };
                                 var loginRet = InvokeHelper.Login();
                                 var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
-                                if (isSuccess == 0)
+                                if (isSuccess < 0)
                                 {
                                     objjson.code = "0";
                                     objjson.count = 0;
@@ -1336,7 +1338,7 @@
                                     objjson.data = null;
                                     return objjson;
                                 }
-                                LogService.Write("jsonRoot:" + jsonRoot.ToString());
+                                //LogService.Write("jsonRoot:" + jsonRoot.ToString());
                                 var result = InvokeHelper.Save("PUR_ReceiveBill", jsonRoot.ToString());
                                 //LogService.Write(result);
                                 if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE")
@@ -1408,6 +1410,11 @@
             return HInterID;
         }
 
+        /// <summary>
+        /// 鍒拌揣纭鎵敹鏂欓�氱煡鍗曞彿 鑾峰彇琛ㄤ綋鍜岃〃澶存暟鎹�
+        /// </summary>
+        /// <param name="HBarCode"></param>
+        /// <returns></returns>
         public json Get_ReciveBillCheckDate(string HBarCode)
         {
             json objjson = new json();
@@ -1454,6 +1461,73 @@
             }
         }
 
+        //[Route("POStockInBillList/AuditPOInStockBillPost")]
+        //[HttpGet]
+        //public object AuditPOInStockBill([FromBody] JObject msg) {
+        //    string _msg = msg.ToString();
+
+        //    objJsonResult.code = "0";
+        //    objJsonResult.count = 0;
+        //    objJsonResult.Message = s;
+        //    objJsonResult.data = null;
+        //    return objJsonResult;
+        //}
+
+        /// <summary>
+        /// 鍒拌揣纭 鎵潯鐮� 鏍¢獙
+        /// </summary>
+        /// <param name="HBarcode"></param>
+        /// <param name="HInterID"></param>
+        /// <returns></returns>
+        [Route("POStockInBillList/Get_ReciveBillByBarcode")]
+        [HttpGet]
+        public object Get_ReciveBillByBarcode(string HBarcode, string HInterID)
+        {
+            try
+            {
+                //鏍¢獙鏉$爜鏄惁瀛樺湪
+                string sql = $"select* from  Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode}'";
+                DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList") ; 
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏉$爜涓嶅瓨鍦紒";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+                //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                //string sql = $"select * from H_v_SRM_POInStockBillList where 鍗曟嵁鍙� ='{HBillno}'";
+                //ds = oCn.RunProcReturn(sql, "H_v_SRM_POInStockBillList");
+                //if (ds == null || ds.Tables[0].Rows.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //else
+                //{
+
+                //}
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
         //鏀舵枡閫氱煡鍗曞鏍� 瀹℃牳鎻愪氦
         [Route("POStockInBillList/Exec_ReciveBillCheck")]
         [HttpGet]

--
Gitblit v1.9.1