duhongyu 5 years ago
parent
commit
e3741dbd72

+ 2 - 1
代码/System.Common/Filter/ActionFilter.cs

@@ -61,7 +61,8 @@ namespace System.Common
61 61
                 {
62 62
                     param = request.Form.ToJson();
63 63
                 }
64
-                log.Error("IP:" + ip.ToString() + "|||UserInfo:" + userinfo + "|||ContentType:" + request.ContentType + "|||Params:" + param);
64
+                  log.Error("IP:" + ip.ToString() + "|||UserInfo:" + userinfo + "|||ContentType:" + request.ContentType + "|||Params:" + param);
65
+              
65 66
 
66 67
             }
67 68
             base.OnActionExecuting(context);

+ 2 - 2
代码/System.Common/Filter/ExceptionFilter.cs

@@ -50,8 +50,8 @@ namespace System.Common
50 50
                 + "|||Error:"+ context.Exception.ToString() + "|||/r/n<br>\\r\\n" + context.Exception.StackTrace;
51 51
             log.Error(strError);
52 52
 
53
-            //context.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.error.ToString(), message = "系统异常,请稍后重试" }.ToJson() };
54
-            context.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.error.ToString(), message = strError }.ToJson() };
53
+            context.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.error.ToString(), message = "系统异常,请稍后重试" }.ToJson() };
54
+           // context.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.error.ToString(), message = strError }.ToJson() };
55 55
 
56 56
             base.OnException(context);
57 57
         }

+ 6 - 1
代码/System.Common/Helpers/Billoflading.cs

@@ -72,5 +72,10 @@ namespace System.Common.Helpers
72 72
         public decimal? sendmoney;
73 73
         public decimal? signformoney;
74 74
     }
75
-    
75
+    public class kingNo
76
+    {
77
+        public string F_Id;
78
+        public string F_TrackingNo;
79
+    }
80
+
76 81
 }

+ 87 - 0
代码/System.Common/Helpers/NPOIHelper.cs

@@ -617,8 +617,95 @@ namespace System.Common.Helpers
617 617
                 return bs;
618 618
             }
619 619
         }
620
+        /// <summary>
621
+        /// 下载excel
622
+        /// </summary>
623
+        /// <param name="cols"></param>
624
+        /// <returns></returns>
625
+        public byte[] kingNoExportToExcel(List <string > objs, string[] cols = null, string[] colname = null)
626
+        {
627
+            IWorkbook workbook = new XSSFWorkbook();
628
+            ISheet sheet = workbook.CreateSheet("Sheet1");
629
+
630
+            ICellStyle HeadercellStyle = workbook.CreateCellStyle();
631
+            HeadercellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
632
+            HeadercellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
633
+            HeadercellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
634
+            HeadercellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
635
+            HeadercellStyle.Alignment = HorizontalAlignment.Center;
636
+            HeadercellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.SkyBlue.Index;
637
+            HeadercellStyle.FillPattern = FillPattern.SolidForeground;
638
+            HeadercellStyle.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.SkyBlue.Index;
639
+
640
+            //字体
641
+            NPOI.SS.UserModel.IFont headerfont = workbook.CreateFont();
642
+            headerfont.Boldweight = (short)FontBoldWeight.Bold;
643
+            headerfont.FontHeightInPoints = 12;
644
+            HeadercellStyle.SetFont(headerfont);
645
+
646
+
647
+
648
+            if (objs.Count   > 0)
649
+            {
650
+                ICellStyle cellStyle = workbook.CreateCellStyle();
651
+
652
+                //为避免日期格式被Excel自动替换,所以设定 format 为 『@』 表示一率当成text來看
653
+                cellStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("@");
654
+                cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
655
+                cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
656
+                cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
657
+                cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
658
+
659
+
660
+                NPOI.SS.UserModel.IFont cellfont = workbook.CreateFont();
661
+                cellfont.Boldweight = (short)FontBoldWeight.Normal;
662
+                cellStyle.SetFont(cellfont);
663
+
664
+                int icolIndex = 0;
665
+                IRow headerRow = sheet.CreateRow(0);
666
+
667
+             
668
+                foreach (string dc in cols)
669
+                {
670
+                    ICell cell = headerRow.CreateCell(icolIndex);
671
+                    cell.SetCellValue(dc);
672
+                    cell.CellStyle = HeadercellStyle;
673
+
674
+                    sheet.SetDefaultColumnStyle(icolIndex, cellStyle);
620 675
 
676
+                    icolIndex++;
677
+                }
678
+                //处理数据内容
679
+                //建立内容行
680
+                int iRowIndex = 0;
621 681
 
682
+                for (int i  = 0; i < objs.Count; i++)
683
+                {
684
+                    IRow irow5 = sheet.CreateRow(1 + i );
685
+                    ICell cell2 = irow5.CreateCell(0);
686
+                    cell2.SetCellValue(objs [i ]);
687
+                    cell2.CellStyle = cellStyle;
688
+                }
689
+
690
+            }
691
+            //自适应列宽度
692
+            for (int i = 0; i < 2; i++)
693
+            {
694
+                sheet.AutoSizeColumn(i);
695
+            }
696
+            using (MemoryStream ms = new MemoryStream())
697
+            {
698
+                workbook.Write(ms);
699
+                byte[] bs = ms.ToArray();
700
+
701
+                workbook = null;
702
+                ms.Close();
703
+                ms.Dispose();
704
+
705
+                return bs;
706
+            }
707
+        }
708
+       
622 709
         /// <summary>
623 710
         /// 下载excel
624 711
         /// </summary>

+ 3 - 0
代码/System.Model/Bus/T_Bus_ChatLog.cs

@@ -106,6 +106,9 @@ namespace System.Model.Bus
106 106
             set { _f_updatetime = value; }
107 107
             get { return _f_updatetime; }
108 108
         }
109
+        /// <summary>
110
+        /// 0订单1会员
111
+        /// </summary>
109 112
         public int F_State { set; get; } = 0;
110 113
         #endregion Model
111 114
 

+ 5 - 0
代码/System.Model/Bus/T_Bus_Order.cs

@@ -623,7 +623,12 @@ namespace System.Model
623 623
         /// 订购次数
624 624
         /// </summary>
625 625
         public int VipCount { set; get; } = 0;
626
+
626 627
         public DateTime  F_Waybill { set; get; }
628
+
629
+        public int? F_Department { set; get; } = 0;//部门
630
+        public int? F_Core { set; get; } = 0;//中心
631
+        public int? F_Group { set; get; } = 0;//小组
627 632
         #endregion Model
628 633
 
629 634
     }

+ 7 - 3
代码/System.Model/Call/T_Call_Distribution.cs

@@ -37,7 +37,7 @@ namespace System.Model
37 37
         /// <summary>
38 38
         /// 部门
39 39
         /// </summary>
40
-        public int  F_Dept { set; get; }
40
+        public int F_Dept { set; get; } = 0;
41 41
         /// <summary>
42 42
         /// 部门名称
43 43
         /// </summary>
@@ -45,7 +45,7 @@ namespace System.Model
45 45
         /// <summary>
46 46
         /// 团队
47 47
         /// </summary>
48
-        public int  F_Team { set; get; }
48
+        public int F_Team { set; get; } = 0;
49 49
         /// <summary>
50 50
         /// 团队名称
51 51
         /// </summary>
@@ -53,7 +53,7 @@ namespace System.Model
53 53
         /// <summary>
54 54
         /// 小组
55 55
         /// </summary>
56
-        public int  F_Group { set; get; }
56
+        public int F_Group { set; get; } = 0;
57 57
         /// <summary>
58 58
         /// 小组名称
59 59
         /// </summary>
@@ -80,5 +80,9 @@ namespace System.Model
80 80
         public string F_Handler { set; get; }
81 81
          public int F_IsDelete { set; get; }
82 82
         public DateTime F_AssignmentTime { set; get; }
83
+        /// <summary>
84
+        /// 0媒体1中转池
85
+        /// </summary>
86
+        public int F_Type { set; get; } = 0;
83 87
     }
84 88
 }

+ 8 - 0
代码/System.Model/Cus/T_Cus_VipInfo.cs

@@ -292,6 +292,14 @@ namespace System.Model
292 292
         public string  F_Membership { get; set; }
293 293
         public int F_Count { set; get; }
294 294
         public DateTime     F_GiveTime { set; get; }
295
+        /// <summary>
296
+        /// 是否转售后
297
+        /// </summary>
298
+        public int F_IsTransfer { set; get; } = 0;
299
+        /// <summary>
300
+        /// 已处理未处理
301
+        /// </summary>
302
+        public int F_TransferState { set; get; } = 0;
295 303
         #endregion Model
296 304
     }
297 305
 }

+ 8 - 0
代码/System.Model/Cus/V_Cus_VipInfo.cs

@@ -203,6 +203,14 @@ namespace System.Model
203 203
         public string F_Membership { set; get; }
204 204
         public int F_Count { set; get; }
205 205
         public DateTime F_GiveTime { set; get; }
206
+        /// <summary>
207
+        /// 是否转售后
208
+        /// </summary>
209
+        public int F_IsTransfer { set; get; } = 0;
210
+        /// <summary>
211
+        /// 已处理未处理
212
+        /// </summary>
213
+        public int F_TransferState { set; get; } = 0;
206 214
         #endregion Model
207 215
     }
208 216
 }

+ 72 - 28
代码/TVShoppingCallCenter_ZLJ/Controllers/CallCenter/CallFunctionController.cs

@@ -48,14 +48,19 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
48 48
         private readonly IBus_OrderRepository bus_OrderRepository;
49 49
         private readonly IBus_OrderDetailRepository bus_OrderDetailRepository;
50 50
         private readonly IBus_OrderlogsRepository busOrderlogsRepository;
51
+        private readonly ISys_UserAccountRepository _sys_useraccountRepository;
52
+        private readonly ICall_DistributionRepository call_DistributionRepository;
51 53
         public CallFunctionController(ISys_SystemConfigRepository _busSystemConfigRepository,ICDRRepository _busCdrRepository,ICall_CallRecordsRepository _busCallRecordsRepository,IConfiguration _configuration, ISys_MobileDataRepository _busMobileDataRepository, ICus_VipInfoRepository cus_vip_infoRepository,
52 54
             ICall_CallOutboundRepository _CallOutboundRecordsRepository, Iauto_cdrRepository _auto_cdrRepository
53 55
             , ItaskRepository _taskRepository, ISys_AutoDialRepository _sys_autodialrepository, IBus_AfterSaleRepository _busAfterSaleRepository, ISys_UserAccountRepository _sys_UserAccountRepository, IBus_AutomaticOrderRepository _bus_AutomaticOrderRepository,
54 56
             IBus_ProductRepository productRepository, OrderFunctionController _OrderFunctionController
55 57
             , IBus_OrderRepository _bus_OrderRepository, IBus_OrderDetailRepository _bus_OrderDetailRepository
56
-            , IBus_OrderlogsRepository _busOrderlogsRepository)
58
+            , IBus_OrderlogsRepository _busOrderlogsRepository,
59
+            ISys_UserAccountRepository sys_useraccountRepository
60
+            , ICall_DistributionRepository _call_DistributionRepository)
57 61
            
58 62
         {
63
+            call_DistributionRepository = _call_DistributionRepository;
59 64
             busOrderlogsRepository = _busOrderlogsRepository;
60 65
             bus_OrderDetailRepository = _bus_OrderDetailRepository;
61 66
             bus_OrderRepository = _bus_OrderRepository;
@@ -74,6 +79,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
74 79
             bus_AutomaticOrderRepository = _bus_AutomaticOrderRepository;
75 80
             _productRepository = productRepository;
76 81
             busOrderFunctionController = _OrderFunctionController;
82
+            _sys_useraccountRepository = sys_useraccountRepository;
77 83
         }
78 84
        
79 85
         /// <summary>
@@ -139,9 +145,9 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
139 145
             return location;
140 146
 
141 147
         }
148
+     
142 149
 
143 150
 
144
- 
145 151
 
146 152
         #region  同步通话记录
147 153
         /// <summary>
@@ -165,6 +171,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
165 171
                     dtime = modelCallRecord.EndTime.GetValueOrDefault();
166 172
             }
167 173
             List<cdr> modellist = await busCdrRepository.GetListALL(q => q.id > maxid || q.end_time >= dtime);
174
+           
168 175
             int totle = 0;
169 176
             int n = 0;
170 177
             int n1 = 0;
@@ -178,6 +185,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
178 185
                 }
179 186
                 totle = modellist.Count;
180 187
                 List<T_Call_CallRecords> modelRecordList = new List<T_Call_CallRecords>();
188
+                List<T_Call_Distribution> Distributions = new List<T_Call_Distribution>();
181 189
                 foreach (cdr modelcdr in modellist)
182 190
                 {
183 191
 
@@ -187,31 +195,51 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
187 195
                     modelRecord.Callee = modelcdr.callee;
188 196
                     if (modelcdr.call_type == 0)
189 197
                     {
190
-                        string tel = modelcdr.caller.TrimStart('0');
198
+                        string tel = "";
199
+                        if (modelcdr.caller.Length > 11)
200
+                            tel = modelcdr.caller.TrimStart('0');
201
+                        else
202
+                            tel = modelcdr.caller;
191 203
                         modelRecord.UserCode = modelcdr.callee_agent;
192
-                        var user = await sys_UserAccountRepository.GetListALL (x => x.F_UserCode == modelcdr.callee_agent
193
-                        &&x.F_DeleteFlag ==0);
194
-                        if (user!=null && user.Count >0)
204
+                        if (!string .IsNullOrEmpty(modelcdr.callee_agent))
195 205
                         {
196
-                            modelRecord.UserName = user.FirstOrDefault().F_UserName;
197
-                            modelRecord.Deptid = user.FirstOrDefault().F_DeptId ;
198
-                            modelRecord.DeptName  = user.FirstOrDefault().F_Dept ;
206
+                            var user = await sys_UserAccountRepository.GetListALL(x => x.F_UserCode == modelcdr.callee_agent
207
+                                                  && x.F_DeleteFlag == 0);
208
+                            if (user != null && user.Count > 0)
209
+                            {
210
+                                modelRecord.UserName = user.FirstOrDefault().F_UserName;
211
+                                modelRecord.Deptid =(int ) user.FirstOrDefault().F_DeptTeamId; ;
212
+                                modelRecord.DeptName = user.FirstOrDefault().F_Dept;
213
+                            }
199 214
                         }
200
-                        var cus = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1 && x.F_Phone
201
-                       == modelcdr.caller || x.F_Phone == tel|| x.F_Mobile == modelcdr.caller || x.F_Mobile == tel
202
-                       || x.F_Mobile1 == modelcdr.caller || x.F_Mobile1 == tel );
203
-                        if (cus!=null&&cus.Count >0 )
215
+                        var cus = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1 && ( x.F_Phone == tel  || x.F_Mobile.Contains(tel)
216
+                          ));
217
+                        if (cus != null && cus.Count > 0)
204 218
                         {
205
-                            modelRecord.CusCode = cus.FirstOrDefault ().F_Name ;
206
-                            modelRecord.CusId = cus.FirstOrDefault().F_ID ;
219
+                            modelRecord.CusCode = cus.FirstOrDefault().F_Name;
220
+                            modelRecord.CusId = cus.FirstOrDefault().F_ID;
207 221
                             if (modelcdr.is_answer == 1)
208 222
                             {
209 223
                                 if (cus.FirstOrDefault().F_Firstcalltime == null)
210 224
                                     cus.FirstOrDefault().F_Firstcalltime = modelcdr.end_time;
211
-                                cus.FirstOrDefault().F_Lastholetime  = modelcdr.end_time;
225
+                                cus.FirstOrDefault().F_Lastholetime = modelcdr.end_time;
212 226
                                 var res = await _cus_vip_infoRepository.Update(cus.FirstOrDefault());
213 227
                             }
214 228
                         }
229
+                        else
230
+                        {
231
+                            T_Call_Distribution t_Call_Distribution = new T_Call_Distribution();
232
+                            t_Call_Distribution.F_Tel = tel;
233
+                            t_Call_Distribution.F_Name = "";
234
+                            t_Call_Distribution.F_Media =0;
235
+                            t_Call_Distribution.F_MediaName = "";
236
+                            t_Call_Distribution.F_CrateTime =DateTime .Now ;
237
+                            t_Call_Distribution.F_CrateUser = "";
238
+                            t_Call_Distribution.F_Type = 1;
239
+                            Distributions.Add(t_Call_Distribution);
240
+                           
241
+                        }
242
+
215 243
                     }
216 244
                     else
217 245
                     {
@@ -221,26 +249,32 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
221 249
                         if (user != null && user.Count > 0)
222 250
                         {
223 251
                             modelRecord.UserName = user.FirstOrDefault().F_UserName;
224
-                            modelRecord.Deptid = user.FirstOrDefault().F_DeptId;
252
+                            modelRecord.Deptid = (int)user.FirstOrDefault().F_DeptTeamId; ;
225 253
                             modelRecord.DeptName = user.FirstOrDefault().F_Dept;
226 254
                         }
227
-                        string tel = modelcdr.callee.TrimStart('0');
255
+                        string tel = "";
256
+                        if (tel.Length > 11 && tel.Length < 13)
257
+                            tel = modelcdr.callee.Substring(1, 12);
258
+                        else if (tel.Length > 12)
259
+                            tel = modelcdr.callee.Substring(2, 13);
260
+                        else
261
+                            tel = modelcdr.callee;
228 262
                         modelRecord.UserCode = modelcdr.callee_agent;
229
-                        var cus = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1 &&( x.F_Phone
230
-                       == modelcdr.caller || x.F_Phone == tel||x.F_Mobile == modelcdr.caller || x.F_Mobile
231
-                       == tel || x.F_Mobile1 == modelcdr.caller || x.F_Mobile1 == tel ));
263
+                        var cus = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1 &&( x.F_Phone == tel|| x.F_Mobile
264
+                       .Contains ( tel)  ));
232 265
                          if (cus != null && cus.Count > 0)
233 266
                         {
234 267
                             modelRecord.CusCode = cus.FirstOrDefault().F_Name;
235 268
                             modelRecord.CusId = cus.FirstOrDefault().F_ID;
269
+                            if (modelcdr.is_answer == 1)
270
+                            {
271
+                                if (cus.FirstOrDefault().F_Firstcalltime == null)
272
+                                    cus.FirstOrDefault().F_Firstcalltime = modelcdr.end_time;
273
+                                cus.FirstOrDefault().F_Lastholetime = modelcdr.end_time;
274
+                                var res = await _cus_vip_infoRepository.Update(cus.FirstOrDefault());
275
+                            }
236 276
                         }
237
-                        if (modelcdr.is_answer == 1)
238
-                        {
239
-                            if (cus.FirstOrDefault().F_Firstcalltime == null)
240
-                                cus.FirstOrDefault().F_Firstcalltime = modelcdr.end_time;
241
-                            cus.FirstOrDefault().F_Lastholetime = modelcdr.end_time;
242
-                            var res = await _cus_vip_infoRepository.Update(cus.FirstOrDefault());
243
-                        }
277
+                       
244 278
                     }
245 279
                     modelRecord.Caller = modelcdr.caller;
246 280
                     modelRecord.CallType = modelcdr.call_type;
@@ -279,6 +313,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
279 313
                     {
280 314
                         await busCallRecordsRepository.AddAndUpdateList(modelRecordList);
281 315
                         modelRecordList.Clear();
316
+                        await call_DistributionRepository.AddAndUpdateList(Distributions);
282 317
                         n = 0;
283 318
                     }
284 319
 
@@ -287,6 +322,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
287 322
                 //T_Call_CallRecords modelreturn = 
288 323
                 await busCallRecordsRepository.AddAndUpdateList(modelRecordList);
289 324
             }
325
+            
290 326
             return $"同步情况  成功/总数 = {n1}/{totle}";
291 327
         }
292 328
         /// <summary>
@@ -506,6 +542,14 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
506 542
                             modelOrder.F_PayType = "货到付款";
507 543
                             modelOrder.F_VipId = iv.F_ID;
508 544
                             modelOrder.F_Belong = iv.F_Saleperson.ObjToInt();
545
+                            var useraccount = await _sys_useraccountRepository.GetSingle(x => x.F_UserId == modelOrder.F_Belong);
546
+
547
+                            if (useraccount != null)
548
+                            {
549
+                                modelOrder.F_Department = useraccount.F_DeptId;
550
+                                modelOrder.F_Core = useraccount.F_DeptTeamId;
551
+                                modelOrder.F_Group = useraccount.F_GroupId;
552
+                            }
509 553
                             modelOrder.F_BelongName = "ID:" + iv.F_Saleperson;
510 554
                             modelOrder.F_ExpressFee = 0;
511 555
                             //  modelOrder.F_Stock = input.F_Stock;

+ 357 - 14
代码/TVShoppingCallCenter_ZLJ/Controllers/CallCenter/DistributionController.cs

@@ -7,7 +7,8 @@ using System.Linq;
7 7
 using System.Model;
8 8
 using System.Threading.Tasks;
9 9
 using Microsoft.AspNetCore.Mvc;
10
-
10
+using SqlSugar;
11
+using System.Text.RegularExpressions;
11 12
 namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
12 13
 {
13 14
     [Route("api/[controller]")]
@@ -15,48 +16,390 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
15 16
     {
16 17
         private readonly ICall_DistributionRepository call_DistributionRepository;
17 18
         private readonly ICus_VipInfoRepository _cus_vip_infoRepository;
18
-        public DistributionController(ICall_DistributionRepository _call_DistributionRepository, ICus_VipInfoRepository cus_vip_infoRepository)
19
+        private readonly ICall_CallRecordsRepository busCallRecordsRepository;
20
+        private readonly ISys_UserAccountRepository sys_UserAccountRepository;
21
+        public DistributionController(ICall_DistributionRepository _call_DistributionRepository, ICus_VipInfoRepository cus_vip_infoRepository,
22
+            ICall_CallRecordsRepository _busCallRecordsRepository,
23
+           ISys_UserAccountRepository _sys_UserAccountRepository)
19 24
         {
20 25
             call_DistributionRepository = _call_DistributionRepository;
21 26
             _cus_vip_infoRepository = cus_vip_infoRepository;
27
+            busCallRecordsRepository = _busCallRecordsRepository;
28
+            sys_UserAccountRepository = _sys_UserAccountRepository;
22 29
         }
23
-    /// <summary>
24
-    /// 添加
25
-    /// </summary>
26
-    /// <param name="input"></param>
27
-    /// <returns></returns>
28
-    [HttpPost("add")]
30
+
31
+            /// <summary>
32
+           /// 添加
33
+          /// </summary>
34
+         /// <param name="input"></param>
35
+        /// <returns></returns>
36
+        [HttpPost("add")]
29 37
         public async Task<IActionResult> AddAsync(T_Call_Distribution input)
30 38
         {
31 39
             if (string.IsNullOrEmpty(input.F_Tel ))
32 40
                 return Error("请输入联系电话");
33
-
41
+            if (!valtel(input.F_Tel))
42
+                return Error("手机号必须为11位数字");
43
+            var list = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1 && (x.F_Phone == input.F_Tel || x
44
+             .F_Mobile.Contains(input.F_Tel)));
34 45
             input.F_CrateTime = DateTime.Now;
35 46
             input.F_CrateUser = UserLogin.UserCode;
36 47
             input.F_IsDelete = 0;
37
-            if (input .F_Dept >0)
48
+            if (list!=null && list.Count >0)
49
+            {
50
+                var user = await sys_UserAccountRepository.GetSingle (x => x.F_UserId  == list[0].F_Saleperson.ObjToInt () );
51
+                T_Call_CallRecords modelRecord = new T_Call_CallRecords();
52
+                modelRecord.ActionID = 1;
53
+                modelRecord.Caller = input.F_Tel;
54
+                modelRecord.CallType = 0;
55
+                modelRecord.CallState = 0;
56
+                modelRecord.Id = 0;
57
+                modelRecord.MYD = 1;
58
+                modelRecord.OperateType =0;
59
+                modelRecord.LongTime = 0;
60
+                input.F_IsDelete = 1;
61
+                modelRecord.UserCode = user.F_UserCode;
62
+                modelRecord.UserName = user.F_UserName;
63
+                modelRecord.Deptid =(int ) user.F_DeptTeamId ;
64
+                modelRecord.DeptName = user.F_Team;
65
+
66
+                await busCallRecordsRepository.Add(modelRecord);
67
+            }
68
+            else
69
+            {
70
+                if (input.F_Dept > 0)
71
+                {
72
+                    input.F_OperationDept = UserLogin.UserCode;
73
+                    if (input.F_Team > 0)
74
+                    {
75
+                        input.F_OperationTeam = UserLogin.UserCode;
76
+                        if (input.F_Group > 0)
77
+                        {
78
+                            input.F_OperationGroup = UserLogin.UserCode;
79
+                            {
80
+                                if (!string.IsNullOrEmpty(input.F_OperationHandler))
81
+                                {
82
+                                   var user = await sys_UserAccountRepository.GetListALL(x => x.F_UserCode == input.F_OperationHandler
83
+                                               && x.F_DeleteFlag == 0);
84
+                                    if (user == null)
85
+                                        return Error("分配人员不存在");
86
+                                    input.F_OperationHandler = UserLogin.UserCode;
87
+                                    T_Call_CallRecords modelRecord = new T_Call_CallRecords();
88
+                                    modelRecord.ActionID = 1;
89
+                                    modelRecord.Caller = input.F_Tel;
90
+                                    modelRecord.CallType = 0;
91
+                                    modelRecord.CallState = 0;
92
+                                    modelRecord.Id = 0;
93
+                                    modelRecord.MYD = 1;
94
+                                    modelRecord.OperateType = 0;
95
+                                    modelRecord.LongTime = 0;
96
+                                    input.F_IsDelete = 1;
97
+                                    modelRecord.UserCode = user[0].F_UserCode;
98
+                                    modelRecord.UserName = user[0].F_UserName;
99
+                                    modelRecord.Deptid = (int)user[0].F_DeptTeamId;
100
+                                    modelRecord.DeptName = user[0].F_Team;
101
+                                    await busCallRecordsRepository.Add(modelRecord);
102
+                                }
103
+                            }
104
+                        }
105
+                    }
106
+                    input.F_AssignmentTime = DateTime.Now;
107
+                }
108
+                if (await call_DistributionRepository.Add(input) > 0)
109
+                {
110
+                    return Success("添加成功");
111
+                }
112
+              
113
+            }
114
+            return Error("添加失败");
115
+        }
116
+        /// <summary>
117
+        /// 修改
118
+        /// </summary>
119
+        /// <param name="input"></param>
120
+        /// <returns></returns>
121
+        [HttpPost("update")]
122
+        public async Task<IActionResult> UpdateAsync(T_Call_Distribution input)
123
+        {
124
+            if (input.F_ID <=0)
125
+                return Error("参数错误");
126
+            if (string.IsNullOrEmpty(input.F_Tel))
127
+                return Error("请输入联系电话");
128
+            if (!valtel(input.F_Tel))
129
+                return Error("手机号必须为11位数字");
130
+
131
+
132
+            var model = await call_DistributionRepository.GetSingle(x => x.F_ID == input.F_ID);
133
+            if (model == null)
134
+                return Error("操作失败");
135
+            var list = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1 && (x.F_Phone == input.F_Tel || x
136
+             .F_Mobile.Contains(input.F_Tel)));
137
+            model.F_Tel = input.F_Tel;
138
+            model.F_Name = input.F_Name;
139
+            model.F_Media = input.F_Media;
140
+            model.F_MediaName = input.F_MediaName;
141
+            model.F_CrateTime = model.F_CrateTime;
142
+            model.F_CrateUser = model.F_CrateUser;
143
+            input.F_IsDelete = 0;
144
+            if (list != null && list.Count > 0)
145
+            {
146
+                var user = await sys_UserAccountRepository.GetSingle(x => x.F_UserId == list[0].F_Saleperson.ObjToInt());
147
+                T_Call_CallRecords modelRecord = new T_Call_CallRecords();
148
+                modelRecord.ActionID = 1;
149
+                modelRecord.Caller = input.F_Tel;
150
+                modelRecord.CallType = 0;
151
+                modelRecord.CallState = 0;
152
+                modelRecord.Id = 0;
153
+                modelRecord.MYD = 1;
154
+                modelRecord.OperateType = 0;
155
+                modelRecord.LongTime = 0;
156
+                model.F_IsDelete = 1;
157
+                modelRecord.UserCode = user.F_UserCode;
158
+                modelRecord.UserName = user.F_UserName;
159
+                modelRecord.Deptid = (int)user.F_DeptTeamId;
160
+                modelRecord.DeptName = user.F_Team;
161
+
162
+                await busCallRecordsRepository.Add(modelRecord);
163
+            }
164
+            else
38 165
             {
166
+                if (input.F_Dept > 0)
167
+                {
168
+                    model.F_Dept = input.F_Dept;
169
+                    model.F_DeptName = input.F_DeptName;
170
+                    input.F_OperationDept = UserLogin.UserCode;
171
+                    if (input.F_Team > 0)
172
+                    {
173
+                        model.F_Team = input.F_Team;
174
+                        model.F_TeamName  = input.F_TeamName;
175
+                        input.F_OperationTeam = UserLogin.UserCode;
176
+                        if (input.F_Group > 0)
177
+                        {
178
+                            model.F_Group = input.F_Group;
179
+                            model.F_GroupName  = input.F_GroupName;
180
+                            input.F_OperationGroup = UserLogin.UserCode;
181
+                            {
182
+                                    if (!string.IsNullOrEmpty(input.F_OperationHandler))
183
+                                    {
184
+                                        var user = await sys_UserAccountRepository.GetListALL(x => x.F_UserCode == input.F_OperationHandler
185
+                                                    && x.F_DeleteFlag == 0);
186
+                                        if (user == null)
187
+                                            return Error("分配人员不存在");
188
+                                        input.F_OperationHandler = UserLogin.UserCode;
189
+                                        T_Call_CallRecords modelRecord = new T_Call_CallRecords();
190
+                                        modelRecord.ActionID = 1;
191
+                                        modelRecord.Caller = input.F_Tel;
192
+                                        modelRecord.CallType = 0;
193
+                                        modelRecord.CallState = 0;
194
+                                        modelRecord.Id = 0;
195
+                                        modelRecord.MYD = 1;
196
+                                        modelRecord.OperateType = 0;
197
+                                        modelRecord.LongTime = 0;
198
+                                        model.F_IsDelete = 1;
199
+                                  
200
+                                        modelRecord.UserCode = user[0].F_UserCode;
201
+                                        modelRecord.UserName = user[0].F_UserName;
202
+                                        modelRecord.Deptid = (int)user[0].F_DeptTeamId;
203
+                                        modelRecord.DeptName = user[0].F_Team;
204
+                                        await busCallRecordsRepository.Add(modelRecord);
205
+                                    }
206
+                            }
207
+                        }
208
+                    }
209
+                    input.F_AssignmentTime = DateTime.Now;
210
+                }
211
+                if (await call_DistributionRepository.Update(model))
212
+                {
213
+                    return Success("修改成功");
214
+                }
215
+
216
+            }
217
+            return Error("添加失败");
218
+        }
219
+        /// <summary>
220
+        /// 分配
221
+        /// </summary>
222
+        /// <param name="input"></param>
223
+        /// <returns></returns>
224
+        [HttpPost("distribution")]
225
+        public async Task<IActionResult> Distribution(T_Call_Distribution input)
226
+        {
227
+            if (input.F_ID <= 0)
228
+                return Error("参数错误");
229
+            if (string.IsNullOrEmpty(input.F_Tel))
230
+                return Error("请输入联系电话");
231
+            var model = await call_DistributionRepository.GetSingle(x => x.F_ID == input.F_ID);
232
+            if (model == null)
233
+                return Error("操作失败");
234
+            if (input.F_Dept > 0)
235
+            {
236
+                model.F_Dept = input.F_Dept;
237
+                model.F_DeptName  = input.F_DeptName;
39 238
                 input.F_OperationDept = UserLogin.UserCode;
40 239
                 if (input.F_Team > 0)
41 240
                 {
241
+                    model.F_Team = input.F_Team;
242
+                    model.F_TeamName  = input.F_TeamName;
42 243
                     input.F_OperationTeam = UserLogin.UserCode;
43 244
                     if (input.F_Group > 0)
44 245
                     {
246
+                        model.F_Group = input.F_Group;
247
+                        model.F_GroupName  = input.F_GroupName;
45 248
                         input.F_OperationGroup = UserLogin.UserCode;
46 249
                         {
47 250
                             if (!string.IsNullOrEmpty(input.F_OperationHandler))
251
+                            {
252
+                                var user = await sys_UserAccountRepository.GetListALL(x => x.F_UserCode == input.F_OperationHandler
253
+                                            && x.F_DeleteFlag == 0);
254
+                                if (user == null)
255
+                                    return Error("分配人员不存在");
48 256
                                 input.F_OperationHandler = UserLogin.UserCode;
257
+                                T_Call_CallRecords modelRecord = new T_Call_CallRecords();
258
+                                modelRecord.ActionID = 1;
259
+                                modelRecord.Caller = input.F_Tel;
260
+                                modelRecord.CallType = 0;
261
+                                modelRecord.CallState = 0;
262
+                                modelRecord.Id = 0;
263
+                                modelRecord.MYD = 1;
264
+                                modelRecord.OperateType = 0;
265
+                                modelRecord.LongTime = 0;
266
+                                model.F_IsDelete = 1;
267
+                                modelRecord.UserCode = user[0].F_UserCode;
268
+                                modelRecord.UserName = user[0].F_UserName;
269
+                                modelRecord.Deptid = (int)user[0].F_DeptTeamId;
270
+                                modelRecord.DeptName = user[0].F_Team;
271
+                                await busCallRecordsRepository.Add(modelRecord);
272
+                            }
49 273
                         }
50 274
                     }
51 275
                 }
52 276
                 input.F_AssignmentTime = DateTime.Now;
53 277
             }
54
-            if (await call_DistributionRepository.Add(input) > 0)
278
+        
279
+
280
+            if (await call_DistributionRepository.Update(model))
281
+                {
282
+                    return Success("分配成功");
283
+                }
284
+            
285
+            return Error("分配失败");
286
+        }
287
+        /// <summary>
288
+        /// 删除
289
+        /// </summary>
290
+        /// <param name="ids"></param>
291
+        /// <returns></returns>
292
+        [HttpPost("delete")]
293
+        public async Task<IActionResult> Remove(int[] ids)
294
+        {
295
+            var res = 0;
296
+            if (ids != null && ids.Length > 0)
55 297
             {
56
-                return Success("添加成功");
298
+                foreach (var item in ids)
299
+                {
300
+                    var model = await call_DistributionRepository.GetSingle(x => x.F_ID == item);
301
+                    model.F_IsDelete  = 1;
302
+                    if (call_DistributionRepository.Update(model).Result)
303
+                        res += 1;
304
+                }
305
+                if (res == ids.Length)
306
+                    return Success("操作成功");
307
+                else if (res > 0 && res < ids.Length)
308
+                    return Error("部分操作失败,请查看后重新操作");
309
+                else
310
+                    return Error("操作失败,请查看后重新操作");
57 311
             }
58
-            return Error("添加失败");
312
+            else
313
+                return Error("请选择要删除的记录");
59 314
         }
60
-       
315
+        /// <summary>
316
+        /// 获取列表
317
+        /// </summary>
318
+        /// <param name="keyword"></param>
319
+        /// <param name="pageindex"></param>
320
+        /// <param name="pagesize"></param>
321
+        /// <returns></returns>
322
+        [HttpGet("getlist")]
323
+        public async Task<IActionResult> GetLisAsync(string name, int dept = 0, int team = 0, int group = 0, int type = 0, int pageindex = 1, int pagesize = 20)
324
+        {
325
+            List<IConditionalModel> conModels = new List<IConditionalModel>();
326
+            #region 条件筛选
327
+            conModels.Add(new ConditionalModel() { FieldName = "F_IsDelete", ConditionalType = ConditionalType.Equal, FieldValue = "0" });
328
+            conModels.Add(new ConditionalModel() { FieldName = "F_Type", ConditionalType = ConditionalType.Equal, FieldValue = type.ToString () });
329
+            if (!string.IsNullOrEmpty(name))
330
+            {
331
+                conModels.Add(new ConditionalModel() { FieldName = "F_Name", ConditionalType = ConditionalType.Equal, FieldValue = name });
332
+            }
333
+            if (dept >0 )
334
+            {
335
+                conModels.Add(new ConditionalModel() { FieldName = "F_Dept", ConditionalType = ConditionalType.Equal, FieldValue = dept.ToString() });
336
+            }
337
+            if (team > 0)
338
+            {
339
+                conModels.Add(new ConditionalModel() { FieldName = "F_Team", ConditionalType = ConditionalType.Equal, FieldValue = team.ToString() });
340
+               
341
+            }
342
+            if (group > 0)
343
+            {
344
+                conModels.Add(new ConditionalModel() { FieldName = "F_Group", ConditionalType = ConditionalType.Equal, FieldValue = group.ToString() });
345
+            }
346
+
347
+            if (UserLogin.RoleCode == "ZXFZR")
348
+            {
349
+                var useraccount = await sys_UserAccountRepository.GetSingle(x => x.F_UserId == UserLogin.UserId.ObjToInt());
350
+                conModels.Add(new ConditionalModel() { FieldName = "F_Team", ConditionalType = ConditionalType.Equal, FieldValue = useraccount.F_DeptTeamId.ToString() });
351
+            }
352
+            else if (UserLogin.RoleCode == "XZFZR")
353
+            {
354
+                var useraccount = await sys_UserAccountRepository.GetSingle(x => x.F_UserId == UserLogin.UserId.ObjToInt());
355
+                conModels.Add(new ConditionalModel() { FieldName = "F_Group", ConditionalType = ConditionalType.Equal, FieldValue = useraccount.F_GroupId .ToString ()});
356
+            }
357
+            #endregion
358
+            int recordCount = 0;
359
+            var list = await call_DistributionRepository.GetListByPage(conModels, new MyPageModel() { PageIndex = pageindex, PageSize = pagesize, PageCount = recordCount });
360
+            var obj = new
361
+            {
362
+                state = "success",
363
+                message = "成功",
364
+                rows = list,
365
+                total = list.Totals,
366
+            };
367
+            return Content(obj.ToJson());
368
+        }
369
+
370
+        /// <summary>
371
+        /// 获取详情
372
+        /// </summary>
373
+        /// <param name="id">id</param>
374
+        /// <returns></returns>
375
+        [HttpGet("getdetails")]
376
+        public async Task<IActionResult> GetDetailsAsync(int id)
377
+        {
378
+            if (id <= 0)
379
+                return Error("参数错误");
380
+
381
+            var model = await call_DistributionRepository.GetSingle(x => x.F_ID == id);
382
+            if (model == null)
383
+            {
384
+                return Error("获取失败");
385
+            }
386
+           
387
+            return Success("获取成功!", model);
388
+        }
389
+
390
+        /// <summary>
391
+        /// 判断号码必须为十一位数字
392
+        /// </summary>
393
+        /// <param name="tel"></param>
394
+        /// <returns></returns>
395
+        public bool valtel(string tel)
396
+        {
397
+            var res = false;
398
+            //11位数字
399
+            if (tel.Length == 11 && Regex.IsMatch(tel, @"^\d{11}$"))
400
+                res = true;
401
+            return res;
402
+        }
403
+
61 404
     }
62 405
 }

+ 91 - 9
代码/TVShoppingCallCenter_ZLJ/Controllers/Customer/VIPInfoController.cs

@@ -21,6 +21,7 @@ using System.Utility.Encrypt;
21 21
 using System.IRepositories.Bus;
22 22
 using System.IRepositories.Cus;
23 23
 using System.Model.Cus;
24
+using System.Model.Bus;
24 25
 
25 26
 namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
26 27
 {
@@ -38,8 +39,10 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
38 39
         private readonly Ipoint_agentRepository _point_agentrepository;
39 40
         private readonly IBus_OrderRepository busOrderRepository;
40 41
         private readonly ICus_MembershipRepository _cus_membershiprepository;
42
+        private readonly IBus_ChatLogRepository bus_ChatLogRepository;
41 43
         public VipInfoController(ICus_VipInfoRepository cus_vip_infoRepository, ISys_UserAccountRepository sys_user_accountRepository, ICus_MsgRepository cus_msgRepository,IConfiguration configuration,
42
-            ISMS_InternalMessagesReposytory sys_internalMessagesrepository, ICall_CallRecordsRepository _busCallRecordsRepository, Ipoint_agentRepository point_agentrepository, IBus_OrderRepository _busOrderRepository,ICus_MembershipRepository cus_membershiprepository)
44
+            ISMS_InternalMessagesReposytory sys_internalMessagesrepository, ICall_CallRecordsRepository _busCallRecordsRepository, Ipoint_agentRepository point_agentrepository, IBus_OrderRepository _busOrderRepository,ICus_MembershipRepository cus_membershiprepository,
45
+            IBus_ChatLogRepository _bus_ChatLogRepository)
43 46
         {
44 47
             _cus_vip_infoRepository = cus_vip_infoRepository;
45 48
             _sys_user_accountRepository = sys_user_accountRepository;
@@ -50,6 +53,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
50 53
             _point_agentrepository = point_agentrepository;
51 54
             busOrderRepository = _busOrderRepository;
52 55
             _cus_membershiprepository = cus_membershiprepository;
56
+            bus_ChatLogRepository = _bus_ChatLogRepository;
53 57
         }
54 58
 
55 59
         [HttpGet]
@@ -66,7 +70,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
66 70
         /// <param name="pagesize"></param>
67 71
         /// <returns></returns>
68 72
         [HttpGet("getlistbypage")]
69
-        public async Task<IActionResult> GetListsByPageAsync(string keyword,string label, string name,string phone,string type, string province,string city,string area,string town,string address,string birthday,string recommender,string saleperson,string  laststartholetime,string lastendholetime,    int pageindex = 1, int pagesize = 20)
73
+        public async Task<IActionResult> GetListsByPageAsync(string keyword,string label, string name,string phone,string type, string province,string city,string area,string town,string address,string birthday,string recommender,string saleperson,string  laststartholetime,string lastendholetime, int transferState = -1,    int pageindex = 1, int pagesize = 20)
70 74
         {
71 75
             List<IConditionalModel> conModels = new List<IConditionalModel>();
72 76
             #region 条件筛选
@@ -112,6 +116,10 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
112 116
             {
113 117
                 conModels.Add(new ConditionalModel() { FieldName = "F_Town", ConditionalType = ConditionalType.Like, FieldValue = town });
114 118
             }
119
+            if (transferState > -1)
120
+            {
121
+                conModels.Add(new ConditionalModel() { FieldName = "F_TransferState", ConditionalType = ConditionalType.Equal , FieldValue = transferState.ToString () });
122
+            }
115 123
             if (!string.IsNullOrEmpty(address))
116 124
             {
117 125
                 conModels.Add(new ConditionalModel() { FieldName = "F_Address", ConditionalType = ConditionalType.Like, FieldValue = address });
@@ -408,7 +416,61 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
408 416
                 return Error ("部分档案拆分成功");
409 417
         }
410 418
 
419
+        /// <summary>
420
+        /// 转办售后
421
+        /// </summary>
422
+        /// <param name="id">id</param>
423
+        /// <returns></returns>
424
+        [HttpGet("ransfer")]
425
+        public async Task<IActionResult> Transfer(int id)
426
+        {
427
+            if (id <= 0)
428
+                return Error("请选择要转办的会员");
429
+            var model = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == id && x.F_State == (int)EnumDelState.Enabled);
430
+            if (model == null)
431
+                return Error("操作失败,会员不存在");
432
+
433
+            model.F_IsTransfer = 1;
434
+            model.F_TransferState = 0;
435
+            bool b = await _cus_vip_infoRepository.Update(model);
436
+            if (b)
437
+                return Success("转办成功");
438
+            else
439
+                return Error("转办失败");
440
+        }
441
+        /// <summary>
442
+        /// 处理转办
443
+        /// </summary>
444
+        /// <param name="id">id</param>
445
+        /// <returns></returns>
446
+        [HttpGet("handleTransfer")]
447
+        public async Task<IActionResult> HandleTransfer(int id,string message)
448
+        {
449
+            if (id <= 0)
450
+                return Error("请选择要处理的会员");
451
+            var model = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == id && x.F_State == (int)EnumDelState.Enabled);
452
+            if (model == null)
453
+                return Error("操作失败,会员不存在");
411 454
 
455
+            model.F_IsTransfer = 1;
456
+            model.F_TransferState = 1;
457
+            T_Bus_ChatLog log = new T_Bus_ChatLog();
458
+            log.F_WoID = model.F_ID.ToString ();
459
+            log.F_Content = message;
460
+            log.F_AddUser = UserLogin .UserId ;
461
+            log.F_AddUserName = UserLogin.UserName ;
462
+            log.F_AddTime = DateTime .Now ;
463
+            log.F_IsSo =1;
464
+            log.F_IsDelete = 0;
465
+            log.F_State =1;
466
+            if (await bus_ChatLogRepository.Add(log) > 0)
467
+            {
468
+                bool b = await _cus_vip_infoRepository.Update(model);
469
+                if (b)
470
+                    return Success("处理成功");
471
+            }
472
+            return Error("处理失败");
473
+        }
412 474
         /// <summary>
413 475
         /// 获取会员所有手机号
414 476
         /// </summary>
@@ -528,7 +590,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
528 590
             if (string.IsNullOrEmpty(input.phone))
529 591
                 return Error("请输入联系方式");
530 592
 
531
-            if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone   == input.phone  && q.F_State== (int)EnumDelState.Enabled) >0)
593
+            if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone == input.phone||q .F_Mobile .Contains (input.phone)  && q.F_State== (int)EnumDelState.Enabled) >0)
532 594
             {
533 595
                 return Error("手机号已存在");
534 596
             }
@@ -603,7 +665,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
603 665
             model.F_City1 = input.city1;
604 666
             model.F_Address1 = input.address1;
605 667
 
606
-
668
+            
607 669
             model.F_Province2 = input.province2;
608 670
             model.F_Area2 = input.area2;
609 671
             model.F_Town2 = input.town2;
@@ -616,7 +678,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
616 678
             model.F_Score = input.score;
617 679
             model.F_Money = input.money;
618 680
             model.F_TotalScore = input.totalscore;
619
-            model.F_Saleperson = user; //"8000";input.saleperson;
681
+            model.F_Saleperson =UserLogin .UserId ; //"8000";input.saleperson;
620 682
             model.F_Type = input.type;
621 683
             model.F_CreateBy = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value; //"8000";
622 684
             model.F_CreateOn = DateTime.Now;
@@ -658,7 +720,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
658 720
             var res = await _cus_vip_infoRepository.Add(model);
659 721
             if (res > 0)
660 722
             {
661
-                return Success("添加成功");
723
+                return Success("添加成功", res);
662 724
             }
663 725
             else
664 726
             {
@@ -678,7 +740,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
678 740
             if (string.IsNullOrEmpty(input.phone))
679 741
                 return Error("请输入联系方式");
680 742
 
681
-            if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone == input.phone && q.F_ID!= input.id && q.F_State == (int)EnumDelState.Enabled) > 0)
743
+            if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone == input.phone|| q.F_Mobile.Contains(input.phone) && q.F_ID!= input.id && q.F_State == (int)EnumDelState.Enabled) > 0)
682 744
             {
683 745
                 return Error("手机号已存在");
684 746
             }
@@ -766,8 +828,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
766 828
             model.F_MembershipId = model.F_MembershipId;
767 829
             model.F_Membership = model.F_Membership;
768 830
             model.F_Address2 = input.address2;
769
-            //model.F_Saleperson = input.saleperson;
770
-            //model.F_Contact = input.contact;
831
+           model.F_Saleperson = model.F_Saleperson;
832
+        //  model.F_Contact = input.contact;
771 833
             model.F_Type = input.type;
772 834
             if (model.F_GiftYear != DateTime.Now.Year.ToString())
773 835
             {
@@ -806,6 +868,26 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
806 868
             return Error("修改失败");
807 869
         }
808 870
         /// <summary>
871
+        /// 判断号码是否存在
872
+        /// </summary>
873
+        /// <param name="phone"></param>
874
+        /// <returns></returns>
875
+        [HttpGet("getexistence")]
876
+        public async Task<IActionResult> GetExistence(string phone)
877
+        {
878
+            if (string.IsNullOrEmpty(phone))
879
+                return Error("参数错误");
880
+            if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone == phone || q.F_Mobile.Contains(phone) && q.F_State == (int)EnumDelState.Enabled) > 0)
881
+            {
882
+                return Success("手机号已存在",1);
883
+            }
884
+            else
885
+            {
886
+                return Success ("成功",2);
887
+            }
888
+        }
889
+
890
+        /// <summary>
809 891
         /// 删除会员信息 by ids
810 892
         /// </summary>
811 893
         /// <param name="ids"></param>

File diff suppressed because it is too large
+ 15 - 6
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/AfterSaleController.cs


+ 10 - 1
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/ChatLogController.cs

@@ -125,12 +125,21 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
125 125
         /// <param name="pagesize"></param>
126 126
         /// <returns></returns>
127 127
         [HttpGet("getlist")]
128
-        public async Task<IActionResult> GetLisAsync(string woid ,int state = 1, int pageindex = 1, int pagesize = 20)
128
+        public async Task<IActionResult> GetLisAsync(string woid , int state = 1, int pageindex = 1, int pagesize = 20)
129 129
         {
130 130
             List<IConditionalModel> conModels = new List<IConditionalModel>();
131 131
             #region 条件筛选
132 132
             conModels.Add(new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal , FieldValue = state.ToString() });
133 133
             conModels.Add(new ConditionalModel() { FieldName = "F_WoID", ConditionalType = ConditionalType.Equal, FieldValue = woid.ToString() });
134
+            conModels.Add(new ConditionalCollections()
135
+            {
136
+                ConditionalList = new List<KeyValuePair<WhereType, ConditionalModel>>()
137
+                    {
138
+                        new  KeyValuePair<WhereType, ConditionalModel>(WhereType.And, new ConditionalModel() { FieldName = "F_IsSo", ConditionalType = ConditionalType.Equal , FieldValue = "1"}),
139
+                        new  KeyValuePair<WhereType, ConditionalModel>( WhereType.Or , new ConditionalModel() { FieldName = "F_AddUser", ConditionalType = ConditionalType.Like, FieldValue =  UserLogin.UserId }),
140
+                    }
141
+            });
142
+
134 143
             #endregion
135 144
             int recordCount = 0;
136 145
             var list = await bus_ChatLogRepository.GetListByPage(conModels, new MyPageModel() { PageIndex = pageindex, PageSize = pagesize, PageCount = recordCount });

+ 24 - 12
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/KFOrderController.cs

@@ -557,7 +557,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
557 557
         }
558 558
 
559 559
         /// <summary>
560
-        /// 订单二审 审完 走发货
560
+        /// 订单
561 561
         /// </summary>
562 562
         /// <param name="orderid">订单号</param>
563 563
         /// <param name="state">订单状态 -1无效 0暂存 1提交  2KF退回  3通过 4KG退回 5已分拣 6已发货7,8分仓</param>
@@ -741,7 +741,16 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
741 741
                 }
742 742
                 
743 743
             }
744
-
744
+            if (UserLogin.RoleCode == "ZXFZR")
745
+            {
746
+                var useraccount = await _sys_useraccountRepository.GetSingle(x => x.F_UserId == UserLogin.UserId.ObjToInt());
747
+                conModels.Add(new ConditionalModel() { FieldName = "F_Core", ConditionalType = ConditionalType.Equal, FieldValue = useraccount.F_DeptTeamId.ToString() });
748
+            }
749
+            else if (UserLogin.RoleCode == "XZFZR")
750
+            {
751
+                var useraccount = await _sys_useraccountRepository.GetSingle(x => x.F_UserId == UserLogin.UserId.ObjToInt());
752
+                conModels.Add(new ConditionalModel() { FieldName = "F_Group", ConditionalType = ConditionalType.Equal, FieldValue = useraccount.F_GroupId.ToString() });
753
+            }
745 754
             //else if (UserLogin.RoleCode == "KF")
746 755
             //{
747 756
             //    conModels.Add(new ConditionalCollections()
@@ -909,8 +918,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
909 918
             List<OrderInput> returnlist = new List<OrderInput>();
910 919
             if (isdc ==1)
911 920
             {
912
-                var zzroleid =await  sys_RoleInfoRepository.GetListALL (x => x.F_RoleCode == "XSZZ"&&x .F_State ==1);
913
-                var jlroleid = await sys_RoleInfoRepository.GetListALL(x => x.F_RoleCode == "ZXJL" && x.F_State == 1);
921
+                var zzroleid =await  sys_RoleInfoRepository.GetListALL (x => x.F_RoleCode == "XZFZR" && x .F_State ==1);
922
+                var jlroleid = await sys_RoleInfoRepository.GetListALL(x => x.F_RoleCode == "ZXFZR" && x.F_State == 1);
914 923
                 foreach (T_Bus_Order t in list.Rows)
915 924
                 {
916 925
                     OrderInput m = new OrderInput();
@@ -1032,8 +1041,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
1032 1041
             }
1033 1042
             else if (isdc ==3)
1034 1043
             {
1035
-
1036
-                var tb = ModelConvertHelper<T_Bus_Order>.ConvertListToDataTable(list.Rows);
1044
+                var tb = ModelConvertHelper<T_Bus_Order>.ConvertListToDataTable(list .Rows);
1037 1045
                 NPOIHelper npoi = new NPOIHelper();
1038 1046
                 string dbkeys = config["Import:ordertrackkey"].ToString();
1039 1047
                 string title = config["Import:ordertracktvalue"].ToString();
@@ -1484,7 +1492,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
1484 1492
         /// <param name="status">0 未发出 1未签收2签收3改代收4拒收</param>
1485 1493
         /// <returns></returns>
1486 1494
         [HttpPost("afterSignfor")]
1487
-        public async Task<IActionResult> AfterSignfor(string orderids,string id)
1495
+        public async Task<IActionResult> AfterSignfor(string orderids, string id, int Status = 2)
1488 1496
         {
1489 1497
 
1490 1498
             #region 验证参数 必填项  
@@ -1496,12 +1504,16 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
1496 1504
             #endregion
1497 1505
             string[] ids = id.Split(',');
1498 1506
             string[] orderid = orderids.Split(',');
1499
-            if (await bus_OrderRepository .Update(s => new T_Bus_Order () { F_Status  = 2 }, q => orderid.Contains(q.F_Id)))
1500
-            {
1501
-                if (await busAfterSaleRepository.Update(s => new T_Bus_AfterSale() { F_IsSignfor = 1 }, q => ids.Contains(q.F_Id)))
1507
+            if (await bus_OrderRepository .Update(s => new T_Bus_Order () { F_Status  = Status }, q => orderid.Contains(q.F_Id)))
1508
+            {if (Status==2)
1502 1509
                 {
1503
-                    return Success("成功");
1510
+                    if (await busAfterSaleRepository.Update(s => new T_Bus_AfterSale() { F_IsSignfor = 1 }, q => ids.Contains(q.F_Id)))
1511
+                    {
1512
+                        return Success("成功");
1513
+                    }
1514
+
1504 1515
                 }
1516
+               
1505 1517
             }
1506 1518
             return Error("失败,请重试!");
1507 1519
 
@@ -1866,7 +1878,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
1866 1878
 
1867 1879
 
1868 1880
         /// <summary>
1869
-        /// 上传文件并导入数据库批量导入快递信息
1881
+        /// 上传文件并导入数据库批量提交
1870 1882
         /// </summary>
1871 1883
         /// <returns></returns>
1872 1884
         [HttpPost("importordersubmitexcel")]

File diff suppressed because it is too large
+ 205 - 34
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/OrderController.cs


+ 7 - 1
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/OrderFunctionController.cs

@@ -12,8 +12,10 @@ using System.Data;
12 12
 using System.IRepositories;
13 13
 using System.Linq;
14 14
 using System.Model;
15
+using System.Net.Http;
15 16
 using System.Repositories;
16 17
 using System.Security.Claims;
18
+using System.Text;
17 19
 using System.Threading.Tasks;
18 20
 using System.Utility.Http;
19 21
 using Microsoft.AspNetCore.Mvc;
@@ -219,7 +221,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
219 221
             modelset.appkey = config["eBoss:appkey"].ToString();
220 222
             modelset.billdate = DateTime.Now.ToString("yyyyMMdd");
221 223
             string url = config["eBoss:url"].ToString();
222
-            string ret = await HttpHelper.HttpGetAsync(url + modelset.ToJson());//"\"success\": true";
224
+            HttpClient client = new HttpClient();
225
+            var content = new StringContent(modelset.ToJson(), Encoding.UTF8, "application/json");
226
+            var response = await client.PostAsync(url, content);
227
+            var result = await response.Content.ReadAsByteArrayAsync();
228
+            string ret = Encoding.Default.GetString(result);//"\"success\": true";
223 229
             //ret.ToJson();
224 230
             
225 231
             foreach (T_Bus_StockLog stocklog in modelStockLogs)

+ 203 - 1
代码/TVShoppingCallCenter_ZLJ/Controllers/Report/KFReportController.cs

@@ -24,9 +24,12 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Report
24 24
         private readonly IConfiguration config;
25 25
         private readonly IBus_AfterSaleRepository busAfterSaleRepository;
26 26
         private readonly IBus_ProductRepository _productRepository;
27
+        private readonly ISys_DeptTeamRepository _sys_deptteamRepository;
28
+        private readonly ISys_DepartmentRepository _sys_departmentRepository;
27 29
         public KFReportController(IBus_OrderDetailRepository _bus_OrderDetailRepository
28 30
             , IBus_OrderRepository _bus_OrderRepository,IConfiguration _config
29
-            , IBus_AfterSaleRepository _busAfterSaleRepository, IBus_ProductRepository productRepository)
31
+            , IBus_AfterSaleRepository _busAfterSaleRepository, IBus_ProductRepository productRepository,
32
+            ISys_DeptTeamRepository sys_deptteamRepository, ISys_DepartmentRepository sys_departmentRepository)
30 33
         {
31 34
             bus_OrderDetailRepository = _bus_OrderDetailRepository;
32 35
             bus_OrderRepository = _bus_OrderRepository;
@@ -461,5 +464,204 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Report
461 464
 
462 465
             return Success("获取成功", Detail);
463 466
         }
467
+
468
+        public class Efficiencys
469
+        {
470
+            public string name { get; set; }//名称
471
+            public decimal  oeder { get; set; } = 0;//下单金额
472
+            public decimal deliver { get; set; } = 0;//发货金额
473
+            public decimal signfor { get; set; } = 0;//签收金额
474
+        }
475
+        /// <summary>
476
+        /// 销售数据表
477
+        /// </summary>
478
+        /// <param name="input"></param>
479
+        /// <returns></returns>
480
+        [HttpGet("efficiency")]
481
+        public async Task<IActionResult> Efficiency(string starttime, string endtime,int type=0, int isdc = 0)
482
+        {
483
+            if (string.IsNullOrEmpty(starttime))
484
+                starttime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy-MM-dd");
485
+            if (string.IsNullOrEmpty(endtime))
486
+                endtime = DateTime.Now.ToString("yyyy-MM-dd");
487
+            List<IConditionalModel> conModels = new List<IConditionalModel>();
488
+            conModels.Add(new ConditionalModel() { FieldName = "F_AddTime", ConditionalType = ConditionalType.GreaterThanOrEqual, FieldValue = starttime });
489
+            conModels.Add(new ConditionalModel() { FieldName = "F_AddTime", ConditionalType = ConditionalType.LessThanOrEqual, FieldValue = endtime });
490
+            List<T_Bus_Order> list = await bus_OrderRepository.GetListALL(conModels, "F_AddTime ASC");
491
+            var rows = list.GroupBy(x => new { x.F_Belong,x .F_BelongName,x .F_State ,x .F_Status  }).Select(
492
+                 x => new { F_State = x.Key.F_State, F_Status = x.Key.F_Status, F_BelongName = x.Key.F_BelongName, Count = x.Select(y => y .F_ShouldPrice ).Sum() });
493
+            var Group = list.GroupBy(x => new {  x.F_Group, x.F_Status ,x .F_State  }).Select(
494
+               x => new { F_Group = x.Key.F_Group, F_Status = x.Key.F_Status, F_State = x.Key.F_State, Count = x.Select(y => y.F_ShouldPrice).Sum() });
495
+            var Core = list.GroupBy(x => new { x.F_Core, x.F_Status, x.F_State }).Select(
496
+               x => new { F_Core = x.Key.F_Core, F_Status = x.Key.F_Status, F_State = x.Key.F_State, Count = x.Select(y => y.F_ShouldPrice).Sum() });
497
+            var Department = list.GroupBy(x => new { x.F_Department, x.F_Status, x.F_State }).Select(
498
+              x => new { F_Department = x.Key.F_Department, F_Status = x.Key.F_Status, F_State = x.Key.F_State, Count = x.Select(y => y.F_ShouldPrice).Sum() });
499
+            List<Efficiencys> efficiencys = new List<Efficiencys>();
500
+            List<Efficiencys> Effic1 = new List<Efficiencys>();
501
+            foreach (var it in rows)
502
+            {
503
+                Efficiencys efficienc = new Efficiencys();
504
+                efficienc.name = it.F_BelongName;
505
+                if (it .F_State >-1)
506
+                {
507
+                    efficienc.oeder+=it .Count;
508
+                }
509
+                if (it.F_State ==6)
510
+                {
511
+                    efficienc.deliver += it.Count;
512
+                    if (it.F_Status ==2)
513
+                    {
514
+                        efficienc.signfor += it.Count;
515
+                    }
516
+                }
517
+                Effic1.Add(efficienc);
518
+            }
519
+            efficiencys= TobeEfficiencys(efficiencys, Effic1,type );
520
+            List<Efficiencys> Effic2 = new List<Efficiencys>();
521
+            foreach (var it in Group)
522
+            {
523
+                Efficiencys efficienc = new Efficiencys();
524
+                var team = await _sys_deptteamRepository.GetSingle(x => x.F_Id == it.F_Group);
525
+                if (team!=null )
526
+                {
527
+                    efficienc.name = team.F_Name ;
528
+                    if (it.F_State > -1)
529
+                    {
530
+                        efficienc.oeder += it.Count;
531
+                    }
532
+                    if (it.F_State == 6)
533
+                    {
534
+                        efficienc.deliver += it.Count;
535
+                        if (it.F_Status == 2)
536
+                        {
537
+                            efficienc.signfor += it.Count;
538
+                        }
539
+                    }
540
+                    Effic2.Add(efficienc);
541
+                }
542
+            }
543
+            efficiencys = TobeEfficiencys(efficiencys, Effic2, type);
544
+            List<Efficiencys> Effic3 = new List<Efficiencys>();
545
+    
546
+            foreach (var it in Core)
547
+            {
548
+                Efficiencys efficienc = new Efficiencys();
549
+                var team = await _sys_deptteamRepository.GetSingle(x => x.F_Id == it.F_Core );
550
+                if (team != null)
551
+                {
552
+                    efficienc.name = team.F_Name;
553
+                    if (it.F_State > -1)
554
+                    {
555
+                        efficienc.oeder += it.Count;
556
+                    }
557
+                    if (it.F_State == 6)
558
+                    {
559
+                        efficienc.deliver += it.Count;
560
+                        if (it.F_Status == 2)
561
+                        {
562
+                            efficienc.signfor += it.Count;
563
+                        }
564
+                    }
565
+                    Effic3.Add(efficienc);
566
+                }
567
+            }
568
+            efficiencys = TobeEfficiencys(efficiencys, Effic3, type);
569
+            List<Efficiencys> Effic4 = new List<Efficiencys>();
570
+            foreach (var it in Department)
571
+            {
572
+                Efficiencys efficienc = new Efficiencys();
573
+                var team = await _sys_departmentRepository.GetSingle(x => x.F_DeptId  == it.F_Department );
574
+                if (team != null)
575
+                {
576
+                    efficienc.name = team.F_DeptName ;
577
+                    if (it.F_State > -1)
578
+                    {
579
+                        efficienc.oeder += it.Count;
580
+                    }
581
+                    if (it.F_State == 6)
582
+                    {
583
+                        efficienc.deliver += it.Count;
584
+                        if (it.F_Status == 2)
585
+                        {
586
+                            efficienc.signfor += it.Count;
587
+                        }
588
+                    }
589
+                    Effic4.Add(efficienc);
590
+                }
591
+            }
592
+            efficiencys = TobeEfficiencys(efficiencys, Effic4, type);
593
+            if (isdc > 0)
594
+            {
595
+               
596
+                NPOIHelper npoi = new NPOIHelper();
597
+                string dbkeys = "name,oeder,deliver,signfor";
598
+                string title = "名称,下单金额,发货金额,签收金额";
599
+                string[] colname = dbkeys.Split(",");
600
+                string[] cols = title.Split(",");
601
+                byte[] sm = npoi.ExportToExcel(efficiencys, cols, colname);
602
+                if (sm != null)
603
+                {
604
+                    return File(sm, "application/vnd.ms-excel", "销售数据报表.xlsx");
605
+                }
606
+                else
607
+                {
608
+                    return Error("导出失败");
609
+                }
610
+
611
+            }
612
+            return Success("获取成功", efficiencys);
613
+        }
614
+        private List <Efficiencys> TobeEfficiencys(List<Efficiencys> efficiencys, List<Efficiencys>  Effic1
615
+           ,int type)
616
+        {
617
+            var date = Effic1.GroupBy(x => new { x.name }).Select(
618
+          x => new {
619
+              name = x.Key.name,
620
+              oeder = x.Select(y => y.oeder).Sum(),
621
+              deliver = x.Select(y => y.deliver).Sum(),
622
+              signfor = x.Select(y => y.signfor).Sum()
623
+          });
624
+           
625
+            if (type==0)
626
+            {
627
+                var obj = date.OrderByDescending(x => x.oeder).ToList();
628
+                foreach (var it in obj)
629
+                {
630
+                    Efficiencys reportdata = new Efficiencys();
631
+                    reportdata.name = it.name;
632
+                    reportdata.oeder = it.oeder;
633
+                    reportdata.deliver = it.deliver;
634
+                    reportdata.signfor = it.signfor;
635
+                    efficiencys.Add(reportdata);
636
+                }
637
+            }
638
+            else if (type == 1)
639
+            {
640
+                var obj = date.OrderByDescending(x => x.deliver).ToList();
641
+                foreach (var it in obj)
642
+                {
643
+                    Efficiencys reportdata = new Efficiencys();
644
+                    reportdata.name = it.name;
645
+                    reportdata.oeder = it.oeder;
646
+                    reportdata.deliver = it.deliver;
647
+                    reportdata.signfor = it.signfor;
648
+                    efficiencys.Add(reportdata);
649
+                }
650
+            }
651
+            else if (type == 2)
652
+            {
653
+                var obj = date.OrderByDescending(x => x.signfor).ToList();
654
+                foreach (var it in obj)
655
+                {
656
+                    Efficiencys reportdata = new Efficiencys();
657
+                    reportdata.name = it.name;
658
+                    reportdata.oeder = it.oeder;
659
+                    reportdata.deliver = it.deliver;
660
+                    reportdata.signfor = it.signfor;
661
+                    efficiencys.Add(reportdata);
662
+                }
663
+            }
664
+            return efficiencys;
665
+        }
464 666
     }
465 667
 }

+ 26 - 0
代码/TVShoppingCallCenter_ZLJ/Controllers/System/UserAccountController.cs

@@ -149,6 +149,32 @@ namespace TVShoppingCallCenter_ZLJ.Controllers
149 149
             {
150 150
                 return Error("手机号已经存在");
151 151
             }
152
+            var rolemodel = await _sys_role_infoRepository.GetSingle(x => x.F_RoleId  == input.roleid);
153
+            if (rolemodel!=null )
154
+            {
155
+                if (input.deptid<=0)
156
+                {
157
+                    if ( rolemodel.F_RoleCode == "ZXFZR" || rolemodel.F_RoleCode == "XZFZR")
158
+                    {
159
+                        return Error("请选择部门");
160
+                    }
161
+                }
162
+                if (input.deptteamid <= 0)
163
+                {
164
+                    if ( rolemodel.F_RoleCode == "ZXFZR" || rolemodel.F_RoleCode == "XZFZR")
165
+                    {
166
+                        return Error("请选择中心");
167
+                    }
168
+                }
169
+                if (input.groupid <= 0)
170
+                {
171
+                    if ( rolemodel.F_RoleCode == "XZFZR")
172
+                    {
173
+                        return Error("请选择小组");
174
+                    }
175
+                }
176
+            }
177
+
152 178
             #endregion
153 179
             var model = new T_Sys_UserAccount();
154 180
             model.F_UserCode = input.usercode;

+ 3 - 3
代码/TVShoppingCallCenter_ZLJ/Startup.cs

@@ -239,8 +239,8 @@ namespace TVShoppingCallCenter_ZLJ
239 239
         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
240 240
         {
241 241
             app.UseCors("Cors");
242
-            app.UseDeveloperExceptionPage();
243
-            app.UseDatabaseErrorPage();
242
+           app.UseDeveloperExceptionPage();
243
+           app.UseDatabaseErrorPage();
244 244
             app.UseBrowserLink();
245 245
             app.UseStaticFiles(new StaticFileOptions()
246 246
             {
@@ -261,7 +261,7 @@ namespace TVShoppingCallCenter_ZLJ
261 261
 
262 262
             app.UseHangfireServer(new BackgroundJobServerOptions
263 263
             {
264
-                Queues = new[] { "daily", "minutely", "monthly", "outbound", "autodial", "month12" },//队列名称,只能为小写
264
+                Queues = new[] { "daily", "minutely", "automatic", "aftersale", "outbound", "autodial", "month12" },//队列名称,只能为小写
265 265
                 WorkerCount = Environment.ProcessorCount * 3, //并发任务数
266 266
                 ServerName = "hangfireMysql",//服务器名称
267 267
             });//启动Hangfire服务  有可选参数

+ 2 - 2
代码/TVShoppingCallCenter_ZLJ/appsettings.json

@@ -39,8 +39,8 @@
39 39
     "vipkey": "F_Name,F_Birthday,F_Age,F_Sex,F_ShoeSize,F_Phone,F_Mobile,F_Recommender,F_RecommenderTel,F_Label,F_Province,F_City,F_Area,F_Town,F_Address,F_Province1,F_City1,F_Area1,F_Town1,F_Address1,F_Province2,F_City2,F_Area2,F_Town2,F_Address2,F_Score,F_Money,F_TotalScore,F_Saleperson,F_Membership",
40 40
     "vipvalue": "姓名,生日,年龄,性别,鞋码,联系方式,备用号码,推荐人,推荐人电话,会员标签,省份,城市,县区,乡镇,地址,备用省份1,,备用城市1,备用县区1,备用乡镇1,备用地址1,备用省份2,,备用城市2,备用县区2,备用乡镇2,备用地址2,会员积分,累计消费,累计积分,销售负责人,会员类型",
41 41
 
42
-    "orderkey": "F_Customer,F_Addressee,F_AddPhone,F_CustomerPhone,F_Ress,F_ProductName,Count,F_TotlePrice,Preferential,F_ShouldPrice,F_RealPrice,F_CheckUserName,XSZZ,DeptName,Manager,F_Remark,F_Id,F_Type,F_AddTime,F_Express",
43
-    "ordervalue": "会员姓名,收件人姓名,手机号,固话,收件人地址,商品名称,数量,订单总金额,优惠活动,应收金额,实收金额,客服姓名,销售组长,中心,中心经理,备注,订单编号,订单类型,订单时间,快递",
42
+    "orderkey": "F_Customer,F_Addressee,F_AddPhone,F_CustomerPhone,F_AddDes,F_Ress,F_ProductName,Count,F_TotlePrice,Preferential,F_ShouldPrice,F_RealPrice,F_CheckUserName,XSZZ,DeptName,Manager,F_Remark,F_Id,F_Type,F_AddTime,F_Express",
43
+    "ordervalue": "会员姓名,收件人姓名,手机号,固话,送货说明,收件人地址,商品名称,数量,订单总金额,优惠活动,应收金额,实收金额,客服姓名,销售组长,中心,中心经理,备注,订单编号,订单类型,订单时间,快递",
44 44
     "ordercommoditykey": "F_ProductName,Count,DeliveryMoney,Signfor,SignforMoney",
45 45
     "ordercommodityvalue": "商品名称,发货数量,发货金额,签收数量,签收金额",
46 46