zhaozhiqiang %!s(int64=3) %!d(string=před) roky
rodič
revize
2a0d6b1cd1

+ 112 - 6
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -60,9 +60,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
60 60
             string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
61 61
             string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
62 62
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
63
+            string wjstrstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("wjstarttime"));
64
+            string wjstrendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("wjendtime"));
63 65
             string strworkid = HttpUtility.UrlDecode(RequestString.GetQueryString("workid"));
64 66
             string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
65 67
             string strddusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("ddusercode"));//调度员
68
+            //回传时间筛选
69
+            string hcstrstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("hcstrstarttime"));
70
+            string hcstrendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("hcstrendtime"));
71
+
66 72
             int source = RequestString.GetInt("source", 0);
67 73
             int keyid = RequestString.GetInt("keyid", 0);
68 74
             int type = RequestString.GetInt("type", 0);
@@ -217,15 +223,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
217 223
             {
218 224
                 sql += " and isnull(F_IsRelease,0) = '" + issend + "' ";
219 225
             }
220
-
226
+            
221 227
             if (strstarttime.Trim() != "" && strstarttime != "undefined")
222 228
             {
223 229
                 sql += " and datediff(day,F_CreateTime,'" + strstarttime + "')<=0 ";
224 230
             }
225
-            if (strendtime.Trim() != "" && strendtime != "undefined")
231
+            if (strendtime.Trim() != "" && strendtime != "undefined") 
226 232
             {
227 233
                 sql += " and datediff(day,F_CreateTime,'" + strendtime + "')>=0   ";
228 234
             }
235
+            #region 结案时间
236
+            if (wjstrstarttime.Trim() != "" && wjstrstarttime != "undefined")
237
+            {
238
+                sql += " and datediff(day,F_CloseTime,'" + wjstrstarttime + "')<=0 ";
239
+            }
240
+            if (wjstrendtime.Trim() != "" && wjstrendtime != "undefined")
241
+            {
242
+                sql += " and datediff(day,F_CloseTime,'" + wjstrendtime + "')>=0   ";
243
+            }
244
+
245
+            #endregion
246
+            //根据回传时间判断
247
+            if (hcstrstarttime.Trim() != "" && hcstrstarttime != "undefined")
248
+            {
249
+                //sql += " and F_Hcdatetime >= '"+ hcstrstarttime + "'";
250
+                sql += " and datediff(day,F_Hcdatetime,'" + hcstrstarttime + "')<=0 ";
251
+            }
252
+            if (hcstrendtime.Trim() != "" && hcstrendtime != "undefined")
253
+            {
254
+                // sql += "  and F_Hcdatetime<='"+ hcstrendtime + "'   ";
255
+                sql += " and datediff(day,F_Hcdatetime,'" + hcstrendtime + "')>=0   ";
256
+            }
229 257
             #endregion
230 258
 
231 259
             if (strpageindex.Trim() != "")
@@ -240,7 +268,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
240 268
             //string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetOverState(F_WorkOrderId) as OverState,"
241 269
             //    + "dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetWorkOrderAssign(F_WorkOrderId) as DeptName ,dbo.GetLimitTime(F_WorkOrderId) as LimitTime";
242 270
             //string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName";
243
-            string sort = "ORDER BY F_CreateTime ASC";
271
+            string sort = "ORDER BY F_CreateTime DESC";
244 272
             if (timesort == 0)
245 273
                 sort = "ORDER BY LimitTime ASC";
246 274
             else if (timesort == 1)
@@ -2485,7 +2513,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2485 2513
             int pagesize = 10;
2486 2514
             int IsExport = RequestString.GetInt("isexport", 0);
2487 2515
             int timesort = RequestString.GetInt("timesort", -1);
2488
-            string sort = "ORDER BY F_CreateTime ASC";
2516
+            string sort = "ORDER BY F_CreateTime DESC";
2489 2517
             if (timesort == 0)
2490 2518
                 sort = "ORDER BY LimitTime ASC";
2491 2519
             else if (timesort == 1)
@@ -3091,6 +3119,55 @@ namespace CallCenterApi.Interface.Controllers.workorder
3091 3119
 
3092 3120
             return Content(obj.ToJson());
3093 3121
         }
3122
+        /// <summary>
3123
+        /// 获取办理数量、催办数量、未上传数量
3124
+        /// </summary>
3125
+        /// <returns></returns>
3126
+        [Authority]
3127
+        public ActionResult GetDcsCount()
3128
+        {
3129
+            
3130
+            int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
3131
+           // int userId = 751;
3132
+            Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
3133
+            //获取待办理工单数量
3134
+            string sql = " select count(*) dblcount from T_Bus_WorkOrder where  F_IsDelete=0  and F_WorkState in (2,4,8) and F_MainDeptId="+userModel.F_DeptId;
3135
+            //获取催办数量
3136
+            string sql1 = " select count(*) dblcount from T_Bus_WorkOrder where  F_IsDelete=0  and ReminderNum>0 and F_WorkOrderID in(select F_WorkOrderID from T_Bus_AssignedInfo WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_IsSure in (0,1) and F_MainDeptId=" + userModel.F_DeptId + ") ";
3137
+            //扫描件未上传数量
3138
+            string sql2 = " select count(*) dblcount from T_Bus_WorkOrder where  F_IsDelete=0  and  F_Files ='' and F_WorkOrderID in(select F_WorkOrderID from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_Type in (1,2) and F_CreateUser=" + userModel.F_UserCode + ") ";
3139
+
3140
+
3141
+            #region 获取待办理数量
3142
+            var dbldatable = DbHelperSQL.Query(sql).Tables[0];
3143
+            var dblrow = dbldatable.Rows;
3144
+            ///待办理数量
3145
+            var dblcount = dblrow[0]["dblcount"].ToString();
3146
+            #endregion
3147
+            #region 获取催办数量
3148
+            var cbdatable = DbHelperSQL.Query(sql1).Tables[0];
3149
+            var cblrow = cbdatable.Rows;
3150
+            ///催办数量
3151
+            var cblcount = cblrow[0]["dblcount"].ToString();
3152
+            #endregion
3153
+            #region 扫描件未上传数量
3154
+            var smjdatable = DbHelperSQL.Query(sql2).Tables[0];
3155
+            var smjlrow = smjdatable.Rows;
3156
+            ///扫描件未上传数量
3157
+            var smjcount = smjlrow[0]["dblcount"].ToString();
3158
+            #endregion
3159
+
3160
+            var obj = new
3161
+            {
3162
+                state = "success",
3163
+                message = "成功",
3164
+                dblcount= dblcount,
3165
+                cblcount= cblcount,
3166
+                smjcount= smjcount
3167
+            };
3168
+
3169
+            return Content(obj.ToJson());
3170
+        }
3094 3171
 
3095 3172
         /// <summary>
3096 3173
         /// 获取单位处理列表
@@ -6226,6 +6303,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
6226 6303
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
6227 6304
 
6228 6305
             string strworkorderid = HttpUtility.UrlDecode(RequestString.GetQueryString("workorderid"));
6306
+            
6307
+
6229 6308
             //int type = RequestString.GetInt("type", 0);//0基本信息1监察意见2领导批示3办理情况4回访信息5督办信息6办理过程
6230 6309
             if (!string.IsNullOrEmpty(strworkorderid))
6231 6310
             {
@@ -6238,6 +6317,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
6238 6317
                      ;
6239 6318
                    
6240 6319
                 var dt = DbHelperSQL.Query(sql).Tables[0];
6320
+                
6321
+
6241 6322
                 if (dt.Rows.Count > 0)
6242 6323
                 {
6243 6324
                     #region 结果汇总
@@ -6581,6 +6662,28 @@ namespace CallCenterApi.Interface.Controllers.workorder
6581 6662
                     }
6582 6663
                     #endregion
6583 6664
 
6665
+                    #region 获取所有工单部门名称
6666
+                    var olderworkerid = dt.Rows[0]["F_OldWorkOrderId"].ToString();
6667
+                    string alldeptname = "";
6668
+                    if (olderworkerid != "")
6669
+                    {
6670
+                        //var olderallworker = dt.Select(" F_OldWorkOrderId='" + olderworkerid + "'");
6671
+                        string sqlallwo = "select *,b.F_DeptName from T_Bus_WorkOrder a  left join  T_Sys_Department b  on a.F_MainDeptId=b.F_DeptId  where  F_IsDelete=0 and F_OldWorkOrderId='" + olderworkerid + "'";
6672
+                        var aaa = DbHelperSQL.Query(sqlallwo).Tables[0];
6673
+                        var bbb = aaa.Rows;
6674
+                        foreach (DataRow oldtrs in aaa.Rows)
6675
+                        {
6676
+                            alldeptname += oldtrs["F_DeptName"].ToString();
6677
+                            alldeptname += ",";
6678
+                        }
6679
+                    }
6680
+                    //else
6681
+                    //{
6682
+                    //    alldeptname = dt.Rows[0]["DeptName"].ToString();
6683
+                    //}
6684
+                   
6685
+                    #endregion
6686
+
6584 6687
                     var obj = new
6585 6688
                     {
6586 6689
                         data = dt,
@@ -6601,7 +6704,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
6601 6704
                         issend = issend,
6602 6705
                         isedit = isedit,
6603 6706
                         isnotice = isnotice,
6604
-                        btndata = btns
6707
+                        btndata = btns,
6708
+                        alldeptname = alldeptname
6605 6709
                     };
6606 6710
                     return Success("获取成功", obj);
6607 6711
                 }
@@ -8229,8 +8333,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
8229 8333
                                 if (!string .IsNullOrEmpty (modelT_Bus_WorkOrder.F_Files))
8230 8334
                                     {
8231 8335
                                     modelT_Bus_WorkOrder.F_WorkState = (int)EnumWorkState.closed ;
8336
+                                    
8232 8337
                                    }
8233
-                                    workorderBLL.Update(modelT_Bus_WorkOrder);
8338
+                                modelT_Bus_WorkOrder.F_Hcdatetime = DateTime.Now;//回传时间
8339
+                                workorderBLL.Update(modelT_Bus_WorkOrder);
8234 8340
                                     #endregion
8235 8341
 
8236 8342
                                     #region 插入操作记录

+ 5 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

@@ -269,7 +269,8 @@ namespace CallCenterApi.Interface.Models.Common
269 269
                     //二级网络单位 管理员     
270 270
                     if (code == "WLDW" || code == "GLY")
271 271
                     {
272
-                        buttons.Add(receive()); buttons.Add(reback());
272
+                        //buttons.Add(receive());
273
+                        buttons.Add(reback());
273 274
                     }
274 275
                     //调度专员 中心领导管理员 管理员
275 276
                     if (code == "ZXLD" || code == "ZXLDGLYGLY" || code == "GLY" || code == "DDZG")
@@ -390,7 +391,7 @@ namespace CallCenterApi.Interface.Models.Common
390 391
                     {
391 392
                         //buttons.Add(reload());
392 393
                         buttons.Add(subreload());
393
-                        buttons.Add(end());
394
+                        //buttons.Add(end());
394 395
                         buttons.Add(Result());
395 396
                         buttons.Add(Reloadsuber());
396 397
                         //   buttons.Add(approval());
@@ -402,7 +403,8 @@ namespace CallCenterApi.Interface.Models.Common
402 403
                     //二级网络单位 管理员
403 404
                     if (code == "WLDW" || code == "GLY" || code == "DDZG")
404 405
                     {
405
-                        buttons.Add(receive()); buttons.Add(reback());
406
+                        //buttons.Add(receive());
407
+                        buttons.Add(reback());
406 408
                     }
407 409
                     //调度专员 中心领导管理员 管理员
408 410
                     if (code == "ZXLD" || code == "ZXLDGLYGLY" || code == "GLY" || code == "DDZG")