From d39e6a7dcb32ab0d8dd4e087106cfd8f6307823b Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 06 三月 2024 15:35:31 +0800
Subject: [PATCH] 设备档案列表 增加 左边树形 器具分类,点击分类,根据分类来过滤,方便选择 设备档案分类 的基础资料 完善禁用 反禁用按钮

---
 WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs |  133 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 103 insertions(+), 30 deletions(-)

diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
index 8011c2a..75d10cd 100644
--- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
+++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
@@ -65,7 +65,6 @@
             public string HMainSourceBillNo;
             public string HMainSourceBillType;
             public int HOrderLevID;
-            public int HHasten;
         }
         #endregion
 
@@ -183,8 +182,8 @@
                 int HMainSourceEntryID = mainList[0].HMainSourceEntryID;
                 string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
                 string HMainSourceBillType = mainList[0].HMainSourceBillType;
-                int HOrderLevID = mainList[0].HOrderLevID == null ? 0 : mainList[0].HOrderLevID;
-                int HHasten = mainList[0].HHasten == null ? 0 : mainList[0].HHasten;
+                int HOrderLevID = mainList[0].HOrderLevID;
+
 
 
                 if (OperationType == 2)
@@ -206,7 +205,7 @@
                 {
                     string sql = "insert into PM_WorkTaskBillMain" +
                         "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" +
-                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten)" +
+                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID)" +
                         "values(" +
                         "" + HYear +
                         "," + HPeriod +
@@ -236,7 +235,6 @@
                         ",'" + HMainSourceBillNo +
                         "','" + HMainSourceBillType +
                         "','" + HOrderLevID  +
-                        "','" +  HHasten  +
                         "')";
 
                     //涓昏〃
@@ -274,7 +272,6 @@
                         ",HMainSourceBillNo = '" + HMainSourceBillNo +
                         "',HMainSourceBillType = '" + HMainSourceBillType +
                         "',HOrderLevID  = '" + HOrderLevID  +
-                        "',HHasten  = '" + HHasten +
                         "' where HInterID = " + HInterID;
 
                     oCN.RunProc(sql);
@@ -288,7 +285,7 @@
                 {
                     string sql = "insert into PM_WorkTaskBillMain" +
                         "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" +
-                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten )" +
+                        ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID )" +
                         "values(" +
                         "" + HYear +
                         "," + HPeriod +
@@ -318,7 +315,6 @@
                         ",'" + HMainSourceBillNo +
                         "','" + HMainSourceBillType +
                         "','" + HOrderLevID +
-                        "','" + HHasten +
                         "')";
                     //涓昏〃
                     oCN.RunProc(sql);
@@ -1087,7 +1083,7 @@
                 BillOld.MvarItemKey = "PM_WorkTaskBillMain";
                 oCN.BeginTran();//寮�濮嬩簨鍔�
 
-                //Type 0 寮�濮嬩换鍔�  1  鎾ら攢浠诲姟
+                //Type 0 寮�濮嬩换鍔�  1  鎾ら攢浠诲姟  2缁撴潫浠诲姟
                 if (Type == 0)
                 {
                     //鍒ゆ柇鍗曟嵁鏄惁瀛樺湪
@@ -1104,8 +1100,20 @@
                     }
                     if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                     {
-                        string  sql1= "update PM_WorkTaskBillMain  set  HTaskStatus='杩涜涓�' where HinterID = " + HInterID;
-                        ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain");
+                        if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HMainSourceBillType"])== "4759")
+                        {
+                            var lInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"];
+                            string sql1 = "update  PM_WorkTaskBillMain   set  HTaskStatus='宸插紑濮�' where HinterID = " + HInterID;
+                            oCN.RunProc(sql1);
+                            string sql2 = "update PM_CustomerTaskBillMain  set  HTaskStatus='宸插紑濮�' where HinterID = " + lInterID;
+                            oCN.RunProc(sql2);
+                        }
+                        else
+                        {
+                            string sql2 = "update PM_WorkTaskBillMain  set  HTaskStatus='宸插紑濮�' where HinterID = " + HInterID;
+                            oCN.RunProc(sql2);
+                        }
+                      
 
                     }
                 }
@@ -1125,29 +1133,70 @@
                     }
                     if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                     {
+                        var lInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"];
                         string sql1 = "update PM_WorkTaskBillMain  set   HTaskStatus='鏈紑濮�' where HinterID = " + HInterID;
-                        ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain");
+                        oCN.RunProc(sql1);
+                        string sql2 = "update PM_CustomerTaskBillMain   set  HTaskStatus='鏈紑濮�' where HinterID = " + lInterID;
+                        oCN.RunProc(sql2);
                     }
                 }
-                else if (Type == 2)
+                oCN.Commit();//鎻愪氦浜嬪姟
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎵ц鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult; ;
+
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ヤ綔浠诲姟  鍌績娆℃暟鍔熻兘
+        [Route("PM_WorkTaskBill/UpdateHHasten")]
+        [HttpGet]
+        public object UpdateHHasten(string HInterID, int HHasten, string user)
+        {
+            try
+            {
+
+                if (string.IsNullOrWhiteSpace(HInterID))
                 {
-                    //鍒ゆ柇鍗曟嵁鏄惁瀛樺湪
-                    DataSet ds;
-                    string sql = "select * from PM_WorkTaskBillMain  where HinterID = " + HInterID;
-                    ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain");
-                    if (ds == null || ds.Tables[0].Rows.Count == 0)
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
-                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
-                    {
-                        string sql1 = "update PM_WorkTaskBillMain  set   HTaskStatus='宸茬粨鏉�' where HinterID = " + HInterID;
-                        ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain");
-                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ClsPub.CurUserName = user;
+                BillOld.MvarItemKey = "PM_WorkTaskBillMain";
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+
+                DataSet ds;
+                string sql = "select * from PM_WorkTaskBillMain  where HinterID = " + HInterID;
+                ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+                {
+                    string sql1 = "update PM_WorkTaskBillMain  set   HHasten='"+ HHasten+ "' where HinterID = " + HInterID;
+                    ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain");
                 }
 
                 oCN.Commit();//鎻愪氦浜嬪姟
@@ -1476,6 +1525,30 @@
                 string HSourceBillType = oSub.HSourceBillType;
                 bool HFinishFlag = oSub.HFinishFlag;
 
+                if (HFinishFlag==true)
+                {
+                    //鍒ゆ柇鍗曟嵁鏄惁瀛樺湪
+                    DataSet ds;
+                    string sqls = "select * from PM_WorkTaskBillMain  where HinterID = " + HSourceInterID;
+                    ds = oCN.RunProcReturn(sqls, "PM_WorkTaskBillMain");
+                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+                    {
+                        var lInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"];
+                        string sql1 = "update PM_WorkTaskBillMain  set   HTaskStatus='宸插畬鎴�' where HinterID = " + HSourceInterID;
+                        oCN.RunProc(sql1);
+                        string sql2 = "update PM_CustomerTaskBillMain   set   HTaskStatus='宸插畬鎴�' where HinterID = " + lInterID;
+                        oCN.RunProc(sql2);
+                    }
+                }
+
                 string sql = "insert into PM_WorkTaskReportBillSub" +
                     "(HInterID,HBillNo_bak,HEntryID,HRemark,HProjectID,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HFinishFlag) " +
                     "values(" +

--
Gitblit v1.9.1