From 8abe6c1a1609513b72c10c7af08c7ca2400200f0 Mon Sep 17 00:00:00 2001
From: zhangrg <z18737863051@163.com>
Date: 星期五, 22 十二月 2023 10:05:29 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs | 107 +++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 83 insertions(+), 24 deletions(-)
diff --git a/WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs b/WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
index 501562b..0acc5cc 100644
--- a/WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
@@ -783,32 +783,26 @@
{
try
{
- if (sWhere == null || sWhere.Equals(""))
+ List<object> columnNameList = new List<object>();
+
+ string sql1 = "select * from h_v_Sc_AssemblyBillList where 1 = 1 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_AssemblyBillList");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
{
- ds = oCN.RunProcReturn("select * from h_v_Sc_AssemblyBillList " + sWhere, "h_v_Sc_AssemblyBillList");
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
}
- else
- {
- string sql1 = "select * from h_v_Sc_AssemblyBillList where 1 = 1 ";
- string sql = sql1 + sWhere;
- ds = oCN.RunProcReturn(sql, "h_v_Sc_AssemblyBillList");
- }
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
}
catch (Exception e)
{
@@ -1109,5 +1103,70 @@
}
#endregion
+ #region 鐢熶骇姹囨姤鍗曡幏鍙栨簮鍗曚骇閲忔眹鎶ュ崟涓存椂琛ㄤ俊鎭�
+ /// <summary>
+ /// 鐢熶骇姹囨姤鍗曡幏鍙栨簮鍗曚骇閲忔眹鎶ュ崟涓存椂琛ㄤ俊鎭�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_ICMOReportBill/GetProdReportBillList")]
+ [HttpGet]
+ public object GetProdReportBillList(string HInterID, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ if (HInterID == null || HInterID.Equals(""))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浜ч噺姹囨姤鍗曞唴鐮佷负绌猴紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+
+ string sql = "exec h_p_Sc_ICMOBillWorkQtyStatus_TmpList '" + HInterID + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOBillWorkQtyStatus_TmpList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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;
+ 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;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1