|
|
@@ -15,7 +15,7 @@ namespace CallCenterApi.Interface.Controllers.callout
|
|
15
|
15
|
{
|
|
16
|
16
|
private readonly BLL.T_Call_BanCallOut banCallOutBLL = new BLL.T_Call_BanCallOut();
|
|
17
|
17
|
private readonly BLL.T_Sys_BanCallOutTime banCallOutTimeBLL = new BLL.T_Sys_BanCallOutTime();
|
|
18
|
|
-
|
|
|
18
|
+ private readonly BLL.T_Sys_BanCallOut sysBanCallOutBLL = new BLL.T_Sys_BanCallOut();
|
|
19
|
19
|
|
|
20
|
20
|
#region 禁止外呼号码管理
|
|
21
|
21
|
public ActionResult GetList(FilterBanCallOut filter)
|
|
|
@@ -76,60 +76,47 @@ namespace CallCenterApi.Interface.Controllers.callout
|
|
76
|
76
|
#endregion
|
|
77
|
77
|
|
|
78
|
78
|
#region 限制外呼时间管理
|
|
79
|
|
- public ActionResult GetBanCallOutTimeList(FilterBanCallOut filter)
|
|
|
79
|
+ public ActionResult GetModel()
|
|
80
|
80
|
{
|
|
81
|
|
- StringBuilder sb = new StringBuilder();
|
|
82
|
|
- if (!string.IsNullOrWhiteSpace(filter.Phone))
|
|
83
|
|
- {
|
|
84
|
|
- sb.Append($" and F_Phone='{filter.Phone}'");
|
|
85
|
|
- }
|
|
86
|
|
- //if (filter.Start != null && filter.End != null)
|
|
87
|
|
- //{
|
|
88
|
|
- // sb.Append($" and F_Phone='{filter.Phone}'");
|
|
89
|
|
- //}
|
|
90
|
|
- var recordCount = 0;
|
|
91
|
|
- var dt = BLL.PagerBLL.GetListPager(
|
|
92
|
|
- "T_Sys_BanCallOut",
|
|
93
|
|
- "F_Id",
|
|
94
|
|
- "*",
|
|
95
|
|
- sb.ToString(),
|
|
96
|
|
- "ORDER BY F_ID desc",
|
|
97
|
|
- filter.PageSize,
|
|
98
|
|
- filter.PageIndex,
|
|
99
|
|
- true,
|
|
100
|
|
- out recordCount);
|
|
101
|
|
- List<Model.T_Sys_BanCallOutTime> modelList = new BLL.T_Sys_BanCallOutTime().DataTableToList(dt);
|
|
102
|
|
- var obj = new
|
|
|
81
|
+ var deptId = CurrentUser.UserData.F_DeptId;
|
|
|
82
|
+ var model = sysBanCallOutBLL.GetModel(deptId);
|
|
|
83
|
+ return Success("获取成功", new
|
|
103
|
84
|
{
|
|
104
|
|
- rows = modelList,
|
|
105
|
|
- total = recordCount
|
|
106
|
|
- };
|
|
107
|
|
- return Content(obj.ToJson());
|
|
|
85
|
+ id = model?.F_Id ?? 0,
|
|
|
86
|
+ deptid = model?.F_DeptId ?? 0,
|
|
|
87
|
+ starttime1 = model?.StartTime1.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
|
|
|
88
|
+ starttime2 = model?.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
|
|
|
89
|
+ endtime1 = model?.EndTime1.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
|
|
|
90
|
+ endtime2 = model?.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss ") ?? "",
|
|
|
91
|
+ });
|
|
108
|
92
|
}
|
|
109
|
93
|
|
|
110
|
|
- public ActionResult AddBanCallOutTime(BanCallOutInput input)
|
|
|
94
|
+ public ActionResult CreateOrUpdate(SysBanCallOutInput input)
|
|
111
|
95
|
{
|
|
112
|
|
- if (string.IsNullOrWhiteSpace(input.Phone))
|
|
113
|
|
- return Error("号码不可为空");
|
|
114
|
|
- var model = banCallOutBLL.GetModel(input.Phone);
|
|
115
|
|
- if (model != null)
|
|
116
|
|
- return Error("该号码已被限制外呼");
|
|
117
|
|
- if (banCallOutBLL.Add(new Model.T_Call_BanCallOut()
|
|
|
96
|
+ Model.T_Sys_BanCallOut model = sysBanCallOutBLL.GetModel(CurrentUser.UserData.F_DeptId);
|
|
|
97
|
+ if (input.F_Id <= 0)
|
|
118
|
98
|
{
|
|
119
|
|
- F_Phone = input.Phone,
|
|
120
|
|
- F_Remark = input.Remark
|
|
121
|
|
- }) > 0)
|
|
122
|
|
- return Success("添加成功");
|
|
123
|
|
- return Error("添加失败");
|
|
124
|
|
- }
|
|
|
99
|
+ if (model != null)
|
|
|
100
|
+ return Error("已经存在该条数据");
|
|
|
101
|
+ model.F_DeptId = CurrentUser.UserData.F_DeptId;
|
|
|
102
|
+ model.StartTime1 = input.StartTime1;
|
|
|
103
|
+ model.EndTime1 = input.EndTime1;
|
|
|
104
|
+ model.StartTime2 = input.StartTime2;
|
|
|
105
|
+ model.EndTime2 = input.EndTime2;
|
|
|
106
|
+ if (sysBanCallOutBLL.Add(model))
|
|
|
107
|
+ return Success("添加成功");
|
|
|
108
|
+ return Error("添加失败");
|
|
|
109
|
+ }
|
|
125
|
110
|
|
|
126
|
|
- public ActionResult DeleteBanCallOutTime(int[] ids)
|
|
127
|
|
- {
|
|
128
|
|
- if (ids == null || ids.Length <= 0)
|
|
129
|
|
- return Error("请选择需要删除的项");
|
|
130
|
|
- var idsStr = string.Join(",", ids);
|
|
131
|
|
- banCallOutBLL.DeleteBatch(idsStr);
|
|
132
|
|
- return Success("删除成功");
|
|
|
111
|
+ if (model == null)
|
|
|
112
|
+ return Error("该条数据不存在");
|
|
|
113
|
+ model.StartTime1 = input.StartTime1;
|
|
|
114
|
+ model.EndTime1 = input.EndTime1;
|
|
|
115
|
+ model.StartTime2 = input.StartTime2;
|
|
|
116
|
+ model.EndTime2 = input.EndTime2;
|
|
|
117
|
+ if (sysBanCallOutBLL.Update(model))
|
|
|
118
|
+ return Success("修改成功");
|
|
|
119
|
+ return Error("修改失败");
|
|
133
|
120
|
}
|
|
134
|
121
|
#endregion
|
|
135
|
122
|
|