| | |
| | | /// <param name="pageIndex"></param> |
| | | /// <param name="pageSize"></param> |
| | | /// <param name="searchKeyword"></param> |
| | | /// <returns></returns> |
| | | /// <returns></returns>(这个没有用到了) |
| | | public WebResponseContent PersonnelMonitoring(PaginationDTO pagination) |
| | | { |
| | | try |
| | |
| | | query=query.OrderByDescending((a, b) => b.Creater); |
| | | } |
| | | |
| | | // 如果不是管理员,根据部门过滤 |
| | | if (pagination.account != "admin") |
| | | { |
| | | var currentUser = _user.Db.Queryable<Sys_User>() |
| | | .Where(u => u.UserName == pagination.account) |
| | | .First(); |
| | | |
| | | if (currentUser == null) |
| | | { |
| | | return new WebResponseContent { Status = false, Data = "未获取到用户信息" }; |
| | | } |
| | | |
| | | int? deptId = currentUser.Dept_Id; |
| | | |
| | | query = query.Where((a, b) => a.Dept_Id == deptId); |
| | | } |
| | | |
| | | |
| | | //返回结果 |
| | | var result = query.Select((a, b) => new |
| | | { |
| | |
| | | maint.MaintenanceStatus = 0;//更改状态 |
| | | BaseDal.UpdateData(maint); |
| | | ////插入记录表 |
| | | //var recording = new Dt_MaintenanceTeam //添加记录 |
| | | //{ |
| | | // OperatorName = sysuer.UserTrueName, |
| | | // TeamName = sysuer.RoleName, |
| | | // DistributionTime = DateTime.Now, |
| | | // EndTime=DateTime.Now, |
| | | //}; |
| | | //_team.AddData(recording); |
| | | var recording = new Dt_MaintenanceTeam //添加记录 |
| | | { |
| | | OperatorName = sysuer.UserTrueName, |
| | | TeamName = sysuer.RoleName, |
| | | EndTime = DateTime.Now, |
| | | }; |
| | | _team.AddData(recording); |
| | | |
| | | return new WebResponseContent { Status = true, Data = maint, Message = "完成检修" }; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 展示开始检修人员 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent YShowStartTake() |
| | | { |
| | | try |
| | | { |
| | | var reslut=BaseDal.QueryData(x => x.MaintenanceStatus == 1).ToList(); |
| | | if (reslut.Count<=0) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "还没有人开始检修" }; |
| | | } |
| | | return new WebResponseContent { Status = true, Data = reslut,Message="检修人员有以下" }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | return new WebResponseContent { Status = false, Message = ex.Message }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 状态枚举 |
| | | /// </summary> |