From f0bb2d8bd83bc984a78a9ef8c3c7dd4ef821627f Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 29 六月 2023 15:24:14 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs | 40 +++++++++++++++++++++-------------------
1 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
index e63541b..9ac86d4 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.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;
@@ -27,6 +28,7 @@
{
try
{
+ List<object> columnNameList = new List<object>();
if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckRuleBillList", 1, false, user))
{
objJsonResult.code = "0";
@@ -47,12 +49,20 @@
ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
}
+ //娣诲姞鍒楀悕
+ 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
@@ -163,24 +173,16 @@
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- if (sqlWhere == null || sqlWhere.Equals(""))
- {
- ds = oCN.RunProcReturn("select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,瀛愬娉� HRemark from h_v_Sb_EquipDotCheckRuleList", "h_v_Sb_EquipDotCheckRuleList");
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
- objJsonResult.data = ds.Tables[0];
- }
- else
- {
- string sql1 = "select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,瀛愬娉� HRemark from h_v_Sb_EquipDotCheckRuleList where 1 = 1 ";
- string sql = sql1 + sqlWhere;
- ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
- objJsonResult.data = ds.Tables[0];
- }
+
+ string sql1 = @"select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,瀛愬娉� HRemark,b.HNumber 鐐规椤圭洰浠g爜 from h_v_Sb_EquipDotCheckRuleList a
+ left join Gy_QCCheckItem b on a.鐐规椤圭洰ID =b.HItemID where 1 = 1 ";
+ string sql = sql1 + sqlWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+
}
catch (Exception e)
{
--
Gitblit v1.9.1