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

通话记录获取工单,增加减免,报表,增加角色,工单流程修改

duhongyu лет назад: 6
Родитель
Сommit
0f613fcbf1
17 измененных файлов с 1107 добавлено и 91 удалено
  1. 7 0
      codegit/CallCenterApi/CallCenterApi.BLL/T_Call_CallRecords.cs
  2. 22 8
      codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs
  3. 24 0
      codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs
  4. 10 9
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DepartmentController.cs
  5. 74 9
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs
  6. 1 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/RoleInfoController.cs
  7. 188 7
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs
  8. 68 5
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs
  9. 1 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs
  10. 121 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/DaysTalkTimeController.cs
  11. 85 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/SwitchedlossCallController.cs
  12. 1 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiManYiDuController.cs
  13. 1 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs
  14. 385 23
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs
  15. 105 26
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs
  16. 4 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderInput.cs
  17. 10 1
      codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

+ 7 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Call_CallRecords.cs

@@ -73,7 +73,14 @@ namespace CallCenterApi.BLL
73 73
 
74 74
             return dal.GetModel(CallRecordsId);
75 75
         }
76
+        /// <summary>
77
+        /// 得到一个对象实体
78
+        /// </summary>
79
+        public Model.T_Call_CallRecords GetModel(string CallId)
80
+        {
76 81
 
82
+            return dal.GetModel(CallId);
83
+        }
77 84
         /// <summary>
78 85
         /// 获得数据列表
79 86
         /// </summary>

Разница между файлами не показана из-за своего большого размера
+ 22 - 8
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs


+ 24 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs

@@ -392,7 +392,31 @@ namespace CallCenterApi.DAL
392 392
             }
393 393
         }
394 394
 
395
+        /// <summary>
396
+        /// 得到一个对象实体
397
+        /// </summary>
398
+        public Model.T_Call_CallRecords GetModel(string CallId)
399
+        {
400
+
401
+            StringBuilder strSql = new StringBuilder();
402
+            strSql.Append("select  top 1 * from T_Call_CallRecords ");
403
+            strSql.Append(" where CallId=@CallId");
404
+            SqlParameter[] parameters = {
405
+                    new SqlParameter("@CallId", SqlDbType.VarChar,50)
406
+            };
407
+            parameters[0].Value = CallId;
395 408
 
409
+            Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
410
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
411
+            if (ds.Tables[0].Rows.Count > 0)
412
+            {
413
+                return DataRowToModel(ds.Tables[0].Rows[0]);
414
+            }
415
+            else
416
+            {
417
+                return null;
418
+            }
419
+        }
396 420
         /// <summary>
397 421
         /// 得到一个对象实体
398 422
         /// </summary>

+ 10 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DepartmentController.cs

@@ -93,15 +93,9 @@ namespace CallCenterApi.Interface.Controllers
93 93
         {
94 94
             if (Request.IsAuthenticated)
95 95
             {
96
-                //int userId = CurrentUser.UserData.F_UserId;
97
-                //Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
98
-
96
+              
99 97
                 DataTable dt = new DataTable();
100 98
                 string where = " ";
101
-                //if (!string.IsNullOrEmpty(userModel.groupcode))
102
-                //{
103
-                //    where += " and F_GroupCode = '" + userModel.groupcode + "'";
104
-                //}
105 99
                 if (pId == 1)
106 100
                     where = "isnull(F_ParentId, 1) = '" + pId + "' and F_State = 1 and F_Layer = 1";
107 101
                else
@@ -209,7 +203,8 @@ namespace CallCenterApi.Interface.Controllers
209 203
                         depname = dModel.F_DeptName,
210 204
                         sort = dModel.F_Sort,
211 205
                         parentid = dModel.F_ParentId,
212
-                        parentname = dModel.F_ParentName
206
+                        parentname = dModel.F_ParentName,
207
+                        layer= dModel.F_Layer 
213 208
                     });
214 209
                 return Error("获取部门信息失败");
215 210
             }
@@ -280,6 +275,7 @@ namespace CallCenterApi.Interface.Controllers
280 275
                 dModel.F_Sort = input.Sort;
281 276
                 dModel.F_DeptName = input.DeptName;
282 277
                 dModel.F_State = 1;
278
+                dModel.F_Layer = input.F_Layer;
283 279
                 //dModel.F_GroupCode = userModel.groupcode;
284 280
                 int id = departmentBLL.Add(dModel);
285 281
                 if (id> 0)
@@ -327,6 +323,7 @@ namespace CallCenterApi.Interface.Controllers
327 323
                 }
328 324
                 dModel.F_Sort = input.Sort;
329 325
                 dModel.F_DeptName = input.DeptName;
326
+                dModel.F_Layer = input.F_Layer;
330 327
                 if (dBLL.Update(dModel))
331 328
                     return Success("编辑成功");
332 329
                 return Error("编辑失败");
@@ -371,10 +368,14 @@ namespace CallCenterApi.Interface.Controllers
371 368
                     pId = userModel.F_DeptId;
372 369
                 string where = "";
373 370
                 DataTable dt = new DataTable();
374
-                if (pId==421 || pId == 2)
371
+                if (pId == 2)
375 372
                 {
376 373
                     where = "(isnull(F_DeptId,0)='" + pId + "'or F_Layer=1 ) and F_State=1";
377 374
                 }
375
+                else if (pId == 421)
376
+                {
377
+                    where = "isnull(F_DeptId,0)='" + 1+ "'and F_State=1";
378
+                        } 
378 379
                 else
379 380
                 {
380 381
                      where = " isnull(F_DeptId,0)='" + pId + "' and F_State=1 ";

+ 74 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -161,6 +161,69 @@ namespace CallCenterApi.Interface.Controllers
161 161
             return res;
162 162
         }
163 163
         /// <summary>
164
+        /// APP上传图片
165
+        /// </summary>
166
+        /// <returns></returns>
167
+        public ActionResult UploadCL64()
168
+        {
169
+            //string dataurl = HttpUtility.UrlDecode(RequestString.GetFormString("dataurl"));
170
+            string dataurl = RequestString.GetFormString("dataurl");
171
+            string filename = RequestString.GetFormString("filename");
172
+            ActionResult res = NoToken("未知错误,请重新登录");
173
+            int userId = CurrentUser.UserData.F_UserId;
174
+            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
175
+            if (userModel != null)
176
+            {
177
+                if (!string.IsNullOrEmpty(dataurl))
178
+                {
179
+                    string path = "/Upload/Workorder/" + DateTime.Now.ToString("yyyy") + "/" + DateTime.Now.ToString("MM") + "/" + DateTime.Now.ToString("dd") + "/";
180
+
181
+                    ImageUpload iu = new ImageUpload();
182
+                    iu.SavePath = path;
183
+                    iu.DataUrl = dataurl;
184
+                    if (!string.IsNullOrEmpty(filename))
185
+                    {
186
+                        iu.SaveType = 1;
187
+                        iu.InFileName = filename;
188
+                    }
189
+                    iu.Upload64();
190
+
191
+                    int n = iu.Error;
192
+                    if (n == 0)
193
+                    {
194
+                        path = path + iu.OutFileName;
195
+                        Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
196
+                        model_T_Sys_Accessories.F_CreateTime = DateTime.Now;//上传时间
197
+                        model_T_Sys_Accessories.F_Name = iu.OutFileName;//附件名称
198
+                        model_T_Sys_Accessories.F_Type = ".jpg";//附件类型
199
+                        model_T_Sys_Accessories.F_Url = path;//附件地址
200
+                        model_T_Sys_Accessories.F_Size = iu.FileSize;
201
+                       // model_T_Sys_Accessories.F_UserCode = userModel.F_UserCode;//上传人  
202
+                        int id = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
203
+                        model_T_Sys_Accessories.F_Id = id;
204
+                        return Success("成功", model_T_Sys_Accessories);
205
+                    }
206
+                    else
207
+                    {
208
+                        string msg = string.Empty;
209
+                        switch (n)
210
+                        {
211
+                            case 1: msg = "请选择要上传的文件"; break;
212
+                            case 2: msg = "上传的文件类型不支持"; break;
213
+                            case 3: msg = "上传的文件过大"; break;
214
+                            case 4: msg = "未知错误"; break;
215
+                        }
216
+                        return Error(msg);
217
+                    }
218
+                }
219
+                else
220
+                {
221
+                    return Error("请选择要上传的文件");
222
+                }
223
+            }
224
+            return res;
225
+        }
226
+        /// <summary>
164 227
         /// 上传用户图片
165 228
         /// </summary>
166 229
         /// <returns></returns>
@@ -182,11 +245,12 @@ namespace CallCenterApi.Interface.Controllers
182 245
                         string dataurl = HttpUtility.UrlDecode(RequestString.GetFormString("dataurl"));
183 246
                         if (!string.IsNullOrEmpty(dataurl))
184 247
                         {
248
+                            path = "/Upload/ZXTX/" + DateTime.Now.ToString("yyyy") + "/" + DateTime.Now.ToString("MM") + "/" + DateTime.Now.ToString("dd") + "/";
249
+
185 250
                             ImageUpload iu = new ImageUpload();
186
-                            iu.SavePath = "/Upload/ZXTX/";
251
+                            iu.SavePath = path;
187 252
                             iu.DataUrl = dataurl;
188 253
                             iu.Upload64();
189
-
190 254
                             int n = iu.Error;
191 255
                             if (n == 0)
192 256
                             {
@@ -201,7 +265,7 @@ namespace CallCenterApi.Interface.Controllers
201 265
                                 model_T_Sys_Accessories.F_Id = id;
202 266
                                 userModel.F_PId  = id;
203 267
                                 new BLL.T_Sys_UserAccount().Update(userModel);
204
-                                res = Success("成功", path);
268
+                                res = Success("成功", model_T_Sys_Accessories);
205 269
                             }
206 270
                             else
207 271
                             {
@@ -568,16 +632,16 @@ namespace CallCenterApi.Interface.Controllers
568 632
                     BLL.T_Bus_WorkOrder workbll = new BLL.T_Bus_WorkOrder();
569 633
                     int[] teltotal = new int[days];
570 634
                     int[] worktotal = new int[days];
571
-                    string uwhere = " 1=1  AND CONVERT(char(7),CreateTime,20) = '" + strDate + "' ";
635
+                    string uwhere = " 1=1  AND CONVERT(char(7),F_CreateTime,20) = '" + strDate + "' ";
572 636
                     string u1where = " 1=1 and ISNULL(groupcode,'') != '' AND CONVERT(char(7),BeginTime,20) = '" + strDate + "' ";
573 637
                     if (userModel.rolecode != "XTGLY")
574 638
                     {
575
-                        uwhere += " and CreateUser='" + userModel.F_UserCode + "' ";
639
+                        uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
576 640
                         u1where += " and UserCode='" + userModel.F_UserCode + "' ";
577 641
                     }
578 642
 
579 643
                     DataTable dtConnect = DbHelperSQL.Query("select CONVERT(varchar(10),BeginTime, 23) AS yearmonthdays,CONVERT(char(7),BeginTime,20) AS yearmonths,CallType,BeginTime,groupcode,UserCode FROM T_Call_CallRecords WITH(NOLOCK) where " + u1where + "").Tables[0];
580
-                    DataTable dtConnect_Wo = DbHelperSQL.Query("select CONVERT(varchar(10),CreateTime, 23) AS yearmonthdays,CONVERT(char(7),CreateTime,20) AS yearmonths,State,IsDel,CreateTime,CreateUser FROM T_Wo_WorkOrder WITH(NOLOCK) where " + uwhere + "").Tables[0];
644
+                    DataTable dtConnect_Wo = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateTime, 23) AS yearmonthdays,CONVERT(char(7),F_CreateTime,20) AS yearmonths,F_State,F_IsDelete,F_CreateTime,F_CreateUser FROM T_Bus_WorkOrder WITH(NOLOCK) where " + uwhere + "").Tables[0];
581 645
                     for (int i = 0; i < cols.Count; i++)
582 646
                     {
583 647
                         int tellist_Count = dtConnect.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
@@ -652,17 +716,18 @@ namespace CallCenterApi.Interface.Controllers
652 716
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
653 717
                     if (ua != null)
654 718
                     {
655
-                        BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
719
+                        BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
656 720
 
657 721
                         string uwhere = " 1=1  ";
658 722
                         if (ua.F_RoleId != 17)
659 723
                         {
660
-                            uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
724
+                            uwhere += " and F_CreateUser='" + ua.F_UserCode + "' ";
661 725
                         }
662 726
 
663 727
                         var obj = new
664 728
                         {
665
-                            dpd = bll.GetList(uwhere+ " and IsDel=0 and State=0 ").Tables[0].Rows.Count,
729
+                          
730
+                            dpd = bll.GetList(uwhere+ " and F_IsDelete=0 and F_State=0 ").Tables[0].Rows.Count,
666 731
                             djd = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='0' and ','+ToUser+',' like '%," + ua.F_UserCode + ",%')  ").Select(p => p.WorkOrderID).Distinct().Count(),
667 732
                             dcl = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='1' and SureUser='" + ua.F_UserCode + "')  ").Select(p => p.WorkOrderID).Distinct().Count()
668 733
                         };

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/RoleInfoController.cs

@@ -102,6 +102,7 @@ namespace CallCenterApi.Interface.Controllers
102 102
                     return Error("请选择要编辑的角色");
103 103
                 Model.T_Sys_RoleInfo rModel = roleInfoBLL.GetModel(input.RoleId);
104 104
                 rModel.F_Remark = input.RoleRemark;
105
+                if (!string .IsNullOrEmpty (input.Code))
105 106
                 rModel.F_RoleCode = input.Code;
106 107
                 rModel.F_RoleName = input.RoleName;
107 108
                 if (rModel == null)

+ 188 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -91,6 +91,154 @@ namespace CallCenterApi.Interface.Controllers
91 91
             return NoToken("未知错误,请重新登录");
92 92
         
93 93
     }
94
+
95
+        /// <summary>
96
+        /// 得到一个汉字的拼音第一个字母,如果是一个英文字母则直接返回大写字母
97
+        /// </summary>
98
+        /// <param name="CnChar">单个汉字</param>
99
+        /// <returns>单个大写字母</returns>
100
+        private string GetSpellCode(string CnChar)
101
+        {
102
+            long iCnChar;
103
+            byte[] arrCN = System.Text.Encoding.Default.GetBytes(CnChar);
104
+
105
+            //如果是字母,则直接返回
106
+            if (arrCN.Length == 1)
107
+            {
108
+                CnChar = CnChar.ToUpper();
109
+            }
110
+            else
111
+            {
112
+                int area = (short)arrCN[0];
113
+                int pos = (short)arrCN[1];
114
+                iCnChar = (area << 8) + pos;
115
+
116
+                // iCnChar match the constant
117
+                string letter = "ABCDEFGHJKLMNOPQRSTWXYZ";
118
+                int[] areacode = { 45217, 45253, 45761, 46318, 46826, 47010, 47297, 47614,
119
+48119, 49062, 49324, 49896, 50371, 50614, 50622, 50906,
120
+51387, 51446, 52218, 52698, 52980, 53689, 54481, 55290 };
121
+                for (int i = 0; i < 23; i++)
122
+                {
123
+                    if (areacode[i] <= iCnChar && iCnChar < areacode[i + 1])
124
+                    {
125
+                        CnChar = letter.Substring(i, 1);
126
+                        break;
127
+                    }
128
+                }
129
+            }
130
+            return CnChar;
131
+        }
132
+         private string GetCode(string F_Name)
133
+        {
134
+            
135
+                char[] strCharArr = F_Name.ToCharArray();
136
+               return  GetSpellCode(strCharArr[0].ToString());
137
+           
138
+        }
139
+        //[Authority]
140
+        //用户列表
141
+        public ActionResult GetMpdelList(FilterUserAccount filter)
142
+        {
143
+            if (Request.IsAuthenticated)
144
+            {
145
+                int userId = CurrentUser.UserData.F_UserId;
146
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
147
+
148
+                DataTable dt = new DataTable();
149
+                string sql = " ";
150
+
151
+                if (userModel != null)
152
+                {
153
+                    if (userModel.F_RoleId == 51 || userModel.F_RoleId == 52)
154
+                        filter.dptid = userModel.F_DeptId;
155
+                }
156
+                if (filter.dptid > 0)
157
+                {
158
+                    Model.T_Sys_Department deptModel = new BLL.T_Sys_Department().GetModel(filter.dptid);
159
+                    if (deptModel != null)
160
+                    {
161
+                        sql += " and F_DeptId in ( select F_DeptId from T_Sys_Department where F_DeptCode like '%" + deptModel.F_DeptCode + "%') ";
162
+                    }
163
+                }
164
+                if (!string.IsNullOrWhiteSpace(filter.Key))
165
+                {
166
+                    sql = "";
167
+                    string str = string.Format(" and (F_UserCode like '%{0}%' or F_UserName like '%{1}%')", filter.Key, filter.Key);
168
+                    sql += str;
169
+                }
170
+                if (filter.type == 1)
171
+                {
172
+                    sql += "and F_RoleId=52";
173
+                }
174
+                if (filter.type == 2)
175
+                {
176
+                    sql += "and F_RoleId=53";
177
+                }
178
+                sql += "and F_See!='5'";
179
+                int recordCount = 0;
180
+                dt = BLL.PagerBLL.GetListPager(
181
+                                        "T_Sys_UserAccount",
182
+                                        "F_UserId",
183
+                                        "*",
184
+                                        sql,
185
+                                        "ORDER BY F_UserId desc",
186
+                                        filter.PageSize,
187
+                                        filter.PageIndex,
188
+                                        true,
189
+                                        out recordCount);
190
+
191
+                List<Model.UserAccount> modelList = new BLL.UserAccount().DataTableToList(dt);
192
+                var modelListOrder = modelList.OrderBy(x => x.F_UserName);
193
+                var obj = new
194
+                {
195
+                    rows = modelListOrder.Select(x => new
196
+                    {
197
+                        code= GetCode(x.F_UserName),
198
+                        F_UserId = x.F_UserId,
199
+                        F_UserCode = x.F_UserCode,
200
+                        F_ExtensionNumber = x.F_ExtensionNumber,
201
+                        F_UserName = x.F_UserName,
202
+                        F_GroupName = x.F_GroupName,
203
+                        F_DeptId = x.F_DeptId,
204
+                        F_RoleId = x.F_RoleId,
205
+                        F_GroupId = x.F_GroupId,
206
+                        F_SeatFlag = x.F_SeatFlag,
207
+                        F_SeatRight = x.F_SeatRight,
208
+                        F_SeatLevel = x.F_SeatLevel,
209
+                        F_SexFlag = x.F_SexFlag,
210
+                        F_RemindFlag = x.F_RemindFlag,
211
+                        F_Remark = x.F_Remark,
212
+                        F_Telephone = x.F_Telephone,
213
+                        F_Mobile = x.F_Mobile,
214
+                        F_HomePhone = x.F_HomePhone,
215
+                        F_Birthday = x.F_Birthday,
216
+                        F_CreateOn = x.F_CreateOn,
217
+                        F_CancelOn = x.F_CancelOn,
218
+                        F_DeleteFlag = x.F_DeleteFlag,
219
+                        F_APPOnFlag = x.F_APPOnFlag,
220
+                        F_LastActiveTime = x.F_LastActiveTime,
221
+                        F_See = x.F_See,
222
+                        F_HJType = x.F_HJType,
223
+                        F_PId = x.F_PId,
224
+                        F_TmId = x.F_TmId,
225
+                        F_RoleName = x.F_RoleName,
226
+                        F_DeptName = x.F_DeptName,
227
+                        F_WorkNumber = x.F_WorkNumber,
228
+                        F_Post = x.F_Post,
229
+                        //F_WXNo=x.F_WXNo,
230
+                        F_SeatGroup = x.F_SeartGroup
231
+                    }),
232
+                    total = recordCount
233
+                };
234
+
235
+                dt.Clear();
236
+                dt.Dispose();
237
+                return Content(obj.ToJson());
238
+                //   return ;
239
+            }
240
+            return NoToken("未知错误,请重新登录");
241
+        }
94 242
         //[Authority]
95 243
         //用户列表
96 244
         public ActionResult GetList(FilterUserAccount filter)
@@ -196,6 +344,23 @@ namespace CallCenterApi.Interface.Controllers
196 344
             }
197 345
             return NoToken("未知错误,请重新登录");
198 346
         }
347
+        public int Getcode()
348
+        {
349
+
350
+            int UserCode = 0;
351
+            string strSql = "select Max(F_UserCode) F_UserCode from T_Sys_UserAccount ";
352
+            object ob = DbHelperSQL.GetSingle(strSql.ToString());
353
+            if (ob == null)
354
+            {
355
+                UserCode = 0;
356
+            }
357
+            else
358
+            {
359
+                UserCode = Convert.ToInt32(ob);
360
+            }
361
+            return UserCode + 1;
362
+
363
+        }
199 364
         //[Authority]
200 365
         //获取用户信息
201 366
         public ActionResult GetUser(int userId = 0, string userCode = "")
@@ -224,6 +389,7 @@ namespace CallCenterApi.Interface.Controllers
224 389
                     F_UserCode = userModel.F_UserCode,
225 390
                     F_ExtensionNumber = userModel.F_ExtensionNumber,
226 391
                     F_UserName = userModel.F_UserName,
392
+                    F_Password = userModel.F_Password ,
227 393
                     F_DeptId = userModel.F_DeptId,
228 394
                     F_RoleId = userModel.F_RoleId,
229 395
                     F_GroupId = userModel.F_GroupId,
@@ -265,9 +431,11 @@ namespace CallCenterApi.Interface.Controllers
265 431
 
266 432
                 Model.T_Sys_UserAccount userAccountModel = new Model.T_Sys_UserAccount();
267 433
                 //员工工号不能重复
268
-                string ucode = input.Usercode.Trim();
269
-                if (!string.IsNullOrEmpty(ucode))
434
+                
435
+               
436
+                if (!string.IsNullOrEmpty(input.Usercode))
270 437
                 {
438
+                    string ucode = input.Usercode.Trim();
271 439
                     Model.T_Sys_UserAccount uModel = new BLL.T_Sys_UserAccount().GetModel(ucode);
272 440
                     if (uModel != null)
273 441
                     {
@@ -279,6 +447,11 @@ namespace CallCenterApi.Interface.Controllers
279 447
                         userAccountModel.F_WorkNumber = ucode;
280 448
                     }
281 449
                 }
450
+                else
451
+                {
452
+                    userAccountModel.F_UserCode = Getcode().ToString();
453
+                    userAccountModel.F_WorkNumber = Getcode().ToString();
454
+                }
282 455
                 if (input.Username != null)
283 456
                     userAccountModel.F_UserName = input.Username.Trim();
284 457
                 if (input.Password != null)
@@ -292,7 +465,7 @@ namespace CallCenterApi.Interface.Controllers
292 465
                 if (input.RoleId != 0)
293 466
                 {
294 467
                     userAccountModel.F_RoleId = input.RoleId;
295
-                    if (input.RoleId==17|| input.RoleId == 50|| input.RoleId == 49)
468
+                    if (input.RoleId==17|| input.RoleId == 50|| input.RoleId == 49 || input.RoleId == 65)
296 469
                     {
297 470
                         userAccountModel.F_See = "0";
298 471
                     }
@@ -308,6 +481,10 @@ namespace CallCenterApi.Interface.Controllers
308 481
                     {
309 482
                         userAccountModel.F_See = "3";
310 483
                     }
484
+                    else if (input.RoleId==66)
485
+                    {
486
+                        userAccountModel.F_See = "4";
487
+                    }
311 488
                 }
312 489
                     
313 490
                
@@ -352,11 +529,11 @@ namespace CallCenterApi.Interface.Controllers
352 529
                     //话务人员限制权限判断
353 530
                     if (sys.IsValidSeatPermission())
354 531
                     {
355
-                        var model = sysUserAccountBll.GetModel(int.Parse(input.Usercode));
532
+                        var model = sysUserAccountBll.GetModel(int.Parse(userAccountModel.F_UserCode));
356 533
                         if (model != null)
357 534
                             return Error("当前员工工号存在,请更换!");
358 535
                         if (sysUserAccountBll.Add(userAccountModel) > 0)
359
-                            return Success("新增成功!");
536
+                            return Success("新增成功!", userAccountModel);
360 537
                         else
361 538
                             return Error("新增失败!");
362 539
                     }
@@ -368,7 +545,7 @@ namespace CallCenterApi.Interface.Controllers
368 545
                 else
369 546
                 {
370 547
                     if (sysUserAccountBll.Add(userAccountModel) > 0)
371
-                        return Success("新增成功!");
548
+                        return Success("新增成功!", userAccountModel);
372 549
                     else
373 550
                         return Error("新增失败!");
374 551
                 }
@@ -413,7 +590,7 @@ namespace CallCenterApi.Interface.Controllers
413 590
                 if (input.RoleId != 0)
414 591
                 {
415 592
                     userAccountModel.F_RoleId = input.RoleId;
416
-                    if (input.RoleId == 17 || input.RoleId == 50 || input.RoleId == 49)
593
+                    if (input.RoleId == 17 || input.RoleId == 50 || input.RoleId == 49 || input.RoleId == 65)
417 594
                     {
418 595
                         userAccountModel.F_See = "0";
419 596
                     }
@@ -429,6 +606,10 @@ namespace CallCenterApi.Interface.Controllers
429 606
                     {
430 607
                         userAccountModel.F_See = "3";
431 608
                     }
609
+                    else if (input.RoleId == 66)
610
+                    {
611
+                        userAccountModel.F_See = "4";
612
+                    }
432 613
                 }
433 614
                    if (input.Pid!=0)
434 615
                     userAccountModel.F_PId  = input.Pid;

+ 68 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -136,6 +136,7 @@ namespace CallCenterApi.Interface.Controllers.customer
136 136
                     {
137 137
                         return Error("导出失败");
138 138
                     }
139
+
139 140
                 }
140 141
              
141 142
                 int recordCount = 0;
@@ -283,13 +284,13 @@ namespace CallCenterApi.Interface.Controllers.customer
283 284
                 {
284 285
                     string sql = "  F_Phone = '" + tel + "' and F_IsDelete=0";
285 286
 
286
-                  //  if (userModel.rolecode != "XTGLY")
287
-                  //  {
288
-                     //   sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
289
-                //    }
290
-
287
+                    //  if (userModel.rolecode != "XTGLY")
288
+                    //  {
289
+                    //   sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
290
+                    //    }
291 291
                     var cususer = new BLL.T_Cus_Customer().GetModelList(sql).OrderByDescending(p => p.F_Id).FirstOrDefault();
292 292
                     return Success("获取成功", cususer);
293
+
293 294
                 }
294 295
                 else
295 296
                 {
@@ -862,6 +863,68 @@ namespace CallCenterApi.Interface.Controllers.customer
862 863
             return NoToken("未知错误,请重新登录");
863 864
         }
864 865
 
866
+        public ActionResult Import()
867
+        {
868
+            DataTable dt = new DataTable();
869
+            var depts = new BLL.T_Sys_UserAccount().GetModelList("F_See!='5'");
870
+           
871
+            #region 
872
+            dt.Columns.Add("工号");
873
+            dt.Columns.Add("姓名");
874
+            dt.Columns.Add("密码");
875
+            dt.Columns.Add("职位");
876
+            dt.Columns.Add("部门");
877
+            dt.Columns.Add("大区");
878
+            #endregion
879
+            foreach (var it in depts)
880
+            {
881
+                DataRow drNew = dt.NewRow();
882
+                #region 基本字段
883
+                drNew["工号"] = it.F_UserCode;//序号
884
+                drNew["姓名"] = it.F_UserName;//姓名
885
+                drNew["密码"] = it.F_Password;//地址
886
+                
887
+                if (it.F_DeptId>0)
888
+                {
889
+                    var dept = new BLL.T_Sys_Department().GetModel(it.F_DeptId);
890
+                    if (dept!=null )
891
+                    {
892
+                        drNew["部门"] = dept.F_DeptName;
893
+                        if (dept.F_Layer ==2)
894
+                        {
895
+                            var dept1 = new BLL.T_Sys_Department().GetModel(dept.F_ParentId );
896
+                            if (dept1!=null )
897
+                                drNew["大区"] = dept1.F_DeptName;
898
+
899
+                        }
900
+                    }
901
+                    
902
+
903
+                }
904
+                if (it.F_RoleId  > 0)
905
+                {
906
+                    var dept = new BLL.T_Sys_RoleInfo ().GetModel(it.F_RoleId);
907
+                    if (dept != null)
908
+                        drNew["职位"] = dept.F_RoleName ;
909
+                }
910
+
911
+
912
+
913
+                dt.Rows.Add(drNew);
914
+                #endregion
915
+            }
916
+            NPOIHelper npoi = new NPOIHelper();
917
+            if (npoi.ExportToExcel("用户管理", dt) == "")
918
+            {
919
+                return Success("导出成功");
920
+            }
921
+            else
922
+            {
923
+                return Error("导出失败");
924
+
925
+            }
926
+
927
+        }
865 928
 
866 929
     }
867 930
 }

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

@@ -649,6 +649,7 @@ namespace CallCenterApi.Interface.Controllers.report
649 649
             DateTime lastmonth= time.AddMonths(-1);
650 650
             sql += " and F_CreateTime>='" + lastmonth.ToString ("yyyy-MM") +"-28" + " 00:00:00' ";
651 651
             sql += " and F_CreateTime<='" + time.ToString("yyyy-MM") + "-27" + " 23:59:59' ";
652
+            sql += $" and (F_Type=2 or (F_Duplicate in(2,0)and F_Type=3))";
652 653
             var modelList= new BLL.T_Bus_WorkOrder().GetModelList(sql);
653 654
             Product product = new Product();
654 655
             product.dates = new List<Date>();

+ 121 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/DaysTalkTimeController.cs

@@ -20,6 +20,126 @@ namespace CallCenterApi.Interface.Controllers.report
20 20
                 String[] str = { "日期", "呼入次数", "呼入时长", "呼出次数", "呼出时长", "呼出未接通次数", "振铃时长", "通话总时长", "平均通话时长" };
21 21
             return Success("获取日通话时长统计表头成功", str);
22 22
         }
23
+        public ActionResult GetDaysTalkCall(string stime, string endtime)
24
+        {
25
+            if (Request.IsAuthenticated)
26
+            {
27
+                DataTable dtNew = new DataTable();
28
+                #region 编辑表头
29
+                DataColumn dc1 = new DataColumn("日期", Type.GetType("System.String"));
30
+                DataColumn dc2 = new DataColumn("呼入次数", Type.GetType("System.String"));
31
+                DataColumn dc3 = new DataColumn("呼入时长", Type.GetType("System.String"));
32
+                DataColumn dc4 = new DataColumn("呼出次数", Type.GetType("System.String"));
33
+                DataColumn dc5 = new DataColumn("呼出时长", Type.GetType("System.String"));
34
+                DataColumn dc6 = new DataColumn("呼出未接通次数", Type.GetType("System.String"));
35
+                DataColumn dc7 = new DataColumn("振铃时长", Type.GetType("System.String"));
36
+                DataColumn dc8 = new DataColumn("通话总时长", Type.GetType("System.String"));
37
+                DataColumn dc9 = new DataColumn("平均通话总时长", Type.GetType("System.String"));
38
+                DataColumn dc10 = new DataColumn("坐席", Type.GetType("System.String"));
39
+                dtNew.Columns.Add(dc10);
40
+                dtNew.Columns.Add(dc1);
41
+                dtNew.Columns.Add(dc2);
42
+                dtNew.Columns.Add(dc3);
43
+                dtNew.Columns.Add(dc4);
44
+                dtNew.Columns.Add(dc5);
45
+                dtNew.Columns.Add(dc6);
46
+                dtNew.Columns.Add(dc7);
47
+                dtNew.Columns.Add(dc8);
48
+                dtNew.Columns.Add(dc9);
49
+                #endregion
50
+                int userId = CurrentUser.UserData.F_UserId;
51
+                if (string.IsNullOrEmpty(stime))
52
+                    stime = DateTime.Now.ToString("yyyy-MM-dd");
53
+                if (string.IsNullOrEmpty(endtime))
54
+                    endtime = DateTime.Now.ToString("yyyy-MM-dd");
55
+
56
+                //  int callConnectCount = dt.Select("begintime >='" + t.ToString() + "' and begintime<'" + t.AddDays(1).ToString() + "' and CallState=1").Length;
57
+                //   int callLossCount = dt.Select("begintime >='" + t.ToString() + "' and begintime<'" + t.AddDays(1).ToString() + "' and CallState=0 and dealtype=5").Length;
58
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
59
+                string sql = " f_seatflag=1 ";
60
+                int roleid = CurrentUser.UserData.F_RoleId;
61
+                int deptid = CurrentUser.UserData.F_DeptId;
62
+                if (roleid != 0)
63
+                {
64
+                    if (roleid != 17)
65
+                    {
66
+                        if (deptid != 0)
67
+                            sql += " and F_DeptId=" + deptid;
68
+                    }
69
+                }
70
+                if (userModel.F_SeartGroupID != 0)
71
+                {
72
+                    sql += " and F_SeartGroupID = '" + userModel.F_SeartGroupID + "' ";
73
+                }
74
+                List<Model.T_Sys_UserAccount> userSeartList = new BLL.T_Sys_UserAccount().GetModelList(sql + "and F_UserCode!='8000' " + " order by f_userid desc ");
75
+              //  dtNew.Columns.Add("坐席");
76
+                if (userSeartList != null)
77
+                {
78
+                    string[] user = new string[userSeartList.Count];
79
+                    for (int i = 0; i < userSeartList.Count; i++)
80
+                    {
81
+                        user[i] = userSeartList[i].F_UserName + "(" + userSeartList[i].F_UserCode + ")";
82
+                        DataRow drNew = dtNew.NewRow();
83
+                       
84
+                     //   dtNew = getData(stime, endtime, user[i], userModel.groupcode);
85
+                     //   drNew["坐席"] = user[i];
86
+
87
+                        DateTime beginTime;
88
+                        DateTime endTime;
89
+                        string where = " AND ISNULL(UserCode,'0') != '0' ";
90
+                        int days = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
91
+                        if (stime != null && stime != "")
92
+                            beginTime = DateTime.Parse(stime);
93
+                        else
94
+                            beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
95
+
96
+                        if (endtime != null && endtime != "")
97
+                            endTime = DateTime.Parse(endtime + " 23:59:59");
98
+                        else
99
+                            endTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59");
100
+
101
+                        if (userSeartList[i] != null && userSeartList[i].F_UserCode  != "")
102
+                        {
103
+                            where += " and UserCode='" + userSeartList[i].F_UserCode + "'";
104
+                        }
105
+
106
+                        where += " and DATEDIFF(d,BeginTime,'" + beginTime.ToString("yyyy-MM-dd HH:mm:ss") + "')<=0";
107
+                        where += " and DATEDIFF(d,BeginTime,'" + endTime.ToString("yyyy-MM-dd HH:mm:ss") + "')>=0";
108
+                        DataTable dt = new BLL.T_Call_CallRecords().GetList("1=1 " + where).Tables[0];
109
+                        string key = beginTime.ToString("yyyyMMdd");
110
+                        DataRow[] drsin = dt.Select("begintime >='" + beginTime.ToString() + "' and begintime<'" + beginTime.AddDays(1).ToString() + "' and CallType=0");
111
+                        DataRow[] drsout = dt.Select("begintime >='" + beginTime.ToString() + "' and begintime<'" + beginTime.AddDays(1).ToString() + "' and CallType=1");
112
+                        DataRow[] drswout = dt.Select("begintime >='" + beginTime.ToString() + "' and begintime<'" + beginTime.AddDays(1).ToString() + "' and CallType=1 and CallState=0 ");
113
+                        int callincount = drsin.Length;
114
+                        int calloutcount = drsout.Length;
115
+                        int callwoutcount = drswout.Length;
116
+                        string thsc = gettimes(dt.Select("begintime >='" + beginTime.ToString() + "' and begintime<'" + beginTime.AddDays(1).ToString() + "' "), 0);
117
+                        string hrsc = gettimes(drsin, 0);
118
+                        string hcsc = gettimes(drsout, 0);
119
+                        string zlsc = gettimes(drswout, 1);
120
+                        drNew["日期"] = key;
121
+                        drNew["呼入次数"] = callincount;
122
+                        drNew["呼入时长"] = hrsc + "S";
123
+                        drNew["呼出次数"] = calloutcount;
124
+                        drNew["呼出时长"] = hcsc + "S";
125
+                        drNew["呼出未接通次数"] = callwoutcount;
126
+                        drNew["振铃时长"] = zlsc + "S";
127
+                        drNew["通话总时长"] = thsc + "S";
128
+                        if ((callincount + calloutcount) > 0)
129
+                            drNew["平均通话总时长"] = (double.Parse(thsc) / (callincount + calloutcount)).ToString("F2") + "S";
130
+                        else
131
+                            drNew["平均通话总时长"] = "0S";
132
+                        drNew["坐席"] = user[i];
133
+
134
+                        dtNew.Rows.Add(drNew);
135
+                    }
136
+                }
137
+               
138
+                return Success("获取成功", dtNew);
139
+
140
+            }
141
+            return NoToken("未知错误,请重新登录");
142
+        }
23 143
 
24 144
         //获取数据
25 145
         public ActionResult GetDataList(string stime, string etime,string usercode)
@@ -59,7 +179,7 @@ namespace CallCenterApi.Interface.Controllers.report
59 179
             return NoToken("未知错误,请重新登录");
60 180
         }
61 181
 
62
-        private DataTable getData(string stime, string etime, string usercode, string dpt)
182
+        private DataTable getData(string stime, string etime, string usercode, string dpt )
63 183
         {
64 184
             DataTable dtNew = new DataTable();
65 185
             #region 编辑表头

+ 85 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/SwitchedlossCallController.cs

@@ -20,7 +20,91 @@ namespace CallCenterApi.Interface.Controllers.report
20 20
             String[] str = { "日期", "接通次数", "呼损次数", "接通率", "呼损率" };
21 21
             return Success("获取接通呼损统计表头成功", str);
22 22
         }
23
+        public ActionResult GetSwitchedlossCall(string stime, string endtime)
24
+        {
25
+            if (Request.IsAuthenticated)
26
+            {
27
+                DataTable dtNew = new DataTable();
28
+                int userId = CurrentUser.UserData.F_UserId;
29
+                if (string.IsNullOrEmpty(stime))
30
+                    stime = DateTime.Now.ToString("yyyy-MM-dd");
31
+                if (string.IsNullOrEmpty(endtime))
32
+                    endtime = DateTime.Now.ToString("yyyy-MM-dd");
33
+
34
+                //  int callConnectCount = dt.Select("begintime >='" + t.ToString() + "' and begintime<'" + t.AddDays(1).ToString() + "' and CallState=1").Length;
35
+                //   int callLossCount = dt.Select("begintime >='" + t.ToString() + "' and begintime<'" + t.AddDays(1).ToString() + "' and CallState=0 and dealtype=5").Length;
36
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
37
+                string sql = " f_seatflag=1 ";
38
+                int roleid = CurrentUser.UserData.F_RoleId;
39
+                int deptid = CurrentUser.UserData.F_DeptId;
40
+                if (roleid != 0)
41
+                {
42
+                    if (roleid != 17)
43
+                    {
44
+                        if (deptid != 0)
45
+                            sql += " and F_DeptId=" + deptid;
46
+                    }
47
+                }
48
+                if (userModel.F_SeartGroupID != 0)
49
+                {
50
+                    sql += " and F_SeartGroupID = '" + userModel.F_SeartGroupID + "' ";
51
+                }
52
+                var CallState = new BLL.T_Call_CallRecords().GetModelList("begintime >= '" + stime + "' and begintime < '" + endtime + "' and CallState = 1");
53
+                var dealtype = new BLL.T_Call_CallRecords().GetModelList("begintime >= '" + stime + "' and begintime < '" + endtime + "' and CallState=0 and dealtype=5");
54
+                List<Model.T_Sys_UserAccount> userSeartList = new BLL.T_Sys_UserAccount().GetModelList(sql + " order by f_userid desc ");
55
+                dtNew.Columns.Add("坐席");
56
+                dtNew.Columns.Add("接通次数");
57
+                dtNew.Columns.Add("呼损次数");
58
+                dtNew.Columns.Add("接通率");
59
+                dtNew.Columns.Add("呼损率");
60
+                if (userSeartList != null)
61
+                {
62
+                    string[] user = new string[userSeartList.Count];
63
+                    int[] Connect = new int[userSeartList.Count];
64
+                    int [] Callloss = new int[userSeartList.Count];
65
+                    for (int i=0;i < userSeartList.Count;i++)
66
+                    {
67
+                        user[i ] = userSeartList[i].F_UserName + "(" + userSeartList[i].F_UserCode + ")";
68
+                        foreach (var it in CallState)
69
+                        {
70
+                            if (it.UserCode == userSeartList[i].F_UserCode)
71
+                                Connect[i]++;
72
+                        }
73
+                        foreach (var it in dealtype)
74
+                        {
75
+                            if (it.UserCode == userSeartList[i].F_UserCode)
76
+                                Callloss[i]++;
77
+                        }
78
+                    }
79
+                    for (int i = 0; i < userSeartList.Count; i++)
80
+                    {
81
+                        DataRow drNew = dtNew.NewRow();
82
+
83
+                        drNew["坐席"] = user[i];
84
+                        drNew["接通次数"] = Connect[i];
85
+                        drNew["呼损次数"] = Callloss[i];
86
+                        int a = Connect[i] + Callloss[i];
87
+                        if  (a>0)
88
+                        {
89
+                            drNew["接通率"] = string.Format("{0}", Connect[i] / a);
90
+                            drNew["呼损率"] = string.Format("{0}", Callloss[i] / a);
91
+                        }
92
+                        else
93
+                        {
94
+                            drNew["接通率"] = string.Format("100%");
95
+                            drNew["呼损率"] = string.Format("100%");
96
+                        }
97
+                        
98
+
99
+                        dtNew.Rows.Add(drNew);
100
+                    }
101
+                }
102
+               
103
+                return Success ("获取成功", dtNew);
23 104
 
105
+            }
106
+            return NoToken("未知错误,请重新登录");
107
+        }
24 108
         //获取数据
25 109
         public ActionResult GetDataList(string stime, string endtime)
26 110
         {
@@ -32,7 +116,7 @@ namespace CallCenterApi.Interface.Controllers.report
32 116
 
33 117
                 DataTable dtNew = new DataTable();
34 118
                 dtNew = GetData(stime, endtime, userModel.groupcode);
35
-                return Success("获取坐席满意度评价情况报表数据成功", dtNew);
119
+                return Success("获取接通呼损统计情况报表数据成功", dtNew);
36 120
             }
37 121
             return NoToken("未知错误,请重新登录");
38 122
         }

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiManYiDuController.cs

@@ -104,6 +104,7 @@ namespace CallCenterApi.Interface.Controllers.report
104 104
             {
105 105
                 sqldtable += " and F_SeartGroupID = '" + dpt + "' ";
106 106
             }
107
+        
107 108
             DataTable dtable = new BLL.T_Sys_UserAccount().GetList($"F_DeleteFlag=0 {sqldtable}").Tables[0];
108 109
             int allcount = dtable.Rows.Count;
109 110
             for (int i = 0; i < allcount; i++)

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -88,7 +88,7 @@ namespace CallCenterApi.Interface.Controllers.tel
88 88
             DataTable dt = BLL.PagerBLL.GetListPager(
89 89
                 "T_Call_CallRecords WITH(NOLOCK) left join T_Sys_UserAccount on UserCode=F_UserCode  ",
90 90
                 "CallRecordsId",
91
-                "T_Call_CallRecords.*,T_Sys_UserAccount.F_UserName as UserName,T_Sys_UserAccount.F_SeartGroup,T_Sys_UserAccount.F_DeptId,(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName",
91
+                "T_Call_CallRecords.*,T_Sys_UserAccount.F_UserName as UserName,T_Sys_UserAccount.F_SeartGroup,T_Sys_UserAccount.F_DeptId,(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName ,(select COUNT(1) from dbo.T_Bus_WorkOrder where F_CallId = T_Call_CallRecords.CallId) as IsWorkeorder",
92 92
                 sql,
93 93
                 "ORDER BY CallRecordsId desc",
94 94
                 pagesize,

+ 385 - 23
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -78,11 +78,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
78 78
         /// 获取工单列表
79 79
         /// </summary>
80 80
         /// <returns></returns>
81
-        public ActionResult GetList(string code, string starttime, string endtime,string duplicatetime,string endduplicatetime, string productType,string productDate, string batchNumber,string manufacturer,string problemCode,string notifications,string keywords, string dealTimely,int area = 0,int office=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10,int isdc=0,int istime=0 )
81
+        public ActionResult GetList(string code, string starttime, string endtime,string duplicatetime,string endduplicatetime, string productType,string productDate, string batchNumber,string manufacturer,string problemCode,string notifications,string keywords, string dealTimely,int CJ=0,int area = 0,int office=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10,int isdc=0,int istime=0 )
82 82
         {
83 83
             int userId = CurrentUser.UserData.F_UserId;
84 84
             if (userId != 0)
85 85
             {
86
+                Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
87
+                Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
86 88
                 string sql = $"  F_IsDelete=0";
87 89
                 sql += "and F_Duplicate!=5";
88 90
                 string where = "";
@@ -98,7 +100,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
98 100
                     else
99 101
                         sql += $" and F_Type=" + type;
100 102
                 }
101
-                    
103
+                if (CJ == 1)
104
+                {
105
+                    sql += "AND F_Duplicate=6";
106
+                    if (ro.F_RoleCode == "BSCJL" || ro.F_RoleCode == "YWY")
107
+                    {
108
+                        sql += "AND F_Notifications =" + ua.F_UserCode;
109
+                    }
110
+                    else if (ro.F_RoleCode == "ZR" || ro.F_RoleCode == "BBZY" || ro.F_RoleCode == "CJZY" || ro.F_RoleCode == "XTGLY")
111
+                    {
112
+                    }
113
+                    else
114
+                        return Error("无操作权限");
115
+                }
102 116
                 if (source > 0)//工单来源
103 117
                     sql += $" and F_Source=" + source;
104 118
                 if (area > 0)//大区
@@ -146,8 +160,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
146 160
                     sql += $"  and ( F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%' ) ";
147 161
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
148 162
                     sql += $" and F_WorkOrderId like '%" + code.Trim() + "%'";
149
-                Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
150
-                Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
163
+               
151 164
                 string uwhere = " ";
152 165
                 if (state > -1)
153 166
                 {
@@ -207,6 +220,18 @@ namespace CallCenterApi.Interface.Controllers.workorder
207 220
                             if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS")
208 221
                                 return Error("无操作权限");
209 222
                             break;
223
+                        case 7://抽检列表
224
+                            sql += "AND F_Duplicate=6";
225
+                            if (ro.F_RoleCode == "BSCJL" || ro.F_RoleCode == "YWY")
226
+                            {
227
+                                sql += "AND F_Notifications =" + ua.F_UserCode;
228
+                            }
229
+                            else if (ro.F_RoleCode == "ZR" || ro.F_RoleCode == "BBZY" || ro.F_RoleCode == "CJZY")
230
+                            {
231
+                            }
232
+                            else 
233
+                                return Error("无操作权限");
234
+                            break;
210 235
                         case 10://已完结
211 236
                             sql += "AND F_State=10";
212 237
                             sql += RetuSql(ro, see, ua);
@@ -305,7 +330,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
305 330
 
306 331
                     }
307 332
                 }
308
-                else  if (isdc == 2)
333
+                else  if (isdc == 2|| isdc == 3)
309 334
                 {
310 335
                     var depts = new BLL.T_Bus_WorkOrder().GetModelList(sql+ "order by F_Id desc");
311 336
                     #region 
@@ -325,7 +350,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
325 350
                     dt.Columns.Add("生产厂家");
326 351
                     dt.Columns.Add("问题代码");
327 352
                     dt.Columns.Add("质量问题");
353
+                    if (isdc == 2)
328 354
                     dt.Columns.Add("通知人");
355
+                    else
356
+                     dt.Columns.Add("处理人");
329 357
                     dt.Columns.Add("接听人");
330 358
                     dt.Columns.Add("落实情况");
331 359
                     dt.Columns.Add("处理进度");
@@ -376,15 +404,30 @@ namespace CallCenterApi.Interface.Controllers.workorder
376 404
                         drNew["生产厂家"] = it.F_Manufacturer;
377 405
                         drNew["问题代码"] = it.F_ProblemCode;
378 406
                         drNew["质量问题"] = it.F_QualityProblem;
379
-                        drNew["通知人"] = it.F_Notifications;
380
-                        if (!string .IsNullOrEmpty (it.F_Notifications))
407
+                        if (isdc == 2)
381 408
                         {
382
-                            var user = new BLL.T_Sys_UserAccount().GetModel(it.F_Notifications);
383
-                            if (user!=null )
409
+                            drNew["通知人"] = it.F_Notifications;
410
+                            if (!string.IsNullOrEmpty(it.F_Notifications))
384 411
                             {
385
-                                drNew["通知人"] = user.F_UserName ;
412
+                                var user = new BLL.T_Sys_UserAccount().GetModel(it.F_Notifications);
413
+                                if (user != null)
414
+                                {
415
+                                    drNew["通知人"] = user.F_UserName;
416
+                                }
417
+
418
+                            }
419
+                        }
420
+                        else
421
+                        {
422
+                            drNew["处理人"] = it.F_DealUser;
423
+                            if (!string.IsNullOrEmpty(it.F_DealUser))
424
+                            {
425
+                                var user = new BLL.T_Sys_UserAccount().GetModel(it.F_DealUser);
426
+                                if (user != null)
427
+                                {
428
+                                    drNew["处理人"] = user.F_UserName;
429
+                                }
386 430
                             }
387
-                           
388 431
                         }
389 432
                         drNew["接听人"] = it.F_ReceivingPerson;
390 433
                         if (!string.IsNullOrEmpty(it.F_ReceivingPerson))
@@ -478,7 +521,110 @@ namespace CallCenterApi.Interface.Controllers.workorder
478 521
             #endregion
479 522
 
480 523
         }
481
-    
524
+       
525
+        public DataTable GetFileData(string ids, string prefix)
526
+        {
527
+            DataTable dt = new DataTable();
528
+            if (!string.IsNullOrEmpty(ids))
529
+            {
530
+                dt = DbHelperSQL.Query("select * from T_Sys_Accessories where F_Id in (" + ids + ")").Tables[0];
531
+                foreach (DataRow dr in dt.Rows)
532
+                {
533
+                    dr["F_Url"] = prefix + dr["F_Url"].ToString();
534
+                }
535
+            }
536
+            return dt;
537
+        }
538
+        public ActionResult GetRepeatWorker(string tel)
539
+        {
540
+            var model = new BLL.T_Bus_WorkOrder().GetModelList("F_IsDelete=0 and F_CusPhone='" + tel + "' order by  F_CreateTime desc").FirstOrDefault();
541
+            var list = new List<Model.T_Bus_WorkOrder>();
542
+            if (model != null)
543
+            {
544
+                list.Add(model);
545
+                var itemlasts = itembll.GetModelList("  F_WoID=" + +model.F_Id + " ");
546
+                var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
547
+                var FileUrl = GetFileData(model.F_DealFile.ToString(), configfj.F_ParamValue);
548
+                if (list.Count > 0)
549
+                {
550
+                    List<WorkOrderInput> Input = modeltooip(list);
551
+                    if (Input != null)
552
+                    {
553
+                        var obj = new
554
+                        {
555
+                            state = "success",
556
+                            message = "成功",
557
+                            rows = Input,
558
+                            FileUrl = FileUrl,
559
+                            itemlasts,
560
+                        };
561
+                        return Content(obj.ToJson());
562
+                    }
563
+                    else
564
+                    {
565
+                        return Error("没有查询到此工单");
566
+                    }
567
+                }
568
+                else
569
+                    return Error("没有查询到此工单");
570
+            }
571
+            return null;
572
+        }
573
+        /// <summary>
574
+        /// 查询工单详情
575
+        /// </summary>
576
+        public ActionResult GetCallidDetails(string  callid)
577
+        {
578
+            int userId = CurrentUser.UserData.F_UserId;
579
+            if (userId != 0)
580
+            {
581
+                Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
582
+
583
+                if (string .IsNullOrEmpty (callid))
584
+                {
585
+                    return Error("请输入正确的id");
586
+                }
587
+                var list = new List<Model.T_Bus_WorkOrder>();
588
+                var model = new BLL.T_Bus_WorkOrder().GetModelList("F_IsDelete=0 and F_CallId='" + callid + "'").FirstOrDefault();
589
+                if (model != null)
590
+                {
591
+                    list.Add(model);
592
+                    var itemlasts = itembll.GetModelList("  F_WoID=" + +model.F_Id + "and  F_OptType !=12 ");
593
+                    var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
594
+                    var FileUrl = GetFileData(model.F_DealFile.ToString(), configfj.F_ParamValue);
595
+                    if (list.Count > 0)
596
+                    {
597
+                        List<WorkOrderInput> Input = modeltooip(list);
598
+                        if (Input != null)
599
+                        {
600
+                            var obj = new
601
+                            {
602
+                                state = "success",
603
+                                message = "成功",
604
+                                rows = Input,
605
+                                FileUrl = FileUrl,
606
+                                itemlasts,
607
+                            };
608
+                            return Content(obj.ToJson());
609
+                        }
610
+                        else
611
+                        {
612
+                            return Error("没有查询到此工单");
613
+                        }
614
+                    }
615
+                    else
616
+                        return Error("没有查询到此工单");
617
+                }
618
+                else
619
+                    return Error("没有查询到此工单");
620
+
621
+            }
622
+            else
623
+            {
624
+                return Error("无操作权限!");
625
+            }
626
+        }
627
+       
482 628
         /// <summary>
483 629
         /// 查询工单详情
484 630
         /// </summary>
@@ -487,7 +633,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
487 633
             int userId = CurrentUser.UserData.F_UserId;
488 634
             if (userId != 0)
489 635
             {
490
-                DataTable FileUrl = new DataTable();
491 636
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
492 637
 
493 638
                 if (id <= 0)
@@ -498,7 +643,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
498 643
                 var model = workorderBLL.GetModel(id);
499 644
                 if (model != null)
500 645
                     list.Add(model);
501
-                var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
646
+                var itemlasts = itembll.GetModelList("  F_WoID=" + +id + "and  F_OptType !=12 ");
647
+                var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
648
+                var FileUrl = GetFileData(model.F_DealFile.ToString(), configfj.F_ParamValue);
502 649
                 if (list.Count > 0)
503 650
                 {
504 651
                     List<WorkOrderInput> Input = modeltooip(list);
@@ -509,6 +656,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
509 656
                             state = "success",
510 657
                             message = "成功",
511 658
                             rows = Input,
659
+                            FileUrl = FileUrl,
512 660
                             itemlasts,
513 661
                         };
514 662
                         return Content(obj.ToJson());
@@ -532,6 +680,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
532 680
             List<WorkOrderInput> Input = new List<WorkOrderInput>();
533 681
             foreach (var it in modlelist)
534 682
             {
683
+               
535 684
                 WorkOrderInput model = new WorkOrderInput();
536 685
                 model.F_Id = it.F_Id;//id
537 686
                 model.F_WorkOrderId = it.F_WorkOrderId;//工单编号
@@ -580,7 +729,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
580 729
                 model.F_Manufacturer = it.F_Manufacturer;//生产厂家
581 730
                 model.F_ProblemCode = it.F_ProblemCode;//问题代码
582 731
                 model.F_QualityProblem = it.F_QualityProblem;//质量问题
583
-
732
+                model.F_IsReduction = it.F_IsReduction;
733
+                model.F_CallId  = it.F_CallId;//通话记录id
584 734
                 model.F_Notifications = it.F_Notifications;//通知人
585 735
                 if (!string .IsNullOrEmpty (it.F_Notifications))
586 736
                 {
@@ -604,7 +754,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
604 754
                 model.F_Duplicate = it.F_Duplicate;//重复工单0未重复1重复
605 755
                 model.F_Content = it.F_Content;//备注
606 756
                 model.F_DealResult = it.F_DealResult;//处理结果
607
-                model.F_DealUser = it.F_DealUser;//处理人
757
+                if (!string.IsNullOrEmpty(it.F_DealUser))
758
+                {
759
+                    var user = new BLL.T_Sys_UserAccount().GetModel(it.F_DealUser);
760
+                    if (user != null)
761
+                    {
762
+                        model.F_DealUser = user.F_UserName; ;//处理人
763
+                    }
764
+                }
608 765
                 model.F_DealTime = it.F_DealTime;//处理时间
609 766
                 model.F_Returnnote = it.F_Returnnote;//退回说明
610 767
                 Input.Add(model);
@@ -711,8 +868,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
711 868
             {
712 869
                 if (see != 0)
713 870
                 {
714
-                    if (HandleUser(ua)!="")
715
-                    sql += "AND F_Largeareaid in (" + HandleUser(ua) + ")";
871
+                    if (HandleUser(ua) != "")
872
+                        sql += "AND F_Largeareaid in (" + HandleUser(ua) + ")";
716 873
                 }
717 874
 
718 875
             }
@@ -730,6 +887,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
730 887
             }
731 888
             return sql;
732 889
         }
890
+       
733 891
         /// <summary>
734 892
         /// 获取处理专员下的大区人员
735 893
         /// </summary>
@@ -791,7 +949,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
791 949
                 string msg = "";
792 950
                 if (id <= 0)
793 951
                     return Error("请输入正确的id");
794
-                sql += " and  F_WoID=" + id ;
952
+                sql += " and  F_WoID=" + id+ "and  F_OptType !=12";
795 953
                 int recordCount = 0;
796 954
                 if (!string.IsNullOrWhiteSpace(sql))
797 955
                 {
@@ -840,6 +998,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
840 998
             {
841 999
                 int userId = CurrentUser.UserData.F_UserId;
842 1000
                 Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
1001
+                Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
843 1002
                 if (!(input.F_Type > 0 && input.F_Type < 4))
844 1003
                     return Error("工单类型错误!");
845 1004
                 if (string.IsNullOrEmpty(input.F_CusName))
@@ -869,6 +1028,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
869 1028
                     }
870 1029
                 }
871 1030
                 var model = new Model.T_Bus_WorkOrder();
1031
+                if (ro .F_RoleCode == "CJZY")
1032
+                {
1033
+                    input.F_Duplicate = 6;
1034
+                }
1035
+                else
1036
+                {
1037
+                    input.F_Duplicate = 0;
1038
+                }
872 1039
                 model = inputtoobj(model, input, 0);
873 1040
             
874 1041
                 int n = workorderBLL.Add(model);
@@ -899,6 +1066,144 @@ namespace CallCenterApi.Interface.Controllers.workorder
899 1066
             return NoToken("未知错误,请重新登录");
900 1067
         }
901 1068
         /// <summary>
1069
+        /// 修改提交工单
1070
+        /// </summary>
1071
+        /// <param name="input"></param>
1072
+        /// <returns></returns>
1073
+        public ActionResult Update(WorkOrderInput input)
1074
+        {
1075
+            if (Request.IsAuthenticated)
1076
+            {
1077
+               
1078
+                int userId = CurrentUser.UserData.F_UserId;
1079
+                Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
1080
+                if (input.F_Id <= 0)
1081
+                    return Error("参数错误!");
1082
+                if (!(input.F_Type > 0 && input.F_Type < 4))
1083
+                    return Error("工单类型错误!");
1084
+                if (string.IsNullOrEmpty(input.F_CusName))
1085
+                    return Error("请输入来电人姓名!");
1086
+                if (string.IsNullOrEmpty(input.F_CusPhone))
1087
+                    return Error("请输入来电人电话!");
1088
+                if (!string.IsNullOrEmpty(input.F_ProductDate))
1089
+                {
1090
+                    try
1091
+                    {
1092
+                        string result = input.F_ProductDate.Replace(".", "");
1093
+                        var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
1094
+                        var protime = Convert.ToDateTime(pronos);
1095
+                        if (DateTime.Parse(pronos) > DateTime.Now)
1096
+                        {
1097
+                            return Error("生产日期不能大于当前时间!");
1098
+                        }
1099
+                    }
1100
+                    catch
1101
+                    {
1102
+                        return Error("生产日期格式错误!");
1103
+                    }
1104
+                }
1105
+                var model = workorderBLL.GetModel(input.F_Id);
1106
+                if (model == null)
1107
+                    return Error("查询不到此工单!");
1108
+                input .F_Duplicate= model.F_Type;
1109
+                input.F_Type = 3;
1110
+                model = inputtoobj(model, input, 1);
1111
+                bool n = workorderBLL.Update(model);
1112
+                if (n)
1113
+                {
1114
+                    var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
1115
+                    string deptname = "";
1116
+                    if (deptmodel != null)
1117
+                        deptname = deptmodel.F_DeptName;
1118
+
1119
+                    AddLog(model.F_Id, int.Parse(model.F_State.ToString()), deptname + userModel.F_UserName + "修改工单", 0, 0, "", 0, userModel, 1);
1120
+                    AddLog(model.F_Id, int.Parse(model.F_State.ToString()), input .F_Content, 0, 12, input .F_CallId  , 0, userModel, 1);
1121
+                   
1122
+                    return Success("修改成功!");
1123
+
1124
+                }
1125
+                else
1126
+                    return Error("修改失败!");
1127
+            }
1128
+            return NoToken("未知错误,请重新登录");
1129
+        }
1130
+        private class workordercall
1131
+        {
1132
+           
1133
+            public Model.T_Call_CallRecords CallRecords;
1134
+            public string F_Remark;
1135
+            public string CusDepName;
1136
+        }
1137
+        public ActionResult GetCallRecords(int id)
1138
+        {
1139
+            int userId = CurrentUser.UserData.F_UserId;
1140
+            if (userId != 0)
1141
+            {
1142
+                DataTable dt = new DataTable();
1143
+                string sql = "";
1144
+                string msg = "";
1145
+                if (id <= 0)
1146
+                    return Error("请输入正确的id");
1147
+                sql += " and  F_WoID=" + id + "and  F_OptType =12";
1148
+                int recordCount = 0;
1149
+
1150
+                var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + id + "and  F_OptType =12");
1151
+                List<workordercall> calls = new List<workordercall>();
1152
+                if (modellist != null)
1153
+                {
1154
+                    foreach (var it in modellist)
1155
+                    {
1156
+                        workordercall workordercalls = new workordercall();
1157
+                        if (!string.IsNullOrEmpty(it.F_NextUser))
1158
+                        {
1159
+                            var callrecords = new BLL.T_Call_CallRecords().GetModel(it.F_NextUser);
1160
+                            if (callrecords != null)
1161
+                            {
1162
+                                workordercalls.CallRecords = callrecords;
1163
+                            }
1164
+
1165
+                        }
1166
+                        workordercalls.F_Remark = it.F_OptContent;
1167
+                        calls.Add(workordercalls);
1168
+                    }
1169
+                }
1170
+                else
1171
+                {
1172
+                    return Success("暂无工单记录"); ;
1173
+                }
1174
+                var obj = new
1175
+                {
1176
+                    rows = calls.Select(x => new
1177
+                    {
1178
+                        CallNumber = x.CallRecords.CallNumber,
1179
+                        FilePath = x.CallRecords.FilePath,
1180
+                        CallType = x.CallRecords.CallType,
1181
+                        DealType = x.CallRecords.DealType,
1182
+
1183
+                        CallState = x.CallRecords.CallState,
1184
+                        UserCode = x.CallRecords.UserCode,
1185
+                        UserName = x.CallRecords.UserName,
1186
+                        BeginTime = x.CallRecords.BeginTime,
1187
+                        TalkStartTime = x.CallRecords.TalkStartTime,
1188
+                        TalkEndTime = x.CallRecords.TalkEndTime,
1189
+                        TalkLongTime = x.CallRecords.TalkLongTime,
1190
+                        F_OptContent = x.F_Remark
1191
+
1192
+                    }),
1193
+                    total = calls.Count
1194
+                };
1195
+
1196
+                return Content(obj.ToJson());
1197
+            }
1198
+      
1199
+            
1200
+            {
1201
+                return Error("无操作权限!");
1202
+            }
1203
+           
1204
+        }
1205
+
1206
+        /// <summary>
902 1207
         /// 修改工单
903 1208
         /// </summary>
904 1209
         /// <param name="input"></param>
@@ -937,6 +1242,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
937 1242
                 var model = workorderBLL.GetModel(input.F_Id);
938 1243
                 if (model == null)
939 1244
                     return Error("查询不到此工单!");
1245
+                    input.F_Duplicate = model .F_Duplicate;
940 1246
                 model = inputtoobj(model, input, 1);
941 1247
                 bool n = workorderBLL.Update(model);
942 1248
                 if (n)
@@ -1127,7 +1433,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1127 1433
         /// </summary>
1128 1434
         /// <returns></returns>
1129 1435
         [Authority]
1130
-        public ActionResult DealWorkOrder(int id, string cont, int isover = 0)
1436
+        public ActionResult DealWorkOrder(int id, string F_Files, string cont, int isover = 0)
1131 1437
         {
1132 1438
             if (Request.IsAuthenticated)
1133 1439
             {
@@ -1140,7 +1446,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1140 1446
                         Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
1141 1447
                         if (model != null)
1142 1448
                         {
1143
-                            var res = DealWO(ua, model, cont, isover);
1449
+                            var res = DealWO(ua, model, cont, F_Files, isover);
1144 1450
                             if (res)
1145 1451
                                 return Success("处理成功");
1146 1452
                             else
@@ -1258,6 +1564,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1258 1564
             {
1259 1565
                 model.F_Officeid = F_Officeid;
1260 1566
                 model.F_Largeareaid = F_Largeareaid;
1567
+                model.F_Notifications = creatuser;//通知人
1261 1568
                 model.F_State = wostate;
1262 1569
                 if (!string.IsNullOrEmpty(model.F_Returnnote))
1263 1570
                     model.F_Returnnote += "," + cont;
@@ -1274,7 +1581,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1274 1581
         /// <summary>
1275 1582
         /// 处理工单
1276 1583
         /// </summary>
1277
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int isover = 0)
1584
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, string F_Files, int isover = 0)
1278 1585
         {
1279 1586
             #region 工单处理
1280 1587
             var opt = "处理";
@@ -1314,6 +1621,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
1314 1621
             {
1315 1622
                 #region 处理工单
1316 1623
                 model.F_State = wostate;
1624
+                if (!string.IsNullOrEmpty(F_Files))
1625
+                {
1626
+                    if (!string.IsNullOrEmpty(model.F_DealFile))
1627
+                        model.F_DealFile = model.F_DealFile + "," + F_Files;
1628
+                    else
1629
+                        model.F_DealFile = F_Files;
1630
+                }
1317 1631
                 //处理内容
1318 1632
                 if (!string.IsNullOrEmpty(model.F_DealResult))
1319 1633
                     model.F_DealResult +=";" +cont ;
@@ -1329,6 +1643,41 @@ namespace CallCenterApi.Interface.Controllers.workorder
1329 1643
             #endregion
1330 1644
         }
1331 1645
         /// <summary>
1646
+        /// 减免工单
1647
+        /// </summary>
1648
+        /// <param name="orderid"></param>
1649
+        /// <param name="cont"></param>
1650
+        /// <returns></returns>
1651
+        public ActionResult Reduction(int id, int IsReduction=0)
1652
+        {
1653
+            if (Request.IsAuthenticated)
1654
+            {
1655
+                int userId = CurrentUser.UserData.F_UserId;
1656
+                if (userId != 0)
1657
+                {
1658
+                    Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
1659
+                    if (ua != null)
1660
+                    {
1661
+                        Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
1662
+                        //验证信息 
1663
+                        if (model != null)
1664
+                        {
1665
+                            if (IsReduction > 0)
1666
+                                model.F_IsReduction = 1;
1667
+                            var res = new BLL.T_Bus_WorkOrder().Update(model);
1668
+                            if (res)
1669
+                                return Success("减免成功");
1670
+                            else
1671
+                                return Error("减免失败!");
1672
+                        }
1673
+                        return Error("工单不存在");
1674
+                    }
1675
+                }
1676
+                return Error("无操作权限");
1677
+            }
1678
+            return NoToken("未知错误,请重新登录");
1679
+        }
1680
+        /// <summary>
1332 1681
         /// 标记工单
1333 1682
         /// </summary>
1334 1683
         /// <param name="orderid"></param>
@@ -1406,9 +1755,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
1406 1755
             model.F_BatchNumber = input.F_BatchNumber;//产品编码
1407 1756
             model.F_Manufacturer = input.F_Manufacturer;//生产厂家
1408 1757
             model.F_ProblemCode = input.F_ProblemCode;//问题代码
1758
+           
1759
+            if (!string .IsNullOrEmpty (input.F_CallId ))
1760
+            {
1761
+                model.F_CallId = input.F_CallId;//通话记录id
1762
+                //var modelRecord = new BLL.T_Call_CallRecords().GetModel(input.F_CallId);
1763
+                //if (modelRecord != null)
1764
+                //    modelRecord.IsExitWorkOrder = true;
1765
+                //new BLL.T_Call_CallRecords().Update(modelRecord);
1766
+            }
1767
+            else
1768
+                model.F_CallId = model.F_CallId;//通话记录id
1409 1769
             model.F_QualityProblem = input.F_QualityProblem;//质量问题
1410 1770
         //    model.F_ImplementationSituation = input.F_ImplementationSituation;//落实情况
1411
-            model.F_Duplicate = 0;//是否重复工单0否1是
1771
+            model.F_Duplicate = input.F_Duplicate;//是否重复工单0否1是
1412 1772
             model.F_Content = input.F_Content;//备注
1413 1773
             #endregion
1414 1774
             if (type == 1)
@@ -1422,6 +1782,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1422 1782
                 model.F_ReceivingPerson = model.F_ReceivingPerson;//接听人
1423 1783
                 model.F_Notifications = model.F_Notifications;//通知人
1424 1784
                 model.F_Returnnote = model.F_Returnnote;//通知人
1785
+                model.F_IsReduction = model.F_IsReduction;
1425 1786
             }
1426 1787
             else
1427 1788
             {
@@ -1429,6 +1790,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1429 1790
                 model.F_Office = input.F_Office;//办事处
1430 1791
                 model.F_ReceivingPerson = usercode;//接听人
1431 1792
                 model.F_State = 0;//0
1793
+                model.F_IsReduction =0;
1432 1794
                 model.F_CreateUser = usercode;
1433 1795
                 model.F_CreateTime = DateTime.Now;//投诉时间
1434 1796
                 string strendtime = DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00";

Разница между файлами не показана из-за своего большого размера
+ 105 - 26
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs


+ 4 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderInput.cs

@@ -7,6 +7,10 @@ namespace CallCenterApi.Interface.Models.Input
7 7
 {
8 8
     public class WorkOrderInput
9 9
     {
10
+        public int F_IsReduction
11
+        {
12
+            get; set;
13
+        }
10 14
         /// <summary>
11 15
         /// 
12 16
         /// </summary>

+ 10 - 1
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -36,7 +36,7 @@ namespace CallCenterApi.Model
36 36
         private string _f_dealresult;
37 37
         private string _f_dealdes;
38 38
         private string _f_dealfile;
39
-        private string  _f_dealtimely;
39
+        private string _f_dealtimely;
40 40
         private string _f_dealuser;
41 41
         private DateTime? _f_dealtime;
42 42
         private string _f_createuser;
@@ -59,6 +59,15 @@ namespace CallCenterApi.Model
59 59
         private int _f_officeid;
60 60
         private int _f_distribution;
61 61
         private string _f_reason;
62
+        private int _f_isreduction;
63
+        /// <summary>
64
+        /// 是否减免0否1是
65
+        /// </summary>
66
+        public int F_IsReduction
67
+        {
68
+            set { _f_isreduction = value; }
69
+            get { return _f_isreduction; }
70
+        }
62 71
         /// <summary>
63 72
         /// 
64 73
         /// </summary>