Browse Source

复制时更新序号

qinqi 2 năm trước cách đây
mục cha
commit
62e0fcdf41
1 tập tin đã thay đổi với 16 bổ sung3 xóa
  1. 16 3
      wwwroot/mes/pm/fqcitems/fqcitemsdetail.ashx

+ 16 - 3
wwwroot/mes/pm/fqcitems/fqcitemsdetail.ashx

@@ -742,6 +742,19 @@ public class fqcitemsdetail : IHttpHandler, IReadOnlySessionState
                        new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
                     );
                 }
+                if (itemsID > 0)
+                {
+                    //更新序号 
+                    int result2 = conn.ExecuteNonQuery(@"
+                        UPDATE TP_PM_FQCITEMSDETAIL C SET C.XUHAO = (
+                        SELECT DISTINCT A.XUHAO FROM TP_PM_FQCITEMSDETAIL A
+                        WHERE A.INSPECTITEM = C.INSPECTITEM 
+                         AND A.ITEMSID = 164 ) WHERE C.ITEMSID = @ITEMSID@
+                    ",
+                        new CDAParameter("ITEMSID", itemsID)
+                    );
+                }
+                
             }
             else
             {
@@ -878,9 +891,9 @@ public class fqcitemsdetail : IHttpHandler, IReadOnlySessionState
                 sqlStr += " AND INSTR( m.REMARKS, @REMARKS@ ) > 0 ";
                 sqlPara.Add(new CDAParameter("REMARKS", form["REMARKS"]));
             }
-            
-             sqlStr += "ORDER BY XUHAO,SID DESC";
-             
+
+            sqlStr += "ORDER BY XUHAO,SID DESC";
+
             int total = 0;
             DataTable dt = conn.SelectPages(page, rows, out total, sqlStr, sqlPara.ToArray());
             return new JsonResult(dt) { total = total }.ToJson();