From a8b6c5662b935dd3ae699c95d3a08e22f3b9aa67 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期二, 01 二月 2022 10:09:15 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/生产管理/报工台工序/Sc_QualityReportStepBillController.cs |   54 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 37 insertions(+), 17 deletions(-)

diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_QualityReportStepBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_QualityReportStepBillController.cs"
index eb94aca..0943ccb 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_QualityReportStepBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_QualityReportStepBillController.cs"
@@ -26,10 +26,20 @@
         #region 杩斿洖鐢熶骇璐ㄩ噺姹囨姤鍗曞垪琛�
         [Route("Sc_QualityReportStepBill/list")]
         [HttpGet]
-        public object list(string sWhere)
+        public object list(string sWhere,string user)
         {
             try
             {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 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_QualityReportBillListDetail " + sWhere, "h_v_Sc_QualityReportBillListDetail");
@@ -259,21 +269,21 @@
         #region 璐ㄩ噺姹囨姤鍗曞垪琛ㄥ垹闄ゆ寜閽�
         [Route("Sc_QualityReportStepBill/DeltetSc_QualityReportBill")]
         [HttpGet]
-        public object DeltetSc_QualityReportBill(long HItemID)
+        public object DeltetSc_QualityReportBill(long HItemID,string user)
         {
             DataSet ds;
             DataSet ds1;
             try
             {
                 //鍒犻櫎鏉冮檺
-                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (HItemID == 0)
@@ -285,8 +295,8 @@
                     return objJsonResult;
                 }
                 oCN.BeginTran();//寮�濮嬩簨鍔�
-                ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where hmainid=" + HItemID, "Sc_QualityReportBillMain");
-                ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where hmainid=" + HItemID, "Sc_QualityReportBillSub");
+                ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where HInterID=" + HItemID, "Sc_QualityReportBillMain");
+                ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where HInterID=" + HItemID, "Sc_QualityReportBillSub");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -314,18 +324,18 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
-                string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
-                if (HUseFlag == "宸蹭娇鐢�")
+                string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
+                if (HBillStatus == "2")
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "姝ら」鐩凡浣跨敤锛屼笉鑳藉垹闄わ紒";
+                    objJsonResult.Message = "姝ら」鐩凡瀹℃牳锛屼笉鑳藉垹闄わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
 
-                oCN.RunProc("delete from Sc_QualityReportBillMain where hmainid=" + HItemID);
-                oCN.RunProc("delete from Sc_QualityReportBillSub where hmainid=" + HItemID);
+                oCN.RunProc("delete from Sc_QualityReportBillMain where HInterID=" + HItemID);
+                oCN.RunProc("delete from Sc_QualityReportBillSub where HInterID=" + HItemID);
                 oCN.Commit();//鎻愪氦浜嬪姟
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -622,6 +632,16 @@
         {
             try
             {
+                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Edit", 1, false, HChecker))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愮紪杈�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 bool bResult2 = false;
                 oCN.BeginTran();

--
Gitblit v1.9.1