From 16bb2f7b48cf2c3cfbb6a026c265d4e52d22eca4 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期六, 29 十月 2022 17:11:14 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/Gy_MateMouldController.cs | 48 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 40 insertions(+), 8 deletions(-)
diff --git a/WebAPI/Controllers/Gy_MateMouldController.cs b/WebAPI/Controllers/Gy_MateMouldController.cs
index 595a5e4..a3679d5 100644
--- a/WebAPI/Controllers/Gy_MateMouldController.cs
+++ b/WebAPI/Controllers/Gy_MateMouldController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -28,6 +29,7 @@
{
try
{
+ List<object> columnNameList = new List<object>();
//缂栬緫鏉冮檺
//if (!DBUtility.ClsPub.Security_Log_second("Gy_MateMould", 1, false, user))
//{
@@ -48,10 +50,19 @@
ds = oCN.RunProcReturn(sql, "h_v_Gy_MateMouldInfoList");
}
+ //娣诲姞鍒楀悕
+ 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)
@@ -210,14 +221,26 @@
{
try
{
+ List<object> columnNameList = new List<object>();
+ //ds = oCN.RunProcReturn("select " +
+ // "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HRelationID) 妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.HName HRelationNameCol" +
+ // ",b.HNumber HRelationNumberCol,a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" +
+ // ",a.HRelationID HRelationIDCol,d.HNumber HUnitNumberCol,d.HName HUnitNameCol" +
+ // ",a.HUnitID HUnitIDCol" +
+ // ",a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" +
+ // ",a.HRemark HRemarkCol " +
+ // " from Gy_MateMouldInfo a " +
+ // " left join h_v_Gy_Mould b on a.HRelationID = b.HItemID " +
+ // " left join Gy_Material c on a.HMaterID = c.HItemID " +
+ // " left join Gy_Unit d on a.HUnitID = d.HItemID where a.HItemID = " + HItemID, "Gy_MateMouldInfo");
ds = oCN.RunProcReturn("select " +
- "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HRelationID) 妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.HName HRelationNameCol" +
- ",b.HNumber HRelationNumberCol,a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" +
- ",a.HRelationID HRelationIDCol,d.HNumber HUnitNumberCol,d.HName HUnitNameCol" +
+ "a.HItemID,a.妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.HName 妯″叿鍚嶇О" +
+ ",b.HNumber 妯″叿浠g爜,a.HMaterID HMaterIDCol,c.HNumber 鐗╂枡浠g爜,c.HName 鐗╂枡鍚嶇О,c.HModel 瑙勬牸鍨嬪彿" +
+ ",a.HRelationID HRelationIDCol,d.HNumber 鍗曚綅浠g爜,d.HName 鍗曚綅鍚嶇О" +
",a.HUnitID HUnitIDCol" +
- ",a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" +
- ",a.HRemark HRemarkCol " +
- " from Gy_MateMouldInfo a " +
+ ",a.寮�濮嬫棩鏈�,a.缁撴潫鏃ユ湡" +
+ ",a.澶囨敞 " +
+ " from h_v_Gy_MateMouldInfoList a " +
" left join h_v_Gy_Mould b on a.HRelationID = b.HItemID " +
" left join Gy_Material c on a.HMaterID = c.HItemID " +
" left join Gy_Unit d on a.HUnitID = d.HItemID where a.HItemID = " + HItemID, "Gy_MateMouldInfo");
@@ -225,16 +248,25 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
+ objJsonResult.Message = "鏃犲垪琛ㄤ俊鎭紒";
objJsonResult.data = null;
return objJsonResult;
}
else
{
+ //娣诲姞鍒楀悕
+ 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;
}
}
--
Gitblit v1.9.1