From f7c4ceeb654db44722c9362af3e9b70c9d231a3d Mon Sep 17 00:00:00 2001
From: 沈泽 <211959439@qq.com>
Date: 星期五, 22 十月 2021 16:54:07 +0800
Subject: [PATCH] 0

---
 WebAPI/DLL/ClsSc_MouldRepairChangeBill.cs                     |    4 
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user   |   34 +++++-----
 WebAPI/Models/ClsSc_MouldRepairChangeBillMain.cs              |    1 
 WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs |    2 
 WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs           |  127 +++++++++++++++++++++++++++++++++++++++---
 5 files changed, 139 insertions(+), 29 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
index a64e2ce..df9c210 100644
--- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -27,20 +27,19 @@
         /// </summary>
         [Route("Cg_POOrderBill/list")]
         [HttpGet]
-        public object list(string sWhere)
+        public object list(string sWhere, string user)
         {
             try
             {
-                if (sWhere == null || sWhere.Equals(""))
+                //鍒ゆ柇鏄惁鏈夐噰璐粡鐞嗘潈闄�
+                bool isCgjl = Security_Log("Cg_POOrderBill_PurchasManager", 1, true, user);
+                if (!isCgjl)
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList " + sWhere, "h_v_IF_POOrderBillList");
+                    sWhere += " and HEmpID in (select HEmpID from Gy_Czygl where Czymc='Admin' )";
                 }
-                else
-                {
-                    string sql1 = "select * from h_v_IF_POOrderBillList where 1 = 1 ";
-                    string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList");
-                }
+                string sql = "select * from h_v_IF_POOrderBillList where 1 = 1 " + sWhere;
+                ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList");
+
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";
@@ -144,6 +143,116 @@
             }
         }
 
+
+
+
+        //鍒ゆ柇鏄惁瀛樺湪鏉冮檺,骞跺啓鍏ユ棩蹇�
+        public static bool Security_Log(string gnsy, int LogTF, bool Msg, string CurUserName)
+        {
+            //gnsy 鍔熻兘绱㈠紩,妯″潡
+            //usercode 褰撳墠鐢ㄦ埛浠g爜
+            //LogTF 1鍒ゆ柇鏉冮檺骞跺啓鏃ュ織锛�2鍙啓鏃ュ織锛�3鍙垽鏂潈闄�
+            //Msg 娌℃湁鏉冮檺鏃� 鏄惁鎻愮ず妗�
+            string UserID = CurUserName;
+            try
+            {
+                ClsSqlHelper oCn = new ClsSqlHelper();
+                DataSet Ds = new DataSet();
+                DataSet DsUser = new DataSet();
+                DataSet DsJS = new DataSet();//瑙掕壊
+                long ModID = 0;
+                bool HavRight = false;
+                //鎵惧埌妯″潡鏉冮檺
+                Ds = oCn.RunProcReturn("select * from xt_xtgnb where gnsy='" + gnsy.Trim() + "'", "xt_xtgnb");
+                if (Ds.Tables[0].Rows.Count == 0)
+                {
+                    if (Msg == true)
+                    {
+                        //MessageBox.Show("娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒", "鎻愮ず");
+                    }
+                    return false;
+                }
+                else
+                {
+                    ModID = ClsPub.isLong(Ds.Tables[0].Rows[0]["ID"].ToString());  //杩斿洖妯″潡
+                }
+                if (LogTF == 1 || LogTF == 3)//闇�瑕佸垽鏂潈闄�
+                {
+                    //鏍规嵁鐢ㄦ埛鍚嶇О鍒ゆ柇鏉冮檺
+                    DsUser = oCn.RunProcReturn("select * from gy_czygl where czymc='" + UserID.Trim() + "'", "gy_czygl");
+                    if (DsUser.Tables[0].Rows.Count == 0)
+                    {
+                        if (Msg == true)
+                        {
+                            //MessageBox.Show("娌℃湁鎵惧埌褰撳墠鎿嶄綔鍛橈紒", "鎻愮ず");
+                        }
+                        return false;
+                    }
+                    //鏍规嵁鐢ㄦ埛鍚嶇О鍒ゆ柇鏉冮檺
+                    if ((bool)DsUser.Tables[0].Rows[0]["ManagerFlag"])  //鏄惁绠$悊鍛�
+                    {
+                        HavRight = true;
+                    }
+                    else
+                    {
+                        if (DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
+                        {
+                            HavRight = true;
+                        }
+                        else
+                        {
+                            //鑾峰彇鐢ㄦ埛缁�  骞跺惊鐜垽鏂潈闄�
+                            //鍒ゆ柇瑙掕壊鏄惁鏈夋潈闄�
+                            DsJS = oCn.RunProcReturn("select isnull(AuthorityID,'') AuthorityID from System_UserGroupinfo a inner join System_UserGroup b on a.GroupID=b.GroupID " +
+                                " Where a.USERID='" + UserID.Trim() + "'", "gy_czygl");
+                            if (DsJS == null)
+                            {
+                                HavRight = false;
+                            }
+                            else
+                            {
+                                HavRight = false;
+                                for (int i = 0; i < DsJS.Tables[0].Rows.Count; i++)
+                                {
+                                    if (ClsPub.isStrNull(DsJS.Tables[0].Rows[i]["AuthorityID"]).Length > ModID)
+                                    {
+                                        if (DsJS.Tables[0].Rows[i]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
+                                        {
+                                            HavRight = true;
+                                            break;
+                                        }
+                                    }
+                                }
+
+                            }
+                        }
+                    }
+
+                    if (HavRight == false)
+                    {
+                        if (Msg == true)
+                        {
+                            //MessageBox.Show("鎮ㄦ病鏈夋潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒", "鎻愮ず");
+                        }
+                    }
+                }
+                //闇�瑕佸啓鍏ユ棩蹇�
+                if ((LogTF == 1 && HavRight) || LogTF == 2)
+                {
+                    //Add_Log(Ds.Tables[0].Rows[0]["id"].ToString().Trim(), gnsy + "," + Ds.Tables[0].Rows[0]["gnmc"].ToString().Trim(), CurUserName);
+                }
+                return HavRight;
+            }
+            catch (Exception e)
+            {
+                if (Msg == true)
+                {
+                    //MessageBox.Show("鍒ゆ柇鏉冮檺鏃跺彂鐜伴敊璇�,璇蜂笌绠$悊鍛樿仈绯伙紒", "鎻愮ず");
+                }
+                return false;
+            }
+        }
+
         //
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs
index 8a698fb..dc82efa 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs
@@ -508,7 +508,7 @@
                     //oItem.HDeptID = 0;        //楠屾敹閮ㄩ棬(Gy_Department)
                     //oItem.HExplanation = "";  //鎽樿(鏁呴殰鎻忚堪)  
                     //oItem.HRemark = "";       //澶囨敞
-
+                    
                     //oItem.HMainSourceInterID = oItem.HInterID;
 
                     //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
diff --git a/WebAPI/DLL/ClsSc_MouldRepairChangeBill.cs b/WebAPI/DLL/ClsSc_MouldRepairChangeBill.cs
index c7e9544..d653986 100644
--- a/WebAPI/DLL/ClsSc_MouldRepairChangeBill.cs
+++ b/WebAPI/DLL/ClsSc_MouldRepairChangeBill.cs
@@ -46,14 +46,14 @@
                 "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HDate," +
                 "HMaker,HMakeDate,HInnerBillNo,HRepairID,HDeptID,HRepairBeginDate,HRepairEndDate," +
                 "HCycleUnit,HPlanTimes,HTimes,HChangeNum,HEmpID,HManagerID,HRepairType,HSupID," +
-                "HNewMaterID,HNewName,HNewModel,HNewModel2,HExplanation,HRepairContent,HRemark" +
+                "HNewMaterID,HNewName,HNewModel,HNewModel2,HExplanation,HRepairContent,HRemark,HChangeType" +
                 ") " +
                 " values("+omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                 ",'"  + omodel.HMaker + "',getdate()" + 
                 ",'" + omodel.HInnerBillNo+"',"+ omodel.HRepairID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HRepairBeginDate + "','" + omodel.HRepairEndDate +
                 "','" + omodel.HCycleUnit + "'," + omodel.HPlanTimes.ToString() + "," + omodel.HTimes.ToString() + "," + omodel.HChangeNum.ToString()  + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() +
                  ",'" + omodel.HRepairType + "'," + omodel.HSupID.ToString() + "," + omodel.HNewMaterID.ToString() + ",'"+ omodel.HNewName + "','" + omodel.HNewModel + "','" + omodel.HNewModel2 + "','" + omodel.HExplanation  + "','" + omodel.HRepairContent + "','" + omodel.HRemark+
-                 "') ");
+                 "','"+omodel.HChangeType + "') ");
                 //鎻掑叆瀛愯〃
                 foreach (Models.ClsSc_MouldRepairChangeBillSub oSub in DetailColl)
                 {
diff --git a/WebAPI/Models/ClsSc_MouldRepairChangeBillMain.cs b/WebAPI/Models/ClsSc_MouldRepairChangeBillMain.cs
index 114f0e8..3d19e8c 100644
--- a/WebAPI/Models/ClsSc_MouldRepairChangeBillMain.cs
+++ b/WebAPI/Models/ClsSc_MouldRepairChangeBillMain.cs
@@ -28,6 +28,7 @@
         public string HNewBarCode;        /*--鏀瑰埗鍚庢柊鏉$爜*/
         public string HNewDesignLife;       /*--鏂拌璁″鍛�*/
         public string HExplanation;           /* --鏀瑰埗瑕佹眰*/
+        public string HChangeType;         /* --鏀瑰瀷绫诲瀷*/
         public string HRemark;         /* --澶囨敞*/
         public string HInnerBillNo;        /* --鍐呴儴鍗曟嵁鍙�*/
     }
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index 5407aef..942231f 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -18,25 +18,25 @@
       <publishTime>02/22/2013 16:43:40</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>10/22/2021 13:46:33</publishTime>
+      <publishTime>10/22/2021 15:00:35</publishTime>
     </File>
     <File Include="bin/BLL.pdb">
-      <publishTime>10/22/2021 13:46:33</publishTime>
+      <publishTime>10/22/2021 15:00:35</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>10/22/2021 13:46:28</publishTime>
+      <publishTime>10/22/2021 15:00:33</publishTime>
     </File>
     <File Include="bin/DAL.pdb">
-      <publishTime>10/22/2021 13:46:28</publishTime>
+      <publishTime>10/22/2021 15:00:33</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 22:52:40</publishTime>
     </File>
     <File Include="bin/DBUtility.dll">
-      <publishTime>10/22/2021 13:46:19</publishTime>
+      <publishTime>10/22/2021 15:00:29</publishTime>
     </File>
     <File Include="bin/DBUtility.pdb">
-      <publishTime>10/22/2021 13:46:19</publishTime>
+      <publishTime>10/22/2021 15:00:29</publishTime>
     </File>
     <File Include="bin/Interop.gregn6Lib.dll">
       <publishTime>08/25/2021 10:28:25</publishTime>
@@ -60,10 +60,10 @@
       <publishTime>07/25/2012 19:48:56</publishTime>
     </File>
     <File Include="bin/Model.dll">
-      <publishTime>10/22/2021 13:46:21</publishTime>
+      <publishTime>10/22/2021 15:00:30</publishTime>
     </File>
     <File Include="bin/Model.pdb">
-      <publishTime>10/22/2021 13:46:21</publishTime>
+      <publishTime>10/22/2021 15:00:30</publishTime>
     </File>
     <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
       <publishTime>08/09/2021 15:55:25</publishTime>
@@ -72,22 +72,22 @@
       <publishTime>08/04/2014 04:33:56</publishTime>
     </File>
     <File Include="bin/Pub_Class.dll">
-      <publishTime>10/22/2021 13:46:15</publishTime>
+      <publishTime>10/22/2021 15:00:27</publishTime>
     </File>
     <File Include="bin/Pub_Class.pdb">
-      <publishTime>10/22/2021 13:46:15</publishTime>
+      <publishTime>10/22/2021 15:00:27</publishTime>
     </File>
     <File Include="bin/Pub_Control.dll">
-      <publishTime>10/22/2021 13:46:17</publishTime>
+      <publishTime>10/22/2021 15:00:28</publishTime>
     </File>
     <File Include="bin/Pub_Control.pdb">
-      <publishTime>10/22/2021 13:46:17</publishTime>
+      <publishTime>10/22/2021 15:00:28</publishTime>
     </File>
     <File Include="bin/SQLHelper.dll">
-      <publishTime>10/22/2021 13:46:17</publishTime>
+      <publishTime>10/22/2021 15:00:29</publishTime>
     </File>
     <File Include="bin/SQLHelper.pdb">
-      <publishTime>10/22/2021 13:46:17</publishTime>
+      <publishTime>10/22/2021 15:00:29</publishTime>
     </File>
     <File Include="bin/stdole.dll">
       <publishTime>05/09/2021 13:35:37</publishTime>
@@ -189,10 +189,10 @@
       <publishTime>11/24/2014 19:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>10/22/2021 13:46:37</publishTime>
+      <publishTime>10/22/2021 15:00:38</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>10/22/2021 13:46:37</publishTime>
+      <publishTime>10/22/2021 15:00:38</publishTime>
     </File>
     <File Include="bin/WebGrease.dll">
       <publishTime>07/18/2013 01:03:52</publishTime>
@@ -363,7 +363,7 @@
       <publishTime>08/06/2021 22:57:28</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>10/22/2021 13:46:48</publishTime>
+      <publishTime>10/22/2021 15:01:44</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file

--
Gitblit v1.9.1