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

呼叫转移,设置时间段接口
自定义字段接口调整

yuqian лет назад: 8
Родитель
Сommit
d31b4d389d

+ 1 - 0
CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -90,6 +90,7 @@
90 90
     <Compile Include="T_SMS_SendSMSTask.cs" />
91 91
     <Compile Include="T_SMS_SentSMS.cs" />
92 92
     <Compile Include="T_SMS_Template.cs" />
93
+    <Compile Include="T_Sys_BanCallOut.cs" />
93 94
     <Compile Include="T_Sys_BanCallOutTime.cs" />
94 95
     <Compile Include="T_Sys_Department.cs" />
95 96
     <Compile Include="T_Sys_DictionaryBase.cs" />

+ 1 - 1
CallCenterApi/CallCenterApi.BLL/T_Call_BanCallOut.cs

@@ -44,7 +44,7 @@ namespace CallCenterApi.BLL
44 44
             return dal.Add(model);
45 45
         }
46 46
 
47
-        public int deleteBatch(string ids)
47
+        public int DeleteBatch(string ids)
48 48
         {
49 49
             return dal.DeleteBatch(ids);
50 50
         }

+ 29 - 0
CallCenterApi/CallCenterApi.BLL/T_Sys_BanCallOut.cs

@@ -0,0 +1,29 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.BLL
8
+{
9
+    public class T_Sys_BanCallOut
10
+    {
11
+        private readonly DAL.T_Sys_BanCallOut dal = new DAL.T_Sys_BanCallOut();
12
+
13
+        public bool Add(Model.T_Sys_BanCallOut model)
14
+        {
15
+            return dal.Add(model);
16
+        }
17
+
18
+        public bool Update(Model.T_Sys_BanCallOut model)
19
+        {
20
+            return dal.Update(model);
21
+        }
22
+
23
+        public Model.T_Sys_BanCallOut GetModel(int deptId)
24
+        {
25
+            return dal.GetModel(deptId);
26
+
27
+        }
28
+    }
29
+}

+ 1 - 0
CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj

@@ -90,6 +90,7 @@
90 90
     <Compile Include="T_SMS_SendSMSTask.cs" />
91 91
     <Compile Include="T_SMS_SentSMS.cs" />
92 92
     <Compile Include="T_SMS_Template.cs" />
93
+    <Compile Include="T_Sys_BanCallOut.cs" />
93 94
     <Compile Include="T_Sys_BanCallOutTime.cs" />
94 95
     <Compile Include="T_Sys_Department.cs" />
95 96
     <Compile Include="T_Sys_DictionaryBase.cs" />

+ 1 - 1
CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerField.cs

@@ -79,7 +79,7 @@ namespace CallCenterApi.DAL
79 79
         }
80 80
         public int Add(Model.T_Cus_CustomerField model)
81 81
         {
82
-            string sql = "insert into T_Cus_CustomerField (F_FieldType,F_FieldId,F_Name,F_DBTypeName,F_DBFieldName) value (@F_FieldType,@F_FieldId,@F_Name,@F_DBTypeName,@F_DBFieldName)";
82
+            string sql = "insert into T_Cus_CustomerField (F_FieldType,F_FieldId,F_Name,F_DBTypeName,F_DBFieldName) values (@F_FieldType,@F_FieldId,@F_Name,@F_DBTypeName,@F_DBFieldName)";
83 83
             return DbHelperSQL.ExecuteSql(sql, new SqlParameter[] {
84 84
                 new SqlParameter("@F_FieldType",model.F_FieldType),
85 85
                 new SqlParameter("@F_FieldId",model.F_FieldId),

+ 54 - 0
CallCenterApi/CallCenterApi.DAL/T_Sys_BanCallOut.cs

@@ -0,0 +1,54 @@
1
+using CallCenterApi.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data.SqlClient;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+
9
+namespace CallCenterApi.DAL
10
+{
11
+    public class T_Sys_BanCallOut
12
+    {
13
+        public bool Add(Model.T_Sys_BanCallOut model)
14
+        {
15
+            var sql = "insert into T_Sys_BanCallOut (F_DeptId,StartTime1,StartTime2,EndTime1,EndTime2) values (@F_DeptId,@StartTime1,@StartTime2,@EndTime1,@EndTime2)";
16
+            return DbHelperSQL.ExecuteSql(sql, new SqlParameter[] {
17
+               new SqlParameter("@F_DeptId", model.F_DeptId),
18
+               new SqlParameter("@StartTime1", model.StartTime1),
19
+               new SqlParameter("@EndTime1", model.EndTime1),
20
+               new SqlParameter("@StartTime2", model.StartTime2),
21
+               new SqlParameter("@EndTime2", model.EndTime2)
22
+            }) > 0;
23
+        }
24
+        public bool Update(Model.T_Sys_BanCallOut model)
25
+        {
26
+            var sql = "update T_Sys_BanCallOut set StartTime1=@StartTime1,EndTime1=@EndTime1,StartTime2=@StartTime2,EndTime=@EndTime2 where F_Id=@F_Id ";
27
+            return DbHelperSQL.ExecuteSql(sql, new SqlParameter[] {
28
+               new SqlParameter("@F_Id", model.F_Id),
29
+               new SqlParameter("@StartTime1", model.StartTime1),
30
+               new SqlParameter("@EndTime1", model.EndTime1),
31
+               new SqlParameter("@StartTime2", model.StartTime2),
32
+               new SqlParameter("@EndTime2", model.EndTime2)
33
+            }) > 0;
34
+        }
35
+        public Model.T_Sys_BanCallOut GetModel(int deptId)
36
+        {
37
+            Model.T_Sys_BanCallOut model = new Model.T_Sys_BanCallOut();
38
+            var sql = "select F_Id,F_DeptId,StartTime1,StartTime2,EndTime1,EndTime2	from T_Sys_BanCallOut where F_DeptId ";
39
+            var dt = DbHelperSQL.Query(sql, new SqlParameter("@F_DeptId", deptId)).Tables[0];
40
+            if (dt.Rows.Count > 0)
41
+            {
42
+                model.F_Id = dt.Rows[0]["F_Id"] == DBNull.Value ? 0 : Convert.ToInt32(dt.Rows[0]["F_Id"]);
43
+                model.F_DeptId = dt.Rows[0]["F_DeptId"] == DBNull.Value ? 0 : Convert.ToInt32(dt.Rows[0]["F_DeptId"].ToString());
44
+                model.StartTime1 = dt.Rows[0]["StartTime1"] == DBNull.Value ? null : (DateTime?)DateTime.Parse(dt.Rows[0]["StartTime1"].ToString());
45
+                model.StartTime2 = dt.Rows[0]["StartTime2"] == DBNull.Value ? null : (DateTime?)DateTime.Parse(dt.Rows[0]["StartTime2"].ToString());
46
+                model.EndTime1 = dt.Rows[0]["EndTime1"] == DBNull.Value ? null : (DateTime?)DateTime.Parse(dt.Rows[0]["EndTime1"].ToString());
47
+                model.EndTime2 = dt.Rows[0]["EndTime2"] == DBNull.Value ? null : (DateTime?)DateTime.Parse(dt.Rows[0]["EndTime2"].ToString());
48
+                return model;
49
+            }
50
+            return null;
51
+
52
+        }
53
+    }
54
+}

+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -331,6 +331,7 @@
331 331
     <Compile Include="Models\Input\RegionCategoryInput.cs" />
332 332
     <Compile Include="Models\Input\RoleInput.cs" />
333 333
     <Compile Include="Models\Input\SeatGroupInput.cs" />
334
+    <Compile Include="Models\Input\SysBanCallOutInput.cs" />
334 335
     <Compile Include="Models\Input\SysConfigInput.cs" />
335 336
     <Compile Include="Models\Input\UserAccountInput.cs" />
336 337
     <Compile Include="Properties\AssemblyInfo.cs" />

+ 2 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/BanCallOutController.cs

@@ -70,7 +70,7 @@ namespace CallCenterApi.Interface.Controllers.callout
70 70
             if (ids == null || ids.Length <= 0)
71 71
                 return Error("请选择需要删除的项");
72 72
             var idsStr = string.Join(",", ids);
73
-            banCallOutBLL.deleteBatch(idsStr);
73
+            banCallOutBLL.DeleteBatch(idsStr);
74 74
             return Success("删除成功");
75 75
         }
76 76
         #endregion
@@ -128,7 +128,7 @@ namespace CallCenterApi.Interface.Controllers.callout
128 128
             if (ids == null || ids.Length <= 0)
129 129
                 return Error("请选择需要删除的项");
130 130
             var idsStr = string.Join(",", ids);
131
-            banCallOutBLL.deleteBatch(idsStr);
131
+            banCallOutBLL.DeleteBatch(idsStr);
132 132
             return Success("删除成功");
133 133
         }
134 134
         #endregion

+ 45 - 5
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallOutLimitController.cs

@@ -1,4 +1,6 @@
1
-using System;
1
+using CallCenterApi.Interface.Controllers.Base;
2
+using CallCenterApi.Interface.Models.Input;
3
+using System;
2 4
 using System.Collections.Generic;
3 5
 using System.Linq;
4 6
 using System.Web;
@@ -6,12 +8,50 @@ using System.Web.Mvc;
6 8
 
7 9
 namespace CallCenterApi.Interface.Controllers.callout
8 10
 {
9
-    public class CallOutLimitController : Controller
11
+    public class CallOutLimitController : BaseController
10 12
     {
11
-        // GET: CallOutLimit
12
-        public ActionResult Index()
13
+        private readonly BLL.T_Sys_BanCallOut banCallOutBLL = new BLL.T_Sys_BanCallOut();
14
+        public ActionResult GetModel()
13 15
         {
14
-            return View();
16
+            var deptId = CurrentUser.UserData.F_DeptId;
17
+            var model = banCallOutBLL.GetModel(deptId);
18
+            return Success("获取成功", new
19
+            {
20
+                id = model?.F_Id ?? 0,
21
+                deptid = model?.F_DeptId ?? 0,
22
+                starttime1 = model?.StartTime1.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
23
+                starttime2 = model?.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
24
+                endtime1 = model?.EndTime1.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
25
+                endtime2 = model?.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
26
+            });
27
+        }
28
+
29
+        public ActionResult CreateOrUpdate(SysBanCallOutInput input)
30
+        {
31
+            Model.T_Sys_BanCallOut model = banCallOutBLL.GetModel(CurrentUser.UserData.F_DeptId);
32
+            if (input.F_Id <= 0)
33
+            {
34
+                if (model != null)
35
+                    return Error("已经存在该条数据");
36
+                model.F_DeptId = CurrentUser.UserData.F_DeptId;
37
+                model.StartTime1 = input.StartTime1;
38
+                model.EndTime1 = input.EndTime1;
39
+                model.StartTime2 = input.StartTime2;
40
+                model.EndTime2 = input.EndTime2;
41
+                if (banCallOutBLL.Add(model))
42
+                    return Success("添加成功");
43
+                return Error("添加失败");
44
+            }
45
+
46
+            if (model == null)
47
+                return Error("该条数据不存在");
48
+            model.StartTime1 = input.StartTime1;
49
+            model.EndTime1 = input.EndTime1;
50
+            model.StartTime2 = input.StartTime2;
51
+            model.EndTime2 = input.EndTime2;
52
+            if (banCallOutBLL.Update(model))
53
+                return Success("修改成功");
54
+            return Error("修改失败");
15 55
         }
16 56
     }
17 57
 }

+ 9 - 8
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerFieldController.cs

@@ -57,7 +57,9 @@ namespace CallCenterApi.Interface.Controllers.customer
57 57
             if (input.Id <= 0 && input.AttributeId > 0)
58 58
             {
59 59
                 attrModel = entityAttrBLL.GetModel(input.AttributeId);
60
-                model.F_FieldId = 1;
60
+                if (attrModel == null)
61
+                    return Error("该条记录不存在");
62
+                model.F_FieldId = attrModel.F_AttributeId;
61 63
                 model.F_FieldType = attrModel.F_EntityId;
62 64
                 model.F_Name = attrModel.F_Name;
63 65
                 model.F_DBFieldName = attrModel.F_DBFieldlName;
@@ -73,13 +75,12 @@ namespace CallCenterApi.Interface.Controllers.customer
73 75
                 if (model == null)
74 76
                     return Error("该条记录不存在");
75 77
                 model.F_Name = string.IsNullOrWhiteSpace(input.Name) ? model.F_Name : input.Name;
76
-                model.F_Sort = input.Sort > 0 ? input.Sort : model.F_Sort;
77
-                model.F_CharLength = input.CharLength > 0 ? input.CharLength : model.F_CharLength;
78
-                model.F_IsNecessary = input.IsNecessary > 0 ? input.IsNecessary : model.F_IsNecessary;
79
-                model.F_IsExportOrInput = input.IsExportOrInput > 0 ? input.IsExportOrInput : model.F_IsExportOrInput;
80
-                model.F_IsShowOnList = input.IsShowOnList > 0 ? input.IsShowOnList : model.F_IsShowOnList;
81
-                model.F_IsShowOnScrean = input.IsShowOnScrean > 0 ? input.IsShowOnScrean : model.F_IsShowOnScrean;
82
-                model.F_Search = input.Search > 0 ? input.Search : model.F_Search;
78
+                model.F_Sort = input.Sort != model.F_Sort ? input.Sort : model.F_Sort;
79
+                model.F_IsNecessary = input.IsNecessary != model.F_IsNecessary ? input.IsNecessary : model.F_IsNecessary;
80
+                model.F_IsExportOrInput = input.IsExportOrInput != model.F_IsExportOrInput ? input.IsExportOrInput : model.F_IsExportOrInput;
81
+                model.F_IsShowOnList = input.IsShowOnList != model.F_IsShowOnList ? input.IsShowOnList : model.F_IsShowOnList;
82
+                model.F_IsShowOnScrean = input.IsShowOnScrean != model.F_IsShowOnScrean ? input.IsShowOnScrean : model.F_IsShowOnScrean;
83
+                model.F_Search = input.Search != model.F_Search ? input.Search : model.F_Search;
83 84
 
84 85
 
85 86
                 if (customerFieldBLL.Update(model))

+ 17 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/SysBanCallOutInput.cs

@@ -0,0 +1,17 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+
6
+namespace CallCenterApi.Interface.Models.Input
7
+{
8
+    public class SysBanCallOutInput
9
+    {
10
+        public int F_Id { get; set; } = 0;
11
+        public int F_DeptId { get; set; } = 0;
12
+        public DateTime? StartTime1 { get; set; }
13
+        public DateTime? EndTime1 { get; set; }
14
+        public DateTime? StartTime2 { get; set; }
15
+        public DateTime? EndTime2 { get; set; }
16
+    }
17
+}

+ 1 - 0
CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

@@ -96,6 +96,7 @@
96 96
     <Compile Include="T_SMS_SendSMSTask.cs" />
97 97
     <Compile Include="T_SMS_SentSMS.cs" />
98 98
     <Compile Include="T_SMS_Template.cs" />
99
+    <Compile Include="T_Sys_BanCallOut.cs" />
99 100
     <Compile Include="T_Sys_BanCallOutTime.cs" />
100 101
     <Compile Include="T_Sys_Department.cs" />
101 102
     <Compile Include="T_Sys_DictionaryBase.cs" />

+ 19 - 0
CallCenterApi/CallCenterApi.Model/T_Sys_BanCallOut.cs

@@ -0,0 +1,19 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    public class T_Sys_BanCallOut
10
+    {
11
+        public int F_Id { get; set; }
12
+        public int F_DeptId { get; set; }
13
+        public DateTime? StartTime1 { get; set; }
14
+        public DateTime? EndTime1 { get; set; }
15
+        public DateTime? StartTime2 { get; set; }
16
+        public DateTime? EndTime2 { get; set; }
17
+
18
+    }
19
+}