From 18bf65577b174d574b36c5fb5ab4364a14c7724a Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期三, 03 七月 2024 15:09:13 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/WebAPIController.cs |  210 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 178 insertions(+), 32 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index ad05fa7..b91b18a 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -119,7 +119,7 @@
                     //----------鍒涘缓铏氳〃------------------------
                     DataTable dt_Main = new DataTable("Json");
                     dt_Main.Columns.Add("HBillNo", typeof(string));
-                    dt_Main.Columns.Add("HInterID", typeof(int));
+                    dt_Main.Columns.Add("HInterID", typeof(Int64));
                     //---------鍒涘缓鏂拌------------------------
                     DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 
                     dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑
@@ -11983,19 +11983,24 @@
                 List<object> list = new List<object>();
                 DataSet ds2;
                 DataSet ds1;
-                string sql1 = string.Format(@"select t.HMaintainItemID ,m.HNumber HMaintainItemNumber,t.HMaintainItem,t.HMaintainPart,t.HClaim,t.HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
-                                                from Sc_MouldMaintainRuleBillMain a left join Sc_MouldMaintainRuleBillSub_Item t on a.HInterID=t.HInterID 
-                                                left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
-                                                left join Gy_Employee e on e.HItemID=t.HManagerID
-                                                where a.HInterID=" + MouldMaintainRuleID);
 
-                string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, m.HModel HMaterSpec,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark from Sc_MouldMaintainRuleBillMain a  
-												left join Sc_MouldMaintainRuleBillSub b on a.HInterID=b.HInterID 
-                                                left join h_v_IF_Material m on b.HMaterID=m.HItemID
-												left join h_v_IF_Unit u on b.HUnitID=u.HItemID
-                                                where a.HInterID=" + MouldMaintainRuleID);
-                ds1 = oCN.RunProcReturn(sql1, "Sc_MouldMaintainRuleBillMain");//淇濆吇
-                ds2 = oCN.RunProcReturn(sql2, "Sc_MouldMaintainRuleBillMain");//閰嶄欢
+            //    string sql1 = string.Format(@"select t.HMaintainItemID ,m.HNumber HMaintainItemNumber,t.HMaintainItem,t.HMaintainPart,t.HClaim,t.HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
+            //                                    from Sc_MouldMaintainRuleBillMain a left join Sc_MouldMaintainRuleBillSub_Item t on a.HInterID=t.HInterID 
+            //                                    left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
+            //                                    left join Gy_Employee e on e.HItemID=t.HManagerID
+            //                                    where a.HInterID=" + MouldMaintainRuleID);
+
+            //    string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, m.HModel HMaterSpec,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark from Sc_MouldMaintainRuleBillMain a  
+												//left join Sc_MouldMaintainRuleBillSub b on a.HInterID=b.HInterID 
+            //                                    left join h_v_IF_Material m on b.HMaterID=m.HItemID
+												//left join h_v_IF_Unit u on b.HUnitID=u.HItemID
+            //                                    where a.HInterID=" + MouldMaintainRuleID);
+
+                string sql1 = string.Format(@"select * from h_v_Sc_MouldMaintainRuleBillSub_Item where hmainid=" + MouldMaintainRuleID);
+                string sql2 = string.Format(@"select * from h_v_Sc_MouldMaintainRuleBillSub where hmainid=" + MouldMaintainRuleID);
+
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainRuleBillSub_Item");//淇濆吇
+                ds2 = oCN.RunProcReturn(sql2, "h_v_Sc_MouldMaintainRuleBillSub");//閰嶄欢
                 list.Add(ds1.Tables[0]);
                 list.Add(ds2.Tables[0]);
                 objJsonResult.code = "0";
@@ -12129,19 +12134,22 @@
                 List<object> list = new List<object>();
                 DataSet ds2;
                 DataSet ds1;
-                string sql1 = string.Format(@"select t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
-                                                from Sb_EquipMaintainRuleBillMain a left join Sb_EquipMaintainRuleBillSub_Item t on a.HInterID=t.HInterID 
-                                                left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
-                                                left join Gy_Employee e on e.HItemID=t.HManagerID
-                                                where a.HInterID=" + EquipProjectID);
-                string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HRemark from Sb_EquipMaintainRuleBillMain a  
-												left join Sb_EquipMaintainRuleBillSub b on a.HInterID=b.HInterID 
-                                                left join h_v_IF_Material m on b.HMaterID=m.HItemID
-												left join h_v_IF_Unit u on b.HUnitID=u.HItemID
-                                                where a.HInterID=" + EquipProjectID);
+            //    string sql1 = string.Format(@"select t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
+            //                                    from Sb_EquipMaintainRuleBillMain a left join Sb_EquipMaintainRuleBillSub_Item t on a.HInterID=t.HInterID 
+            //                                    left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
+            //                                    left join Gy_Employee e on e.HItemID=t.HManagerID
+            //                                    where a.HInterID=" + EquipProjectID);
+            //    string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HRemark from Sb_EquipMaintainRuleBillMain a  
+												//left join Sb_EquipMaintainRuleBillSub b on a.HInterID=b.HInterID 
+            //                                    left join h_v_IF_Material m on b.HMaterID=m.HItemID
+												//left join h_v_IF_Unit u on b.HUnitID=u.HItemID
+            //                                    where a.HInterID=" + EquipProjectID);
 
-                ds1 = oCN.RunProcReturn(sql1, "Sb_EquipMaintainRuleBillMain");//淇濆吇
-                ds2 = oCN.RunProcReturn(sql2, "Sc_MouldMaintainRuleBillMain");//閰嶄欢
+                string sql1 = string.Format(@"select * from h_v_Sb_EquipMaintainRuleBillList where HInterID=" + EquipProjectID);
+                string sql2 = string.Format(@"select * from h_v_Sb_EquipMaintainRuleSub where hmainid=" + EquipProjectID);
+
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sb_EquipMaintainRuleBillList");//淇濆吇
+                ds2 = oCN.RunProcReturn(sql2, "h_v_Sb_EquipMaintainRuleSub");//閰嶄欢
                 list.Add(ds1.Tables[0]);
                 list.Add(ds2.Tables[0]);
                 objJsonResult.code = "0";
@@ -12495,13 +12503,8 @@
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                string sql = string.Format(@"select b.HDotCheckItemID HDotCheckItemID,c.HNumber HDotCheckCode,b.HDotCheckItem,b.HDotCheckPart,b.HClaim,
-                                    b.HManagerID,e.HNumber HManagerCode,e.HName HManagerName,b.HRemark from Sb_EquipDotCheckRuleBillMain  a 
-									left join Sb_EquipDotCheckRuleBillSub b on a.HInterID=b.HInterID 
-                                    left join Gy_DotCheck c on c.HItemID=b.HDotCheckItemID
-                                     left join Gy_Employee e on e.HItemID=b.HManagerID
-                                    where a.HInterID=" + HDotCheckRuleInterID);
-                ds = oCN.RunProcReturn(sql, "Sb_EquipDotCheckRuleBillMain");
+                string sql = string.Format(@"select * from h_v_Sb_EquipDotCheckRuleBillList_PDA where HInterID=" + HDotCheckRuleInterID);
+                ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleBillList_PDA");
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objjson.code = "0";
@@ -12529,6 +12532,149 @@
             }
         }
 
+        /// <summary>
+        /// 鏍规嵁璁惧淇濆吇瑙勭▼鏄剧ず璁惧淇濆吇绋嬮」鐩�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetMaintainItemByMaintainRuleID")]
+        [HttpGet]
+        public object GetMaintainItemByMaintainRuleID(int HEquipMaintainRuleInterID)
+        {
+            if (HEquipMaintainRuleInterID <= 0)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "璁惧淇濆吇瑙勭▼鏈�夋嫨";
+                objjson.data = null;
+                return objjson;
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = string.Format(@"select * from h_v_Sb_EquipMaintainRuleBillList_PDA where HInterID=" + HEquipMaintainRuleInterID);
+                ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainRuleBillList_PDA");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍣ㄥ叿鐐规瑙勭▼鏄剧ず鍣ㄥ叿鐐规绋嬮」鐩�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetDotCheckRuleItemByDotCheckRuleID/Mould")]
+        [HttpGet]
+        public object GetDotCheckRuleItemByDotCheckRuleIDForMould(int HDotCheckRuleInterID)
+        {
+            if (HDotCheckRuleInterID <= 0)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鍣ㄥ叿鐐规瑙勭▼鏈�夋嫨";
+                objjson.data = null;
+                return objjson;
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = string.Format(@"select * from h_v_Sc_MouldDotCheckRuleBillList_PDA where HInterID=" + HDotCheckRuleInterID);
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckRuleBillList_PDA");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍣ㄥ叿淇濆吇瑙勭▼鏄剧ず鍣ㄥ叿淇濆吇绋嬮」鐩�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetMaintainItemByMaintainRuleID/Mould")]
+        [HttpGet]
+        public object GetMaintainItemByMaintainRuleIDForMould(int HMouldMaintainRuleInterID)
+        {
+            if (HMouldMaintainRuleInterID <= 0)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鍣ㄥ叿淇濆吇瑙勭▼鏈�夋嫨";
+                objjson.data = null;
+                return objjson;
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = string.Format(@"select * from h_v_Sb_MouldMaintainRuleBillList_PDA where HInterID=" + HMouldMaintainRuleInterID);
+                ds = oCN.RunProcReturn(sql, "h_v_Sb_MouldMaintainRuleBillList_PDA");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
 
         /// <summary>
         /// 鑾峰彇缁翠慨椤圭洰鍒楄〃

--
Gitblit v1.9.1