|
|
@@ -18,15 +18,17 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.TaskManagement
|
|
18
|
18
|
[Route("api/[controller]")]
|
|
19
|
19
|
public class TaskManagementController : BaseController
|
|
20
|
20
|
{
|
|
|
21
|
+ private readonly ISMS_InternalMessagesReposytory _sys_internalMessagesrepository;
|
|
21
|
22
|
private readonly ISys_UserAccountRepository _sys_useraccountRepository;
|
|
22
|
23
|
private readonly ISys_TaskManagementRepository _sys_taskmanagement_Repository;
|
|
23
|
24
|
private readonly ISys_DepartmentRepository _sys_departmentRepository;
|
|
24
|
25
|
public TaskManagementController(ISys_TaskManagementRepository sys_taskmanagement_Repository, ISys_DepartmentRepository sys_departmentRepository,
|
|
25
|
|
- ISys_UserAccountRepository sys_useraccountRepository)
|
|
|
26
|
+ ISys_UserAccountRepository sys_useraccountRepository, ISMS_InternalMessagesReposytory sys_internalMessagesrepository)
|
|
26
|
27
|
{
|
|
27
|
28
|
_sys_taskmanagement_Repository = sys_taskmanagement_Repository;
|
|
28
|
29
|
_sys_departmentRepository = sys_departmentRepository;
|
|
29
|
30
|
_sys_useraccountRepository = sys_useraccountRepository;
|
|
|
31
|
+ _sys_internalMessagesrepository = sys_internalMessagesrepository;
|
|
30
|
32
|
}
|
|
31
|
33
|
/// <summary>
|
|
32
|
34
|
/// 添加任务
|
|
|
@@ -61,9 +63,30 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.TaskManagement
|
|
61
|
63
|
input.F_CreateTime = DateTime.Now;
|
|
62
|
64
|
input.F_CreateUser = user;
|
|
63
|
65
|
input.F_IsDelete = 0;
|
|
|
66
|
+
|
|
|
67
|
+
|
|
|
68
|
+
|
|
64
|
69
|
var res = await _sys_taskmanagement_Repository.Add(input);
|
|
65
|
70
|
if (res > 0)
|
|
66
|
71
|
{
|
|
|
72
|
+ try
|
|
|
73
|
+ {
|
|
|
74
|
+ DateTime time = DateTime.Parse(input.F_Remindertime.ToString());
|
|
|
75
|
+ if (input .F_Tasker >0)
|
|
|
76
|
+ {
|
|
|
77
|
+ string usercode = _sys_useraccountRepository.GetSingle(x => x.F_UserId == input.F_Tasker).Result.F_UserCode;
|
|
|
78
|
+ bool n = new InternalMessages.InternalMessagesController(_sys_internalMessagesrepository, _sys_useraccountRepository).AddInternalMessagesInfo(res, "任务提醒", input.F_Name + "任务提醒", user, time, 1, 1, 0, usercode, 1);
|
|
|
79
|
+ }
|
|
|
80
|
+ else
|
|
|
81
|
+ {
|
|
|
82
|
+ bool n = new InternalMessages.InternalMessagesController(_sys_internalMessagesrepository, _sys_useraccountRepository).AddInternalMessagesInfo(res, "任务提醒", input.F_Name + "任务提醒", user, time, 1, 1, int.Parse(input.F_Deptid.Split(',')[input.F_Deptid.Split(',').Length - 1]), "", 0);
|
|
|
83
|
+ }
|
|
|
84
|
+
|
|
|
85
|
+ }
|
|
|
86
|
+ catch
|
|
|
87
|
+ {
|
|
|
88
|
+
|
|
|
89
|
+ }
|
|
67
|
90
|
return Success("添加成功");
|
|
68
|
91
|
}
|
|
69
|
92
|
else
|
|
|
@@ -112,9 +135,63 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.TaskManagement
|
|
112
|
135
|
// model.F_UpdateUser = "8000";
|
|
113
|
136
|
var b = await _sys_taskmanagement_Repository.Update(input);
|
|
114
|
137
|
if (b)
|
|
|
138
|
+ {
|
|
|
139
|
+ DateTime time = DateTime.Parse(input.F_Remindertime.ToString());
|
|
|
140
|
+ var InternalMessages = _sys_internalMessagesrepository.GetSingle(x => x.F_ID == model.F_ID).Result;
|
|
|
141
|
+ if (InternalMessages!=null )
|
|
|
142
|
+ {
|
|
|
143
|
+ try
|
|
|
144
|
+ {
|
|
|
145
|
+ if (input.F_Tasker > 0)
|
|
|
146
|
+ {
|
|
|
147
|
+ string usercode = _sys_useraccountRepository.GetSingle(x => x.F_UserId == input.F_Tasker).Result.F_UserCode;
|
|
|
148
|
+ InternalMessages.SMS_Content = input.F_Name + "任务提醒";
|
|
|
149
|
+ InternalMessages.SMS_Remindertime = input.F_Remindertime;
|
|
|
150
|
+ InternalMessages.SMS_ReceiveUserCode = usercode;
|
|
|
151
|
+ bool n = await _sys_internalMessagesrepository.Update(InternalMessages);
|
|
|
152
|
+ }
|
|
|
153
|
+ else
|
|
|
154
|
+ {
|
|
|
155
|
+ InternalMessages.SMS_Content = input.F_Name + "任务提醒";
|
|
|
156
|
+ InternalMessages.SMS_Remindertime = input.F_Remindertime;
|
|
|
157
|
+ InternalMessages.SMS_Deptid = int.Parse(input.F_Deptid.Split(',')[input.F_Deptid.Split(',').Length - 1]);
|
|
|
158
|
+ bool n = await _sys_internalMessagesrepository.Update(InternalMessages);
|
|
|
159
|
+ }
|
|
|
160
|
+ }
|
|
|
161
|
+ catch
|
|
|
162
|
+ {
|
|
|
163
|
+
|
|
|
164
|
+ }
|
|
|
165
|
+
|
|
|
166
|
+ }
|
|
|
167
|
+ else
|
|
|
168
|
+ {
|
|
|
169
|
+ try
|
|
|
170
|
+ {
|
|
|
171
|
+ if (input.F_Tasker > 0)
|
|
|
172
|
+ {
|
|
|
173
|
+ string usercode = _sys_useraccountRepository.GetSingle(x => x.F_UserId == input.F_Tasker).Result.F_UserCode;
|
|
|
174
|
+ bool n = new InternalMessages.InternalMessagesController(_sys_internalMessagesrepository, _sys_useraccountRepository).AddInternalMessagesInfo(model.F_ID, "任务提醒", input.F_Name + "任务提醒", user, time, 1, 1, 0, usercode, 1);
|
|
|
175
|
+ }
|
|
|
176
|
+ else
|
|
|
177
|
+ {
|
|
|
178
|
+ bool n = new InternalMessages.InternalMessagesController(_sys_internalMessagesrepository, _sys_useraccountRepository).AddInternalMessagesInfo(model.F_ID, "任务提醒", input.F_Name + "任务提醒", user, time, 1, 1, int.Parse(input.F_Deptid.Split(',')[input.F_Deptid.Split(',').Length - 1]), "", 0);
|
|
|
179
|
+ }
|
|
|
180
|
+ }
|
|
|
181
|
+ catch
|
|
|
182
|
+ {
|
|
|
183
|
+
|
|
|
184
|
+ }
|
|
|
185
|
+
|
|
|
186
|
+ }
|
|
|
187
|
+
|
|
|
188
|
+
|
|
115
|
189
|
return Success("修改成功");
|
|
|
190
|
+ }
|
|
|
191
|
+
|
|
116
|
192
|
return Error("修改失败");
|
|
117
|
193
|
}
|
|
|
194
|
+
|
|
118
|
195
|
/// <summary>
|
|
119
|
196
|
/// 删除任务
|
|
120
|
197
|
/// </summary>
|