From 72c0e1a3457d8b43c5eefe4e6d4dd0ef9bc0b2ee Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 24 十月 2025 09:46:35 +0800
Subject: [PATCH] 增加app模具选着保养规程或点检规程自动带出子表信息方法,增加客户物料对应表接口字段商品idHSupID
---
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs | 443 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 264 insertions(+), 179 deletions(-)
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index f77ca59..077a950 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -474,62 +474,7 @@
}
- /// <summary>
- /// 妯″叿鐐规璁板綍琛ㄥ垎椤靛垪琛�
- /// </summary>
- /// <returns></returns>
- [Route("Sc_MouldDotCheckBill/GetMouldDotCheckBillListPage")]
- [HttpGet]
- public object GetMouldDotCheckBillListPage(string sWhere, string user, int page, int size)
- {
- try
- {
- List<object> columnNameList = new List<object>();
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- if (sWhere == null || sWhere.Equals(""))
- {
- ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",''", "h_p_Sc_MouldDotCheckBillList");
- }
- else
- {
- sWhere = sWhere.Replace("'", "''");
- ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldDotCheckBillList");
- }
-
- //娣诲姞鍒楀悕
- foreach (DataColumn col in ds.Tables[0].Columns)
- {
- Type dataType = col.DataType;
- string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
- columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
- }
-
-
- objJsonResult.code = CodeConstant.SUCCEED;
- objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- objJsonResult.list = columnNameList;
- return objJsonResult;
- }
- catch (Exception ex)
- {
- objJsonResult.code = CodeConstant.FAIL;
- objJsonResult.count = CountConstant.FAIL;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
- }
-
+
#region sql璇彞
@@ -589,127 +534,6 @@
#endregion
- /// <summary>
- /// 妯″叿淇濆吇璁″垝琛ㄥ垪琛�
- /// </summary>
- /// <returns></returns>
- [Route("Sc_MouldMaintainPlanBill/GetMouldMaintainPlanBillList")]
- [HttpGet]
- public object GetMouldMaintainPlanBillList(string sWhere,string user)
- {
- try
- {
- List<object> columnNameList = new List<object>();
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- ds = Sc_MouldMaintainPlanBillList_s(sWhere);
-
- //娣诲姞鍒楀悕
- foreach (DataColumn col in ds.Tables[0].Columns)
- {
- Type dataType = col.DataType;
- string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
- columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
- }
-
- //if (ds.Tables[0].Rows.Count != 0 || ds != null)
- //{
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- objJsonResult.list = columnNameList;
- return objJsonResult;
- //}
- //else
- //{
- //objJsonResult.code = "0";
- //objJsonResult.count = 0;
- //objJsonResult.Message = "鏃犳暟鎹�";
- //objJsonResult.data = null;
- //return objJsonResult;
- //}
- }
- catch (Exception ex)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
- }
-
- #region sql璇彞
-
-
- public static DataSet Sc_MouldMaintainPlanBillList_s(string sWhere)
- {
- return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList where 1=1 "+sWhere+ " order by hmainid desc", "h_v_Sc_MouldMaintainPlanBillList");
- }
- #endregion
-
- #region 妯″叿淇濆吇璁″垝鍒嗛〉鍒楄〃
- [Route("Sc_MouldMaintainPlanBill/page")]
- [HttpGet]
- public object Sc_MouldMaintainPlanBillPage(string sWhere, string user, int page, int size)
- {
- DataSet ds;
- try
- {
- List<object> columnNameList = new List<object>();
- //鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- sWhere = sWhere.Replace("'", "''");
- if (sWhere == null || sWhere.Equals(""))
- {
- ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldMaintainPlanBillList_Query");
- }
- else
- {
- ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldMaintainPlanBillList_Query");
- }
-
- //娣诲姞鍒楀悕
- foreach (DataColumn col in ds.Tables[0].Columns)
- {
- Type dataType = col.DataType;
- string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
- columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
- }
-
- objJsonResult.code = CodeConstant.SUCCEED;
- objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.list = columnNameList;
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
- catch (Exception e)
- {
- objJsonResult.code = CodeConstant.FAIL;
- objJsonResult.count = CountConstant.FAIL;
- objJsonResult.Message = "Exception锛�" + e.ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
- }
- #endregion
/// <summary>
/// 妯″叿鏁呴殰鐧昏琛ㄥ垪琛�
@@ -6909,7 +6733,118 @@
#endregion
+
+
#region 妯″叿淇濆吇璁″垝鍗�
+
+ #region 妯″叿淇濆吇璁″垝琛ㄥ垪琛�
+ [Route("Sc_MouldMaintainPlanBill/GetMouldMaintainPlanBillList")]
+ [HttpGet]
+ public object GetMouldMaintainPlanBillList(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = Sc_MouldMaintainPlanBillList_s(sWhere);
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #region sql璇彞
+
+
+ public static DataSet Sc_MouldMaintainPlanBillList_s(string sWhere)
+ {
+ return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_Sc_MouldMaintainPlanBillList");
+ }
+ #endregion
+ #endregion
+
+ #region 妯″叿淇濆吇璁″垝鍒嗛〉鍒楄〃
+ [Route("Sc_MouldMaintainPlanBill/page")]
+ [HttpGet]
+ public object Sc_MouldMaintainPlanBillPage(string sWhere, string user, int page, int size)
+ {
+ DataSet ds;
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldMaintainPlanBillList_Query");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldMaintainPlanBillList_Query");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
#region 妯″叿淇濆吇璁″垝鍗� 淇濆瓨/缂栬緫
/// <summary>
@@ -7115,6 +7050,7 @@
}
}
#endregion
+
#region[妯″叿淇濆吇璁″垝鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
[Route("Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListCheckDetai")]
[HttpGet]
@@ -7129,6 +7065,7 @@
return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
}
#endregion
+
#region[妯″叿淇濆吇璁″垝鍗曠紪杈戞椂鑾峰彇琛ㄩ鏁版嵁]
[Route("Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai")]
[HttpGet]
@@ -8237,6 +8174,61 @@
#region 妯″叿鐐规璁板綍琛�
+ #region 妯″叿鐐规璁板綍琛ㄥ垎椤靛垪琛�
+ [Route("Sc_MouldDotCheckBill/GetMouldDotCheckBillListPage")]
+ [HttpGet]
+ public object GetMouldDotCheckBillListPage(string sWhere, string user, int page, int size)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",''", "h_p_Sc_MouldDotCheckBillList");
+ }
+ else
+ {
+ sWhere = sWhere.Replace("'", "''");
+ ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldDotCheckBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
#region 妯″叿鐐规璁板綍琛� 淇濆瓨/缂栬緫
/// <summary>
/// 淇濆瓨妯″叿缁翠慨鍗�
@@ -8407,7 +8399,6 @@
}
#endregion
-
#region[妯″叿鐐规璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
[Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckBillListCheckDetai")]
[HttpGet]
@@ -8422,6 +8413,7 @@
return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
}
#endregion
+
#region[妯″叿鐐规璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁]
[Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckBillListProjectDetai")]
[HttpGet]
@@ -8461,6 +8453,7 @@
return objJsonResult;
}
#endregion
+
#region[妯″叿鐐规璁板綍琛ㄩ�夋嫨鐐规璁″垝甯﹀嚭琛ㄦ牸鏁版嵁]
[Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckSubBillListByPlan")]
[HttpGet]
@@ -8487,6 +8480,7 @@
return objJsonResult;
}
#endregion
+
#region [妯″叿鐐规璁板綍琛ㄥ垹闄ゅ姛鑳絔
/// <summary>
/// 妯″叿鐐规璁板綍鍒犻櫎鍔熻兘
@@ -8952,6 +8946,43 @@
objJsonResult.data = null;
return objJsonResult;
}
+ }
+ #endregion
+
+ #region[妯″叿鐐规璁板綍琛ㄧ偣鍑讳富琛ㄦ煡鐪嬪瓙琛ㄤ俊鎭痌
+ [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckBillList_sub")]
+ [HttpGet]
+ public object Sc_MouldDotCheckBillList_sub(string HInterID)
+ {
+
+ DataSet ds;
+ List<object> list = new List<object>();
+ string Swhere = "";
+ try
+ {
+ if (HInterID != "" || HInterID != null)
+ {
+ Swhere = " and hmainid='" + HInterID + "'";
+ }
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ //鑾峰彇鐐规椤圭洰鏁版嵁
+ string sql = "select 鐐规椤圭洰浠g爜 HDotCheckItemNumber, 鐐规椤圭洰 HDotCheckItem,鐐规鏂规硶鍚嶇О HDotCheckItemMethodName,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,鐐规缁撴灉 HDotCheckResult,瀛愬娉�2 HRemark from h_v_Sc_MouldDotCheckBill_Edit where 1 = 1 " + Swhere + "";
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBill_Edit");
+
+ list.Add(ds.Tables[0]);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.list = list;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
}
#endregion
@@ -14902,6 +14933,60 @@
}
}
#endregion
-
+
+ #region[app鏍规嵁妯″叿 淇濆吇瑙勭▼鎴栫偣妫�瑙勭▼鑷姩鑾峰彇瀛愯〃淇℃伅]
+ [Route("Sc_MouldMaintainRuleBill/GetMouldRuleSubList-Detail")]
+ [HttpGet]
+ public object GetMouldMaintainRuleSubList(string HInterID,string HBillType)
+ {
+
+ DataSet ds, ds1;
+ List<object> list = new List<object>();
+ string Swhere = "";
+ try
+ {
+ if (HInterID != "" || HInterID != null)
+ {
+ Swhere = " and HInterID='" + HInterID + "'";
+ }
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ //淇濆吇璁板綍璋冪敤
+ if (HBillType== "3819")
+ {
+ //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
+ string sql = "select HMaintainItemID,HManagerID,HMaintainItem,HMaintainPart,HClaim,HRemark,'true' HMaintainResult from Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + "";
+ ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainRuleBillSub_Item");
+ //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+ string sql1 = "select HMaterID, HUnitID, HQty, HQtyMust, HRemark from Sc_MouldMaintainRuleBillSub where 1 = 1 " + Swhere + "";
+ ds1 = oCN.RunProcReturn(sql1, "Sc_MouldMaintainRuleBillSub");
+ list.Add(ds.Tables[0]);
+ list.Add(ds1.Tables[0]);
+ }
+ //鐐规璁板綍璋冪敤
+ else if (HBillType== "3821")
+ {
+ //鑾峰彇鐐规椤圭洰缂栬緫鏁版嵁
+ string sql = "select HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim,HManagerID,HDotCheckItemClassID,HDotCheckItemMethodID,HRemark from Sc_MouldDotCheckRuleBillSub where 1 = 1 " + Swhere + "";
+ ds = oCN.RunProcReturn(sql, "Sc_MouldDotCheckRuleBillSub");
+ list.Add(ds.Tables[0]);
+ }
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.list = list;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
+ }
+ #endregion
+
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1