Просмотр исходного кода

修改当项多时 以pager方式获取数据结果有误的bug

machenyang лет назад: 8
Родитель
Сommit
bb6100b6d1

+ 9 - 27
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/GDLXSJController.cs

28
             //添加第一行标题
28
             //添加第一行标题
29
             //DataColumn dc1 = new DataColumn("");
29
             //DataColumn dc1 = new DataColumn("");
30
             //dtNew.Columns.Add(dc1);
30
             //dtNew.Columns.Add(dc1);
31
-            var sqlGDLY1 = "select F_CategoryId,F_CategoryName from T_RepositoryCategory where 1=1 and F_CategoryType = 1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_DeleteFlag = 0 and F_CategoryName = '试剂')";
31
+            var sqlGDLY1 = "select F_CategoryId,F_CategoryName from T_RepositoryCategory where 1=1 and F_CategoryType = 1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_DeleteFlag = 0 and F_CategoryName = '试剂') and F_DeleteFlag = 0";
32
             var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
32
             var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
33
             int dtGDLY1rowcount = dtGDLY1.Rows.Count;
33
             int dtGDLY1rowcount = dtGDLY1.Rows.Count;
34
             //列名
34
             //列名
41
             for (int v = 0; v < dtGDLY1rowcount; v++)
41
             for (int v = 0; v < dtGDLY1rowcount; v++)
42
             {
42
             {
43
                 string catename = dtGDLY1.Rows[v]["F_CategoryName"].ToString();
43
                 string catename = dtGDLY1.Rows[v]["F_CategoryName"].ToString();
44
-                var count_sub = int.Parse(DbHelperSQL.GetSingle("select count(*) from T_RepositoryCategory where 1=1 and F_CategoryType = 1 and F_DeleteFlag = 0 and F_ParentId=" + int.Parse(dtGDLY1.Rows[v]["F_CategoryId"].ToString()) + "").ToString());
44
+                var count_sub = int.Parse(DbHelperSQL.GetSingle("select count(*) from T_RepositoryCategory where 1=1 and F_DeleteFlag = 0 and F_CategoryType = 1 and F_ParentId=" + int.Parse(dtGDLY1.Rows[v]["F_CategoryId"].ToString()) + "").ToString());
45
                 dtGDLY1_name[v + 1] = catename;
45
                 dtGDLY1_name[v + 1] = catename;
46
                 dtGDLY1_count[v + 1] = count_sub;
46
                 dtGDLY1_count[v + 1] = count_sub;
47
             }
47
             }
99
               "*",
99
               "*",
100
               sqlGDLY,
100
               sqlGDLY,
101
               "ORDER BY F_ParentId asc",
101
               "ORDER BY F_ParentId asc",
102
-              10,
102
+              100,
103
               1,
103
               1,
104
               true,
104
               true,
105
               out recordCount);
105
               out recordCount);
134
         {
134
         {
135
             DataTable dtNew = new DataTable();
135
             DataTable dtNew = new DataTable();
136
             #region 添加表格标题
136
             #region 添加表格标题
137
-            ////添加第一行标题
138
-            ////DataColumn dc1 = new DataColumn("");
139
-            ////dtNew.Columns.Add(dc1);
140
-            //var sqlGDLY1 = "select F_CategoryId,F_CategoryName from T_RepositoryCategory where 1=1 and F_CategoryType = 1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_DeleteFlag = 0 and F_CategoryName = '试剂'))";
141
-            //var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
142
-            //int dtGDLY1rowcount = dtGDLY1.Rows.Count;
143
-            ////列名
144
-            //string[] dtGDLY1_name = new string[dtGDLY1rowcount + 1];
145
-            //dtGDLY1_name[0] = "";
146
-            ////列数
147
-            //int[] dtGDLY1_count = new int[dtGDLY1rowcount + 1];
148
-            //dtGDLY1_count[0] = 1;
149
-
150
-            //for (int v = 0; v < dtGDLY1rowcount; v++)
151
-            //{
152
-            //    string catename = dtGDLY1.Rows[v]["F_CategoryName"].ToString();
153
-            //    var count_sub = int.Parse(DbHelperSQL.GetSingle("select count(*) from T_RepositoryCategory where 1=1 and F_CategoryType = 1 and F_ParentId=" + int.Parse(dtGDLY1.Rows[v]["F_CategoryId"].ToString()) + "").ToString());
154
-            //    dtGDLY1_name[v + 1] = catename;
155
-            //    dtGDLY1_count[v + 1] = count_sub;
156
-            //}
157
-
158
             //添加第二行标题
137
             //添加第二行标题
159
             DataColumn dc = new DataColumn("姓名");
138
             DataColumn dc = new DataColumn("姓名");
160
             dtNew.Columns.Add(dc);
139
             dtNew.Columns.Add(dc);
161
-            var sqlGDLY = " and F_CategoryType=1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_DeleteFlag = 0 and F_CategoryName = '试剂') and F_DeleteFlag = 0 ) and F_DeleteFlag = 0";
140
+            var sqlGDLY = " and F_CategoryType=1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_ParentId in (select F_CategoryId from T_RepositoryCategory where F_CategoryType = 1 and F_DeleteFlag = 0 and F_CategoryName = '试剂') and F_DeleteFlag = 0) and F_DeleteFlag = 0";
162
             var recordCount = 0;
141
             var recordCount = 0;
163
             var dtGDLY = BLL.PagerBLL.GetListPager(
142
             var dtGDLY = BLL.PagerBLL.GetListPager(
164
               "T_RepositoryCategory",
143
               "T_RepositoryCategory",
166
               "*",
145
               "*",
167
               sqlGDLY,
146
               sqlGDLY,
168
               "ORDER BY F_ParentId asc",
147
               "ORDER BY F_ParentId asc",
169
-              10,
148
+              100,
170
               1,
149
               1,
171
               true,
150
               true,
172
               out recordCount);
151
               out recordCount);
313
                 //colpos[dtcolpos + 2] = 1;
292
                 //colpos[dtcolpos + 2] = 1;
314
                 //colpos[dtcolpos + 3] = 1;
293
                 //colpos[dtcolpos + 3] = 1;
315
 
294
 
295
+
296
+
316
                 NPOIHelper npoi = new NPOIHelper();
297
                 NPOIHelper npoi = new NPOIHelper();
317
                 DataTable dt = getData(stime, endtime);
298
                 DataTable dt = getData(stime, endtime);
318
                 #region 处理第二行标题
299
                 #region 处理第二行标题
326
                   "*",
307
                   "*",
327
                   sqlGDLY,
308
                   sqlGDLY,
328
                   "ORDER BY F_ParentId asc",
309
                   "ORDER BY F_ParentId asc",
329
-                  10,
310
+                  100,
330
                   1,
311
                   1,
331
                   true,
312
                   true,
332
                   out recordCount);
313
                   out recordCount);
340
                 }
321
                 }
341
                 colnames.Add("");
322
                 colnames.Add("");
342
                 #endregion
323
                 #endregion
324
+
343
                 if (npoi.ExportToExcelForGDLX("工单类型试剂报表", dt, "试剂", dtGDLY1_name, colpos, colnames) == "")
325
                 if (npoi.ExportToExcelForGDLX("工单类型试剂报表", dt, "试剂", dtGDLY1_name, colpos, colnames) == "")
344
                 {
326
                 {
345
                     var obj = new
327
                     var obj = new

+ 3 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/GDLXYQController.cs

102
               "*",
102
               "*",
103
               sqlGDLY,
103
               sqlGDLY,
104
               "ORDER BY F_ParentId asc",
104
               "ORDER BY F_ParentId asc",
105
-              10,
105
+              100,
106
               1,
106
               1,
107
               true,
107
               true,
108
               out recordCount);
108
               out recordCount);
148
               "*",
148
               "*",
149
               sqlGDLY,
149
               sqlGDLY,
150
               "ORDER BY F_ParentId asc",
150
               "ORDER BY F_ParentId asc",
151
-              10,
151
+              100,
152
               1,
152
               1,
153
               true,
153
               true,
154
               out recordCount);
154
               out recordCount);
310
                   "*",
310
                   "*",
311
                   sqlGDLY,
311
                   sqlGDLY,
312
                   "ORDER BY F_ParentId asc",
312
                   "ORDER BY F_ParentId asc",
313
-                  10,
313
+                  100,
314
                   1,
314
                   1,
315
                   true,
315
                   true,
316
                   out recordCount);
316
                   out recordCount);