From c2a9a460e38c7c196fe98a94e29e6330eac3626f Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 03 三月 2023 14:30:06 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs |  423 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 297 insertions(+), 126 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index ce578bb..63e2e3d 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -280,22 +280,13 @@
 
                 ds = Sc_MouldDotCheckPlanBillList_s(sWhere);
 
-                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
-                //{
+               
                 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 = "鏃犳暟鎹�";
-                //objJsonResult.data = null;
-                //return objJsonResult;
-                //}
+              
             }
             catch (Exception ex)
             {
@@ -345,8 +336,7 @@
                     columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
 
-                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
-                //{
+                
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";
@@ -354,15 +344,6 @@
                 objJsonResult.list = columnNameList;
 
                 return objJsonResult;
-                //}
-                //else
-                //{
-                //objJsonResult.code = "0";
-                //objJsonResult.count = 0;
-                //objJsonResult.Message = "鏃犳暟鎹�";
-                //objJsonResult.data = null;
-                //return objJsonResult;
-                //}
             }
             catch (Exception ex)
             {
@@ -881,22 +862,12 @@
                     ds = oCN.RunProcReturn(sql, "h_v_IF_MoveStockBillList");
                 }
 
-                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
-                //{
                 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 = "鏃犳暟鎹�";
-                //objJsonResult.data = null;
-                //return objJsonResult;
-                //}
+              
             }
             catch (Exception ex)
             {
@@ -907,6 +878,46 @@
                 return objJsonResult;
             }
         }
+
+
+        #region 璋冩嫧鍗�  鍒犻櫎
+        [Route("Kf_MoveStockBill/DelteteGetMoveStockBill")]
+        [HttpGet]
+        public object DelteteGetMoveStockBill(string HInterID, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愬垹闄�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
         /// <summary>
         /// 閿�鍞嚭搴撳崟鍒楄〃
@@ -1070,6 +1081,44 @@
             }
         }
 
+        #region 鍏朵粬鍑哄簱鍗�  鍒犻櫎
+        [Route("Kf_OtherOutBill/DelteteGetOtherOutBill")]
+        [HttpGet]
+        public object DelteteGetOtherOutBill(string HInterID, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愬垹闄�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
         /// <summary>
         /// 濮斿鍑哄簱鍗曞垪琛�
@@ -1426,7 +1475,7 @@
         #endregion
 
 
-        #region 妯″叿缁翠慨鍗曚繚瀛�/缂栬緫
+        #region 妯″叿缁翠慨璁板綍鍗曚繚瀛�/缂栬緫
         /// <summary>
         /// 淇濆瓨妯″叿缁翠慨鍗�
         /// </summary>
@@ -1442,6 +1491,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            string msg5 = sArray[3].ToString();
 
 
             string UserName = "";
@@ -1514,24 +1564,62 @@
                 List<Model.ClsSb_MouldRepairWorkBillSub> ls = new List<Model.ClsSb_MouldRepairWorkBillSub>();
                 ls = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub(msg3);
                 int i = 0;
-                foreach (Model.ClsSb_MouldRepairWorkBillSub oItemSub in ls)
+                foreach (Model.ClsSb_MouldRepairWorkBillSub oItem in ls)
                 {
 
                     i++;
-                    oItemSub.HEntryID = i;
+                    oItem.HEntryID = i;
                     //oItemSub.HCloseMan = "";       //琛屽叧闂�
-                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
-                    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+                    oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItem.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                    oItem.HRelationQty = 0;     //鍏宠仈鏁伴噺
                     //oItemSub.HRelationMoney = 0;   //鍏宠仈閲戦
                     //oItemSub.HRepairID = 0;       //缁翠慨椤圭洰
                     //oItemSub.HRepairExplanation ="";   //缁翠慨瑕佹眰
                     //oItemSub.HManagerID = 0;   //璐熻矗浜篒D
                     //oItemSub.HMoney = 0;        //缁翠慨璐圭敤
-                    oBill.DetailColl.Add(oItemSub);
+                    oBill.DetailColl.Add(oItem);
 
                 }
+
+                //閰嶄欢鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg5 = msg5.Substring(1, msg5.Length - 2);
+                msg5 = msg5.Replace("\\", "");
+                msg5 = msg5.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSb_MouldRepairWorkBillSub_Item> ls1 = new List<Model.ClsSb_MouldRepairWorkBillSub_Item>();
+                ls1 = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub_Item(msg5);
+                int j = 0;
+                foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oItemSub in ls1)
+                {
+
+                    j++;
+                    oItemSub.HEntryID = j;
+                    //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;     //鍏宠仈鏁伴噺
+                    //oItemSub.HRelationMoney = 0;   //鍏宠仈閲戦
+                    //HMaterID = "";//閰嶄欢浠g爜
+                    //HUnitID = "";//鍗曚綅浠g爜
+                    //HQty = "";//瀹為檯鐢ㄩ噺
+                    //HQtyMust = "";//鍗曚綅鐢ㄩ噺
+                    //HRemark = "";//澶囨敞
+                    //oItemSub.HRepairID = 0;       //缁翠慨椤圭洰
+                    //oItemSub.HRepairExplanation ="";   //缁翠慨瑕佹眰
+                    //oItemSub.HManagerID = 0;   //璐熻矗浜篒D
+                    //oItemSub.HMoney = 0;        //缁翠慨璐圭敤
+                    oBill.DetailCol.Add(oItemSub);
+
+                }
+
                 //淇濆瓨
                 //淇濆瓨瀹屾瘯鍚庡鐞�
                 bool bResult;
@@ -1593,30 +1681,27 @@
         [HttpGet]
         public object Sb_MouldRepairWorkBillListProjectDetai(string sqlWhere)
         {
-            DataSet ds;
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                if (sqlWhere == null || sqlWhere.Equals(""))
-                {
-                    //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark   from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub");
-                    ds = oCN.RunProcReturn("select HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark,婧愬崟涓诲唴鐮� HSourceInterID,婧愬崟瀛愬唴鐮� HSourceEntryID,婧愬崟鍗曞彿 HSourceBillNo,婧愬崟绫诲瀷 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
-                else
-                {
-                    //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark  from Sc_MouldRepairWorkBillSub where 1 = 1 ";
-                    string sql1 = "select HRepairID,瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark,婧愬崟涓诲唴鐮� HSourceInterID,婧愬崟瀛愬唴鐮� HSourceEntryID,婧愬崟鍗曞彿 HSourceBillNo,婧愬崟绫诲瀷 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 ";
-                    string sql = sql1 + sqlWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
+
+                string sql = "select HRepairID,瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark,婧愬崟涓诲唴鐮� HSourceInterID,婧愬崟瀛愬唴鐮� HSourceEntryID,婧愬崟鍗曞彿 HSourceBillNo,婧愬崟绫诲瀷 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "+ sqlWhere;
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit");
+
+                string sql1 = "select 閰嶄欢ID HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,瀛愬娉�1 HRemark,瑙勬牸鍨嬪彿 HMaterSpec  from h_v_Sc_MouldRepairWorkBillSub_Item  where 1 = 1 " + sqlWhere ;
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldRepairWorkBillSub_Item");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.data = null;
+                objJsonResult.list = list;
+
             }
             catch (Exception e)
             {
@@ -2446,6 +2531,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            string msg5 = sArray[3].ToString();
 
 
             string UserName = "";
@@ -2499,6 +2585,34 @@
                     }
                     oBill.omodel = oItem;
                 }
+
+                //淇濆吇椤硅〃浣撴暟鎹�
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg5 = msg5.Substring(1, msg5.Length - 2);
+                msg5 = msg5.Replace("\\", "");
+                msg5 = msg5.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSc_MouldMaintainPlanBillSub_Item> ls1 = new List<Model.ClsSc_MouldMaintainPlanBillSub_Item>();
+                ls1 = oListModels.getObjectByJson_Gy_MouldMaintainPlanBillSub_Item(msg5);
+                int j = 0;
+                foreach (Model.ClsSc_MouldMaintainPlanBillSub_Item item in ls1)
+                {
+
+                    j++;
+                    item.HEntryID = j;
+                    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                    item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    item.HCloseType = false;   //鍏抽棴绫诲瀷
+                    //oItemSub.HRemark = "";         //澶囨敞
+                    item.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    item.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
+                    //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                    item.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                    oBill.DetailCol.Add(item);
+
+                }
+
                 //琛ㄤ綋鏁版嵁
                 //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
                 msg3 = msg3.Substring(1, msg3.Length - 2);
@@ -2594,28 +2708,28 @@
         [HttpGet]
         public object Sc_MouldMaintainPlanBillListProjectDetai(string sqlWhere)
         {
-            DataSet ds;
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
+           
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                if (sqlWhere == null || sqlWhere.Equals(""))
-                {
-                    ds = oCN.RunProcReturn("select a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,a.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,a.HQty,a.HQtyMust,a.HRemark  from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID", "Sc_MouldMaintainPlanBillSub");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
-                else
-                {
-                    string sql1 = "select a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,a.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,a.HQty,a.HQtyMust,a.HRemark  from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID where 1 = 1 ";
-                    string sql = sql1 + sqlWhere;
-                    ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainPlanBillSub");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
+                //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
+                string sql = "select 淇濆吇椤圭洰ID HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo  from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + "";
+
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainPlanBillSub_Item");
+                //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                string sql1 = "select 閰嶄欢ID HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,瀛愬娉�1 HRemark,瑙勬牸鍨嬪彿 HMaterSpec  from h_v_Sc_MouldMaintainPlanBillSub  where 1 = 1 " + sqlWhere + "";
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainPlanBillSub");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.data = null;
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -3076,6 +3190,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            //string msg5 = sArray[3].ToString();
 
             string UserName = "";
             ListModels oListModels = new ListModels();
@@ -3099,6 +3214,7 @@
                 {
                     //oItem.HMaker = "";
                     UserName = oItem.HMaker;  //鍒跺崟浜�
+                    oItem.HMaker = msg4;
                     oItem.HBillType = "3821";
                     oItem.HBillSubType = "3821";
 
@@ -3161,6 +3277,32 @@
                     oBill.DetailColl.Add(oItemSub);
 
                 }
+
+                ////閰嶄欢椤硅〃浣撴暟鎹�
+                ////鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                //msg5 = msg5.Substring(1, msg5.Length - 2);
+                //msg5 = msg5.Replace("\\", "");
+                //msg5 = msg5.Replace("\n", "");  //\n
+                //                                //msg2 = msg2.Replace("'", "鈥�");
+                //List<Model.ClsSc_MouldDotCheckBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckBillSub_Item>();
+                //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub_Item(msg5);
+                //int j = 0;
+                //foreach (Model.ClsSc_MouldDotCheckBillSub_Item oItemSub in ls1)
+                //{
+
+                //    j++;
+                //    oItemSub.HEntryID = j;
+                //    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                //    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                //    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+
+                //    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                //    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+
+                //    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                //    oBill.DetailCol.Add(oItemSub);
+                //}
+
                 //淇濆瓨
                 //淇濆瓨瀹屾瘯鍚庡鐞�
                 bool bResult;
@@ -3222,28 +3364,29 @@
         [HttpGet]
         public object Sc_MouldDotCheckBillListProjectDetai(string sqlWhere)
         {
-            DataSet ds;
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
+            string Swhere = "";
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                if (sqlWhere == null || sqlWhere.Equals(""))
-                {
-                    ds = oCN.RunProcReturn("select HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
-                else
-                {
-                    string sql1 = "select HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 ";
-                    string sql = sql1 + sqlWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBillList");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
+                //鑾峰彇鐐规椤圭洰缂栬緫鏁版嵁
+                ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub");
+                //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID
+                    ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark 
+                    from Sc_MouldDotCheckBillSub_Item b 
+                    left join Gy_Material mt on b.HMaterID=mt.HItemID 
+                    left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub_Item");
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.data = null;
+                objJsonResult.list = list;
+
             }
             catch (Exception e)
             {
@@ -3382,6 +3525,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            //string msg5 = sArray[3].ToString();
 
 
             string UserName = "";
@@ -3396,7 +3540,7 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-
+                DBUtility.ClsPub.CurUserName = msg4;
                 DAL.ClsSc_MouldDotCheckPlanBill oBill = new DAL.ClsSc_MouldDotCheckPlanBill();
                 List<Model.ClsSc_MouldDotCheckPlanBillMain> lsmain = new List<Model.ClsSc_MouldDotCheckPlanBillMain>();
                 msg2 = msg2.Replace("\\", "");
@@ -3406,8 +3550,8 @@
                 {
                     //oItem.HMaker = "";
                     UserName = oItem.HMaker;  //鍒跺崟浜�
-                    oItem.HBillType = "3821";
-                    oItem.HBillSubType = "3821";
+                    oItem.HBillType = "3820";
+                    oItem.HBillSubType = "3820";
 
                     //oItem.HInterID =0;
                     //oItem.HBillNo = "";
@@ -3435,7 +3579,7 @@
                     }
                     oBill.omodel = oItem;
                 }
-                //琛ㄤ綋鏁版嵁
+                //鐐规椤圭洰琛ㄤ綋鏁版嵁
                 //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
                 msg3 = msg3.Substring(1, msg3.Length - 2);
                 msg3 = msg3.Replace("\\", "");
@@ -3468,6 +3612,32 @@
                     oBill.DetailColl.Add(oItemSub);
 
                 }
+
+                ////閰嶄欢椤硅〃浣撴暟鎹�
+                ////鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                //msg5 = msg5.Substring(1, msg5.Length - 2);
+                //msg5 = msg5.Replace("\\", "");
+                //msg5 = msg5.Replace("\n", "");  //\n
+                //                                //msg2 = msg2.Replace("'", "鈥�");
+                //List<Model.ClsSc_MouldDotCheckPlanBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckPlanBillSub_Item>();
+                //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckPlanBillSub_Item(msg5);
+                //int j = 0;
+                //foreach (Model.ClsSc_MouldDotCheckPlanBillSub_Item oItemSub in ls1)
+                //{
+
+                //    j++;
+                //    oItemSub.HEntryID = j;
+                //    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                //    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                //    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+
+                //    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                //    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+
+                //    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                //    oBill.DetailCol.Add(oItemSub);
+                //}
+
                 //淇濆瓨
                 //淇濆瓨瀹屾瘯鍚庡鐞�
                 bool bResult;
@@ -3529,28 +3699,29 @@
         [HttpGet]
         public object Sc_MouldDotCheckPlanBillListProjectDetai(string sqlWhere)
         {
-            DataSet ds;
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
+            string Swhere = "";
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                if (sqlWhere == null || sqlWhere.Equals(""))
-                {
-                    ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID", "Sc_MouldDotCheckPlanBillSub");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
-                else
-                {
-                    string sql1 = "select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1 = 1 ";
-                    string sql = sql1 + sqlWhere;
-                    ds = oCN.RunProcReturn(sql, "Sc_MouldDotCheckPlanBillSub");
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                }
+                //鑾峰彇鐐规椤圭洰缂栬緫鏁版嵁
+                ds = oCN.RunProcReturn(@"select a.HDotCheckItemID,HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a 
+                  left join Gy_Employee e on a.HManagerID=e.HItemID
+                        where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub");
+                ////鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                //ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID
+                //    ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark 
+                //    from Sc_MouldDotCheckPlanBillSub_Item b 
+                //    left join Gy_Material mt on b.HMaterID=mt.HItemID 
+                //    left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub_Item");
+                list.Add(ds.Tables[0]);
+                //list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.data = null;
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -3684,7 +3855,7 @@
                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�у悕绉� HPropertyName,
                                             HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo,
                                             璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炴敹鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鏀舵枡浠撳簱浠g爜 HWHCode, 鏀舵枡浠撳簱鍚嶇О HWHName,
-                                            HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark,HStockOrgID
+                                            HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 瀛愬娉� HRemark,HStockOrgID
                                             FROM h_v_Sc_MouldScrapInHouseBillList"), "h_v_Sc_MouldScrapInHouseBillList");
 
                 }
@@ -3695,7 +3866,7 @@
                     string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�у悕绉� HPropertyName,
                                             HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo,
                                             璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炴敹鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鏀舵枡浠撳簱浠g爜 HWHCode, 鏀舵枡浠撳簱鍚嶇О HWHName,
-                                            HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark,HStockOrgID
+                                            HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 瀛愬娉� HRemark,HStockOrgID
                                             FROM h_v_Sc_MouldScrapInHouseBillList where 1 = 1 ");
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapInHouseBillList");
@@ -5693,7 +5864,7 @@
                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿 HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�� HPropertyName,
                                                            HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅 HSecUnitName,鎹㈢畻鐜� HSecUnitRate,
                                                            HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅 HUnitName,
-                                                           璁捐瀵垮懡 HDesignLife, 鍘熷墿浣欏鍛� HLeaveLife, 鏂板墿浣欏鍛� HNewLife,琛ㄤ綋澶囨敞 HRemark 
+                                                           璁捐瀵垮懡 HDesignLife, 鍘熷墿浣欏鍛� HLeaveLife, 鏂板墿浣欏鍛� HNewLeaveLife,琛ㄤ綋澶囨敞 HRemark 
 	                                                       FROM h_v_Sc_MouldLifeChangeBillList_Edit"), "h_v_Sc_MouldLifeChangeBillList_Edit");
 
                     objJsonResult.code = "0";
@@ -5708,7 +5879,7 @@
                     string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿 HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�� HPropertyName,
                                                   HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅 HSecUnitName,鎹㈢畻鐜� HSecUnitRate,
                                                   HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅 HUnitName,
-                                                  璁捐瀵垮懡 HDesignLife, 鍘熷墿浣欏鍛� HLeaveLife, 鏂板墿浣欏鍛� HNewLife,琛ㄤ綋澶囨敞 HRemark 
+                                                  璁捐瀵垮懡 HDesignLife, 鍘熷墿浣欏鍛� HLeaveLife, 鏂板墿浣欏鍛� HNewLeaveLife,琛ㄤ綋澶囨敞 HRemark 
 	                                              FROM h_v_Sc_MouldLifeChangeBillList_Edit where 1 = 1 ");
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeChangeBillList_Edit");

--
Gitblit v1.9.1