Explorar el Código

督办数据报表

duhongyu %!s(int64=4) %!d(string=hace) años
padre
commit
63556a258c

+ 83 - 31
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Assessment/DataAssessmentController.cs

@@ -214,56 +214,108 @@ namespace CallCenterApi.Interface.Controllers.Assessment
214 214
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
215 215
             if (userModel == null)
216 216
                 return Error("权限不足!");
217
-         //   string sqlwhere = "";
218
-            string strdate = "";string edate = "";
217
+           string edate = "";
219 218
             if (userModel.F_RoleCode == "WLDW")
220 219
                 deptid = userModel.F_DeptId;
221 220
             #region 
221
+            string strdate = date;
222
+            string sqlwhere = "";
222 223
             if (string.IsNullOrEmpty(date))
223 224
             {
224
-                strdate = DateTime.Now.AddMonths (-1).ToString("yyyy-MM")+"-21 00:00:00";
225
-                edate = DateTime.Now.ToString("yyyy-MM") + "-20 23:59:59";
225
+                //strdate = DateTime.Now.ToString("yyyyMM");
226 226
 
227
+                string sql = "select top 1 F_BatchNo  from  T_Data_Supervision order by F_BatchNo desc";
228
+                string dates = DbHelperSQL.GetSingle(sql).ToString();
229
+                if (!string.IsNullOrEmpty(dates))
230
+                {
231
+                    strdate += dates;
232
+                }
233
+                sqlwhere += " and F_BatchNo = '" + Convert.ToDateTime(strdate).ToString("yyyyMM") + "'";
227 234
             }
228
-            else
235
+            //}
236
+           if (!string.IsNullOrEmpty(date))
229 237
             {
230
-                strdate = Convert.ToDateTime(date).AddMonths(-1).ToString("yyyy-MM") + "-21 00:00:00";
231
-                edate = Convert.ToDateTime(date).ToString("yyyy-MM") + "-20 23:59:59";
232
-            }
233
-                //else
234
-                //{
235
-                //    sqlwhere += " and F_BatchNo = '" + Convert.ToDateTime(dates).ToString("yyyyMM") + "'";
236
-                //}
238
+               // strdate = DateTime.Now.ToString("yyyyMM");
239
+                sqlwhere += " and F_BatchNo = '" +Convert.ToDateTime(strdate).ToString("yyyyMM")  + "'";
237 240
 
241
+            }
238 242
 
239
-                //}
240
-                //if (!string.IsNullOrEmpty(date))
241
-                //{
242
-                //   // strdate = DateTime.Now.ToString("yyyyMM");
243
-                //    sqlwhere += " and F_BatchNo = '" +Convert.ToDateTime(strdate).ToString("yyyyMM")  + "'";
243
+            if (deptid > 0)
244
+                sqlwhere += " and F_DeptId=" + deptid;
244 245
 
245
-                //}
246
+            var sqlass = "select * from T_Data_Supervision where 1=1  " + sqlwhere + " order by F_ReciveCount desc ";//此处以查收量倒叙排序
247
+            #endregion
248
+          var list = DbHelperSQL.Query(sqlass).Tables[0];
249
+            var obj = new
250
+            {
251
+                state = "success",
252
+                message = "成功",
253
+                rows = list,
254
+                total = list.Rows.Count
255
+            };
256
+            return Content(obj.ToJson());
257
+        }
246 258
 
247
-                //if (deptid > 0)
248
-                //    sqlwhere += " and F_DeptId=" + deptid;
249 259
 
250
-                //var sqlass = "select * from T_Data_Supervision where 1=1  " + sqlwhere + " order by F_ReciveCount desc ";//此处以查收量倒叙排序
251
-                #endregion
252
-                Dictionary<string, string> paras = new Dictionary<string, string>();
253
-            paras.Add("@deptid", deptid.ToString ());
260
+        public ActionResult GetDBDataList_1(DateTime ? starttime , DateTime? endtime, int deptid = 0,bool isdc=false )
261
+        {
262
+            int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
263
+            if (userId <= 0)
264
+               return Error("权限不足");
265
+            Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
266
+            if (userModel == null)
267
+                return Error("权限不足!");
268
+              string sqlwhere = "";
269
+            string strdate = ""; string edate = "";
270
+            if (userModel.F_RoleCode == "WLDW")
271
+                deptid = userModel.F_DeptId;
272
+            #region 
273
+            string month = "";
274
+            if (starttime==null )
275
+            {
276
+                strdate = DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-21 00:00:00";
277
+            }
278
+            else
279
+            {
280
+                strdate = starttime.Value.ToString("yyyy-MM-dd HH:mm:ss");
281
+                
282
+            }
283
+            if (endtime == null)
284
+            {
285
+                edate = DateTime.Now.ToString("yyyy-MM") + "-20 23:59:59";
286
+                month = DateTime.Now.Month.ToString();
287
+            }
288
+            else
289
+            {
290
+                edate = endtime.Value .ToString("yyyy-MM") + "-20 23:59:59";
291
+                month = endtime.Value.Month.ToString();
292
+            }
293
+            #endregion
294
+            Dictionary<string, string> paras = new Dictionary<string, string>();
295
+            paras.Add("@deptid", deptid.ToString());
254 296
             paras.Add("@sdate", strdate);
255 297
             paras.Add("@edate", edate);
256
-            var list = DbHelperSQL.RunProcedure("P_DeptData", paras, "DeptData").Tables[0];
257
-
258
-
259
-          //var list = DbHelperSQL.Query(sqlass).Tables[0];
260
-
298
+            var list = DbHelperSQL.RunProcedure("P_DeptDBData", paras, "DeptData").Tables[0];
299
+            //var list = DbHelperSQL.Query(sqlass).Tables[0];
300
+            if (isdc)
301
+            {
302
+                NPOIHelper npoi = new NPOIHelper();
303
+                if (npoi.DBExportToExcel(list,"督办数据统计",month, Convert.ToDateTime(strdate).ToString("yyyy-MM-dd"),
304
+                    Convert.ToDateTime(edate).ToString("yyyy-MM-dd")
305
+                   ) == "")
306
+                {
307
+                    return Success("导出成功");
308
+                }
309
+                else
310
+                {
311
+                    return Error("导出失败");
312
+                }
313
+            }
261 314
             var obj = new
262 315
             {
263 316
                 state = "success",
264 317
                 message = "成功",
265
-                rows = list,
266
-                total = list.Rows.Count
318
+                rows = list
267 319
             };
268 320
             return Content(obj.ToJson());
269 321
         }

+ 2 - 9
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/information/NoticeController.cs

@@ -269,15 +269,8 @@ namespace CallCenterApi.Interface.Controllers.information
269 269
            
270 270
            if (!string .IsNullOrEmpty (F_File))
271 271
             {
272
-                var files = F_File.Split(',');
273
-                foreach (var  it in files)
274
-                {
275
-
276
-                    if (!string .IsNullOrEmpty (it))
277
-                    {
278
-                        dt = GetFileData(it, prefix);
279
-                    }
280
-                }
272
+               
273
+                dt = GetFileData(F_File, prefix);
281 274
             }
282 275
             else
283 276
             {

+ 31 - 19
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/APPSController.cs

@@ -1196,37 +1196,49 @@ namespace CallCenterApi.Interface.Controllers.workorder
1196 1196
             var strCrt_EmpID = txnBodyComresult["strCrt_EmpID"] == null ? "" : txnBodyComresult["strCrt_EmpID"].ToString();//市民ID
1197 1197
             var strWrkOrdr_ID = txnBodyComresult["strWrkOrdr_ID"] == null ? "" : txnBodyComresult["strWrkOrdr_ID"].ToString();//工单编号
1198 1198
             var strStm_Src_Dsc = txnBodyComresult["strStm_Src_Dsc"] == null ? "" : txnBodyComresult["strStm_Src_Dsc"].ToString();//系统来源
1199
-            Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(strWrkOrdr_ID);
1200
-            if (modelT_Bus_WorkOrder!=null )
1201
-            {
1202
-                string strSql = string.Format(@"INSERT INTO T_Sys_Collection ( [F_WorkOrderId], [strCrt_EmpID], [strMnplt_TpCd], [strStm_Src_Dsc], [F_CreateTime]) 
1203
-                   values   ('{0}','{1}','{2}','{3}','{4}') ;select @@IDENTITY ", strWrkOrdr_ID, strCrt_EmpID, strMnplt_TpCd, strStm_Src_Dsc, DateTime.Now);
1204
-                object objres = DbHelperSQL.GetSingle(strSql);
1205
-                if (objres == null)
1199
+                if (strMnplt_TpCd!="00")
1206 1200
                 {
1201
+                    string strSql = string.Format(@"update  T_Sys_Collection   set strMnplt_TpCd='"+ strMnplt_TpCd + "' " +
1202
+                        "where F_WorkOrderId='"+ strWrkOrdr_ID + "'and " +
1203
+                        "strCrt_EmpID='"+ strCrt_EmpID + "'");
1204
+                    object objres = DbHelperSQL.GetSingle(strSql);
1207 1205
                     var objs = new
1208 1206
                     {
1209 1207
                         state = "success",
1210 1208
                         message = "成功",
1211
-                        data = "",
1209
+                        data = ""
1212 1210
                     };
1213 1211
                     return Content(objs.ToJson());
1214 1212
                 }
1215 1213
                 else
1216 1214
                 {
1217
-                    var objs = new
1215
+                    string strSql = string.Format(@"INSERT INTO T_Sys_Collection ( [F_WorkOrderId], [strCrt_EmpID], [strMnplt_TpCd], [strStm_Src_Dsc], [F_CreateTime]) 
1216
+                   values   ('{0}','{1}','{2}','{3}','{4}') ;select @@IDENTITY ", strWrkOrdr_ID, strCrt_EmpID, strMnplt_TpCd, strStm_Src_Dsc, DateTime.Now);
1217
+                    object objres = DbHelperSQL.GetSingle(strSql);
1218
+                    if (objres == null)
1218 1219
                     {
1219
-                        state = "success",
1220
-                        message = "成功",
1221
-                        data = int.Parse(objres.ToString()),
1222
-                    };
1223
-                    return Content(objs.ToJson());
1220
+                        var objs = new
1221
+                        {
1222
+                            state = "success",
1223
+                            message = "成功",
1224
+                            data = "",
1225
+                        };
1226
+                        return Content(objs.ToJson());
1227
+                    }
1228
+                    else
1229
+                    {
1230
+                        var objs = new
1231
+                        {
1232
+                            state = "success",
1233
+                            message = "成功",
1234
+                            data = int.Parse(objres.ToString()),
1235
+                        };
1236
+                        return Content(objs.ToJson());
1237
+                    }
1224 1238
                 }
1225
-            }
1226
-            else
1227
-            {
1228
-                return Error("工单不存在");
1229
-            }
1239
+            
1240
+          
1241
+           
1230 1242
          
1231 1243
         }
1232 1244
         public ActionResult zmhd10005()