Bladeren bron

工单类型试剂 和 工单类型仪器 bug 修改

lihai 7 jaren geleden
bovenliggende
commit
4eca8193d9

+ 26 - 11
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/GDLXSJController.cs

@@ -29,7 +29,7 @@ namespace CallCenterApi.Interface.Controllers.report
29 29
             //添加第一行标题
30 30
             //DataColumn dc1 = new DataColumn("");
31 31
             //dtNew.Columns.Add(dc1);
32
-            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 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 ORDER BY F_ParentId ASC";
33 33
             var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
34 34
             int dtGDLY1rowcount = dtGDLY1.Rows.Count;
35 35
             //列名
@@ -66,7 +66,7 @@ namespace CallCenterApi.Interface.Controllers.report
66 66
             //添加第一行标题
67 67
             //DataColumn dc1 = new DataColumn("");
68 68
             //dtNew.Columns.Add(dc1);
69
-            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";
69
+            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 ORDER BY F_ParentId ASC";
70 70
             var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
71 71
             int dtGDLY1rowcount = dtGDLY1.Rows.Count;
72 72
             //列名
@@ -99,7 +99,7 @@ namespace CallCenterApi.Interface.Controllers.report
99 99
               "F_CategoryId",
100 100
               "*",
101 101
               sqlGDLY,
102
-              "ORDER BY F_ParentId asc",
102
+              "ORDER  BY F_ParentId ASC,F_Sort ASC",
103 103
               100,
104 104
               1,
105 105
               true,
@@ -110,18 +110,32 @@ namespace CallCenterApi.Interface.Controllers.report
110 110
             for (int i = 0; i < modelList.Count; i++)
111 111
             {
112 112
                 string colname = modelList[i].F_CategoryName;
113
-                if (colnames.Contains(colname))
114
-                    colname += "_" + i;
113
+                //if (colnames.Contains(colname))
114
+                //    colname += "_" + i;
115
+                //colname = "list" + i;
115 116
                 colnames.Add(colname);
116 117
             }
117
-            //dtNew.Columns.Add("总计");
118 118
             colnames.Add("");
119
+
120
+            #region 第二行标题 - 作为临时字段(解决返回字典重复问题)
121
+            List<string> colnames2 = new List<string>();
122
+            colnames2.Add("姓名");
123
+            for (int i = 0; i < modelList.Count; i++)
124
+            {
125
+                string colname2 = "";
126
+                colname2 = "list" + i;
127
+                colnames2.Add(colname2);
128
+            }
129
+            colnames2.Add("");
130
+            #endregion
131
+
119 132
             #endregion
120 133
             var obj = new
121 134
             {
122 135
                 linename = dtGDLY1_name,
123 136
                 linecount = dtGDLY1_count,
124 137
                 lineSeName = colnames,
138
+                lineSeName2 = colnames2,
125 139
                 dtlist = dtNew
126 140
             };
127 141
             res = Success("获取工单类型数据成功", obj);
@@ -143,7 +157,7 @@ namespace CallCenterApi.Interface.Controllers.report
143 157
               "F_CategoryId",
144 158
               "*",
145 159
               sqlGDLY,
146
-              "ORDER BY F_ParentId asc",
160
+              "ORDER  BY F_ParentId ASC,F_Sort ASC",
147 161
               100,
148 162
               1,
149 163
               true,
@@ -154,8 +168,9 @@ namespace CallCenterApi.Interface.Controllers.report
154 168
             for (int i = 0; i < modelList.Count; i++)
155 169
             {
156 170
                 string colname = modelList[i].F_CategoryName;
157
-                if (dtNew.Columns.Contains(colname))
158
-                    colname += "_" + i;
171
+                //if (dtNew.Columns.Contains(colname))
172
+                //    colname += "_" + i;
173
+                colname = "list" + i;
159 174
                 dtNew.Columns.Add(new DataColumn(colname));
160 175
                 cateid[i] = modelList[i].F_CategoryId;
161 176
             }
@@ -230,7 +245,7 @@ namespace CallCenterApi.Interface.Controllers.report
230 245
                 //添加第一行标题
231 246
                 //DataColumn dc1 = new DataColumn("");
232 247
                 //dtNew.Columns.Add(dc1);
233
-                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";
248
+                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 ORDER BY F_ParentId ASC";
234 249
                 var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
235 250
                 int dtGDLY1rowcount = dtGDLY1.Rows.Count;
236 251
                 //每块占的列数
@@ -305,7 +320,7 @@ namespace CallCenterApi.Interface.Controllers.report
305 320
                   "F_CategoryId",
306 321
                   "*",
307 322
                   sqlGDLY,
308
-                  "ORDER BY F_ParentId asc",
323
+                  "ORDER  BY F_ParentId ASC,F_Sort ASC",
309 324
                   100,
310 325
                   1,
311 326
                   true,

+ 24 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/GDLXYQController.cs

@@ -31,7 +31,7 @@ namespace CallCenterApi.Interface.Controllers.report
31 31
             //添加第一行标题
32 32
             //DataColumn dc1 = new DataColumn("");
33 33
             //dtNew.Columns.Add(dc1);
34
-            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";
34
+            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 ORDER BY F_ParentId ASC";
35 35
             var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
36 36
             int dtGDLY1rowcount = dtGDLY1.Rows.Count;
37 37
             //列名
@@ -68,7 +68,7 @@ namespace CallCenterApi.Interface.Controllers.report
68 68
             //添加第一行标题
69 69
             //DataColumn dc1 = new DataColumn("");
70 70
             //dtNew.Columns.Add(dc1);
71
-            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";
71
+            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 ORDER BY F_ParentId ASC";
72 72
             var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
73 73
             int dtGDLY1rowcount = dtGDLY1.Rows.Count;
74 74
             //列名
@@ -101,7 +101,7 @@ namespace CallCenterApi.Interface.Controllers.report
101 101
               "F_CategoryId",
102 102
               "*",
103 103
               sqlGDLY,
104
-              "ORDER BY F_ParentId asc",
104
+              "ORDER  BY F_ParentId ASC,F_Sort ASC",
105 105
               100,
106 106
               1,
107 107
               true,
@@ -120,12 +120,25 @@ namespace CallCenterApi.Interface.Controllers.report
120 120
             }
121 121
             //dtNew.Columns.Add("总计");
122 122
             colnames.Add("");
123
+
124
+            #region 第二行标题 - 作为临时字段(解决返回字典重复问题)
125
+            List<string> colnames2 = new List<string>();
126
+            colnames2.Add("姓名");
127
+            for (int i = 0; i < modelList.Count; i++)
128
+            {
129
+                string colname2 = "";
130
+                colname2 = "list" + i;
131
+                colnames2.Add(colname2);
132
+            }
133
+            colnames2.Add("");
134
+            #endregion
123 135
             #endregion
124 136
             var obj = new
125 137
             {
126 138
                 linename = dtGDLY1_name,
127 139
                 linecount = dtGDLY1_count,
128 140
                 lineSeName = colnames,
141
+                lineSeName2 = colnames2,
129 142
                 dtlist = dtNew
130 143
             };
131 144
             res = Success("获取工单类型数据成功", obj);
@@ -147,7 +160,7 @@ namespace CallCenterApi.Interface.Controllers.report
147 160
               "F_CategoryId",
148 161
               "*",
149 162
               sqlGDLY,
150
-              "ORDER BY F_ParentId asc",
163
+              "ORDER  BY F_ParentId ASC,F_Sort ASC",
151 164
               100,
152 165
               1,
153 166
               true,
@@ -157,9 +170,11 @@ namespace CallCenterApi.Interface.Controllers.report
157 170
 
158 171
             for (int i = 0; i < modelList.Count; i++)
159 172
             {
160
-                string colname = modelList[i].F_CategoryName;
161
-                if (dtNew.Columns.Contains(colname))
162
-                    colname += "_" + i;
173
+                //string colname = modelList[i].F_CategoryName;
174
+                //if (dtNew.Columns.Contains(colname))
175
+                //    colname += "_" + i;
176
+                string colname = "";
177
+                colname = "list" + i;
163 178
                 dtNew.Columns.Add(new DataColumn(colname));
164 179
                 cateid[i] = modelList[i].F_CategoryId;
165 180
             }
@@ -234,7 +249,7 @@ namespace CallCenterApi.Interface.Controllers.report
234 249
                 //添加第一行标题
235 250
                 //DataColumn dc1 = new DataColumn("");
236 251
                 //dtNew.Columns.Add(dc1);
237
-                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";
252
+                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 ORDER BY F_ParentId ASC";
238 253
                 var dtGDLY1 = DbHelperSQL.Query(sqlGDLY1).Tables[0];
239 254
                 int dtGDLY1rowcount = dtGDLY1.Rows.Count;
240 255
                 //每块占的列数
@@ -309,7 +324,7 @@ namespace CallCenterApi.Interface.Controllers.report
309 324
                   "F_CategoryId",
310 325
                   "*",
311 326
                   sqlGDLY,
312
-                  "ORDER BY F_ParentId asc",
327
+                  "ORDER  BY F_ParentId ASC,F_Sort ASC",
313 328
                   100,
314 329
                   1,
315 330
                   true,