From 2fa45c3a43e907ad22dcfada5be88c0f31115e31 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 07 九月 2023 11:10:02 +0800
Subject: [PATCH] 工作任务单:增加项目内码字段 工作任务单:记录源单信息

---
 WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs |   53 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
index bc9577d..1139f2f 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.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;
@@ -20,6 +21,14 @@
         public DAL.ClsSc_MouldMaintainRuleBill BillNew = new DAL.ClsSc_MouldMaintainRuleBill();   //瀵瑰簲鍗曟嵁绫�
         public DAL.ClsSc_MouldMaintainRuleBill BillOld = new DAL.ClsSc_MouldMaintainRuleBill();   //瀵瑰簲鍗曟嵁绫�
 
+
+        //public class HlpBill
+        //{
+        //    public int HSouceInterID = 0;
+        //    public int HSourceEntryID = 0;
+        //    public int Type = 0;
+        //    public string user { get; set; }
+        //}
         #region 鍣ㄥ叿淇濆吇瑙勭▼鍗曞垪琛�
         [Route("Sc_MouldMaintainRuleBill/GetMouldMaintainRuleList")]
         [HttpGet]
@@ -27,6 +36,9 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+                //HlpBill com = JsonConvert.DeserializeObject<HlpBill>(sWhere.ToString());
                 //缂栬緫鏉冮檺
                 if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBillList", 1, false, user))
                 {
@@ -48,22 +60,21 @@
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillList");
                 }
 
-                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
-                //{
+                //娣诲姞鍒楀悕
+                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;
-                //}
-                //else
-                //{
-                //objJsonResult.code = "0";
-                //objJsonResult.count = 0;
-                //objJsonResult.Message = "鏃犳暟鎹�";
-                //objJsonResult.data = null;
-                //return objJsonResult;
-                //}
             }
             catch (Exception ex)
             {
@@ -171,11 +182,11 @@
                 }
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
-                string sql = "select 淇濆吇椤圭洰ID,淇濆吇椤圭洰,淇濆吇閮ㄤ綅,鍏蜂綋瑕佹眰,璐熻矗浜篒D,璐熻矗浜轰唬鐮�,璐熻矗浜哄悕绉�,瀛愬娉�2 from h_v_Sc_MouldMaintainRuleBillList where 1 = 1 " + Swhere + "";
-                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillList");
+                string sql = "select 淇濆吇椤圭洰ID,淇濆吇椤圭洰浠g爜,淇濆吇椤圭洰,淇濆吇閮ㄤ綅,鍏蜂綋瑕佹眰,璐熻矗浜篒D,璐熻矗浜轰唬鐮�,璐熻矗浜哄悕绉�,瀛愬娉�2 from  h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + "";
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillSub_Item");
                 //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
-                string sql1 = "select 閰嶄欢ID,閰嶄欢浠g爜,閰嶄欢鍚嶇О,鍗曚綅ID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅鍚嶇О,鐢ㄩ噺,鏍囧噯鐢ㄩ噺,瀛愬娉�1 from h_v_Sc_MouldMaintainRuleBillList where 1 = 1 " + Swhere + "";
-                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainRuleBillList");
+                string sql1 = "select 閰嶄欢ID,閰嶄欢浠g爜,閰嶄欢鍚嶇О,鍗曚綅ID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅鍚嶇О,鐢ㄩ噺,鏍囧噯鐢ㄩ噺,瀛愬娉�1 from h_v_Sc_MouldMaintainRuleBillSub where 1 = 1 " + Swhere + "";
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainRuleBillSub");
 
                 list.Add(ds.Tables[0]);
                 list.Add(ds1.Tables[0]);
@@ -231,11 +242,11 @@
                 }
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
-                string sql = "select 淇濆吇椤圭洰ID HMaintainItemID,淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark from h_v_Sc_MouldMaintainRuleBillList where 1 = 1 " + Swhere + "";
-                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillList");
+                string sql = "select 淇濆吇椤圭洰ID HMaintainItemID,淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark from h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + "";
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillSub_Item");
                 //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
-                string sql1 = "select 閰嶄欢ID HMaterID,閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,瀛愬娉�1 HRemark from h_v_Sc_MouldMaintainRuleBillList where 1 = 1 " + Swhere + "";
-                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainRuleBillList");
+                string sql1 = "select 閰嶄欢ID HMaterID,閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,瀛愬娉�1 HRemark from h_v_Sc_MouldMaintainRuleBillSub where 1 = 1 " + Swhere + "";
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainRuleBillSub");
 
                 list.Add(ds.Tables[0]);
                 list.Add(ds1.Tables[0]);
@@ -271,7 +282,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
-            string msg5 = sArray[2].ToString();
+            string msg5 = sArray[3].ToString();
 
             string UserName = "";
             ListModels oListModels = new ListModels();

--
Gitblit v1.9.1