From f1c258211a7bcc79cb7b86e6007a27afebb24e21 Mon Sep 17 00:00:00 2001
From: 沈泽 <211959439@qq.com>
Date: 星期一, 18 十月 2021 16:23:31 +0800
Subject: [PATCH] 新增工资结算单(集体),工资结算各列表表体的金额能自动按照工时*数量*工价得出总价且能按照所选物料和工序自动填入工价,加入工序流转卡维护拆分功能权限

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |   64 +++++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 05fabe2..97f9cf9 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -359,10 +359,18 @@
         /// </summary>
         [Route("Gy_Mould/list1")]
         [HttpGet]
-        public object list1(string sWhere)
+        public object list1(string sWhere,string ModRightNameSelect, string user)
         {
             try
             {
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameSelect, 1, true, 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_Gy_MouldFileList " + sWhere, "h_v_Gy_MouldFileList");
@@ -509,13 +517,26 @@
         /// </summary>
         [Route("Gy_Mould_Edit/AddBill")]
         [HttpPost]
-        public object AddBill([FromBody] JObject sMainSub)
+        public object AddBill([FromBody] JObject oMain)
         {
-            var _value = sMainSub["oMain"].ToString();
+            var _value = oMain["oMain"].ToString();
             string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();//妯″潡鏉冮檺
+            string msg4 = sArray[2].ToString();//褰撳墠浜�
+
             oCN.BeginTran();
+            if (!DBUtility.ClsPub.Security_Log(msg3, 1, true, msg4))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
             //淇濆瓨涓昏〃
-            objJsonResult = AddBillMain(msg1);
+            objJsonResult = AddBillMain(msg2);
             if (objJsonResult.code == "0")
             {
                 oCN.RollBack();
@@ -532,10 +553,8 @@
             return objJsonResult;
         }
 
-        public json AddBillMain(string msg1)
+        public json AddBillMain(string msg2)
         {
-            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
-            string msg2 = sArray[0].ToString();
             try
             {
                 msg2 = "[" + msg2.ToString() + "]";
@@ -650,16 +669,25 @@
         [HttpPost]
         public object AddBill1([FromBody] JObject oMain)
         {
-
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();//妯″潡鏉冮檺
+            string msg4 = sArray[2].ToString();//褰撳墠浜�
             try
             {
+                if (!DBUtility.ClsPub.Security_Log(msg3, 1, true, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 DAL.ClsGy_MouldFile oMould = new DAL.ClsGy_MouldFile();
                 DAL.ClsGy_MouldFileMain_View oDeptHlp = new DAL.ClsGy_MouldFileMain_View();
 
-                var _value = oMain["oMain"].ToString();
-                string msg1 = _value.ToString();
-                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
-                string msg2 = sArray[0].ToString();
 
                 //鍙嶅簭鍒楀寲
                 msg2 = "[" + msg2.ToString() + "]";
@@ -814,12 +842,20 @@
         /// </summary>
         [Route("Gy_Mould_Edit/Delete_Json")]
         [HttpGet]
-        public object Delete_Json(long hmainid)
+        public object Delete_Json(long hmainid, string ModRightNameDelete, string user)
         {
             DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
             try
             {
-                    if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo))
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo))
                     {
                         //鍐欏叆鏃ュ織
                         ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName);

--
Gitblit v1.9.1