From 466e6a2a0f3363cadaf24296c9285a57aafc078a Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期一, 11 七月 2022 13:58:03 +0800
Subject: [PATCH] nothing

---
 WebAPI/Controllers/POStockInBillController.cs |  156 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 153 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 73cdd77..e180af3 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -1,5 +1,6 @@
 锘縰sing DBUtility;
 using Model;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using SQLHelper;
 using System;
@@ -136,7 +137,7 @@
                 WebS.WebService1 oWebs = new WebS.WebService1();
                 WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
                 string sExpressNumber = "";
-                WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
+                WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
                 if (WebSoBar == null)
                 {
                     objJsonResult.code = "0";
@@ -347,6 +348,7 @@
         {
             try
             {
+                LogService.Write("鎵ц鎴愬姛!");
                 // DataSet ds = new DataSet();
                 // WebServer webserver = new WebServer();
                 string sWhere = " Where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "'";
@@ -377,7 +379,7 @@
                 {
                     HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]);
                     HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]);
-                    if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, HBillType, HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo))
+                    if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, "3711", HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo))
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 1;
@@ -1029,6 +1031,7 @@
 
         }
 
+
         //[Route("POStockInBillList/confirm")]
         //public object confirm(string hmainid)
         //{
@@ -1063,7 +1066,7 @@
         //            FentityModel.Add("FSRCENTRYID", item["FHPOOrderEntryID"].ToString());//婧愬崟鍒嗗綍鍐呯爜
         //            FentityModel.Add("FORDERBILLNO", item["FHPOOrderBillNo"].ToString());//婧愬崟鍗曞彿
         //            FentityModel.Add("FPOORDERENTRYID", item["FHPOOrderEntryID"].ToString());//婧愬崟鍒嗗綍鍐呯爜
-                   
+
 
         //            JArray Fentity2 = new JArray();
         //            JObject FentityModel2 = new JObject();
@@ -1108,5 +1111,152 @@
 
         //}
         #endregion
+
+        #region [鏀舵枡閫氱煡鍗曞鏍竇
+        //鏀舵枡閫氱煡鍗曞鏍� 鎵潯鐮�
+        [Route("POStockInBillList/Get_ReciveBillCheckDate")]
+        [HttpGet]
+        public object Get_ReciveBillCheckDate(string HBarCode)
+        {
+            try
+            {
+                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                DataSet Ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_Temp_Add_POInStockCheck2 '" + HBarCode + "'", "h_p_KF_PonderationBillMain_Temp_Add_POInStockCheck2");
+                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 0)
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "Sucess锛�";
+                        objJsonResult.data = Ds.Tables[0];
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+        }
+
+        //鏀舵枡閫氱煡鍗曞鏍� 瀹℃牳鎻愪氦
+        [Route("POStockInBillList/Exec_ReciveBillCheck")]
+        [HttpGet]
+        public object Exec_ReciveBillCheck(string HBarCode)
+        {
+            try
+            {
+                //淇敼閲戣澏鐢熶骇鍗曠殑鐘舵��
+                //璁块棶閲戣澏
+                var loginRet = InvokeHelper.Login();
+                var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
+
+                if (isSuccess == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎿嶄綔澶辫触,閲戣澏璐﹀彿鐧诲綍寮傚父銆�" + loginRet;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                var json = new
+                {
+                    //CreateOrgId = 0,
+                    Numbers = HBarCode,
+                    //Ids = (EntyID).Split('-')[0],
+                    //PkEntryIds = (EntyID).Split('-')[1]
+                };
+                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");
+                //鍒ゆ柇褰撳墠鏀舵枡閫氱煡鍗曠姸鎬佲�斺�斿凡鍒涘缓鍒欏厛鎻愪氦鍐嶅鏍搞�佷互鎻愪氦鍒欏彧瀹℃牳
+                if (Ds.Tables[0].Rows[0][0].ToString() == "A"|| Ds.Tables[0].Rows[0][0].ToString() == "D")
+                {
+                    result1 = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject(json));
+                    result2 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json));
+                }
+                if (Ds.Tables[0].Rows[0][0].ToString() == "B")
+                {
+                    result2 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json));
+                }
+                //鍒ゆ柇瀹℃牳鏄惁鎴愬姛
+                if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳鏀舵枡閫氱煡鍗曞け璐ワ紒鍗曟嵁鍙凤細" + HBarCode;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+        }
+        #endregion
+
+        #region PDA閿�鍞嚭搴�
+        //PDA閿�鍞嚭搴撴暣鎵樺垹闄�
+        [Route("POStockInBillList/SellOutBillSDeleCode")]
+        [HttpGet]
+        public object SellOutBillSDeleCode(string HBarCode,string HInterID)
+        {
+            try
+            {
+                //鏍规嵁鏉$爜鍦ㄦ潯鐮佹。妗堜腑鎵惧埌瀵瑰簲鐨勬墭鏉$爜锛屽啀鍦ㄤ复鏃惰〃涓垹闄よ鎵樻潯鐮佺殑鍏ㄩ儴璁板綍
+                string sql = string.Format(@"delete from KF_PonderationBillMain_Temp where HBillType=1205 and HInterID=" + HInterID + " and HBarCode" +
+                    " in (select HBarCode from Gy_BarCodeBill where HBarCode_Pack = (select HBarCode_Pack from Gy_BarCodeBill where HBarCode = '"+ HBarCode + "'))");
+                oCn.RunProc(sql);
+                
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏁存墭鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1