Przeglądaj źródła

省市县带出业务员信息,微信客户反馈修改

duhongyu 6 lat temu
rodzic
commit
c26bfc1da9

+ 103 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -188,7 +188,109 @@ namespace CallCenterApi.Interface.Controllers.customer
188 188
                 return Error("参数传输失败");
189 189
             }
190 190
         }
191
+        public class Sales
192
+        {
193
+            public string name;
194
+        }
195
+        public class Salesman
196
+        {
197
+            public string name;
198
+            public string phone;
199
+            public int  areaid;
200
+            public string area;
201
+            public int branchid;
202
+            public string branch;
203
+            public List<Salesmanproduct> product;
204
+        }
205
+        public class Salesmanproduct
206
+        {
207
+            public string product;
208
+        }
209
+        public ActionResult GetSalesman(string Salesman)
210
+        {
211
+            string sql = " F_IsDelete = 0 ";
191 212
 
213
+            if (!string.IsNullOrEmpty(Salesman))
214
+            {
215
+                sql += $" and  F_Salesman  = '" + Salesman.Trim() + "'";
216
+            }
217
+            var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(sql);
218
+            
219
+            Salesman salesmen = new Salesman();
220
+            salesmen.product  = new List<Salesmanproduct>();
221
+            foreach (var it in userModel)
222
+            {
223
+                 salesmen.name = it.F_Salesman;
224
+                if (string.IsNullOrEmpty (salesmen.phone))
225
+                {
226
+                    if (!string.IsNullOrEmpty(it.F_SalesPhone))
227
+                    {
228
+                        salesmen.phone = it.F_SalesPhone;
229
+                    }
230
+                }
231
+                if (string.IsNullOrEmpty(salesmen.area))
232
+                {
233
+                    if (!string.IsNullOrEmpty(it.F_AreaID))
234
+                    {
235
+                        var area = deptbll.GetModel(it.F_AreaID);
236
+                        if (area !=null )
237
+                        {
238
+                            salesmen.areaid = area.F_DeptId ;
239
+                            salesmen.area = area.F_DeptName;
240
+                        }
241
+                       
242
+                    }
243
+                }
244
+                if (string.IsNullOrEmpty(salesmen.branch))
245
+                {
246
+                    if (!string.IsNullOrEmpty(it.F_BranchID))
247
+                    {
248
+                        var branch = deptbll.GetModel(it.F_BranchID);
249
+                        if (branch != null)
250
+                        {
251
+                            salesmen.branchid = branch.F_DeptId;
252
+                            salesmen.branch = branch.F_DeptName;
253
+                        }
254
+                    }
255
+                }
256
+                if (salesmen.product.Exists(x => x.product == it.F_Product) == false && !string.IsNullOrEmpty(it.F_Product))
257
+                {
258
+                    Salesmanproduct model = new Salesmanproduct();
259
+                    model.product = it.F_Product;
260
+                    salesmen.product.Add(model);
261
+                }
262
+            }
263
+            return Success("获取成功", salesmen);
264
+        }
265
+        public ActionResult GetSales(string Province, string City, string Country)
266
+        {
267
+            string sql = " F_IsDelete = 0 ";
268
+
269
+            if (!string .IsNullOrEmpty (Province))
270
+            {
271
+                sql += $" and  F_AddressProvince  = '" + Province.Trim() + "'";
272
+            }
273
+            if (!string.IsNullOrEmpty(City))
274
+            {
275
+                sql += $" and  F_AddressCity  = '" + City.Trim() + "'";
276
+            }
277
+            if (!string.IsNullOrEmpty(Country))
278
+            {
279
+                sql += $" and  F_AddressCountry  = '" + Country.Trim() + "'"; ;
280
+            }
281
+                var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList( sql);
282
+                List<Sales> salesmen = new List<Sales>();
283
+                foreach (var  it  in userModel)
284
+                {
285
+                    if (salesmen.Exists(x => x.name == it.F_Salesman) == false&&!string .IsNullOrEmpty (it.F_Salesman))
286
+                    {
287
+                      Sales model = new Sales();
288
+                        model.name = it.F_Salesman;
289
+                        salesmen.Add(model);
290
+                    }
291
+                }
292
+                return Success("获取成功", salesmen);
293
+        }
192 294
         /// <summary>
193 295
         /// 通过来电号码获取来电弹屏左侧客户信息
194 296
         /// </summary>
@@ -197,7 +299,7 @@ namespace CallCenterApi.Interface.Controllers.customer
197 299
         {
198 300
             if (!string.IsNullOrWhiteSpace(tel))
199 301
             {
200
-                var sql = $" and (F_SalesPhone like '%" + tel.Trim() + "%' or F_LegalPhone like '%" + tel.Trim() + "%')";
302
+                var sql = $" and  F_LegalPhone  = '" + tel.Trim() + "'";
201 303
                 var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
202 304
                 if (userModel.Count() > 0)
203 305
                 {

+ 9 - 13
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -139,7 +139,7 @@ namespace CallCenterApi.Interface.Controllers.report
139 139
                 drNew["九江"] = woBLL.GetModelList(sql + "and F_SalesBase='九江'" + nsg).Count.ToString(); ;
140 140
                 drNew["新疆"] = woBLL.GetModelList(sql + "and F_SalesBase='新疆' " + nsg).Count.ToString();
141 141
                 drNew["东北"] = woBLL.GetModelList(sql + "and F_SalesBase='东北'" + nsg).Count.ToString();
142
-                drNew["计"] = woBLL.GetModelList(sql + nsg).Count.ToString();
142
+                drNew["计"] = woBLL.GetModelList(sql + nsg).Count.ToString();
143 143
                 int a = woBLL.GetModelList(sql + "and F_DealType='当即办理'" + nsg).Count;
144 144
                 int b = woBLL.GetModelList(sql + nsg).Count;
145 145
                 if (b > 0)
@@ -1018,6 +1018,7 @@ namespace CallCenterApi.Interface.Controllers.report
1018 1018
             public int bevisit;
1019 1019
             public int visit;
1020 1020
             public int Overdue;
1021
+            public int visitcont;
1021 1022
             public int satisfied;
1022 1023
             public int dissatisfied;
1023 1024
         }
@@ -1111,8 +1112,10 @@ namespace CallCenterApi.Interface.Controllers.report
1111 1112
             {
1112 1113
                 sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
1113 1114
             }
1115
+            List<Returnvisit> returnvisits = new List<Returnvisit>();
1116
+            Returnvisit model = new Returnvisit();
1114 1117
             var workordewr = woBLL.GetModelList(sql + "and F_State in(10,11) and F_IsVisit =1");
1115
-          string name="客户回访"; int bevisit = 0, visit = 0, Overdue = 0, satisfied = 0, dissatisfied = 0;int visitcont = 0;
1118
+            model. name ="客户回访"; int bevisit = 0, visit = 0, Overdue = 0, satisfied = 0, dissatisfied = 0;int visitcont = 0;
1116 1119
             var workorder = woBLL.GetModelList(sql + "and F_State in(10,11)");
1117 1120
             visitcont = workorder.Count;
1118 1121
             foreach (var it in workordewr)
@@ -1128,17 +1131,10 @@ namespace CallCenterApi.Interface.Controllers.report
1128 1131
                 if (it.F_VisitResult == "不满意")
1129 1132
                     dissatisfied++;
1130 1133
             }
1131
-            var obj = new
1132
-            {
1133
-                name,
1134
-                bevisit,
1135
-                visit,
1136
-                visitcont,
1137
-                Overdue,
1138
-                satisfied,
1139
-                dissatisfied
1140
-            };
1141
-            return Success("获取成功", obj
1134
+            model.bevisit = bevisit; model.visit = visit; model.visitcont = visitcont; model.Overdue = Overdue;
1135
+            model.satisfied = satisfied; model.dissatisfied = dissatisfied;
1136
+            returnvisits.Add(model);
1137
+            return Success("获取成功", returnvisits
1142 1138
            );
1143 1139
 
1144 1140
         }

+ 17 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -537,9 +537,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
537 537
             {
538 538
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
539 539
                 var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
540
-                if (ua == null)
540
+                if (source !=3)
541 541
                 {
542
-                    return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
542
+                    if (ua == null)
543
+                    {
544
+                        return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
545
+                    }
543 546
                 }
544 547
                 //  Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
545 548
                 string sql = $" and F_IsDelete=0";
@@ -1348,11 +1351,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
1348 1351
         {
1349 1352
             if (!string.IsNullOrEmpty(OpenId))
1350 1353
             {
1351
-                var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
1352
-                if (ua == null)
1353
-                {
1354
-                    return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
1355
-                }
1356 1354
                 if (id <= 0)
1357 1355
                 {
1358 1356
                     return Error("请输入正确的id");
@@ -1364,8 +1362,18 @@ namespace CallCenterApi.Interface.Controllers.weixin
1364 1362
                     list.Add(model);
1365 1363
                 var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
1366 1364
                 ; var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
1367
-                FileUrl = GetFileData(model.F_Files, configfj.F_ParamValue);
1368
-
1365
+                if (!string .IsNullOrEmpty (model.F_Files))
1366
+                {
1367
+                    FileUrl = GetFileData(model.F_Files, configfj.F_ParamValue);
1368
+                }
1369
+                var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
1370
+                if (model .F_Source !="3")
1371
+                {
1372
+                    if (ua == null)
1373
+                    {
1374
+                        return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
1375
+                    }
1376
+                }
1369 1377
                 if (list.Count > 0)
1370 1378
                 {
1371 1379
                     List<WorkOrderNewInput> Input = modeltooip(list,ua );