From 4bfab3d9173fcced07cea4afb71227b83b47c469 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 25 六月 2024 12:32:22 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs |  156 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 145 insertions(+), 11 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index e54ea8a..6309077 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -1860,7 +1860,7 @@
                 if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
                     objJsonResult.data = null;
                     return objJsonResult;
@@ -1869,7 +1869,7 @@
                 if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                 {
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                     objJsonResult.data = null;
                     return objJsonResult;
@@ -1894,11 +1894,11 @@
                 oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOutStockToPOStockIn_Delete " + HInterID);
 
 
-                //oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
-                //oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
 
-                string sql = "exec h_p_WMS_ICStockBillAndWMS_Delete " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','1205'";
-                oCn.RunProc(sql);
+                //string sql = "exec h_p_WMS_ICStockBillAndWMS_Delete " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','1205'";
+                //oCn.RunProc(sql);
 
                 //鍒犻櫎鍚庢帶鍒�==================================================================================      
                 string sql2 = "exec h_p_Kf_SellOutBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
@@ -1907,7 +1907,7 @@
                 {
                     s = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
                     objJsonResult.data = null;
                     oCN.RollBack();
@@ -1917,7 +1917,7 @@
                 {
                     s = ds.Tables[0].Rows[0]["HRemark"].ToString();
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
                     objJsonResult.data = null;
                     oCN.RollBack();
@@ -3300,7 +3300,6 @@
                     }
                     //================================================================================== 
 
-               
                     //瀹℃牳鍗曟嵁
                     if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
@@ -3351,7 +3350,6 @@
                         return objJsonResult;
                     }
                     //===========================================================          
-
 
                     //鍙嶅鏍稿崟鎹�
                     if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
@@ -5587,6 +5585,142 @@
         }
         #endregion
 
+        #region 妯″叿淇濆吇璁板綍琛� 淇濆瓨/缂栬緫PDA
+        /// <summary>
+        /// 淇濆瓨妯″叿缁翠慨鍗�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("Sc_MouldMaintainBill/SaveGetMouldMaintainBillListPDA")]
+        [HttpPost]
+        public object SaveGetMouldMaintainBillListPDA([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+            string msg5 = sArray[2].ToString();
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBill_Edit", 1, false, msg5))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                DAL.ClsSc_MouldMaintainBill oBill = new DAL.ClsSc_MouldMaintainBill();
+                List<Model.ClsSc_MouldMaintainBillMain> lsmain = new List<Model.ClsSc_MouldMaintainBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Sc_MouldMaintainBillMain(msg2);
+                foreach (Model.ClsSc_MouldMaintainBillMain oItem in lsmain)
+                {
+                    UserName = oItem.HMaker;  //鍒跺崟浜�
+                    DBUtility.ClsPub.CurUserName = UserName;
+                    oItem.HBillType = "3819";
+                    oItem.HBillSubType = "3819";
+
+                    //oItem.HInterID =0;
+                    //oItem.HBillNo = "";
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --鏃ユ湡
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    //oItem.HMakeDate = "";
+                    //oItem.HYear = "";
+                    //oItem.HPeriod = "";
+                    //oItem.HRemark = "";
+                    //oItem.HCycleUnit = "";
+                    //oItem.HCheckCycle = "";
+                    //oItem.HBeginDate = "";
+                    //oItem.HEndDate = "";
+                    //oItem.HInnerBillNo = "";
+                    //oItem.HExplanation = "";
+
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //淇濆吇椤硅〃浣撴暟鎹�
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSc_MouldMaintainRuleBillSub_Item> ls = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>();
+                ls = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillSub_Item(msg3);
+                int i = 0;
+                foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item oItemSub in ls)
+                {
+
+                    i++;
+                    oItemSub.HEntryID = i;
+                    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+                    //oItemSub.HRemark = "";         //澶囨敞
+                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
+                    //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                    oBill.DetailCol.Add(oItemSub);
+
+                }
+               
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region[妯″叿淇濆吇璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
         [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai")]
         [HttpGet]
@@ -6743,7 +6877,7 @@
                     return objJsonResult;
                 }
                 //寰楀埌淇℃伅
-                ds = oCN.RunProcReturn("select top 1 * from Gy_MouldFileMain  where HNumber= '" + HBarCode + "'", "Gy_MouldFileMain");
+                ds = oCN.RunProcReturn("select top 1 * from Gy_MouldFileMain  where HBarCode= '" + HBarCode + "'", "Gy_MouldFileMain");
                 //鍐欏叆淇℃伅
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {

--
Gitblit v1.9.1