|
|
@@ -239,6 +239,9 @@ namespace CallCenterApi.Interface.Controllers
|
|
239
|
239
|
int userId = CurrentUser.UserData.F_UserId;
|
|
240
|
240
|
string usercode = CurrentUser.UserData.F_UserCode;
|
|
241
|
241
|
int roleid = CurrentUser.UserData.F_RoleId;
|
|
|
242
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
243
|
+ if (userModel == null)
|
|
|
244
|
+ return Error("无操作权限");
|
|
242
|
245
|
if (userId != 0)
|
|
243
|
246
|
{
|
|
244
|
247
|
var date = DateTime.Now;
|
|
|
@@ -246,11 +249,17 @@ namespace CallCenterApi.Interface.Controllers
|
|
246
|
249
|
string strMonth = date.ToString("yyyy-MM");
|
|
247
|
250
|
|
|
248
|
251
|
string uwhere = " 1=1 ";
|
|
249
|
|
- if (roleid != 17)
|
|
250
|
|
- {
|
|
251
|
|
- uwhere += " and UserCode='" + usercode + "' ";
|
|
252
|
|
- }
|
|
253
|
|
-
|
|
|
252
|
+
|
|
|
253
|
+ if (roleid == 17)
|
|
|
254
|
+ {
|
|
|
255
|
+ if (!string.IsNullOrEmpty(userModel.groupcode))
|
|
|
256
|
+ {
|
|
|
257
|
+ uwhere += " and groupcode = '" + userModel.groupcode + "' ";
|
|
|
258
|
+ }
|
|
|
259
|
+ }
|
|
|
260
|
+ else
|
|
|
261
|
+ uwhere += " and UserCode='" + userModel.F_UserCode + "'";
|
|
|
262
|
+
|
|
254
|
263
|
BLL.T_Call_CallRecords bll = new BLL.T_Call_CallRecords();
|
|
255
|
264
|
//var dayinlist = bll.GetModelList(uwhere + " and CallType='0' and CONVERT(varchar(10),BeginTime, 23)='" + strDate + "' and CallState='1' ");
|
|
256
|
265
|
//var dayoutlist = bll.GetModelList(uwhere + " and CallType='1' and CONVERT(varchar(10),BeginTime, 23)='" + strDate + "' and CallState='1' ");
|
|
|
@@ -379,30 +388,30 @@ namespace CallCenterApi.Interface.Controllers
|
|
379
|
388
|
var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
|
|
380
|
389
|
string strDate = date.ToString("yyyy-MM-dd");
|
|
381
|
390
|
string strMonth = date.ToString("yyyy-MM");
|
|
382
|
|
-
|
|
|
391
|
+
|
|
383
|
392
|
//BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
|
|
384
|
393
|
//var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
|
|
385
|
394
|
//var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
|
|
386
|
395
|
//var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
|
|
387
|
396
|
//var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
|
|
388
|
397
|
|
|
389
|
|
- string uwhere = " 1=1 AND CONVERT(char(7),F_CreateTime,20) = '" + strMonth + "'"; ;
|
|
390
|
|
- if (userModel.rolecode != "XTGLY")
|
|
|
398
|
+ string uwhere = " 1=1 "; ;
|
|
|
399
|
+ if (!string.IsNullOrEmpty(userModel.groupcode))
|
|
391
|
400
|
{
|
|
392
|
|
- uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
|
|
|
401
|
+ uwhere += " and F_GroupCode = '" + userModel.groupcode + "' ";
|
|
393
|
402
|
}
|
|
394
|
403
|
|
|
395
|
|
-
|
|
|
404
|
+
|
|
396
|
405
|
//var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
|
|
397
|
406
|
//var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
|
|
398
|
407
|
//var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
|
|
399
|
408
|
//var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
|
|
400
|
409
|
|
|
401
|
410
|
BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
|
|
402
|
|
- var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
|
|
403
|
|
- var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
|
|
404
|
|
- var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
|
|
405
|
|
- var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
|
|
|
411
|
+ var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in(1) and F_IsDelete=0 ").Tables[0];
|
|
|
412
|
+ var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in (0) and F_IsDelete=0 ").Tables[0];
|
|
|
413
|
+ var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in(1) and F_IsDelete=0 ").Tables[0];
|
|
|
414
|
+ var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in (0) and F_IsDelete=0 ").Tables[0];
|
|
406
|
415
|
|
|
407
|
416
|
var obj = new
|
|
408
|
417
|
{
|
|
|
@@ -588,6 +597,10 @@ namespace CallCenterApi.Interface.Controllers
|
|
588
|
597
|
#region 权限限制
|
|
589
|
598
|
string sql = " F_IsDelete=0 ";
|
|
590
|
599
|
sql += " and F_CreateUser = '" + ua.F_UserCode + "' ";
|
|
|
600
|
+ if (!string.IsNullOrEmpty(ua.groupcode))
|
|
|
601
|
+ {
|
|
|
602
|
+ sql += " and F_GroupCode = '" + ua.groupcode + "' ";
|
|
|
603
|
+ }
|
|
591
|
604
|
#endregion
|
|
592
|
605
|
#region 工单各状态下数量
|
|
593
|
606
|
BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
|