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

心连心短信,用户登录,首页工单信息,客户档案

duhongyu лет назад: 6
Родитель
Сommit
8d45045813
14 измененных файлов с 367 добавлено и 104 удалено
  1. 7 6
      codegit/CallCenterApi/CallCenterApi.BLL/UserAccount.cs
  2. 1 1
      codegit/CallCenterApi/CallCenterApi.Cache/Models/CurrentUserInfo.cs
  3. 8 4
      codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_UserAccount.cs
  4. 48 6
      codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs
  5. 49 49
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs
  6. 9 8
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs
  7. 6 4
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs
  8. 36 12
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs
  9. 22 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController.cs
  10. 171 3
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs
  11. 1 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs
  12. 5 5
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs
  13. 2 2
      codegit/CallCenterApi/CallCenterApi.Model/T_Sys_UserAccount.cs
  14. 2 2
      codegit/CallCenterApi/CallCenterApi.Model/UserAccount.cs

+ 7 - 6
codegit/CallCenterApi/CallCenterApi.BLL/UserAccount.cs

@@ -265,14 +265,15 @@ namespace CallCenterApi.BLL
265 265
                     {
266 266
                         model.F_WXNo = dt.Rows[n]["F_WXNo"].ToString();
267 267
                     }
268
-                    if (dt.Rows[n]["F_SeartGroupID"] != null && dt.Rows[n]["F_SeartGroupID"].ToString() != "")
268
+                    //if (dt.Rows[n]["F_SeartGroupID"] != null && dt.Rows[n]["F_SeartGroupID"].ToString() != "")
269
+                    //{
270
+                    //    model.F_SeartGroupID = int.Parse(dt.Rows[n]["F_SeartGroupID"].ToString());
271
+                    //}
272
+                    if (dt.Rows[n]["F_SeartGroupID"] != null)
269 273
                     {
270
-                        model.F_SeartGroupID = int.Parse(dt.Rows[n]["F_SeartGroupID"].ToString());
271
-                    }
272
-                    if (dt.Rows[n]["F_SeartGroup"] != null)
273
-                    {
274
-                        model.F_SeartGroup = dt.Rows[n]["F_SeartGroup"].ToString();
274
+                        model.F_SeartGroupID = dt.Rows[n]["F_SeartGroupID"].ToString();
275 275
                     }
276
+                 
276 277
                     if (dt.Rows[n]["RegionId"] != null && dt.Rows[n]["RegionId"].ToString() != "")
277 278
                     {
278 279
                         Model.T_Cus_RegionCategory modelRegion = new BLL.T_Cus_RegionCategory().GetModel(Convert.ToInt32(dt.Rows[n]["RegionId"].ToString()));

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Cache/Models/CurrentUserInfo.cs

@@ -75,7 +75,7 @@ namespace CallCenterApi.Cache.Models
75 75
         /// <summary>
76 76
         /// 坐席组ID
77 77
         /// </summary>
78
-        public virtual int? F_SeartGroupID { get; set; }
78
+        public virtual string  F_SeartGroupID { get; set; }
79 79
 
80 80
         /// <summary>
81 81
         /// 坐席组

+ 8 - 4
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_UserAccount.cs

@@ -84,7 +84,7 @@ namespace CallCenterApi.DAL
84 84
                     new SqlParameter("@F_WorkNumber", SqlDbType.VarChar,-1),
85 85
                     new SqlParameter("@F_DeptCode", SqlDbType.VarChar,50),
86 86
                     new SqlParameter("@F_WXNo", SqlDbType.NVarChar,50),
87
-                    new SqlParameter("@F_SeartGroupID", SqlDbType.Int,4),
87
+                    new SqlParameter("@F_SeartGroupID", SqlDbType.NVarChar,100),
88 88
                     new SqlParameter("@F_SeartGroup", SqlDbType.NVarChar,50),
89 89
                     new SqlParameter("@F_WxOpenId", SqlDbType.NVarChar,300),
90 90
                     new SqlParameter("@RegionId", SqlDbType.Int,4)};
@@ -203,7 +203,7 @@ namespace CallCenterApi.DAL
203 203
                     new SqlParameter("@F_WorkNumber", SqlDbType.VarChar,-1),
204 204
                     new SqlParameter("@F_DeptCode", SqlDbType.VarChar,50),
205 205
                     new SqlParameter("@F_WXNo", SqlDbType.NVarChar,50),
206
-                    new SqlParameter("@F_SeartGroupID", SqlDbType.Int,4),
206
+                    new SqlParameter("@F_SeartGroupID",SqlDbType.NVarChar,100),
207 207
                     new SqlParameter("@F_SeartGroup", SqlDbType.NVarChar,50),
208 208
                     new SqlParameter("@F_WxOpenId", SqlDbType.NVarChar,300),
209 209
                     new SqlParameter("@RegionId", SqlDbType.Int,4),
@@ -624,9 +624,13 @@ namespace CallCenterApi.DAL
624 624
                 {
625 625
                     model.F_WXNo = row["F_WXNo"].ToString();
626 626
                 }
627
-                if (row["F_SeartGroupID"] != null && row["F_SeartGroupID"].ToString() != "")
627
+                //if (row["F_SeartGroupID"] != null && row["F_SeartGroupID"].ToString() != "")
628
+                //{
629
+                //    model.F_SeartGroupID = int.Parse(row["F_SeartGroupID"].ToString());
630
+                //}
631
+                if (row["F_SeartGroupID"] != null)
628 632
                 {
629
-                    model.F_SeartGroupID = int.Parse(row["F_SeartGroupID"].ToString());
633
+                    model.F_SeartGroupID = row["F_SeartGroupID"].ToString();
630 634
                 }
631 635
                 if (row["F_SeartGroup"] != null)
632 636
                 {

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


+ 49 - 49
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -228,56 +228,56 @@ namespace CallCenterApi.Interface.Controllers
228 228
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
229 229
                     if (ua != null)
230 230
                     {
231
-                        //var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
232
-                        //string strDate = date.ToString("yyyy-MM-dd");
233
-                        //string strMonth = date.ToString("yyyy-MM");
234
-
235
-                        ////BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
236
-                        ////var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
237
-                        ////var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
238
-                        ////var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
239
-                        ////var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
240
-                        ////部门信息
241
-                        //var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
242
-                        //int depType = 0;
243
-                        //if (modelDep != null)
244
-                        //    depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
245
-
246
-                        //string uwhere = " 1=1 ";
247
-                        //if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
248
-                        //{
249
-                        //    uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
250
-                        //}
231
+                        var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
232
+                        string strDate = date.ToString("yyyy-MM-dd");
233
+                        string strMonth = date.ToString("yyyy-MM");
234
+
235
+                        //BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
236
+                        //var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
237
+                        //var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
238
+                        //var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
239
+                        //var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
240
+                        //部门信息
241
+                        var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
242
+                        int depType = 0;
243
+                        if (modelDep != null)
244
+                            depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
245
+
246
+                        string uwhere = " 1=1 ";
247
+                        if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
248
+                        {
249
+                            uwhere += " and F_CreateBy='" + ua.F_UserCode + "' ";
250
+                        }
251 251
 
252
-                        //BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
253
-                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
254
-                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State <" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
255
-                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
256
-                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State <" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
257
-                        //#region
258
-                        ////var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
259
-                        ////var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
260
-                        ////var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
261
-                        ////var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
262
-
263
-                        //////日已完成
264
-                        ////var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =1 and IsDel=0 ").Tables[0];
265
-                        //////日未完成
266
-                        ////var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State=0 and IsDel=0 ").Tables[0];
267
-                        //////月已完成
268
-                        ////var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =1 and IsDel=0 ").Tables[0];
269
-                        //////月未完成
270
-                        ////var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State=0 and IsDel=0 ").Tables[0];
271
-                        //#endregion
272
-                        //var obj = new
273
-                        //{
274
-                        //    daywc = list1.Rows.Count,
275
-                        //    daywwc = list2.Rows.Count,
276
-                        //    monwc = list3.Rows.Count,
277
-                        //    monwwc = list4.Rows.Count
278
-                        //};
279
-                        //res = Success("成功", obj);
280
-                        res = Success("成功");
252
+                        BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
253
+                        var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateOn, 23)='" + strDate + "' and F_State in(" + (int)EnumWorkOrderState.finish +","+(int)EnumWorkOrderState.evaluate + ") and F_IsDelete=0 ").Tables[0];
254
+                        var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateOn, 23)='" + strDate + "' and F_State in (0,1,2,3,4,5,6,7,12,14,16) and F_IsDelete=0 ").Tables[0];
255
+                        var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateOn,20)='" + strMonth + "' and F_State in(" + (int)EnumWorkOrderState.finish + "," + (int)EnumWorkOrderState.evaluate+ ") and F_IsDelete=0 ").Tables[0];
256
+                        var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateOn,20)='" + strMonth + "' and F_State in (0,1,2,3,4,5,6,7,12,14,16) and F_IsDelete=0 ").Tables[0];
257
+                        #region
258
+                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
259
+                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
260
+                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
261
+                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
262
+
263
+                        ////日已完成
264
+                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =1 and IsDel=0 ").Tables[0];
265
+                        ////日未完成
266
+                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State=0 and IsDel=0 ").Tables[0];
267
+                        ////月已完成
268
+                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =1 and IsDel=0 ").Tables[0];
269
+                        ////月未完成
270
+                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State=0 and IsDel=0 ").Tables[0];
271
+                        #endregion
272
+                        var obj = new
273
+                        {
274
+                            daywc = list1.Rows.Count,
275
+                            daywwc = list2.Rows.Count,
276
+                            monwc = list3.Rows.Count,
277
+                            monwwc = list4.Rows.Count
278
+                        };
279
+                        res = Success("成功", obj);
280
+                     //   res = Success("成功");
281 281
                     }
282 282
                 }
283 283
             }

+ 9 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

@@ -17,26 +17,27 @@ namespace CallCenterApi.Interface.Controllers
17 17
         // 短信应用SDK AppKey
18 18
         string appkey = "2b2094bcaf2c841fdb50bcaebabf6f54";
19 19
         // 需要发送短信的手机号码
20
-        string[] phoneNumbers = { "17839539537" };
21
-        // 短信模板ID,需要在短信应用中申请
22 20
         int templateId = 392016; // NOTE: 这里的模板ID`7839`只是一个示例,真实的模板ID需要在短信控制台中申请
23 21
         // 签名
24 22
         string smsSign = "河南心连心客服"; // NOTE: 这里的签名只是示例,请使用真实的已申请的签名, 签名参数使用的是`签名内容`,而不是`签名ID`
25 23
         #endregion
26
-        public ActionResult SMSSend()
24
+        public ActionResult SMSSend(string name,string phone,string cusphone)
27 25
         {
28 26
 
29
-            SmsSingleSenderResult result = SMSSingleshot(phoneNumbers[0], "为更好的为你提供服务,请你对我们的服务进行评价,满意请按1,一般请按2,不满意请按3.");
27
+            SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,感谢你的致电反馈,稍后会安排业务经理和你联系,请你保持电话畅通。业务经理姓名:"+ name+",电话:"+ phone+"。");
28
+            
30 29
             if (result != null)
31 30
             {
31
+               
32 32
 
33
-                return Success("短信测试", result);
33
+                return Success("发送短信", result);
34 34
             }
35 35
             else
36 36
             {
37
-                return null;
37
+                return Error ("发送失败,请检查客户电话");
38 38
             }
39 39
         }
40
+      
40 41
         /// <summary>
41 42
         /// 单发短信
42 43
         /// </summary>
@@ -47,7 +48,7 @@ namespace CallCenterApi.Interface.Controllers
47 48
             try
48 49
             {
49 50
                 SmsSingleSender ssender = new SmsSingleSender(appid, appkey);
50
-                var result = ssender.send(0, "86", phoneNumbers[0],
51
+                var result = ssender.send(0, "86", phone,
51 52
                  cont, "", "");
52 53
                 Console.WriteLine(result);
53 54
                 return result;
@@ -164,7 +165,7 @@ namespace CallCenterApi.Interface.Controllers
164 165
         {
165 166
             try
166 167
             {
167
-                
168
+               
168 169
                 SmsStatusPuller spuller = new SmsStatusPuller(appid, appkey);
169 170
                 // 拉取短信回执
170 171
                 var callbackResult = spuller.pullCallback(maxNum);

+ 6 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -264,10 +264,12 @@ namespace CallCenterApi.Interface.Controllers
264 264
                     }
265 265
                     else
266 266
                     {
267
-                      userAccountModel.F_UserCode = Getcode().ToString ();
267
+                        userAccountModel.F_UserCode = Getcode().ToString();
268 268
                         userAccountModel.F_WorkNumber = ucode;
269 269
                     }
270
+                   
270 271
                 }
272
+             
271 273
                 if (input.Username != null)
272 274
                     userAccountModel.F_UserName = input.Username.Trim();
273 275
                 if (input.Password != null)
@@ -307,7 +309,7 @@ namespace CallCenterApi.Interface.Controllers
307 309
                 //if (input.SeartGroupID != 0)
308 310
                 if (input.GroupId != 0)
309 311
                 {
310
-                    userAccountModel.F_SeartGroupID = input.GroupId;
312
+                    userAccountModel.F_SeartGroupID = input.GroupId.ToString ();
311 313
                     Model.T_Sys_SeatGroup sm = new BLL.T_Sys_SeatGroup().GetModel(input.GroupId);
312 314
                     if (sm != null)
313 315
                     {
@@ -320,7 +322,7 @@ namespace CallCenterApi.Interface.Controllers
320 322
                     //话务人员限制权限判断
321 323
                     if (sys.IsValidSeatPermission(""))
322 324
                     {
323
-                        var model = sysUserAccountBll.GetModel(int.Parse(input.Usercode));
325
+                        var model = sysUserAccountBll.GetModel(int.Parse(userAccountModel.F_UserCode));
324 326
                         if (model != null)
325 327
                             return Error("当前员工工号存在,请更换!");
326 328
                         if (sysUserAccountBll.Add(userAccountModel) > 0)
@@ -405,7 +407,7 @@ namespace CallCenterApi.Interface.Controllers
405 407
                 //if (input.SeartGroupID != 0)
406 408
                 if (input.GroupId != 0)
407 409
                 {
408
-                    userAccountModel.F_SeartGroupID = input.GroupId;
410
+                    userAccountModel.F_SeartGroupID = input.GroupId.ToString ();
409 411
                     Model.T_Sys_SeatGroup sm = new BLL.T_Sys_SeatGroup().GetModel(input.GroupId);
410 412
                     if (sm != null)
411 413
                     {

+ 36 - 12
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -376,21 +376,22 @@ namespace CallCenterApi.Interface.Controllers.customer
376 376
                         Input1.F_CompanyName = model[i].F_CompanyName;
377 377
                     Input1.F_AreaID = model[i].F_AreaID;//大区ID
378 378
                     Input1.F_BranchID = model[i].F_BranchID;//分公司ID
379
+
379 380
                     if (!string.IsNullOrEmpty(model[i].F_AreaID))
380 381
                     {
381
-                        Model.T_Sys_Department pdModel = departmentBLL.GetModel(int.Parse(model[i].F_AreaID));
382
-                        if (pdModel != null)
383
-                        {
384
-                            Input1.F_AreaName = pdModel.F_DeptName.ToString();
385
-                        }
382
+                            Model.T_Sys_Department pdModel = departmentBLL.GetModel(int.Parse(model[i].F_AreaID));
383
+                            if (pdModel != null)
384
+                            {
385
+                                Input1.F_AreaName = pdModel.F_DeptName.ToString();
386
+                            }
386 387
                     }
387 388
                     if (!string.IsNullOrEmpty(model[i].F_BranchID))
388 389
                     {
389
-                        Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(int.Parse(model[i].F_BranchID));
390
-                        if (pdModel1 != null)
391
-                        {
392
-                            Input1.F_BranchName = pdModel1.F_DeptName.ToString();
393
-                        }
390
+                           Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(int.Parse(model[i].F_BranchID));
391
+                            if (pdModel1 != null)
392
+                            {
393
+                                Input1.F_BranchName = pdModel1.F_DeptName.ToString();
394
+                            }
394 395
                     }
395 396
                     if (!string.IsNullOrEmpty(model[i].F_Gender))
396 397
                     {
@@ -450,8 +451,31 @@ namespace CallCenterApi.Interface.Controllers.customer
450 451
             if (!string.IsNullOrWhiteSpace(input.F_CompanyName))
451 452
                 model.F_CompanyName = input.F_CompanyName;
452 453
             #region 基本字段
453
-            model.F_AreaID = input.F_AreaID;//大区ID
454
-            model.F_BranchID = input.F_BranchID;//分公司ID
454
+            try
455
+            {
456
+                model.F_AreaID = int .Parse (input.F_AreaID).ToString ();//大区ID
457
+                model.F_BranchID = int .Parse (input.F_BranchID).ToString ();//分公司ID
458
+            }
459
+            catch
460
+            {
461
+                if (!string .IsNullOrEmpty (input.F_AreaID))
462
+                {
463
+                    Model.T_Sys_Department pdModel = departmentBLL.GetModel(input.F_AreaID);
464
+                    if (pdModel != null)
465
+                    {
466
+                        model.F_AreaID = pdModel.F_DeptId .ToString();
467
+                    }
468
+                }
469
+                if (!string .IsNullOrEmpty (input.F_BranchID))
470
+                {
471
+                    Model.T_Sys_Department pdModel = departmentBLL.GetModel(input.F_BranchID);
472
+                    if (pdModel != null)
473
+                    {
474
+                        model.F_BranchID = pdModel.F_DeptId.ToString();
475
+                    }
476
+                }
477
+            }
478
+           
455 479
             model.F_Gender = input.F_Gender;//分公司ID
456 480
             model.F_Salesman = input.F_Salesman;//业务员
457 481
             model.F_SalesPhone = input.F_SalesPhone;//业务员电话

+ 22 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController.cs

@@ -21,7 +21,7 @@ namespace CallCenterApi.Interface.Controllers.customer
21 21
         /// 获取省市县乡镇
22 22
         /// </summary>
23 23
         /// <returns></returns>
24
-        public ActionResult GetAllList(int F_Layer, string F_RegionName = "")
24
+        public ActionResult GetAllList(int F_Layer, string F_RegionName = "",string  keywords="")
25 25
         {
26 26
             int F_RegionId = 0;
27 27
             if (F_RegionName!= "")
@@ -48,6 +48,27 @@ namespace CallCenterApi.Interface.Controllers.customer
48 48
             }
49 49
         }
50 50
         /// <summary>
51
+        /// 获取省市县乡镇
52
+        /// </summary>
53
+        /// <returns></returns>
54
+        public ActionResult GetKeywordsList(int F_Layer, string keywords = "")
55
+        {
56
+            int F_RegionId = 0;
57
+            if (keywords != "")
58
+            {
59
+             List <   Model.T_RegionCategory> userModel = regionBLL.GetModelList("and F_CusPhone like '%" + keywords.Trim());
60
+                if (userModel != null)
61
+                {
62
+                    return Success("加载成功", userModel);
63
+                }
64
+                else
65
+                {
66
+                    return Success("获取失败,内容为空");
67
+                }
68
+            }
69
+            return Success("获取失败,内容为空");
70
+        }
71
+        /// <summary>
51 72
         /// 导入excel
52 73
         /// </summary>
53 74
         /// <returns></returns>

+ 171 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -10,6 +10,7 @@ using System.Text.RegularExpressions;
10 10
 using System.Web;
11 11
 using System.Web.Mvc;
12 12
 
13
+
13 14
 namespace CallCenterApi.Interface.Controllers.report
14 15
 {
15 16
     public class WOReportController : BaseController
@@ -929,7 +930,7 @@ namespace CallCenterApi.Interface.Controllers.report
929 930
             public int Unsatisfactory;//不满意
930 931
             public int Total;
931 932
         }
932
-  
933
+       
933 934
         /// <summary>
934 935
         /// 市场反馈一览表
935 936
         /// </summary>
@@ -1050,6 +1051,145 @@ namespace CallCenterApi.Interface.Controllers.report
1050 1051
 
1051 1052
                 return Content(obj.ToJson()); ;
1052 1053
         }
1054
+
1055
+        /// <summary>
1056
+        /// 渠道数量对比表
1057
+        /// </summary>
1058
+        /// <param name="stime"></param>
1059
+        /// <param name="endtime"></param>
1060
+        /// <returns></returns>
1061
+        public ActionResult GetChanelList(string stime, string endtime)
1062
+        {
1063
+            string sql = $" and F_IsDelete=0";
1064
+            DataTable dt = new DataTable();
1065
+            #region 筛选条件
1066
+            if (stime != null && stime.Trim() != "")
1067
+            {
1068
+                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
1069
+            }
1070
+            if (endtime != null && endtime.Trim() != "")
1071
+            {
1072
+                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
1073
+            }
1074
+            #endregion
1075
+            List<string> channelname = new List<string>();
1076
+            channelname.Add("总经销");
1077
+            channelname.Add("二级商");
1078
+            channelname.Add("种田大户");
1079
+            channelname.Add("公司员工");
1080
+            channelname.Add("农户");
1081
+            channelname.Add("化工客户");
1082
+            channelname.Add("其他");
1083
+            int Distribution = 0, Quotient=0, Bigfarmer = 0, Companystaf = 0, Peasant = 0, Customers = 0, Other = 0;
1084
+            for (int i=0;i < channelname.Count;i++)
1085
+            {
1086
+                string msg = "'" +channelname[i] + "'";
1087
+                var modellist = woBLL.GetModelList(" F_CustomerID in (" + GetCustomer(msg) + ")" + sql + "and F_Type in (2,3)");
1088
+                var modellis = woBLL.GetModelList(" F_CusPhone in (" + GetCustomerrel(msg) + ")" + sql + "and F_Type in (1,4)");
1089
+                switch (i )
1090
+                {
1091
+                    case 0:
1092
+                        Distribution = modellist.Count + modellis.Count;//总经销
1093
+                        break;
1094
+                    case 1:
1095
+                        Quotient = modellist.Count + modellis.Count;//二级商
1096
+                        break;
1097
+                    case 2:
1098
+                        Bigfarmer = modellist.Count + modellis.Count;//种田大户
1099
+                        break;
1100
+                    case 3:
1101
+                        Companystaf = modellist.Count + modellis.Count;//公司员工
1102
+                        break;
1103
+                    case 4:
1104
+                        Peasant = modellist.Count + modellis.Count;//农户
1105
+                        break;
1106
+                    case 5:
1107
+                        Customers = modellist.Count + modellis.Count;//化工客户
1108
+                        break;
1109
+                    case 6:
1110
+                        Other = modellist.Count + modellis.Count;//其他
1111
+                        break;
1112
+                }
1113
+                     
1114
+            }
1115
+
1116
+            var obj = new
1117
+            {
1118
+                state = "success",
1119
+                message = "成功",
1120
+                rows=new
1121
+                {
1122
+                    Distribution,
1123
+                    Quotient,
1124
+                    Bigfarmer,
1125
+                    Companystaf,
1126
+                    Peasant,
1127
+                    Customers,
1128
+                    Other,
1129
+                }
1130
+                ,
1131
+                total =6
1132
+            };
1133
+
1134
+            return Content(obj.ToJson()); ;
1135
+
1136
+
1137
+        }
1138
+        BLL.T_Sys_DictionaryValue dicvalueBll = new BLL.T_Sys_DictionaryValue();
1139
+        public class Brand
1140
+        {
1141
+            public string name;
1142
+            public int number;
1143
+        }
1144
+        /// <summary>
1145
+        /// 产品品牌对照表
1146
+        /// </summary>
1147
+        /// <param name="stime"></param>
1148
+        /// <param name="endtime"></param>
1149
+        /// <returns></returns>
1150
+        public ActionResult GetbrandList(string stime, string endtime)
1151
+        {
1152
+            string sql = $" and F_IsDelete=0";
1153
+            DataTable dt = new DataTable();
1154
+            #region 筛选条件
1155
+            if (stime != null && stime.Trim() != "")
1156
+            {
1157
+                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
1158
+            }
1159
+            if (endtime != null && endtime.Trim() != "")
1160
+            {
1161
+                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
1162
+            }
1163
+            #endregion
1164
+            var dicv = dicvalueBll.GetList(" F_DictionaryFlag='" + "ZXCPMC" + "' and F_State=1 ").Tables[0];
1165
+            List<Brand> list = new List<Brand>();
1166
+            List<Model.T_Sys_DictionaryValue> dicval = new List<Model.T_Sys_DictionaryValue>();
1167
+            if (dicv !=null )
1168
+            {
1169
+                dicval = dicvalueBll.DataTableToList(dicv);
1170
+            }
1171
+            if (dicval !=null&& dicval.Count >0)
1172
+            {
1173
+                foreach (var it in dicval)
1174
+                {
1175
+                    var modellist = woBLL.GetModelList(" F_TS_Category in ('" + it.F_Name  + "')" + sql );
1176
+                    Brand brand = new Brand();
1177
+                    brand.name = it.F_Name;
1178
+                    brand.number  = modellist.Count;
1179
+                    list.Add(brand);
1180
+
1181
+                }
1182
+            }
1183
+            var obj = new
1184
+            {
1185
+                state = "success",
1186
+                message = "成功",
1187
+                rows = list
1188
+                 ,
1189
+                total = list.Count ,
1190
+           };
1191
+            return Content(obj.ToJson()); ;
1192
+        }
1053 1193
         public class QuestionType
1054 1194
         {
1055 1195
             public string F_QuestionType;
@@ -1246,9 +1386,12 @@ namespace CallCenterApi.Interface.Controllers.report
1246 1386
                 }
1247 1387
                 else
1248 1388
                 {
1249
-                    changel = "'农户','化工客户'";
1389
+                    changel = "'农户','化工客户','其他'";
1250 1390
                 }
1251
-                var modellist= woBLL.GetModelList(" F_CustomerID in (" + GetCustomer(changel) + ")" + sql);
1391
+                string msg = "";
1392
+               
1393
+                var modellist= woBLL.GetModelList(" F_CustomerID in (" + GetCustomer(changel) + ")" + sql+ "and F_Type in (2,3)");
1394
+                var modellis = woBLL.GetModelList(" F_CusPhone in (" + GetCustomerrel(changel) + ")" + sql + "and F_Type in (1,4)");
1252 1395
                 int phone = 0, Chat = 0, diate=0, Trans=0, Satis=0, Unsatis= 0,Verysatisfied=0, Commonly=0;
1253 1396
                 foreach (var it in modellist)
1254 1397
                 {
@@ -1269,6 +1412,25 @@ namespace CallCenterApi.Interface.Controllers.report
1269 1412
                     if ( it.F_VisitResult == "不满意")
1270 1413
                         Unsatis++;
1271 1414
                 }
1415
+                foreach (var it in modellis)
1416
+                {
1417
+                    if (it.F_Source == "1")
1418
+                        phone++;
1419
+                    if (it.F_Source == "2" || it.F_Source == "3")
1420
+                        Chat++;
1421
+                    if (it.F_DealType == "当即办理")
1422
+                        diate++;
1423
+                    if (it.F_DealType == "电话转接")
1424
+                        Trans++;
1425
+                    if (it.F_VisitResult == "非常满意")
1426
+                        Verysatisfied++;
1427
+                    if (it.F_VisitResult == "满意")
1428
+                        Satis++;
1429
+                    if (it.F_VisitResult == "一般")
1430
+                        Commonly++;
1431
+                    if (it.F_VisitResult == "不满意")
1432
+                        Unsatis++;
1433
+                }
1272 1434
                 model.Telephone = phone;
1273 1435
                 model.WeChat = Chat;
1274 1436
                 model.Immediate = diate;
@@ -1363,6 +1525,12 @@ namespace CallCenterApi.Interface.Controllers.report
1363 1525
             str = "select F_CustomerCode from T_Cus_CustomerBaseNew where F_IsDelete=0" + " and F_Channel in(" + msg+")";
1364 1526
             return str;
1365 1527
         }
1528
+        public string GetCustomerrel(string msg)
1529
+        {
1530
+            string str = "";
1531
+            str = "select F_LegalPhone from T_Cus_CustomerBaseNew where F_IsDelete=0" + " and F_Channel in(" + msg + ")";
1532
+            return str;
1533
+        }
1366 1534
         private string ChannelType(string msg)
1367 1535
         {
1368 1536
             string mag = "";

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

@@ -824,7 +824,7 @@ namespace CallCenterApi.Interface.Controllers.tel
824 824
             ActionResult res = NoToken("未知错误,请重新登录");
825 825
             if (Request.IsAuthenticated)
826 826
             {
827
-                int? groid = CurrentUser.UserData.F_SeartGroupID;
827
+                int? groid =int .Parse ( CurrentUser.UserData.F_SeartGroupID);
828 828
                 //string groname = CurrentUser.UserData.F_SeartGroup;
829 829
                 string groname = "", grocode = "";
830 830
                 string depname = "";

+ 5 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -4098,7 +4098,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4098 4098
             else
4099 4099
             {
4100 4100
                 model.F_WorkOrderCode = model.F_WorkOrderCode;//工单编号
4101
-                model.F_Source = model.F_Source.ToString();//工单来源
4101
+                model.F_Source = input .F_Source.ToString();//工单来源
4102 4102
             }
4103 4103
                 #region 基本字段
4104 4104
                 if (type == 2)
@@ -5294,7 +5294,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5294 5294
                 {
5295 5295
                     if (!string.IsNullOrEmpty(model.F_CusPhone.Trim () ))
5296 5296
                     {
5297
-                        SmsSingleSenderResult result = new SMSController().SMSSingleshot(model.F_CusPhone.Trim (), smscont);
5297
+                        SmsSingleSenderResult result = new SMSController().SMSSingleshot(model.F_CusPhone.Trim(), smscont);
5298 5298
                         if (result !=null )
5299 5299
                         {
5300 5300
                             sid = result.sid.Trim ();
@@ -5689,9 +5689,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
5689 5689
                     tousername = clus.F_UserName + "(" + touser + ")";
5690 5690
                     if (sms != 0)
5691 5691
                     {
5692
-                        if (!string .IsNullOrEmpty (clus.F_Mobile))
5692
+                        if (!string .IsNullOrEmpty (clus.F_Mobile.Trim ()))
5693 5693
                         {
5694
-                            SmsSingleSenderResult result = new SMSController().SMSSingleshot(clus.F_Mobile.Trim (), smscont);
5694
+                            SmsSingleSenderResult result = new SMSController().SMSSingleshot(clus.F_Mobile.Trim(), smscont);
5695 5695
                         }
5696 5696
                         
5697 5697
                     }
@@ -5719,7 +5719,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5719 5719
                     {
5720 5720
                         if (!string.IsNullOrEmpty(l.F_Mobile.Trim ()))
5721 5721
                         {
5722
-                            SmsSingleSenderResult result = new SMSController().SMSSingleshot(l.F_Mobile.Trim (), smscont);
5722
+                            SmsSingleSenderResult result = new SMSController().SMSSingleshot(l.F_Mobile.Trim(), smscont);
5723 5723
                         }
5724 5724
 
5725 5725
                     }

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Model/T_Sys_UserAccount.cs

@@ -45,7 +45,7 @@ namespace CallCenterApi.Model
45 45
         private string _f_worknumber;
46 46
         private string _f_deptcode;
47 47
         private string _f_wxno;
48
-        private int?   _f_seartgroupid;
48
+        private string   _f_seartgroupid;
49 49
         private string _f_seartgroup;
50 50
         private int _regionid;
51 51
         private string _f_wxopenid;
@@ -293,7 +293,7 @@ namespace CallCenterApi.Model
293 293
         /// <summary>
294 294
 		/// 坐席组ID
295 295
 		/// </summary>
296
-		public int?   F_SeartGroupID
296
+		public string    F_SeartGroupID
297 297
         {
298 298
             set { _f_seartgroupid = value; }
299 299
             get { return _f_seartgroupid; }

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Model/UserAccount.cs

@@ -47,7 +47,7 @@ namespace CallCenterApi.Model
47 47
         private string _f_deptname;
48 48
         private string _f_worknumber;
49 49
         private string _f_wxno;
50
-        private int? _f_seartgroupid;
50
+        private string  _f_seartgroupid;
51 51
         private string _f_seartgroup;
52 52
         private string _f_regionname;
53 53
         /// <summary>
@@ -310,7 +310,7 @@ namespace CallCenterApi.Model
310 310
         /// <summary>
311 311
 		/// 坐席组ID
312 312
 		/// </summary>
313
-		public int? F_SeartGroupID
313
+		public string  F_SeartGroupID
314 314
         {
315 315
             set { _f_seartgroupid = value; }
316 316
             get { return _f_seartgroupid; }