From acdbefae8e00a3d32b17fd23c95ad31c73d9566f Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 07 六月 2022 09:57:39 +0800
Subject: [PATCH] nothing

---
 WebAPI/Controllers/Kf_EntrustInBillController.cs |  140 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 140 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/Kf_EntrustInBillController.cs b/WebAPI/Controllers/Kf_EntrustInBillController.cs
index a3059f5..4df6b2d 100644
--- a/WebAPI/Controllers/Kf_EntrustInBillController.cs
+++ b/WebAPI/Controllers/Kf_EntrustInBillController.cs
@@ -44,6 +44,7 @@
         private JsonResult objJsonResult = new JsonResult();
         public WebS.WebService1 oWebs = new WebS.WebService1();
         public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
+        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
 
         /// <summary>
         /// 濮斿鍏ュ簱/鎵潯鐮�/鐩存帴璋僿ebservice
@@ -436,5 +437,144 @@
                 return objJsonResult;
             }
         }
+
+
+        #region 濮斿鍑哄簱
+        /// <summary>
+        /// 濮斿鍑哄簱/鎻愪氦/鐩存帴璋冪敤webservice
+        /// </summary>
+        /// <returns></returns>
+        [Route("Kf_EntrustInBill/set_SaveEntrustOutBill_Json")]
+        [HttpPost]
+        public object set_SaveEntrustOutBill_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+            try
+            {
+                List<Model.ClsKf_EntrustInBillMain> lsmain = new List<Model.ClsKf_EntrustInBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getEntrustInBillMainByJson(msg1);
+                lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                lsmain[0].HBillType = "1211";
+
+                WebAPI.WebS.ClsKf_EntrustInBillMain websLsmain = new WebS.ClsKf_EntrustInBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HInnerBillNo = "";
+                websLsmain.HDate = lsmain[0].HDate;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = lsmain[0].HBillType;
+                websLsmain.HBillerID = DBUtility.ClsPub.isLong(DBUtility.ClsPub.CurUserID);
+                websLsmain.HDeptID = lsmain[0].HDeptID;
+                websLsmain.HEmpID = lsmain[0].HEmpID;
+                websLsmain.HRemark = "";
+                websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HSupID = lsmain[0].HSupID;
+                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
+                websLsmain.HSCWHID = lsmain[0].HSCWHID;
+                websLsmain.HKeeperID = lsmain[0].HKeeperID;
+                websLsmain.HMainSourceBillType = "1604";
+                websLsmain.HMangerID = lsmain[0].HMangerID;
+                websLsmain.HWHID = lsmain[0].HWHID;
+                websLsmain.HExplanation = lsmain[0].HExplanation;
+                websLsmain.HBillType = "1211";//鍥哄畾鍊�
+
+                string sSourceBillType = "1604";
+
+                if (webserver.set_SaveEntrustInBill_New(websLsmain, sSourceBillType, 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 = websLsmain;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "涓婁紶澶辫触锛佸紓甯�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 濮斿鍑哄簱 鎵弿婧愬崟锛屽皢婧愬崟淇℃伅鍐欏叆鏉$爜涓存椂琛�
+        /// </summary>
+        /// <param name="HSourceBillNo"></param>
+        /// <returns></returns>
+        [Route("Kf_EntrustInBill/GetWW_PPBomBillMainByHSourceBillNo")]
+        [HttpGet]
+        public object GetWW_PPBomBillMainByHSourceBillNo(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo)
+        {
+            try
+            {
+                string sWhere = " Where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "%'";
+                if (HSourceBillType == "1604")
+                {
+                    ds = oCn.RunProcReturn("Select HBillNo,HSupID,s.HName HSupName from WW_PPBomBillMain a left join Gy_Supplier s on a.HSupID=s.HItemID Where HBillNo='" + HSourceBillNo+"'", "WW_PPBomBillMain");
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍,婧愬崟绫诲瀷鏈夐敊璇紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+                }
+                else
+                {
+                    if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, "1211", HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                        objJsonResult.data = ds.Tables[0];
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍐欏叆涓存椂琛ㄥけ璐ワ紒" + DBUtility.ClsPub.sErrInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }

--
Gitblit v1.9.1