浏览代码

郑州电信

duhongyu 6 年之前
父节点
当前提交
94d2bc9b5a
共有 14 个文件被更改,包括 786 次插入705 次删除
  1. 289 226
      codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs
  2. 2 2
      codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs
  3. 28 11
      codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_Customer.cs
  4. 1 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs
  5. 3 22
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallOutPlanController.cs
  6. 98 127
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs
  7. 6 6
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs
  8. 1 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/QCResultController.cs
  9. 2 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/YearContrastController.cs
  10. 42 17
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiManYiDuController.cs
  11. 19 105
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs
  12. 204 188
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs
  13. 73 0
      codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs
  14. 18 0
      codegit/CallCenterApi/CallCenterApi.Model/T_Cus_Customer.cs

文件差异内容过多而无法显示
+ 289 - 226
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs


+ 2 - 2
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs

@@ -1023,8 +1023,8 @@ namespace CallCenterApi.DAL
1023 1023
             strSql.Append(" case calltype when 1 then '呼出' else '呼入' end calltypes, ");
1024 1024
             //2018-05-23 lihai 处理方式0:IVR处理1骚扰电话2自助服务3转值班电话4留言5呼损6人工处理
1025 1025
             strSql.Append(" case DealType when 0 then 'IVR处理' when 1 then '骚扰电话' when 2 then '自助服务' when 3 then '转值班电话' when 4 then '留言' when 5 then '呼损' when 6 then '人工处理' else '-' end DealType, ");
1026
-            strSql.Append(" (select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d ");
1027
-            strSql.Append(" where u.F_DeptId=d.F_DeptId and u.F_UserCode= c.UserCode) udept, ");
1026
+            strSql.Append(" (select d.F_SeartGroup from T_Sys_UserAccount d ");
1027
+            strSql.Append(" where F_UserCode= c.UserCode) udept, ");
1028 1028
             strSql.Append(" case callstate when 1 then '已接通' else '未接通' end callstates, ");
1029 1029
             strSql.Append(" usercode, (select F_UserName from T_Sys_UserAccount where F_UserCode= c.UserCode) username, ");
1030 1030
             strSql.Append(" begintime, talkstarttime, talkendtime, talklongtime");

+ 28 - 11
codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_Customer.cs

@@ -38,9 +38,9 @@ namespace CallCenterApi.DAL
38 38
         {
39 39
             StringBuilder strSql = new StringBuilder();
40 40
             strSql.Append("insert into T_Cus_Customer(");
41
-            strSql.Append("F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_Office,F_County,F_Remarks)");
41
+            strSql.Append("F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_Office,F_County,F_Customertype,F_Definition,F_Remarks)");
42 42
             strSql.Append(" values (");
43
-            strSql.Append("@F_GroupCode,@F_Type,@F_Area,@F_Province,@F_City,@F_Name,@F_Phone,@F_Sex,@F_State,@F_CreateUser,@F_CreateTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime,@F_Office,@F_County,@F_Remarks)");
43
+            strSql.Append("@F_GroupCode,@F_Type,@F_Area,@F_Province,@F_City,@F_Name,@F_Phone,@F_Sex,@F_State,@F_CreateUser,@F_CreateTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime,@F_Office,@F_County,@F_Customertype,@F_Definition,@F_Remarks)");
44 44
             strSql.Append(";select @@IDENTITY");
45 45
             SqlParameter[] parameters = {
46 46
                     new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50),
@@ -59,6 +59,8 @@ namespace CallCenterApi.DAL
59 59
                      new SqlParameter("@F_Office", SqlDbType.VarChar,50),
60 60
                       new SqlParameter("@F_County", SqlDbType.VarChar,100),
61 61
                        new SqlParameter("@F_Remarks", SqlDbType.VarChar,500),
62
+                        new SqlParameter("@F_Customertype", SqlDbType.VarChar,100),
63
+                         new SqlParameter("@F_Definition", SqlDbType.VarChar,100),
62 64
                 
63 65
                     new SqlParameter("@F_DeleteTime", SqlDbType.DateTime)};
64 66
             parameters[0].Value = model.F_GroupCode;
@@ -77,8 +79,10 @@ namespace CallCenterApi.DAL
77 79
             parameters[13].Value = model.F_Office;
78 80
             parameters[14].Value = model.F_County;
79 81
             parameters[15].Value = model.F_Remarks;
80
-           
81
-          parameters[16].Value = model.F_DeleteTime;
82
+            parameters[16].Value = model.F_Customertype;
83
+            parameters[17].Value = model.F_Definition;
84
+            
85
+            parameters[18].Value = model.F_DeleteTime;
82 86
 
83 87
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
84 88
             if (obj == null)
@@ -113,7 +117,9 @@ namespace CallCenterApi.DAL
113 117
             strSql.Append("F_Office=@F_Office,");
114 118
             strSql.Append("F_County=@F_County,");
115 119
             strSql.Append("F_Remarks=@F_Remarks,");
116
-           
120
+            strSql.Append("F_Customertype=@F_Customertype,");
121
+            strSql.Append("F_Definition=@F_Definition,");
122
+            
117 123
             strSql.Append("F_DeleteTime=@F_DeleteTime");
118 124
             strSql.Append(" where F_Id=@F_Id");
119 125
             SqlParameter[] parameters = {
@@ -133,7 +139,8 @@ namespace CallCenterApi.DAL
133 139
                      new SqlParameter("@F_Office", SqlDbType.VarChar,50),
134 140
                       new SqlParameter("@F_County", SqlDbType.VarChar,100),
135 141
                        new SqlParameter("@F_Remarks", SqlDbType.VarChar,500),
136
-                     
142
+                       new SqlParameter("@F_Customertype", SqlDbType.VarChar,100),
143
+                     new SqlParameter("@F_Definition", SqlDbType.VarChar,100),
137 144
                     new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
138 145
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
139 146
             parameters[0].Value = model.F_GroupCode;
@@ -152,9 +159,11 @@ namespace CallCenterApi.DAL
152 159
             parameters[13].Value = model.F_Office;
153 160
             parameters[14].Value = model.F_County;
154 161
             parameters[15].Value = model.F_Remarks;
162
+            parameters[16].Value = model.F_Customertype;
163
+            parameters[17].Value = model.F_Definition;
155 164
             
156
-            parameters[16].Value = model.F_DeleteTime;
157
-            parameters[17].Value = model.F_Id;
165
+            parameters[18].Value = model.F_DeleteTime;
166
+            parameters[19].Value = model.F_Id;
158 167
 
159 168
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
160 169
             if (rows > 0)
@@ -218,7 +227,7 @@ namespace CallCenterApi.DAL
218 227
         {
219 228
 
220 229
             StringBuilder strSql = new StringBuilder();
221
-            strSql.Append("select  top 1 F_Id,F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_Office,F_County, F_Remarks from T_Cus_Customer ");
230
+            strSql.Append("select  top 1 F_Id,F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_Office,F_County,F_Customertype, F_Remarks,F_Definition from T_Cus_Customer ");
222 231
             
223 232
             strSql.Append(" where F_Id=@F_Id");
224 233
             SqlParameter[] parameters = {
@@ -319,6 +328,14 @@ namespace CallCenterApi.DAL
319 328
                 {
320 329
                     model.F_Remarks = row["F_Remarks"].ToString();
321 330
                 }
331
+                if (row["F_Customertype"] != null)
332
+                {
333
+                    model.F_Customertype = row["F_Customertype"].ToString();
334
+                }
335
+                if (row["F_Definition"] != null)
336
+                {
337
+                    model.F_Definition = row["F_Definition"].ToString();
338
+                }
322 339
                 
323 340
             }
324 341
             return model;
@@ -330,7 +347,7 @@ namespace CallCenterApi.DAL
330 347
         public DataSet GetList(string strWhere)
331 348
         {
332 349
             StringBuilder strSql = new StringBuilder();
333
-            strSql.Append("select F_Id,F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime ,F_Office,F_County,F_Remarks");
350
+            strSql.Append("select F_Id,F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime ,F_Office,F_County,F_Remarks,F_Customertype,F_Definition");
334 351
           
335 352
             strSql.Append(" FROM T_Cus_Customer ");
336 353
             if (strWhere.Trim() != "")
@@ -351,7 +368,7 @@ namespace CallCenterApi.DAL
351 368
             {
352 369
                 strSql.Append(" top " + Top.ToString());
353 370
             }
354
-            strSql.Append(" F_Id,F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_Office,F_County,F_Remarks ");
371
+            strSql.Append(" F_Id,F_GroupCode,F_Type,F_Area,F_Province,F_City,F_Name,F_Phone,F_Sex,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_Office,F_County,F_Remarks,F_Customertype ,F_Definition");
355 372
            
356 373
             strSql.Append(" FROM T_Cus_Customer ");
357 374
             if (strWhere.Trim() != "")

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

@@ -556,6 +556,7 @@ namespace CallCenterApi.Interface.Controllers
556 556
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
557 557
 
558 558
                 string sql = " f_seatflag=1 ";
559
+                sql += " and F_SeartGroup = '" + userModel.F_SeartGroup  + "' ";
559 560
                 int roleid = CurrentUser.UserData.F_RoleId;
560 561
                 int deptid = CurrentUser.UserData.F_DeptId;
561 562
                 if (roleid != 0)

+ 3 - 22
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallOutPlanController.cs

@@ -688,6 +688,7 @@ namespace CallCenterApi.Interface.Controllers.callout
688 688
                                     true,
689 689
                                     out recordCount);
690 690
             #region 条件调整
691
+     
691 692
             string sqlc = "";
692 693
             sqlc += "  and isnull(F_HJJGName,'') not in ('正常接通','停机','空号','正常接通-不满意','不在本地居住') ";
693 694
             sqlc += "and F_TaskID in (select F_TaskID from T_Call_OutTask where F_IsStart=1 and F_DeleteFlag=0) ";
@@ -867,17 +868,7 @@ namespace CallCenterApi.Interface.Controllers.callout
867 868
                     true,
868 869
                     out recordCount);
869 870
             #region 判断是否已存在工单
870
-            foreach (DataRow item in dt.Rows)
871
-            {
872
-                string wjid = item["F_Id"].ToString();
873
-                int c = new BLL.T_Wo_WorkOrder().GetRecordCount(" isnull(WjID,'')='" + wjid + "'");
874
-                if (c > 0)
875
-                {
876
-                    item["ExpandSintField1"] = 1;
877
-                }
878
-                else
879
-                    item["ExpandSintField1"] = 0;
880
-            }
871
+           
881 872
             #endregion
882 873
             var obj = new
883 874
             {
@@ -935,17 +926,7 @@ namespace CallCenterApi.Interface.Controllers.callout
935 926
                     true,
936 927
                     out recordCount);
937 928
             #region 判断是否已存在工单
938
-            foreach (DataRow item in dt.Rows)
939
-            {
940
-                string wjid = item["F_Id"].ToString();
941
-                int c = new BLL.T_Wo_WorkOrder().GetRecordCount(" isnull(WjID,'')='" + wjid + "'");
942
-                if (c > 0)
943
-                {
944
-                    item["ExpandSintField1"] = 1;
945
-                }
946
-                else
947
-                    item["ExpandSintField1"] = 0;
948
-            }
929
+        
949 930
             #endregion
950 931
             var obj = new
951 932
             {

+ 98 - 127
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -38,24 +38,16 @@ namespace CallCenterApi.Interface.Controllers.customer
38 38
                 //分组代码
39 39
                 //string code = RequestString.GetFormString("code");
40 40
                 //类型
41
-               // int type = RequestString.GetInt("type", 0);
41
+                int type = RequestString.GetInt("type", 0);
42 42
                 //联系人
43 43
                 string strname = RequestString.GetQueryString("name");
44 44
                 //电话
45
-                string strtel = RequestString.GetQueryString("tel");
46
-                //大区
47
-                string strarea = RequestString.GetQueryString("area");
48
-                //办事处
49
-                string stroffice = RequestString.GetQueryString("office");
50
-                //省份
51
-                string strprov = RequestString.GetQueryString("province");
52
-                //城市
53
-                string strcity = RequestString.GetQueryString("city");
54
-                //县区
55
-                string strcounty = RequestString.GetQueryString("county");
45
+                 string strtel = RequestString.GetQueryString("tel");
56 46
                 string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
57 47
                 string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
58
-
48
+                string customertype = RequestString.GetQueryString("customertype");
49
+                string definition = RequestString.GetQueryString("definition");
50
+                
59 51
                 string strpageindex = RequestString.GetQueryString("page");
60 52
                 int pageindex = 1;
61 53
                 string strpagesize = RequestString.GetQueryString("pagesize");
@@ -70,10 +62,7 @@ namespace CallCenterApi.Interface.Controllers.customer
70 62
                  //   sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
71 63
              //   }
72 64
 
73
-              //  if (type!=0)
74
-               // {
75
-                  //  sql += " and F_Type = '" + type + "' ";
76
-               // }
65
+                   sql += " and F_Type = '" + type + "' ";
77 66
                 if (strname.Trim() != "" && strname != "undefined")
78 67
                 {
79 68
                     sql += " and F_Name like '%" + strname.Trim() + "%' ";
@@ -82,27 +71,15 @@ namespace CallCenterApi.Interface.Controllers.customer
82 71
                 {
83 72
                     sql += " and F_Phone like '%" + strtel + "%' ";
84 73
                 }
85
-                if (strarea.Trim() != "" && strarea != "undefined")
86
-                {
87
-                    sql += " and F_Area = '" + strarea.Trim() + "' ";
88
-                }
89
-                if (stroffice.Trim() != "" && stroffice != "undefined")
74
+                if (customertype.Trim() != "" && customertype != "undefined")
90 75
                 {
91
-                    sql += " and F_Office = '" + stroffice.Trim() + "' ";
76
+                    sql += " and F_Customertype like '%" + customertype + "%' ";
92 77
                 }
93
-                if (strprov.Trim() != "" && strprov.Trim() != "undefined")
78
+                if (definition.Trim() != "" && definition != "undefined")
94 79
                 {
95
-                    sql += " and F_Province = '" + strprov.Trim() + "' ";
80
+                    sql += " and F_Definition like '%" + definition + "%' ";
96 81
                 }
97
-                if (strcity.Trim() != "" && strcity.Trim() != "undefined")
98
-                {
99
-                    sql += " and F_City = '" + strcity.Trim() + "' ";
100
-                }
101
-                if (strcounty.Trim() != "" && strcounty.Trim() != "undefined")
102
-                {
103
-                    sql += " and F_County = '" + strcounty.Trim() + "' ";
104
-                }
105
-
82
+                
106 83
                 if (strstarttime.Trim() != "" && strstarttime != "undefined")
107 84
                 {
108 85
                     sql += " and datediff(day,F_CreateTime,'" + strstarttime + "')<=0 ";
@@ -124,10 +101,23 @@ namespace CallCenterApi.Interface.Controllers.customer
124 101
 
125 102
                 if (isdc > 0)
126 103
                 {
127
-                    string dccols = "F_Area,F_Office,F_Province,F_City,F_County,F_Name,F_Phone,F_Remarks";
128
-                    var dtdc = DbHelperSQL.Query(" select " + dccols + " from T_Bus_WorkOrder where 1=1 " + sql).Tables[0];
129
-                    string[] dccolnames = new string[] {"大区", "办事处", "省份", "城市", "县/区", "姓名", "电话", "备注" };
130
-                    var msg = new NPOIHelper().ExportToExcel("客户列表", dtdc, dccolnames);
104
+                    string msg = "";
105
+                    if (type ==0)
106
+                    {
107
+                        string dccols = "F_Name,F_Phone,F_Customertype";
108
+                        var dtdc = DbHelperSQL.Query(" select " + dccols + " from T_Cus_Customer where 1=1 " + sql+ "ORDER BY F_Id desc").Tables[0];
109
+                        string[] dccolnames = new string[] { "客户姓名", "客户电话", "客户类型" };
110
+                        msg = new NPOIHelper().ExportToExcel("客户列表", dtdc, dccolnames);
111
+
112
+                    }
113
+                    else
114
+                    {
115
+                        string dccols = "F_Definition,F_Name,F_Phone";
116
+                        var dtdc = DbHelperSQL.Query(" select " + dccols + " from T_Cus_Customer where 1=1 " + sql + "ORDER BY F_Id desc").Tables[0];
117
+                        string[] dccolnames = new string[] { "营业厅名称","处理人姓名", "处理人电话" };
118
+                        msg = new NPOIHelper().ExportToExcel("营业厅列表", dtdc, dccolnames);
119
+                    }
120
+                 
131 121
                     if (msg == "")
132 122
                     {
133 123
                         return Success("导出成功");
@@ -178,59 +168,26 @@ namespace CallCenterApi.Interface.Controllers.customer
178 168
                 //分组代码
179 169
              //   string code = RequestString.GetFormString("code");
180 170
                 //类型
181
-              //  int type = RequestString.GetInt("type", 0);
171
+                int type = RequestString.GetInt("type", 0);
182 172
                 //关键词
183 173
                 string strkey = RequestString.GetQueryString("key");
184 174
                 //大区
185
-                string strarea = RequestString.GetQueryString("area");
186
-                //办事处
187
-                string stroffice = RequestString.GetQueryString("office");
188
-                //省份
189
-                string strprov = RequestString.GetQueryString("province");
190
-                //城市
191
-                string strcity = RequestString.GetQueryString("city");
192
-                //县/区
193
-                string strcounty = RequestString.GetQueryString("county");
194
-
175
+                string customertype = RequestString.GetQueryString("customertype");
176
+                string definition = RequestString.GetQueryString("definition");
195 177
                 string sql = " F_IsDelete=0";
196
-
197
-              //  if (!string.IsNullOrEmpty(code))
198
-             //   {
199
-                 //   sql += " and F_GroupCode = '" + code + "' ";
200
-               // }
201
-               // else if (!string.IsNullOrEmpty(userModel.groupcode))
202
-              //  {
203
-                   // sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
204
-              //  }
205
-              //  if (type != 0)
206
-               // {
207
-                   // sql += " and F_Type = '" + type + "' ";
208
-              //  }
209 178
                 if (strkey.Trim() != "" && strkey != "undefined")
210 179
                 {
211 180
                     sql += " and (F_Name like '%" + strkey.Trim() + "%' or F_Phone like '%" + strkey.Trim() + "%' or F_Area like '%" + strkey.Trim() + "%' or F_Office like '%" + strkey.Trim() + "%') ";
212 181
                 }
213
-                if (strarea.Trim() != "" && strarea != "undefined")
214
-                {
215
-                    sql += " and F_Area = '" + strarea.Trim() + "' ";
216
-                }
217
-                if (stroffice.Trim() != "" && stroffice != "undefined")
182
+                if (customertype.Trim() != "" && customertype != "undefined")
218 183
                 {
219
-                    sql += " and F_Office = '" + stroffice.Trim() + "' ";
184
+                    sql += " and F_Customertype like '%" + customertype + "%' ";
220 185
                 }
221
-                if (strprov.Trim() != "" && strprov.Trim() != "undefined")
186
+                if (definition.Trim() != "" && definition != "undefined")
222 187
                 {
223
-                    sql += " and F_Province = '" + strprov.Trim() + "' ";
188
+                    sql += " and F_Definition like '%" + definition + "%' ";
224 189
                 }
225
-                if (strcity.Trim() != "" && strcity.Trim() != "undefined")
226
-                {
227
-                    sql += " and F_City = '" + strcity.Trim() + "' ";
228
-                }
229
-                if (strcounty.Trim() != "" && strcounty.Trim() != "undefined")
230
-                {
231
-                    sql += " and F_County = '" + strcounty.Trim() + "' ";
232
-                }
233
-
190
+                    sql += " and F_Type = '" + type + "' ";
234 191
                 DataTable dt = new BLL.T_Cus_Customer().GetList(sql).Tables[0];
235 192
                 return Success("获取成功", dt);
236 193
 
@@ -313,24 +270,15 @@ namespace CallCenterApi.Interface.Controllers.customer
313 270
                 //id
314 271
                 int id = RequestString.GetInt("id", 0);
315 272
                 //分组代码
316
-             //  string code = RequestString.GetFormString("code");
273
+               string code = RequestString.GetFormString("code");
317 274
                 //类型
318
-             //  int type = RequestString.GetInt("type", 0);
275
+               int type = RequestString.GetInt("type", 0);
319 276
                 //联系人
320 277
                 string strname = RequestString.GetFormString("name");
321 278
                 //电话
322 279
                 string strtel = RequestString.GetFormString("tel");
323
-                //大区
324
-                string strarea = RequestString.GetFormString("area");
325
-                //省份
326
-                string strprov = RequestString.GetFormString("province");
327
-                //城市
328
-                string strcity = RequestString.GetFormString("city");
329
-                //办事处
330
-                string stroffice = RequestString.GetFormString("office");
331
-                //县/区
332
-                string strcounty = RequestString.GetFormString("county");
333
-                //备注
280
+                string customertype = RequestString.GetFormString("customertype");
281
+                string definition = RequestString.GetFormString("definition");
334 282
                 string strremarks = RequestString.GetFormString("remarks");
335 283
 
336 284
                 Model.T_Cus_Customer model = new Model.T_Cus_Customer();
@@ -338,15 +286,12 @@ namespace CallCenterApi.Interface.Controllers.customer
338 286
 
339 287
                 if (id == 0)
340 288
                 {
341
-                  //  model.F_GroupCode = string.IsNullOrEmpty(code) ? userModel.groupcode : code;
342
-                  //  model.F_Type = type;
289
+                    model.F_GroupCode = string.IsNullOrEmpty(code) ? userModel.groupcode : code;
290
+                    model.F_Type = type;
343 291
                     model.F_Name = strname;
344 292
                     model.F_Phone = strtel;
345
-                    model.F_Area = strarea;
346
-                    model.F_Office  = stroffice;
347
-                    model.F_Province = strprov;
348
-                    model.F_City = strcity;
349
-                    model.F_County  = strcounty;
293
+                    model.F_Customertype = customertype;
294
+                    model.F_Definition = definition;
350 295
                     model.F_Remarks = strremarks;
351 296
                     model.F_CreateUser = userModel.F_UserCode;
352 297
                     model.F_CreateTime = DateTime.Now;
@@ -366,18 +311,15 @@ namespace CallCenterApi.Interface.Controllers.customer
366 311
                     model = bll.GetModel(id);
367 312
                     if (model != null)
368 313
                     {
369
-                       // if (!string.IsNullOrEmpty(code))
370
-                       // {
371
-                          //  model.F_GroupCode = code;
372
-                       // }
373
-                      //  model.F_Type = type;
314
+                        if (!string.IsNullOrEmpty(code))
315
+                        {
316
+                            model.F_GroupCode = code;
317
+                        }
318
+                       model.F_Type = type;
374 319
                         model.F_Name = strname;
375 320
                         model.F_Phone = strtel;
376
-                        model.F_Area = strarea;
377
-                        model.F_Office = stroffice;
378
-                        model.F_Province = strprov;
379
-                        model.F_City = strcity;
380
-                        model.F_County = strcounty;
321
+                        model.F_Customertype = customertype;
322
+                        model.F_Definition = definition;
381 323
                         model.F_Remarks = strremarks;
382 324
                         if (bll.Update(model))
383 325
                         {
@@ -435,14 +377,19 @@ namespace CallCenterApi.Interface.Controllers.customer
435 377
         /// 下载模板
436 378
         /// </summary>
437 379
         /// <returns></returns>
438
-        public ActionResult DownTemplate()
380
+        public ActionResult DownTemplate(int type=0)
439 381
         {
440 382
             if (Request.IsAuthenticated)
441 383
             {
442 384
                 string mbname = Configs.GetValue("mbname").ToString();
385
+                string mbyetname = Configs.GetValue("mbyetname").ToString();
443 386
                 string mbkeys = Configs.GetValue("mbkeys").ToString();
444
-
445
-                var result = new NPOIHelper().ExportToExcel(mbname, new DataTable(), mbkeys.Split(','));
387
+                string mbyet = Configs.GetValue("mbyet").ToString();
388
+                string result = "";
389
+                if (type==0)
390
+                 result = new NPOIHelper().ExportToExcel(mbname, new DataTable(), mbkeys.Split(','));
391
+                else 
392
+                 result = new NPOIHelper().ExportToExcel(mbyetname, new DataTable(), mbyet.Split(','));
446 393
                 if (result == "")
447 394
                 {
448 395
                     return Success("成功");
@@ -473,6 +420,7 @@ namespace CallCenterApi.Interface.Controllers.customer
473 420
             string ip = DTRequest.GetIP();
474 421
             if (!string.IsNullOrWhiteSpace(usercode))
475 422
             {
423
+                int type = RequestString.GetInt("type", 0);
476 424
                 HttpPostedFile _upFile = RequestString.GetFile("upFile");
477 425
                 if (_upFile != null)
478 426
                 {
@@ -510,31 +458,54 @@ namespace CallCenterApi.Interface.Controllers.customer
510 458
                         {
511 459
                             #region 数据入库
512 460
                             headrow = headrow + 1;
513
-                            if (!getunphone(dr["电话"].ToString()))
461
+                           
462
+                            if (type ==0)
514 463
                             {
515
-                                dModel.F_Area = dr["大区"].ToString();
516
-                                dModel.F_Office = dr["办事处"].ToString();
517
-                                dModel.F_Province = dr["省份"].ToString();
518
-                                dModel.F_City = dr["城市"].ToString();
519
-                                dModel.F_County = dr["区/县"].ToString();
520
-                                dModel.F_Name = dr["姓名"].ToString();
521
-                                dModel.F_Phone = dr["电话"].ToString();
522
-                                dModel.F_Remarks = dr["备注"].ToString();
523
-                                #endregion
524
-                                var res = new BLL.T_Cus_Customer().Add(dModel);
525
-                                if (res > 0)
464
+                                if (!getunphone(dr["客户电话"].ToString()))
526 465
                                 {
466
+                                    dModel.F_Type = type;
467
+                                    dModel.F_Customertype = dr["客户类型"].ToString();
468
+                                    dModel.F_Name = dr["客户姓名"].ToString();
469
+                                    dModel.F_Phone = dr["客户电话"].ToString();
470
+
471
+                                    #endregion
472
+                                    var res = new BLL.T_Cus_Customer().Add(dModel);
473
+                                    if (res > 0)
474
+                                    {
475
+                                    }
476
+                                    else
477
+                                    {
478
+                                        msg = msg + "第" + headrow + "行,导入失败<br>";
479
+                                    }
527 480
                                 }
528 481
                                 else
529 482
                                 {
530
-                                    msg = msg + "第" + headrow + "行,导入失败<br>";
483
+                                    msg = msg + "第" + headrow + "行,电话重复,未导入<br>";
531 484
                                 }
532
-
533 485
                             }
534 486
                             else
535 487
                             {
536
-                                msg = msg + "第" + headrow + "行,客户电话重复,未导入<br>";
488
+                                if (!getunphone(dr["处理人电话"].ToString()))
489
+                                {
490
+                                    dModel.F_Type = type;
491
+                                    dModel.F_Definition = dr["营业厅名称"].ToString();
492
+                                    dModel.F_Name = dr["处理人姓名"].ToString();
493
+                                    dModel.F_Phone = dr["处理人电话"].ToString();
494
+                                    var res = new BLL.T_Cus_Customer().Add(dModel);
495
+                                    if (res > 0)
496
+                                    {
497
+                                    }
498
+                                    else
499
+                                    {
500
+                                        msg = msg + "第" + headrow + "行,导入失败<br>";
501
+                                    }
502
+                                }
503
+                                else
504
+                                {
505
+                                    msg = msg + "第" + headrow + "行,电话重复,未导入<br>";
506
+                                }
537 507
                             }
508
+                           
538 509
 
539 510
 
540 511
 

+ 6 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

@@ -646,15 +646,15 @@ namespace CallCenterApi.Interface.Controllers.report
646 646
                 stime = new DateTime(stime.Year, stime.Month, 1);
647 647
             }
648 648
             string where = " F_IsDelete=0 and datediff(day,F_CreateTime,'" + stime + "')<=0 "
649
-                + " and datediff(day,F_CreateTime,'" + etime + "')>=0 and F_Type=F_DictionaryValueId ";
649
+                + " and datediff(day,F_CreateTime,'" + etime + "')>=0 ";
650 650
             string dicwhere = "";
651 651
             if (!string.IsNullOrEmpty(userModel.groupcode))
652 652
             {
653 653
                 where += " and F_GroupCode = '" + userModel.groupcode + "' ";
654 654
                 dicwhere += " and F_GroupCode = '" + userModel.groupcode + "' ";
655 655
             }
656
-            string sql = " select F_Name TypeName,(select COUNT(1) from T_Bus_WorkOrder where "+ where 
657
-                + " ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='GDLX' and F_State=1 "+ dicwhere;
656
+            string sql = " select F_Name F_Typeof,(select COUNT(1) from T_Bus_WorkOrder where " + where 
657
+                + " ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='GDLX' and F_State=1 " ;
658 658
 
659 659
             DataTable dt = DbHelperSQL.Query(sql).Tables[0];
660 660
 
@@ -699,15 +699,15 @@ namespace CallCenterApi.Interface.Controllers.report
699 699
                 stime = new DateTime(stime.Year, stime.Month, 1);
700 700
             }
701 701
             string where = " F_IsDelete=0 and datediff(day,F_CreateTime,'" + stime + "')<=0 "
702
-                + " and datediff(day,F_CreateTime,'" + etime + "')>=0 and F_SmallType=F_DictionaryValueId ";
702
+                + " and datediff(day,F_CreateTime,'" + etime + "')>=0  ";
703 703
             string dicwhere = "";
704 704
             if (!string.IsNullOrEmpty(userModel.groupcode))
705 705
             {
706 706
                 where += " and F_GroupCode = '" + userModel.groupcode + "' ";
707 707
                 dicwhere += " and F_GroupCode = '" + userModel.groupcode + "' ";
708 708
             }
709
-            string sql = " select F_Name TypeName,(select COUNT(1) from T_Bus_WorkOrder where " + where
710
-                + " ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='TSLX' and F_State=1 "+ dicwhere;
709
+            string sql = " select F_Name F_Customertype,(select COUNT(1) from T_Bus_WorkOrder where " + where
710
+                + " ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='KHLX' and F_State=1 " ;
711 711
 
712 712
             DataTable dt = DbHelperSQL.Query(sql).Tables[0];
713 713
 

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/QCResultController.cs

@@ -203,7 +203,7 @@ namespace CallCenterApi.Interface.Controllers.report
203 203
                 {
204 204
                     sqltimeCallRecords += " and CONVERT(varchar , BeginTime, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
205 205
                 }
206
-                if (string.IsNullOrEmpty(userModel.groupcode))
206
+                if (!string.IsNullOrEmpty(userModel.groupcode))
207 207
                 {
208 208
                     //strsql = " and UserId in(select F_UserId from T_Sys_UserAccount where F_DeptId=" + dpt.ToString() + ") ";
209 209
                    strsql += " AND groupcode='" + userModel.groupcode + "' ";

+ 2 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/YearContrastController.cs

@@ -87,6 +87,8 @@ namespace CallCenterApi.Interface.Controllers.report
87 87
         {
88 88
             if (Request.IsAuthenticated)
89 89
             {
90
+                if (beginyear == endyear)
91
+                    return Error("请选择不同的年份");
90 92
                 int userId = CurrentUser.UserData.F_UserId;
91 93
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
92 94
                 NPOIHelper npoi = new NPOIHelper();

+ 42 - 17
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiManYiDuController.cs

@@ -31,7 +31,7 @@ namespace CallCenterApi.Interface.Controllers.report
31 31
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
32 32
 
33 33
                 DataTable dtNew = new DataTable();
34
-                dtNew = getData(stime, endtime, userModel.F_SeartGroupID.Value);
34
+                dtNew = getData(stime, endtime, userModel.F_SeartGroupID.Value,0);
35 35
                 return Success("获取坐席满意度评价情况报表数据成功", dtNew);
36 36
             }
37 37
             return NoToken("未知错误,请重新登录");
@@ -45,7 +45,7 @@ namespace CallCenterApi.Interface.Controllers.report
45 45
                 int userId = CurrentUser.UserData.F_UserId;
46 46
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
47 47
                 NPOIHelper npoi = new NPOIHelper();
48
-                DataTable dt = getData(stime, endtime, userModel.F_SeartGroupID.Value);
48
+                DataTable dt = getData(stime, endtime, userModel.F_SeartGroupID.Value,1);
49 49
                 if (npoi.ExportToExcel("坐席满意度评价情况", dt) == "")
50 50
                 {
51 51
                     return Success("导出成功");
@@ -58,7 +58,7 @@ namespace CallCenterApi.Interface.Controllers.report
58 58
             return NoToken("未知错误,请重新登录");
59 59
         }
60 60
 
61
-        private DataTable getData(string stime, string endtime, int dpt)
61
+        private DataTable getData(string stime, string endtime, int dpt,int isdc)
62 62
         {
63 63
             DataTable dtNew = new DataTable();
64 64
             #region
@@ -130,24 +130,49 @@ namespace CallCenterApi.Interface.Controllers.report
130 130
                     body.Add(UNDN[1], bodylist);
131 131
                 }
132 132
             }
133
-            foreach (string key in body.Keys)
133
+            if (isdc == 0)
134 134
             {
135
-                DataRow dr = dtNew.NewRow();
136
-                int count = body[key].Count;
137
-                foreach (List<string> listiteam in body[key])
135
+                foreach (string key in body.Keys)
138 136
                 {
139
-                    dr["坐席姓名"] = listiteam[0].ToString();
140
-                    dr["非常满意"] = listiteam[1].ToString();
141
-                    dr["非常满意占比"] = listiteam[2].ToString();
142
-                    dr["基本满意"] = listiteam[3].ToString();
143
-                    dr["基本满意占比"] = listiteam[4].ToString();
144
-                    dr["不满意"] = listiteam[5].ToString();
145
-                    dr["不满意占比"] = listiteam[6].ToString();
146
-                    dr["未评价"] = listiteam[7].ToString();
147
-                    dr["未评价占比"] = listiteam[8].ToString();
137
+                    DataRow dr = dtNew.NewRow();
138
+                    int count = body[key].Count;
139
+                    foreach (List<string> listiteam in body[key])
140
+                    {
141
+                        dr["坐席姓名"] = listiteam[0].ToString();
142
+                        dr["非常满意"] = listiteam[1].ToString();
143
+                        dr["非常满意占比"] = string.Format("{0:f2}", double.Parse(listiteam[2]) * 100);
144
+                        dr["基本满意"] = listiteam[3].ToString();
145
+                        dr["基本满意占比"] = string.Format("{0:f2}", double.Parse(listiteam[4]) * 100);
146
+                        dr["不满意"] = listiteam[5].ToString();
147
+                        dr["不满意占比"] = string.Format("{0:f2}", double.Parse(listiteam[6]) * 100);
148
+                        dr["未评价"] = listiteam[7].ToString();
149
+                        dr["未评价占比"] = string.Format("{0:f2}", double.Parse(listiteam[8]) * 100);
150
+                    }
151
+                    dtNew.Rows.Add(dr);
148 152
                 }
149
-                dtNew.Rows.Add(dr);
150 153
             }
154
+            else
155
+            {
156
+                foreach (string key in body.Keys)
157
+                {
158
+                    DataRow dr = dtNew.NewRow();
159
+                    int count = body[key].Count;
160
+                    foreach (List<string> listiteam in body[key])
161
+                    {
162
+                        dr["坐席姓名"] = listiteam[0].ToString();
163
+                        dr["非常满意"] = listiteam[1].ToString();
164
+                        dr["非常满意占比"] = string.Format("{0:f2}%", double.Parse(listiteam[2]) * 100);
165
+                        dr["基本满意"] = listiteam[3].ToString();
166
+                        dr["基本满意占比"] = string.Format("{0:f2}%", double.Parse(listiteam[4]) * 100);
167
+                        dr["不满意"] = listiteam[5].ToString();
168
+                        dr["不满意占比"] = string.Format("{0:f2}%", double.Parse(listiteam[6]) * 100);
169
+                        dr["未评价"] = listiteam[7].ToString();
170
+                        dr["未评价占比"] = string.Format("{0:f2}%", double.Parse(listiteam[8]) * 100);
171
+                    }
172
+                    dtNew.Rows.Add(dr);
173
+                }
174
+            }
175
+           
151 176
             return dtNew;
152 177
         }
153 178
 

+ 19 - 105
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -358,122 +358,36 @@ namespace CallCenterApi.Interface.Controllers.tel
358 358
                 string sql = " 1=1 ";
359 359
                 DataTable dt = new DataTable();
360 360
 
361
-                int userid = CurrentUser.UserData.F_UserId;
362
-                int roleid = CurrentUser.UserData.F_RoleId;
363
-                int deptid = CurrentUser.UserData.F_DeptId;
364
-                string currcode = CurrentUser.UserData.F_UserCode;
365
-                string deptcode = CurrentUser.UserData.F_DeptCode;
361
+                int userId = CurrentUser.UserData.F_UserId;
362
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
363
+                if (userModel == null)
364
+                    return Error("无操作权限");
365
+                Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
366 366
                 string callstate = HttpUtility.UrlDecode(RequestString.GetQueryString("callstate"));
367 367
                 string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
368 368
                 string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
369 369
                 string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
370 370
                 string dept = HttpUtility.UrlDecode(RequestString.GetQueryString("dept"));
371 371
                 string dealtype = HttpUtility.UrlDecode(RequestString.GetQueryString("dealtype"));
372
-
373
-                //if (roleid != 0)
374
-                //{
375
-                //    if (roleid != 17)
376
-                //    {
377
-                //        if (deptcode.IndexOf("|533|") > 0)
378
-                //        {
379
-                //            sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + deptid + ")";
380
-                //        }
381
-                //        if (deptcode.IndexOf("|531|") > 0)
382
-                //        {
383
-                //            if (roleid == 32)
384
-                //            {
385
-                //                usercode = CurrentUser.UserData.F_UserCode;
386
-                //                sql += " and UserCode='" + usercode + "'";
387
-                //            }
388
-                //            else
389
-                //            {
390
-                //                sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptID in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%')) ";
391
-                //            }
392
-                //        }
393
-                //    }
394
-                //}
395
-
396
-                //if (usercode != null && usercode.Trim() != "")
397
-                //{
398
-                //    sql += " and UserCode='" + usercode + "'";
399
-                //}
400
-                //if (dept != null && dept.Trim() != "")
401
-                //{
402
-                //    sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + dept.Trim() + ")";
403
-                //}
404
-                //if (phone != null && phone.Trim() != "")
405
-                //{
406
-                //    sql += " and CallNumber like '%" + phone + "%'";
407
-                //}
408
-                //if (callstate.Trim() != "")
409
-                //{
410
-                //    sql += " and CallState='" + callstate + "'";
411
-                //}
412
-                //if (calltype.Trim() != "")
413
-                //{
414
-                //    sql += " and CallType='" + calltype + "'";
415
-                //}
416
-                //if (starttime.Trim() != "")
417
-                //{
418
-                //    sql += " and datediff(day,BeginTime,'" + starttime + "')<=0 ";
419
-                //}
420
-                //if (endtime.Trim() != "")
421
-                //{
422
-                //    sql += " and datediff(day,BeginTime,'" + endtime + "')>=0 ";
423
-                //}
424
-                ////20180515 坐席能看到同组的 
425
-                //var usergroup = new BLL.T_Sys_UserAccount().GetModel(currcode) == null ? "" : new BLL.T_Sys_UserAccount().GetModel(currcode).F_SeartGroup;
426
-                //var usercodes = new BLL.T_Sys_UserAccount().GetModelList("F_SeartGroup='" + usergroup + "'") == null ? null : new BLL.T_Sys_UserAccount().GetModelList("F_SeartGroup='" + usergroup + "'").Select(p => p.F_UserCode);
427
-                //var str = "";
428
-                //if (usercodes != null)
429
-                //{
430
-                //    foreach (var item in usercodes)
431
-                //    {
432
-                //        str += item.ToString() + ',';
433
-                //    }
434
-                //    str = str.TrimEnd(',');
435
-                //    sql += " and UserCode in (" + str + ") ";
436
-                //}
437
-                //else
438
-                //    sql += " and UserCode='" + usercode + "' ";
439
-                #region 2018-05-30 lihai 坐席能看到同组的通话记录
440
-                int seartGroupId = 0;
441
-                var modelUser = new BLL.T_Sys_UserAccount().GetModel(currcode);
442
-                if (modelUser != null)
443
-                    seartGroupId = modelUser.F_SeartGroupID ?? 0;
444
-                if (seartGroupId != 0)
445
-                {
446
-                    //groupcode判断是市场部或客服部的通话记录
447
-                    var modelSeartGroup = new BLL.T_Sys_SeatGroup().GetModel(seartGroupId);
448
-                    if (modelSeartGroup != null)
449
-                    {
450
-                        sql += " and groupcode = '" + modelSeartGroup.F_ZXZCode + "' ";
451
-                        //if (modelSeartGroup.F_ZXZCode == "SCZ")
452
-                        //{
453
-                        //    sql += " and groupcode = '"+ modelSeartGroup.F_ZXZCode + "' ";
454
-                        //}
455
-                        //else
456
-                        //{
457
-                        //    sql += " and groupcode = 'KFZ' ";
458
-                        //}
459
-                    }
460
-                    //else
461
-                    //    sql += " and UserCode='" + usercode + "' ";
462
-                }
463
-                //else
464
-                //{
465
-                //    //找不到对应坐席组
466
-                //    sql += " and UserCode='" + usercode + "' ";
467
-                //}
468
-                #endregion
469
-
470 372
                 if (usercode != null && usercode.Trim() != "")
471 373
                 {
472 374
                     sql += " and UserCode='" + usercode + "'";
473 375
                 }
376
+                else
377
+                {
378
+                    if (ro.F_RoleCode == "XTGLY")
379
+                    {
380
+                        if (!string.IsNullOrEmpty(userModel.groupcode))
381
+                        {
382
+                            sql += " and groupcode = '" + userModel.groupcode + "' ";
383
+                        }
384
+                    }
385
+                    else
386
+                        sql += " and UserCode='" + userModel.F_UserCode + "'";
387
+                }
474 388
                 if (dept != null && dept.Trim() != "")
475 389
                 {
476
-                    sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + dept.Trim() + ")";
390
+                    sql += " and F_DeptId='" + dept.Trim() + "'";
477 391
                 }
478 392
                 if (dealtype != null && dealtype.Trim() != "")
479 393
                 {
@@ -524,7 +438,7 @@ namespace CallCenterApi.Interface.Controllers.tel
524 438
         private string[] col()
525 439
         {
526 440
             string[] ccc = {
527
-                   "客户姓名","电话号码","录音","呼叫方向","处理方式","部门","呼叫状态","坐席工号","坐席姓名",
441
+                   "客户姓名","电话号码","录音","呼叫方向","处理方式","坐席组","呼叫状态","坐席工号","坐席姓名",
528 442
                   "开始时间","通话开始时间","通话结束时间","通话时长"
529 443
             };
530 444
             return ccc;

+ 204 - 188
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -85,32 +85,24 @@ namespace CallCenterApi.Interface.Controllers.workorder
85 85
                 string strname = RequestString.GetQueryString("name");
86 86
                 //电话
87 87
                 string strtel = RequestString.GetQueryString("tel");
88
-                //大区
89
-                string strarea = RequestString.GetQueryString("area");
90
-                //省份
91
-                string strprov = RequestString.GetQueryString("province");
92
-                //城市
93
-                string strcity = RequestString.GetQueryString("city");
88
+                //营业厅
89
+                string definition = RequestString.GetQueryString("definition");
94 90
                 //关键词
95 91
                 string strkey = RequestString.GetQueryString("key");
96 92
                 //坐席工号
97
-                string strusercode = RequestString.GetQueryString("usercode");
98
-
99
-
93
+                string strusercode = RequestString.GetQueryString("strusercode");
94
+                string F_Typeof = RequestString.GetQueryString("Typeof");
95
+                
100 96
                 //类型
101
-                int type = RequestString.GetInt("type", 0);
97
+                //   int type = RequestString.GetInt("type", 0);
102 98
                 //来源
103 99
                 int source = RequestString.GetInt("source", 0);
104 100
                 //状态
105 101
                 int state = RequestString.GetInt("state", -1);
106 102
                 //处理状态
107 103
                 int dealstate = RequestString.GetInt("dealstate", -1);
108
-                //产品类型
109
-                int producttype = RequestString.GetInt("producttype", 0);
110
-
111 104
                 string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
112 105
                 string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
113
-
114 106
                 string strpageindex = RequestString.GetQueryString("page");
115 107
                 int pageindex = 1;
116 108
                 string strpagesize = RequestString.GetQueryString("pagesize");
@@ -127,18 +119,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
127 119
                         sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
128 120
                     }
129 121
                 }
130
-                if (producttype != 0)
131
-                {
132
-                    sql += " and F_ProductType = '" + producttype + "' ";
133
-                }
134
-                if (type != 0)
135
-                {
136
-                    sql += " and F_Type = '" + type + "' ";
137
-                }
138 122
                 if (source != 0)
139 123
                 {
140 124
                     sql += " and F_Source = '" + source + "' ";
141 125
                 }
126
+                
142 127
                 if (state != -1)
143 128
                 {
144 129
                     sql += " and F_State = '" + state + "' ";
@@ -151,11 +136,17 @@ namespace CallCenterApi.Interface.Controllers.workorder
151 136
                 {
152 137
                     sql += " and F_CreateUser = '" + strusercode + "' ";
153 138
                 }
139
+                else
140
+                {
141
+                    sql += " and F_CreateUser = '" + userModel.F_UserCode  + "' ";
142
+                }
154 143
                 if (strkey.Trim() != "" && strkey != "undefined")
155 144
                 {
156
-                    sql += " and (F_Content like '%" + strkey + "%' or F_CusName like '%" + strkey + "%' or F_Province like '%" + strkey + "%' or F_City like '%"
157
-                        + strkey + "%' or F_ProductName like '%" + strkey + "%' or F_CusPhone like '%" + strkey + "%' or F_BatchNumber like '%" + strkey
158
-                        + "%' or F_CreateUser like '%" + strkey + "%' or F_VIPName like '%" + strkey + "%') ";
145
+                    sql += " and (F_Content like '%" + strkey + "%' or F_CusName like '%" + strkey + "%' or F_CusPhone like '%" + strkey  + "%') ";
146
+                }
147
+                if (F_Typeof.Trim() != "" && F_Typeof != "undefined")
148
+                {
149
+                    sql += " and F_Typeof like '%" + F_Typeof.Trim() + "%' ";
159 150
                 }
160 151
                 if (strworkid.Trim() != "" && strworkid != "undefined")
161 152
                 {
@@ -169,21 +160,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
169 160
                 {
170 161
                     sql += " and F_CusPhone like '%" + strtel + "%' ";
171 162
                 }
172
-                if (strarea.Trim() != "" && strarea != "undefined")
173
-                {
174
-                    sql += " and F_Area = '" + strarea.Trim() + "' ";
175
-                }
176
-                if (strprov.Trim() != "" && strprov.Trim() != "undefined")
163
+                if (definition.Trim() != "" && definition != "undefined")
177 164
                 {
178
-                    //sql += " and F_Province = '" + strprov.Trim() + "' ";
179
-                    sql += " and F_Province like '%" + strprov + "%' ";
165
+                    sql += " and F_Definition like '%" + definition + "%' ";
180 166
                 }
181
-                if (strcity.Trim() != "" && strcity.Trim() != "undefined")
182
-                {
183
-                    //sql += " and F_City = '" + strcity.Trim() + "' ";
184
-                    sql += " and F_City like '%" + strcity + "%' ";
185
-                }
186
-
167
+                
187 168
                 if (strstarttime.Trim() != "" && strstarttime != "undefined")
188 169
                 {
189 170
                     sql += " and datediff(day,F_CreateTime,'" + strstarttime + "')<=0 ";
@@ -203,22 +184,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
203 184
                     pagesize = Convert.ToInt32(strpagesize);
204 185
                 }
205 186
 
206
-                string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,"
207
-                    + "dbo.GetDictionaryName(F_ProductType) as ProductTypeName,dbo.GetDictionaryName(F_Source) as SourceName";
208
-
187
+                //   string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,"
188
+                //    + "dbo.GetDictionaryName(F_ProductType) as ProductTypeName,dbo.GetDictionaryName(F_Source) as SourceName";
189
+                string msg = "";
209 190
                 if (isdc > 0)
210 191
                 {
211
-                    string dccols = "F_WorkOrderId,case isnull(F_State,0) when 0 then '待处理' else '已处理' end,dbo.GetDictionaryName(F_Source) as SourceName,"
212
-                        + "dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,F_CusPhone,F_CusName,F_Content,F_ProductName,"
213
-                        + "F_ProductDate,F_BuyDate,F_BuyAddress,dbo.GetDictionaryName(F_ProductType) as ProductTypeName,F_BatchNumber,F_UserDate,"
214
-                        + "case isnull(F_IsBack,0) when 0 then '否' else '是' end,F_Area,F_Province,F_City,F_VIPName,F_VIPPhone,"
215
-                        + "dbo.GetDictionaryName(F_DealState) as DealStateName,F_DealCost,F_DealResult,F_DealDes,dbo.GetDictionaryName(F_DealTimely) as DealTimelyName,"
216
-                        + "dbo.GetUserName(F_CreateUser) as UserName,F_CreateTime,F_DealTime,F_DealSeconds";
217
-                    var dtdc = DbHelperSQL.Query(" select " + dccols + " from T_Bus_WorkOrder where 1=1 " + sql).Tables[0];
218
-                    string[] dccolnames = new string[] {"工单编号","工单状态", "工单来源", "工单类型", "投诉类型", "投诉号码", "客户姓名", "投诉事件描述", "产品名称",
219
-                        "生产日期", "购买日期", "购买地点", "产品类别", "生产批号", "食/饮用日期", "样品是否寄回", "大区", "省份", "城市" , "专员姓名" , "专员电话" ,
220
-                        "处理状态" , "处理费用" , "处理结果" , "处理进展详述" , "及时响应" , "受理人" , "受理时间","处理时间", "处理间隔(秒)" , };
221
-                    var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc, dccolnames);
192
+                      string dccols = "F_WorkOrderId,case isnull(F_State,0) when 0 then '待处理' else '已处理' end,"
193
+                       + "F_Typeof,F_CusPhone,F_CusName,F_Content,F_Replycontent,"
194
+                       + "dbo.GetDictionaryName(F_DealState) as DealStateName,F_DealResult,F_DealDes,"
195
+                       + "dbo.GetUserName(F_CreateUser) as UserName,F_CreateTime,F_DealTime";
196
+                        var dtdc = DbHelperSQL.Query(" select " + dccols + " from T_Bus_WorkOrder where 1=1 " + sql+ "ORDER BY F_Id desc").Tables[0];
197
+                        string[] dccolnames = new string[] {"工单编号","工单状态", "工单类型",  "客户电话", "客户姓名", "描述内容", "回复内容",
198
+                        "处理状态" , "处理结果" , "处理进展详述" , "创建人" , "受理时间","处理时间" , };
199
+                        msg = new NPOIHelper().ExportToExcel("工单列表", dtdc, dccolnames);
222 200
                     if (msg == "")
223 201
                     {
224 202
                         return Success("导出成功");
@@ -233,7 +211,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
233 211
                 dt = BLL.PagerBLL.GetListPager(
234 212
                     "T_Bus_WorkOrder",
235 213
                     "F_Id",
236
-                    cols,
214
+                    "*",
237 215
                     sql,
238 216
                     "ORDER BY F_Id desc",
239 217
                     pagesize,
@@ -256,6 +234,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
256 234
                     {
257 235
                         dr["FilePath"] = GetCallPath(dr["F_CallRecordId"].ToString(), config.F_ParamValue);
258 236
                     }
237
+                    if (dr["F_CreateUser"] != null && dr["F_CreateUser"].ToString() != "")
238
+                    {
239
+                        var user = new BLL.T_Sys_UserAccount().GetModel(dr["F_CreateUser"].ToString());
240
+                        if (user != null)
241
+                            dr["F_CreateUser"] = dr["F_CreateUser"].ToString() + "(" + user.F_UserName + ")";
242
+                    }
259 243
                 }
260 244
 
261 245
                 var obj = new
@@ -286,10 +270,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
286 270
 
287 271
             if (!string.IsNullOrEmpty(strworkorderid))
288 272
             {
289
-                string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,"
290
-                    + "dbo.GetDictionaryName(F_SmallType) as SmallTypeName,dbo.GetDictionaryName(F_DealState) as DealStateName,"
291
-                    + "dbo.GetDictionaryName(F_DealTimely) as DealTimelyName,dbo.GetDictionaryName(F_ProductType) as ProductTypeName,"
292
-                    + "dbo.GetDictionaryName(F_Source) as SourceName  from T_Bus_WorkOrder where F_WorkOrderId ='" + strworkorderid + "'";
273
+                string sql = "select * from T_Bus_WorkOrder where F_WorkOrderId ='" + strworkorderid + "'";
293 274
                 var dt = DbHelperSQL.Query(sql).Tables[0];
294 275
                 if (dt.Rows.Count > 0)
295 276
                 {
@@ -308,6 +289,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
308 289
                     {
309 290
                         dt.Rows[0]["FilePath"] = GetCallPath(dt.Rows[0]["F_CallRecordId"].ToString(), config.F_ParamValue);
310 291
                     }
292
+                    if (dt.Rows[0]["F_CreateUser"] != null && dt.Rows[0]["F_CreateUser"].ToString() != "")
293
+                    {
294
+                        var user = new BLL.T_Sys_UserAccount().GetModel(dt.Rows[0]["F_CreateUser"].ToString());
295
+                        if (user != null)
296
+                            dt.Rows[0]["F_CreateUser"] = dt.Rows[0]["F_CreateUser"].ToString() + "(" + user.F_UserName + ")";
297
+                    }
311 298
                     #endregion
312 299
 
313 300
                     #region 附件
@@ -339,7 +326,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
339 326
                     }
340 327
                     #endregion
341 328
 
342
-                    #region 理过程
329
+                    #region 理过程
343 330
                     string gcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
344 331
                                     + "from T_Bus_Operation where F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
345 332
                     var gcdt = DbHelperSQL.Query(gcsql).Tables[0];
@@ -394,11 +381,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
394 381
         {
395 382
             int userId = CurrentUser.UserData.F_UserId;
396 383
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
397
-            //投诉人
384
+            //客户姓名
398 385
             string cusname = RequestString.GetFormString("cusname");
399 386
             //投诉人性别
400
-            string cussex = RequestString.GetFormString("cussex");
401
-            //投诉电话
387
+         //  string cussex = RequestString.GetFormString("cussex");
388
+            //客户电话
402 389
             string cusphone = RequestString.GetFormString("cusphone");
403 390
             //分组代码
404 391
             string code = RequestString.GetFormString("code");
@@ -406,48 +393,66 @@ namespace CallCenterApi.Interface.Controllers.workorder
406 393
             {
407 394
                 code = userModel.groupcode;
408 395
             }
409
-            //事件描述
396
+            //客户类别
397
+            string customertype = RequestString.GetFormString("customertype");
398
+            //营业厅名称
399
+            string definition = RequestString.GetFormString("definition");
400
+            //工单类型
401
+            string Typeof = RequestString.GetFormString("Typeof");
402
+            //描述内容
410 403
             string content = RequestString.GetFormString("content");
404
+            //回复内容
405
+            string replycontent = RequestString.GetFormString("replycontent");
406
+            //派单类型
407
+            string pietype = RequestString.GetFormString("pietype");
408
+            //定责
409
+            string fixduty = RequestString.GetFormString("fixduty");
410
+            //处理人
411
+            string dealing = RequestString.GetFormString("dealing");
412
+            //处理人电话
413
+            string dealingtel = RequestString.GetFormString("dealingtel");
414
+
411 415
             //产品名称
412
-            string productname = RequestString.GetFormString("productname");
416
+            //    string productname = RequestString.GetFormString("productname");
413 417
             //购买日期
414
-            string buydate = RequestString.GetFormString("buydate");
418
+            //   string buydate = RequestString.GetFormString("buydate");
415 419
             //购买地点
416
-            string buyaddress = RequestString.GetFormString("buyaddress");
420
+            //   string buyaddress = RequestString.GetFormString("buyaddress");
417 421
             ////产品类别
418 422
             //string producttype = RequestString.GetFormString("producttype");
419 423
             //生产日期
420
-            string productdate = RequestString.GetFormString("productdate");
424
+            //   string productdate = RequestString.GetFormString("productdate");
421 425
             //生产批号
422
-            string batchnumber = RequestString.GetFormString("batchnumber");
426
+            //    string batchnumber = RequestString.GetFormString("batchnumber");
423 427
             //使用日期
424
-            string userdate = RequestString.GetFormString("userdate");
428
+            //   string userdate = RequestString.GetFormString("userdate");
425 429
             //专员名称
426
-            string vipname = RequestString.GetFormString("vipname");
430
+            //   string vipname = RequestString.GetFormString("vipname");
427 431
             //专员号码
428
-            string vipphone = RequestString.GetFormString("vipphone");
432
+            //    string vipphone = RequestString.GetFormString("vipphone");
429 433
             //大区
430
-            string area = RequestString.GetFormString("area");
434
+            //    string area = RequestString.GetFormString("area");
431 435
             //省份
432
-            string province = RequestString.GetFormString("province");
436
+            // string province = RequestString.GetFormString("province");
433 437
             //城市
434
-            string city = RequestString.GetFormString("city");
438
+            //    string city = RequestString.GetFormString("city");
435 439
             //县区
436
-            string county = RequestString.GetFormString("county");
440
+            //   string county = RequestString.GetFormString("county");
437 441
             //附件
438 442
             string files = RequestString.GetFormString("files");
439 443
             //类型
440 444
             int type = RequestString.GetInt("type", 0);
441
-            //子类型
445
+            int taskid = RequestString.GetInt("taskid", 0);
446
+           
442 447
             int smalltype = RequestString.GetInt("smalltype", 0);
443 448
             //产品类别
444
-            int producttype = RequestString.GetInt("producttype", 0);
449
+       //     int producttype = RequestString.GetInt("producttype", 0);
445 450
             //来源
446 451
             int source = RequestString.GetInt("source", 0);
447 452
             //是否寄回
448
-            int isback = RequestString.GetInt("isback", 0);
453
+       //     int isback = RequestString.GetInt("isback", 0);
449 454
             //专员id
450
-            int vipid = RequestString.GetInt("vipid", 0);
455
+          //  int vipid = RequestString.GetInt("vipid", 0);
451 456
 
452 457
             //备注信息
453 458
             string remark = RequestString.GetFormString("remark");
@@ -455,64 +460,68 @@ namespace CallCenterApi.Interface.Controllers.workorder
455 460
             string callid = RequestString.GetFormString("callid");
456 461
 
457 462
             if (string.IsNullOrEmpty(cusphone))
458
-                return Error("请输入投诉电话");
463
+                return Error("请输入客户电话");
459 464
             if (string.IsNullOrEmpty(content))
460
-                return Error("请输入事件描述");
461
-            if (type == 0)
462
-                return Error("请选择工单类型");
463
-            if (source == 0)
464
-                return Error("请选择来源");
465
+                return Error("请输入描述内容");
466
+          
465 467
 
466
-            var valuecode = new BLL.T_Sys_DictionaryValue().GetModel(type).F_ValueCode;
468
+         //   var valuecode = new BLL.T_Sys_DictionaryValue().GetModel(type).F_ValueCode;
467 469
 
468 470
             using (TransactionScope trans = new TransactionScope())
469 471
             {
470 472
                 #region 保存工单信息
471 473
                 Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = new Model.T_Bus_WorkOrder();
472 474
                 //modelT_Bus_WorkOrder.F_WorkOrderId = workorderBLL.GetNewWorkOrderID(valuecode,userModel.F_UserCode);
473
-                modelT_Bus_WorkOrder.F_WorkOrderId = workorderBLL.GetNewWorkOrderID(valuecode);
475
+                modelT_Bus_WorkOrder.F_WorkOrderId = DateTime.Now.ToString("yyyyMMddHHmmssfff");  //工单编号  
474 476
 
475 477
                 modelT_Bus_WorkOrder.F_Source = source;//信息来源
476 478
                 modelT_Bus_WorkOrder.F_Type = type;//信息类别
477 479
                 modelT_Bus_WorkOrder.F_SmallType = smalltype;//信息子类别
478
-                modelT_Bus_WorkOrder.F_CusName = cusname;//投诉人姓名
479
-                modelT_Bus_WorkOrder.F_CusSex = cussex;//性别
480
+                modelT_Bus_WorkOrder.F_CusName = cusname;//客户姓名
481
+                                                         //  modelT_Bus_WorkOrder.F_CusSex = cussex;//性别
482
+                modelT_Bus_WorkOrder.F_Customertype = customertype;//客户类别
483
+                modelT_Bus_WorkOrder.F_Definition = definition;//营业厅名称
484
+                modelT_Bus_WorkOrder.F_Typeof = Typeof;//工单类型
480 485
                 modelT_Bus_WorkOrder.F_CusPhone = cusphone;//来电号码
481 486
                 modelT_Bus_WorkOrder.F_GroupCode = code;//分组代码
482
-                modelT_Bus_WorkOrder.F_Content = content;//事件描述
483
-                modelT_Bus_WorkOrder.F_ProductName = productname;//产品名称
484
-                modelT_Bus_WorkOrder.F_ProductDate = productdate;//生产日期
485
-                modelT_Bus_WorkOrder.F_BuyDate = buydate;//购买日期
486
-                modelT_Bus_WorkOrder.F_BuyAddress = buyaddress;//购买地点
487
-                modelT_Bus_WorkOrder.F_ProductType = producttype;//产品类型
488
-                modelT_Bus_WorkOrder.F_BatchNumber = batchnumber;//生产批号
489
-                modelT_Bus_WorkOrder.F_UserDate = userdate;//使用日期
490
-                modelT_Bus_WorkOrder.F_VIPPhone = vipphone;//专员号码
487
+                modelT_Bus_WorkOrder.F_Content = content;//描述内容
488
+                modelT_Bus_WorkOrder.F_Replycontent = replycontent;//回复内容
489
+                modelT_Bus_WorkOrder.F_Pietype = pietype;//派单类型
490
+                modelT_Bus_WorkOrder.F_Fixduty = fixduty;//定责
491
+                modelT_Bus_WorkOrder.F_Dealing =dealing ;//处理人
492
+                modelT_Bus_WorkOrder.F_Dealingtel = dealingtel ;//处理人电话
493
+                modelT_Bus_WorkOrder.F_VIPId = taskid;//任务id
494
+              
495
+                //    modelT_Bus_WorkOrder.F_ProductName = productname;//产品名称
496
+                //    modelT_Bus_WorkOrder.F_ProductDate = productdate;//生产日期
497
+                //    modelT_Bus_WorkOrder.F_BuyDate = buydate;//购买日期
498
+                //      modelT_Bus_WorkOrder.F_BuyAddress = buyaddress;//购买地点
499
+                //     modelT_Bus_WorkOrder.F_ProductType = producttype;//产品类型
500
+                //     modelT_Bus_WorkOrder.F_BatchNumber = batchnumber;//生产批号
501
+                //      modelT_Bus_WorkOrder.F_UserDate = userdate;//使用日期
502
+                //     modelT_Bus_WorkOrder.F_VIPPhone = vipphone;//专员号码
491 503
                 modelT_Bus_WorkOrder.F_Remark = remark;//备注信息
504
+          //      modelT_Bus_WorkOrder.F_Area = area;//大区
505
+             //   modelT_Bus_WorkOrder.F_Province = province;//省份
506
+            //    modelT_Bus_WorkOrder.F_City = city;//城市
507
+             //   modelT_Bus_WorkOrder.F_County = county; //县区
492 508
 
493
-                modelT_Bus_WorkOrder.F_Area = area;//大区
494
-                modelT_Bus_WorkOrder.F_Province = province;//省份
495
-                modelT_Bus_WorkOrder.F_City = city;//城市
496
-                modelT_Bus_WorkOrder.F_County = county; //县区
497
-
498
-                modelT_Bus_WorkOrder.F_IsBack = isback;//是否寄回
499
-                modelT_Bus_WorkOrder.F_VIPId = vipid;//专员id
500
-
509
+            //    modelT_Bus_WorkOrder.F_IsBack = isback;//是否寄回
510
+            //    modelT_Bus_WorkOrder.F_VIPId = vipid;//专员id
501 511
                 modelT_Bus_WorkOrder.F_DealType = 0;
502
-
503
-                if (vipid != 0)
504
-                {
505
-                    var ml = new BLL.T_Cus_Customer().GetModel(vipid);
506
-                    if (ml != null)
507
-                        modelT_Bus_WorkOrder.F_VIPName = ml.F_Name;
508
-                }
509
-                else
510
-                {
511
-                    modelT_Bus_WorkOrder.F_VIPName = vipname;
512
-                }
513
-
514
-                modelT_Bus_WorkOrder.F_CreateUser = userModel.F_UserCode;//登记人工号
515
-                modelT_Bus_WorkOrder.F_CreateTime = DateTime.Now;//登记时间
512
+                //if (vipid != 0)
513
+                //{
514
+                //    var ml = new BLL.T_Cus_Customer().GetModel(vipid);
515
+                //    if (ml != null)
516
+                //        modelT_Bus_WorkOrder.F_VIPName = ml.F_Name;
517
+                //}
518
+                //else
519
+                //{
520
+                //    modelT_Bus_WorkOrder.F_VIPName = vipname;
521
+                //}
522
+
523
+                modelT_Bus_WorkOrder.F_CreateUser = userModel.F_UserCode;//创建人
524
+                modelT_Bus_WorkOrder.F_CreateTime = DateTime.Now;//创建时间
516 525
                 modelT_Bus_WorkOrder.F_State = 0;//工单状态0登记中
517 526
                 modelT_Bus_WorkOrder.F_IsDelete = 0;//是否删除(0:否,1:是)
518 527
 
@@ -533,7 +542,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
533 542
 
534 543
                 workorderBLL.Add(modelT_Bus_WorkOrder);
535 544
                 #endregion
536
-
545
+                if (taskid > 0)
546
+                {
547
+                    var t_Call_OutTaskTelNum = new BLL.T_Call_OutTaskTelNum().GetModel((int)modelT_Bus_WorkOrder.F_VIPId);
548
+                    if (t_Call_OutTaskTelNum != null)
549
+                        t_Call_OutTaskTelNum.ExpandSintField1 = 1;
550
+                    new BLL.T_Call_OutTaskTelNum().Update (t_Call_OutTaskTelNum);
551
+                }
537 552
                 #region 插入操作记录
538 553
                 Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
539 554
                 oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
@@ -567,42 +582,63 @@ namespace CallCenterApi.Interface.Controllers.workorder
567 582
         {
568 583
             int userId = CurrentUser.UserData.F_UserId;
569 584
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
570
-            //投诉人
585
+            //客户姓名
571 586
             string cusname = RequestString.GetFormString("cusname");
572 587
             //投诉人性别
573
-            string cussex = RequestString.GetFormString("cussex");
574
-            //投诉电话
588
+            //  string cussex = RequestString.GetFormString("cussex");
589
+            //客户电话
575 590
             string cusphone = RequestString.GetFormString("cusphone");
576 591
             //分组代码
577 592
             string code = RequestString.GetFormString("code");
578
-            //事件描述
593
+            if (!string.IsNullOrEmpty(userModel.groupcode))
594
+            {
595
+                code = userModel.groupcode;
596
+            }
597
+            //客户类别
598
+            string customertype = RequestString.GetFormString("customertype");
599
+            //营业厅名称
600
+            string definition = RequestString.GetFormString("definition");
601
+            //工单类型
602
+            string Typeof = RequestString.GetFormString("Typeof");
603
+            //描述内容
579 604
             string content = RequestString.GetFormString("content");
605
+            //回复内容
606
+            string replycontent = RequestString.GetFormString("replycontent");
607
+            //派单类型
608
+            string pietype = RequestString.GetFormString("pietype");
609
+            //定责
610
+            string fixduty = RequestString.GetFormString("fixduty");
611
+            //处理人
612
+            string dealing = RequestString.GetFormString("dealing");
613
+            //处理人电话
614
+            string dealingtel = RequestString.GetFormString("dealingtel");
615
+
580 616
             //产品名称
581
-            string productname = RequestString.GetFormString("productname");
582
-            //生产日期
583
-            string productdate = RequestString.GetFormString("productdate");
617
+            //    string productname = RequestString.GetFormString("productname");
584 618
             //购买日期
585
-            string buydate = RequestString.GetFormString("buydate");
619
+            //   string buydate = RequestString.GetFormString("buydate");
586 620
             //购买地点
587
-            string buyaddress = RequestString.GetFormString("buyaddress");
621
+            //   string buyaddress = RequestString.GetFormString("buyaddress");
588 622
             ////产品类别
589 623
             //string producttype = RequestString.GetFormString("producttype");
624
+            //生产日期
625
+            //   string productdate = RequestString.GetFormString("productdate");
590 626
             //生产批号
591
-            string batchnumber = RequestString.GetFormString("batchnumber");
627
+            //    string batchnumber = RequestString.GetFormString("batchnumber");
592 628
             //使用日期
593
-            string userdate = RequestString.GetFormString("userdate");
629
+            //   string userdate = RequestString.GetFormString("userdate");
594 630
             //专员名称
595
-            string vipname = RequestString.GetFormString("vipname");
631
+            //   string vipname = RequestString.GetFormString("vipname");
596 632
             //专员号码
597
-            string vipphone = RequestString.GetFormString("vipphone");
633
+            //    string vipphone = RequestString.GetFormString("vipphone");
598 634
             //大区
599
-            string area = RequestString.GetFormString("area");
635
+            //    string area = RequestString.GetFormString("area");
600 636
             //省份
601
-            string province = RequestString.GetFormString("province");
637
+            // string province = RequestString.GetFormString("province");
602 638
             //城市
603
-            string city = RequestString.GetFormString("city");
639
+            //    string city = RequestString.GetFormString("city");
604 640
             //县区
605
-            string county = RequestString.GetFormString("county");
641
+            //   string county = RequestString.GetFormString("county");
606 642
             //附件
607 643
             string files = RequestString.GetFormString("files");
608 644
             //类型
@@ -610,13 +646,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
610 646
             //子类型
611 647
             int smalltype = RequestString.GetInt("smalltype", 0);
612 648
             //产品类别
613
-            int producttype = RequestString.GetInt("producttype", 0);
649
+            //     int producttype = RequestString.GetInt("producttype", 0);
614 650
             //来源
615 651
             int source = RequestString.GetInt("source", 0);
616 652
             //是否寄回
617
-            int isback = RequestString.GetInt("isback", 0);
653
+            //     int isback = RequestString.GetInt("isback", 0);
618 654
             //专员id
619
-            int vipid = RequestString.GetInt("vipid", 0);
655
+            //  int vipid = RequestString.GetInt("vipid", 0);
656
+
620 657
             //备注信息
621 658
             string remark = RequestString.GetFormString("remark");
622 659
 
@@ -628,22 +665,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
628 665
             string dealdes = RequestString.GetFormString("dealdes");
629 666
             string dealresult = RequestString.GetFormString("dealresult");
630 667
             int dealstate = RequestString.GetInt("dealstate", 0);
631
-            int dealtimely = RequestString.GetInt("dealtimely", 0);
632
-            decimal dealcost = 0;
633
-            var strdealcost = RequestString.GetFormString("dealcost");
634
-            if (!string.IsNullOrEmpty(strdealcost))
635
-            {
636
-                dealcost = decimal.Parse(strdealcost);
637
-            }
668
+         //   int dealtimely = RequestString.GetInt("dealtimely", 0);
669
+         //   decimal dealcost = 0;
670
+        //    var strdealcost = RequestString.GetFormString("dealcost");
671
+            //if (!string.IsNullOrEmpty(strdealcost))
672
+            //{
673
+            //    dealcost = decimal.Parse(strdealcost);
674
+            //}
638 675
 
639 676
             if (string.IsNullOrEmpty(cusphone))
640 677
                 return Error("请输入投诉电话");
641 678
             if (string.IsNullOrEmpty(content))
642 679
                 return Error("请输入事件描述");
643
-            if (type == 0)
644
-                return Error("请选择工单类型");
645
-            if (source == 0)
646
-                return Error("请选择来源");
680
+         
681
+         
647 682
 
648 683
             #region 修改
649 684
             Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workid);
@@ -657,53 +692,35 @@ namespace CallCenterApi.Interface.Controllers.workorder
657 692
                     modelT_Bus_WorkOrder.F_Type = type;//信息类别
658 693
                     modelT_Bus_WorkOrder.F_SmallType = smalltype;//信息子类别
659 694
                     modelT_Bus_WorkOrder.F_CusName = cusname;//投诉人姓名
660
-                    modelT_Bus_WorkOrder.F_CusSex = cussex;//性别
695
+                  //  modelT_Bus_WorkOrder.F_CusSex = cussex;//性别
661 696
                     modelT_Bus_WorkOrder.F_CusPhone = cusphone;//来电号码
697
+                    modelT_Bus_WorkOrder.F_Customertype = customertype;//客户类别
698
+                    modelT_Bus_WorkOrder.F_Definition = definition;//营业厅名称
699
+                    modelT_Bus_WorkOrder.F_Typeof = Typeof;//工单类型
700
+                    modelT_Bus_WorkOrder.F_Replycontent = replycontent;//回复内容
701
+                    modelT_Bus_WorkOrder.F_Pietype = pietype;//派单类型
702
+                    modelT_Bus_WorkOrder.F_Fixduty = fixduty;//定责
703
+                    
662 704
                     if (!string.IsNullOrEmpty(code))
663 705
                     {
664 706
                         modelT_Bus_WorkOrder.F_GroupCode = code;//分组代码
665 707
                     }
666 708
                     modelT_Bus_WorkOrder.F_Content = content;//事件描述
667
-                    modelT_Bus_WorkOrder.F_ProductName = productname;//产品名称
668
-                    modelT_Bus_WorkOrder.F_ProductDate = productdate;//生产日期
669
-                    modelT_Bus_WorkOrder.F_BuyDate = buydate;//购买日期
670
-                    modelT_Bus_WorkOrder.F_BuyAddress = buyaddress;//购买地点
671
-                    modelT_Bus_WorkOrder.F_ProductType = producttype;//产品类别
672
-                    modelT_Bus_WorkOrder.F_BatchNumber = batchnumber;//生产批号
673
-                    modelT_Bus_WorkOrder.F_UserDate = userdate;//使用日期
674
-                    modelT_Bus_WorkOrder.F_VIPPhone = vipphone;//专员号码
675 709
                     modelT_Bus_WorkOrder.F_Remark = remark;//备注信息
676 710
 
677
-                    modelT_Bus_WorkOrder.F_Area = area;//大区
678
-                    modelT_Bus_WorkOrder.F_Province = province;//省份
679
-                    modelT_Bus_WorkOrder.F_City = city;//城市
680
-                    modelT_Bus_WorkOrder.F_County = county; //县区
681
-
682
-                    modelT_Bus_WorkOrder.F_IsBack = isback;//是否寄回
683
-                    modelT_Bus_WorkOrder.F_VIPId = vipid;//专员id
711
+                    modelT_Bus_WorkOrder.F_Dealing = dealing;//处理人
712
+                    modelT_Bus_WorkOrder.F_Dealingtel = dealingtel;//处理人电话
684 713
 
685 714
                     modelT_Bus_WorkOrder.F_DealState = dealstate;
686 715
                     //modelT_Bus_WorkOrder.F_DealFile = files;
687 716
                     modelT_Bus_WorkOrder.F_DealDes = dealdes;
688 717
                     modelT_Bus_WorkOrder.F_DealResult = dealresult;
689
-                    modelT_Bus_WorkOrder.F_DealCost = dealcost;
690
-                    modelT_Bus_WorkOrder.F_DealTimely = dealtimely;
718
+                //    modelT_Bus_WorkOrder.F_DealCost = dealcost;
719
+                 //   modelT_Bus_WorkOrder.F_DealTimely = dealtimely;
691 720
 
692
-                    if (vipid != 0)
693
-                    {
694
-                        var ml = new BLL.T_Cus_Customer().GetModel(vipid);
695
-                        if (ml != null)
696
-                            modelT_Bus_WorkOrder.F_VIPName = ml.F_Name;
697
-                    }
698
-                    else
699
-                    {
700
-                        modelT_Bus_WorkOrder.F_VIPName = vipname;
701
-                    }
721
+                 
702 722
 
703
-                    //modelT_Bus_WorkOrder.F_CreateUser = userModel.F_UserCode;//登记人工号
704
-                    //modelT_Bus_WorkOrder.F_CreateTime = DateTime.Now;//登记时间
705
-                    //modelT_Bus_WorkOrder.F_State = 0;//工单状态0登记中
706
-                    //modelT_Bus_WorkOrder.F_IsDelete = 0;//是否删除(0:否,1:是)
723
+                 
707 724
 
708 725
                     modelT_Bus_WorkOrder.F_File = files;//附件
709 726
 
@@ -847,7 +864,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
847 864
                     oper.F_State = modelT_Bus_WorkOrder.F_State;
848 865
 
849 866
                     string userinfo = userModel.F_UserName + "(" + userModel.F_UserCode + ")";
850
-                    oper.F_Message = userinfo + " 跟进了工单";
867
+                    oper.F_Message = userinfo + " 跟进了工单"+ content;
851 868
                     oper.F_CreateUser = userModel.F_UserCode;
852 869
                     oper.F_CreateTime = DateTime.Now;
853 870
                     oper.F_IsDelete = 0;
@@ -911,15 +928,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
911 928
                         new BLL.T_Bus_WorkOrder().Update(modelT_Bus_WorkOrder);
912 929
 
913 930
                         #endregion
914
-
915
-
931
+                 
916 932
                         #region 插入操作记录
917 933
                         Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
918 934
                         oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
919 935
                         oper.F_State = modelT_Bus_WorkOrder.F_State;
920 936
 
921 937
                         string userinfo = userModel.F_UserName + "(" + userModel.F_UserCode + ")";
922
-                        oper.F_Message = userinfo + " 办理了工单";
938
+                        oper.F_Message = userinfo + " 处理了工单"+ dealresult;
923 939
                         oper.F_CreateUser = userModel.F_UserCode;
924 940
                         oper.F_CreateTime = DateTime.Now;
925 941
                         oper.F_IsDelete = 0;
@@ -934,7 +950,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
934 950
                 }
935 951
                 else
936 952
                 {
937
-                    return Error("已经理过了");
953
+                    return Error("已经理过了");
938 954
                 }
939 955
             }
940 956
             else

+ 73 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -56,6 +56,79 @@ namespace CallCenterApi.Model
56 56
         private int? _f_isdelete;
57 57
         private string _f_deleteuser;
58 58
         private DateTime? _f_deletetime;
59
+        private string _f_customertype;
60
+        private string _f_definition;
61
+        private string _f_typeof;
62
+        private string _f_replycontent;
63
+        private string _f_pietype;
64
+        private string _f_dealing;
65
+        private string _f_dealingtel;
66
+        private string _f_fixduty;
67
+        /// <summary>
68
+        /// 处理人
69
+        /// </summary>
70
+        public string F_Dealing
71
+        {
72
+            set { _f_dealing = value; }
73
+            get { return _f_dealing; }
74
+        }
75
+        /// <summary>
76
+        /// 处理人电话
77
+        /// </summary>
78
+        public string F_Dealingtel
79
+        {
80
+            set { _f_dealingtel = value; }
81
+            get { return _f_dealingtel; }
82
+        }
83
+        /// <summary>
84
+        /// 定责
85
+        /// </summary>
86
+        public string F_Fixduty
87
+        {
88
+            set { _f_fixduty = value; }
89
+            get { return _f_fixduty; }
90
+        }
91
+        /// <summary>
92
+        /// 派单类型
93
+        /// </summary>
94
+        public string F_Pietype
95
+        {
96
+            set { _f_pietype = value; }
97
+            get { return _f_pietype; }
98
+        }
99
+        
100
+        /// <summary>
101
+        /// 回复内容
102
+        /// </summary>
103
+        public string F_Replycontent
104
+        {
105
+            set { _f_replycontent = value; }
106
+            get { return _f_replycontent; }
107
+        }
108
+        /// <summary>
109
+        /// 工单类型
110
+        /// </summary>
111
+        public string F_Typeof
112
+        {
113
+            set { _f_typeof = value; }
114
+            get { return _f_typeof; }
115
+        }
116
+        /// <summary>
117
+        ///客户类型
118
+        /// </summary>
119
+        public string F_Customertype
120
+        {
121
+            set { _f_customertype = value; }
122
+            get { return _f_customertype; }
123
+        }
124
+        /// <summary>
125
+        /// 营业厅名称
126
+        /// </summary>
127
+        public string F_Definition
128
+        {
129
+            set { _f_definition = value; }
130
+            get { return _f_definition; }
131
+        }
59 132
         /// <summary>
60 133
         /// 
61 134
         /// </summary>

+ 18 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Cus_Customer.cs

@@ -28,6 +28,24 @@ namespace CallCenterApi.Model
28 28
         private string _f_office;
29 29
         private string _f_county;
30 30
         private string _f_remarks;
31
+        private string _f_customertype;
32
+        private string _f_definition;
33
+        /// <summary>
34
+        ///客户类型
35
+        /// </summary>
36
+        public string F_Customertype
37
+        {
38
+            set { _f_customertype = value; }
39
+            get { return _f_customertype; }
40
+        }
41
+        /// <summary>
42
+        /// 营业厅名称
43
+        /// </summary>
44
+        public string F_Definition
45
+        {
46
+            set { _f_definition = value; }
47
+            get { return _f_definition; }
48
+        }
31 49
         /// <summary>
32 50
         /// 
33 51
         /// </summary>