From 76ca893a64258c63a31058331e0bb34560542e21 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 29 十二月 2025 14:11:33 +0800
Subject: [PATCH] 海城报废单生成其他出库单

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs |   93 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 88 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index e21742b..62052b9 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -10766,11 +10766,23 @@
 
                 if (bResult)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //鎴愬姛锛�
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    if(setOutBill(msg))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //鎴愬姛锛�
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                   
                 }
                 else
                 {
@@ -10790,6 +10802,77 @@
                 return objJsonResult;
             }
         }
+
+        public bool setOutBill([FromBody] JObject msg)
+        {
+
+
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string sMainStr = sArray[0].ToString();         //涓昏〃鏁版嵁
+            string sSubStr = sArray[1].ToString();          //瀛愯〃鏁版嵁
+            string HMaker = sArray[2].ToString();           //鍒跺崟浜�
+            try
+            {
+                //List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>();
+                ListModels oListModels = new ListModels();
+                sMainStr = sMainStr.Replace("\\", "");
+                sMainStr = sMainStr.Replace("\n", "");
+                sMainStr = "[" + sMainStr.ToString() + "]";
+                //lsmain = oListModels.getOtherOutBillMainByJson(sMainStr);
+                List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr);
+                //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                string sSourceBillType = "3832";
+
+                WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain();
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HDate = lsmain[0].HDate;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HSupID = lsmain[0].HSupID;
+                websLsmain.HDeptID = lsmain[0].HDeptID;
+                websLsmain.HEmpID = lsmain[0].HKeeperID;
+                websLsmain.HKeeperID = lsmain[0].HKeeperID;
+                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
+                websLsmain.HRemark = lsmain[0].HRemark??"test";
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HBillerID = 0;
+                websLsmain.HSTOCKORGID = 100038;
+                websLsmain.HOWNERID = 100038;
+                websLsmain.HBillType = "1206";//鍥哄畾鍊�
+                websLsmain.HBillSubType = "test";
+                WebS.WebService1 oWebs = new WebS.WebService1();
+                WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
+                if (oWebs.set_SaveOtherOutBill_New_haicheng(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
+                    objJsonResult.data = null;
+                    return true;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    objJsonResult.data = null;
+                    return false;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "涓婁紶澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return false;
+            }
+            return true;
+        }
+
         #endregion
 
         #region [妯″叿澶勭悊鍑哄簱鍗曞垹闄ゅ姛鑳絔

--
Gitblit v1.9.1