From c4c02944532a9bfda6de9a0cd85a9dfa631ed003 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期六, 17 五月 2025 15:28:19 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/POStockInBillController.cs |   92 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 75 insertions(+), 17 deletions(-)

diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index c65a35e..80202ac 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -5013,7 +5013,16 @@
         {
             try
             {
-                string _msg = msg["msg"].ToString();
+                string HMaker ="";           //鍒跺崟浜�
+                var _value = msg["msg"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string _msg = sArray[0].ToString();
+                if(sArray.Length>1)
+                {
+                    HMaker = sArray[1].ToString();
+                }
+
                 _msg = _msg.Replace("\\", "");
                 _msg = _msg.Replace("\n", "");
                 List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg);
@@ -5174,7 +5183,8 @@
                                 ["IsVerifyBaseDataField"] = "false",
                                 ["Model"] = model
                             };
-                            var loginRet = InvokeHelper.Login();
+                            //鐧诲綍
+                            var loginRet = InvokeHelper.LoginUser(HMaker);
                             var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                             if (isSuccess == 0)
                             {
@@ -5220,7 +5230,54 @@
                         LogService.Write("鏀舵枡閫氱煡鍗曞鏍告棤鏁版嵁锛�" + sql);
                     }
                 }
-                else //澶忓疂 锛屾洿鏂癳rp淇℃伅
+                else if(FCusName.Contains("澶忓疂"))
+                {
+                    JObject jsonRoot = new JObject();
+                    jsonRoot.Add("Creator", "");
+                    jsonRoot.Add("NeedUpDateFields", new JArray());
+                    jsonRoot.Add("NeedReturnFields", new JArray());
+                    jsonRoot.Add("IsDeleteEntry", "True"); //娉ㄦ剰IsDeleteEntry鍙傛暟锛屽涓篢rue锛屽垯鍘熷垎褰曡鐨凢EntryId鏈湪鍒嗗綍json鍑虹幇鐨勮锛屽皢浼氳鍒犻櫎 锛堝鏃犻渶鍒犻櫎鍒嗗綍琛岋紝鍙敼涓篺asle锛�
+                    jsonRoot.Add("SubSystemId", "");
+                    jsonRoot.Add("IsVerifyBaseDataField", "");
+
+                    JObject jsonModel = new JObject();
+                    jsonModel.Add("FID", FID);
+                    JArray Entry = new JArray();
+                    foreach (var item in list)
+                    {
+                        if (item.HSQty == 0)
+                            continue;
+                        JObject jsonFPOOrderEntry = new JObject();
+                        jsonFPOOrderEntry.Add("FEntryID", item.FEntryID);
+                        jsonFPOOrderEntry.Add("FActReceiveQty ", item.HSQty); ;
+                        Entry.Add(jsonFPOOrderEntry);
+                    }
+                    jsonModel.Add("FDetailEntity", Entry);
+                    jsonRoot.Add("Model", jsonModel);
+                    //鐧诲綍
+                    var loginRet = InvokeHelper.LoginUser(HMaker);
+                    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 result = InvokeHelper.Save("PUR_ReceiveBill", jsonRoot.ToString());
+                    //LogService.Write(result);
+                    if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                    {
+                        LogService.Write("鏀舵枡閫氱煡鍗曚慨鏀瑰け璐sonRoot:" + jsonRoot.ToString());
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曟洿鏂板け璐�" + result;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else //鏇存柊erp淇℃伅
                 {
                     JObject jsonRoot = new JObject();
                     jsonRoot.Add("Creator", "");
@@ -5244,7 +5301,8 @@
                     }
                     jsonModel.Add("FDetailEntity", Entry);
                     jsonRoot.Add("Model", jsonModel);
-                    var loginRet = InvokeHelper.Login();
+                    //鐧诲綍
+                    var loginRet = InvokeHelper.LoginUser(HMaker);
                     var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                     if (isSuccess <= 0)
                     {
@@ -5318,21 +5376,21 @@
         }
 
         [Route("POStockInBillList/AuditPOInStockBillPost_TianKang")]
-        [HttpPost]
-        public object AuditPOInStockBill_TianKang([FromBody] JObject msg)
+        [HttpGet]
+        public object AuditPOInStockBill_TianKang(long FID,string user)
         {
             try
             {
-                string _msg = msg["msg"].ToString();
-                _msg = _msg.Replace("\\", "");
-                _msg = _msg.Replace("\n", "");
-                List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg);
-                DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill();
-                var hinterID = list[0].HInterID;
-                var FID = list[0].FID;
-                string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);//瀹㈡埛鍚嶇О               
-                var kdTbaleName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");
-                string sql = string.Empty;
+                //string _msg = msg["msg"].ToString();
+                //_msg = _msg.Replace("\\", "");
+                //_msg = _msg.Replace("\n", "");
+                //List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg);
+                //DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill();
+                //var hinterID = list[0].HInterID;
+                //var FID = list[0].FID;
+                //string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);//瀹㈡埛鍚嶇О               
+                //var kdTbaleName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");
+                //string sql = string.Empty;
                                               
                 var json = new
                 {
@@ -5340,7 +5398,7 @@
                 };
                 //LogService.Write(json);
                 //鐧诲綍
-                var loginRet = InvokeHelper.Login();
+                var loginRet = InvokeHelper.LoginUser(user);
                 var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                 if (isSuccess <= 0)
                 {

--
Gitblit v1.9.1