From 7dce710c21f02c3434cb7db21bb29f7a0426d59c Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期六, 22 一月 2022 13:06:32 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs |   85 ++++++++++++++++++++++++++++++++----------
 1 files changed, 65 insertions(+), 20 deletions(-)

diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
index 1733451..42919f3 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -9,6 +9,7 @@
     public class Sb_EquipDotCheckPlanBillController : ApiController
     {
         private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         public DataSet ds = new DataSet();
 
         #region 璁惧鐐规璁″垝琛�
@@ -19,16 +20,51 @@
         /// <returns></returns>
         [Route("Sb_EquipDotCheckPlanBill/GetEquipDotCheckPlanBillList")]
         [HttpGet]
-        public object GetEquipDotCheckPlanBillList(string sWhere)
+        public object GetEquipDotCheckPlanBillList(string sWhere,string user)
         {
             try
             {
-                ds = Sb_EquipDotCheckPlanBillList_s(sWhere);
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                objJsonResult.data = ds.Tables[0];
-                return objJsonResult;
+                if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckPlanBillList", 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_Sb_EquipDotCheckPlanBillList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipDotCheckPlanBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1";
+                    string sql = sql1 + sWhere + " order by hmainid desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁浣犺鎵剧殑璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+                //ds = Sb_EquipDotCheckPlanBillList_s(sWhere);
+                //objJsonResult.code = "1";
+                //objJsonResult.count = 1;
+                //objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                //objJsonResult.data = ds.Tables[0];
+                //return objJsonResult;
             }
             catch (Exception ex)
             {
@@ -64,12 +100,21 @@
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
+            string msg4 = sArray[2].ToString();
 
 
             string UserName = "";
             ListModels oListModels = new ListModels();
             try
             {
+                if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckPlanBill_Edit", 1, false, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 DAL.ClsSb_EquipDotCheckPlanBill oBill = new DAL.ClsSb_EquipDotCheckPlanBill();
                 List<Model.ClsSb_EquipDotCheckPlanBillMain> lsmain = new List<Model.ClsSb_EquipDotCheckPlanBillMain>();
                 msg2 = msg2.Replace("\\", "");
@@ -188,17 +233,17 @@
         /// <returns></returns>
         [Route("Sb_EquipDotCheckPlanBill/DeltetEquipDotCheckPlanBillList")]
         [HttpGet]
-        public object DeltetEquipDotCheckPlanBillList(string HInterID)
+        public object DeltetEquipDotCheckPlanBillList(string HInterID,string user)
         {
             //缂栬緫鏉冮檺
-            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
-            //{
-            //    objJsonResult.code = "0";
-            //    objJsonResult.count = 0;
-            //    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
-            //    objJsonResult.data = null;
-            //    return objJsonResult;
-            //}
+            if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckPlanBill_Delete", 1, false, user))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
 
 
             Int64 lngBillKey = 0;
@@ -274,7 +319,7 @@
             return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
         }
         #endregion
-        #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁]
+        #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁]
         [Route("Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai")]
         [HttpGet]
         public object Sb_EquipDotCheckPlanBillListProjectDetai(string sqlWhere)
@@ -285,7 +330,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckPlanBillList_Edit", "h_v_Sb_EquipDotCheckPlanBillList_Edit");
+                    ds = oCN.RunProcReturn("select 鐐规椤圭洰ID  HDotCheckItemID,鐐规椤圭洰浠g爜  HDotCheckCode ,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerCode,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -293,9 +338,9 @@
                 }
                 else
                 {
-                    string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckPlanBillList_Edit where 1 = 1 ";
+                    string sql1 = "select 鐐规椤圭洰ID  HDotCheckItemID,鐐规椤圭洰浠g爜  HDotCheckCode ,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerCode,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList_Edit");
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";

--
Gitblit v1.9.1