From ac2d164d9824bb678101dca79bd8c4e9c712d688 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 21 九月 2022 13:54:44 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs |   87 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 70 insertions(+), 17 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
index e3a6c4c..3e51d5e 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,13 +21,34 @@
         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]
-        public object GetMouldMaintainRuleList(string sWhere)
+        public object GetMouldMaintainRuleList(string sWhere,string user)
         {
             try
             {
+                List<object> columnNameList = new List<object>();
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+                //HlpBill com = JsonConvert.DeserializeObject<HlpBill>(sWhere.ToString());
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBillList", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 if (sWhere == null || sWhere.Equals(""))
                 {
                     ds = oCN.RunProcReturn("select * from h_v_Sc_MouldMaintainRuleBillList " + sWhere + " order by hmainid desc", "h_v_Sc_MouldMaintainRuleBillList");
@@ -37,22 +59,32 @@
                     string sql = sql1 + sWhere + " order by hmainid desc";
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillList");
                 }
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁浣犺鎵剧殑璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+                
+                //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
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
             }
             catch (Exception ex)
             {
@@ -68,8 +100,18 @@
         #region 鍣ㄥ叿淇濆吇瑙勭▼璁板綍鍒犻櫎鍔熻兘
         [Route("Sc_MouldMaintainRuleBill/DeltetMouldMaintainRuleBillList")]
         [HttpGet]
-        public object DeltetMouldMaintainRuleBillList(string HInterID)
+        public object DeltetMouldMaintainRuleBillList(string HInterID,string user)
         {
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBill_Delete", 1, false, user))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
             Int64 lngBillKey = 0;
             lngBillKey = DBUtility.ClsPub.isLong(HInterID);
             if (lngBillKey == 0)
@@ -250,11 +292,22 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            string msg5 = sArray[3].ToString();
 
             string UserName = "";
             ListModels oListModels = new ListModels();
             try
             {
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBill_Edit", 1, false, msg5))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 DAL.ClsSc_MouldMaintainRuleBill oBill = new DAL.ClsSc_MouldMaintainRuleBill();
                 List<Model.ClsSc_MouldMaintainRuleBillMain> lsmain = new List<Model.ClsSc_MouldMaintainRuleBillMain>();
                 msg2 = msg2.Replace("\\", "");

--
Gitblit v1.9.1