From b0688c1efd606284fd5bc31f2d60a1fec9aef968 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 08 四月 2025 11:20:50 +0800
Subject: [PATCH] 自定义菜单优化
---
WebAPI/Controllers/基础资料/基础资料/Gy_SOPBillController.cs | 191 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 178 insertions(+), 13 deletions(-)
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBillController.cs"
index c9a5385..af52f50 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBillController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBillController.cs"
@@ -31,16 +31,7 @@
{
try
{
- //缂栬緫鏉冮檺
- //if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user))
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
- string sql1 = string.Format(@"select * from h_v_Sc_WorkOrderList where HMainID='" + sWhere + "'");
+ string sql1 = string.Format(@"select * from h_v_Sc_WorkOrderList where 寮�宸ユ爣璁� = 1 and HMainID='" + sWhere + "'");
ds = oCN.RunProcReturn(sql1, "h_v_Sc_WorkOrderList");
@@ -68,7 +59,7 @@
/// </summary>
[Route("Sc_ICMOBillStatus_Tmp/Filelist")]
[HttpGet]
- public object Filelist()
+ public object Filelist(int sWhere)
{
try
{
@@ -81,9 +72,183 @@
// objJsonResult.data = null;
// return objJsonResult;
//}
- string sql1 = string.Format(@"select HSno 搴忓彿,HFileName 鏂囦欢鍚嶇О from Gy_SOPBillSub2");
+ string sql1 = string.Format(@"select * from h_v_Sc_GetFileList where 鏂囦欢ID = " + sWhere);
- ds = oCN.RunProcReturn(sql1, "Gy_SOPBillSub2");
+ ds = oCN.RunProcReturn(sql1, "h_v_Sc_GetFileList");
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 杩斿洖褰撳墠鐢熶骇璧勬簮鐢熶骇鐘舵�佷笅鐨勫伐鍗曞垪琛�
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Sc_ICMOBill/list2")]
+ [HttpGet]
+ public object list2(string HSourceID, string user,string HMainID)
+ {
+ try
+ {
+ var sWhere = "";
+ if (Convert.ToInt32(HMainID) != 0 && HMainID.ToString() != "")
+ {
+ sWhere += " and HMainID = " + HMainID;
+ }
+ string sql1 = string.Format(@"select * from h_v_Sc_ICMOBillList_ToSop where 鐘舵�� = '寮�宸�' and HSourceID='" + HSourceID + "'" + sWhere);
+
+ ds = oCN.RunProcReturn(sql1, "h_v_Sc_ICMOBillList_ToSop");
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 杩斿洖鐢熶骇宸ヤ綅鍒楄〃淇℃伅
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Gy_SourceWorkStationSet_ToSop/Soplist")]
+ [HttpGet]
+ public object Soplist(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql1 = string.Format(@"select * from h_v_Gy_SourceWorkStationSetList where 1 = 1");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_Gy_SourceWorkStationSetList");
+ }
+ else
+ {
+ string sql = sql1 + sWhere + " order by HItemID ";
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_SourceWorkStationSetList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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 e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁鐗╂枡锛屽伐鍗曟煡鎵句綔涓氭寚瀵间功
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Gy_SopBill/getListByMaterID")]
+ [HttpGet]
+ public object getListByMaterID(Int64 HMaterID, string HSourceNo)
+ {
+ try
+ {
+ var sWhere = "";
+ if (Convert.ToInt32(HMaterID) != 0 && HMaterID.ToString() != "" && HSourceNo != null && HSourceNo.ToString() != "" )
+ {
+ sWhere += " and HMaterID = " + HMaterID + " and HSourceNo = '" + HSourceNo + "'";
+ }
+ string sql1 = string.Format(@"select * from h_v_Sc_ICMOBillList_ToSop where 1 = 1 " + sWhere);
+
+ ds = oCN.RunProcReturn(sql1, "h_v_Sc_ICMOBillList_ToSop");
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁鐗╂枡+宸ュ簭鏌ユ壘浣滀笟鎸囧涔�
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Gy_SopBill/getListByMaterProc")]
+ [HttpGet]
+ public object getListByMaterProc(Int64 HMaterID, Int64 HProcID,string HType)
+ {
+ try
+ {
+ var sWhere = "";
+ if (HType != "")
+ {
+ if (Convert.ToInt32(HMaterID) != 0 && HMaterID.ToString() != "" && Convert.ToInt32(HProcID) != 0 && HProcID.ToString() != "")
+ {
+ sWhere += " and HMaterID = " + HMaterID + " and HProcID = " + HProcID + " and HProcID2 = " + HProcID + " and 鎸囧涔︾被鍨� = '"+ HType + "'";
+ }
+ }
+ else
+ {
+ if (Convert.ToInt32(HMaterID) != 0 && HMaterID.ToString() != "" && Convert.ToInt32(HProcID) != 0 && HProcID.ToString() != "")
+ {
+ sWhere += " and HMaterID = " + HMaterID + " and HProcID = " + HProcID + " and HProcID2 = " + HProcID + " ";
+ }
+ }
+ //if (Convert.ToInt32(HMaterID) != 0 && HMaterID.ToString() != "" && Convert.ToInt32(HProcID) != 0 && HProcID.ToString() != "")
+ //{
+ // sWhere += " and HMaterID = " + HMaterID + " and HProcID = " + HProcID + " and HProcID2 = " + HProcID ;
+ //}
+ string sql1 = string.Format(@"select * from h_v_Sc_ICMOBillStatus_Tmp_SOP where 1 = 1 " + sWhere);
+
+ ds = oCN.RunProcReturn(sql1, "h_v_Sc_ICMOBillStatus_Tmp_SOP");
objJsonResult.code = "1";
--
Gitblit v1.9.1