|
|
@@ -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
|
}
|