获取大屏总数
This commit is contained in:
parent
73ae04e7e3
commit
8b0d4a0409
@ -117,6 +117,18 @@ namespace DOAN.WebApi.Controllers.MES.dev
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取大屏总数
|
||||
/// </summary>
|
||||
/// <param name="devicedefault"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("getAllTotal")]
|
||||
public IActionResult GetAllTotal()
|
||||
{
|
||||
|
||||
var response = deviceDataAnalysisServcie.GetAllTotal();
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ namespace ZR.Model.MES.dev
|
||||
/// <summary>
|
||||
/// 检查项状态
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
|
||||
@ -112,6 +112,37 @@ namespace ZR.Model.MES.dev.Dto
|
||||
public PersonnelResponse_Series SeriesData { get; set; }
|
||||
}
|
||||
|
||||
public class FullScreenTotal
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备可用数量
|
||||
/// </summary>
|
||||
public int UseDeviceTotal { get; set; }
|
||||
/// <summary>
|
||||
/// 设备停机中
|
||||
/// </summary>
|
||||
public int UnUseDeviceTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 累计任务数
|
||||
/// </summary>
|
||||
public int TaskTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 累计任务完成数
|
||||
/// </summary>
|
||||
public int FinishTaskTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 累计报修数
|
||||
/// </summary>
|
||||
public int RepairTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 累计维护数
|
||||
/// </summary>
|
||||
public int FinishRepairTotal { get; set; }
|
||||
}
|
||||
|
||||
public class PersonnelResponse_Series
|
||||
{
|
||||
|
||||
@ -10,6 +10,7 @@ using System.Linq;
|
||||
using ZR.Model.MES.dev;
|
||||
using ZR.Model.MES.dev.Dto;
|
||||
using ZR.Service.MES.dev.IService;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Service.MES.dev
|
||||
{
|
||||
@ -65,23 +66,30 @@ namespace ZR.Service.MES.dev
|
||||
|
||||
public PagedInfo<DeviceAccountDto> GetList_Route(DeviceAccountQueryDto2 parm)
|
||||
{
|
||||
|
||||
var predicate = Expressionable.Create<DeviceAccount, DeviceRelRpAt>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.DeviceName), (a, r) => a.DeviceName.Contains(parm.DeviceName))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.DeviceSpecification), (a, r) => a.DeviceSpecification.Contains(parm.DeviceSpecification))
|
||||
.And((a, r) => a.Status == 1)
|
||||
.AndIF(parm.FkDeviceType > 0, (a, r) => a.FkDeviceType == parm.FkDeviceType)
|
||||
.AndIF(parm.Flag == 1, (a, r) => r.FkRouteInspectionPlanId == parm.fkRouteInspectionPlanId)
|
||||
.AndIF(parm.Flag == 0, (a, r) => r.FkRouteInspectionPlanId != parm.fkRouteInspectionPlanId || r.FkRouteInspectionPlanId == null)
|
||||
.And((a, r) => r.FkRouteInspectionPlanId == parm.fkRouteInspectionPlanId)
|
||||
;
|
||||
|
||||
|
||||
var response = Context.Queryable<DeviceAccount>()
|
||||
var temp = Context.Queryable<DeviceAccount>()
|
||||
.LeftJoin<DeviceRelRpAt>((a, r) => a.Id == r.FkDeviceAccountId)
|
||||
.Where(predicate.ToExpression())
|
||||
.Select((a, r) => a)
|
||||
.Where(predicate.ToExpression()).Select((a, r) => a);
|
||||
if (parm.Flag == 0)
|
||||
{
|
||||
int[] exist= temp.Select(a => a.Id).ToArray();
|
||||
temp=Context.Queryable<DeviceAccount>().Where(it => !exist.Contains(it.Id));
|
||||
}
|
||||
|
||||
|
||||
var reponse = temp
|
||||
.ToPage<DeviceAccount, DeviceAccountDto>(parm);
|
||||
|
||||
return response;
|
||||
return reponse;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -578,5 +578,37 @@ namespace ZR.Service.MES.dev
|
||||
lastMondayMidnight = inputDateTime.Date.AddDays(-daysToSubtract).AddDays(-7).Date; // Last Monday midnight
|
||||
lastSundayMidnight = lastMondayMidnight.AddDays(6).AddHours(23).AddMinutes(59).AddSeconds(59); // Last Sunday midnight
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取大屏总数
|
||||
/// </summary>
|
||||
/// <param name="devicedefault"></param>
|
||||
/// <returns></returns>
|
||||
public FullScreenTotal GetAllTotal()
|
||||
{
|
||||
FullScreenTotal screenTotal = new FullScreenTotal();
|
||||
//设备可用数
|
||||
screenTotal.UseDeviceTotal = Context.Queryable<DeviceAccount>().Where(it => it.Status == 1).Count();
|
||||
|
||||
|
||||
//设备停机数
|
||||
screenTotal.UnUseDeviceTotal = Context.Queryable<DeviceAccount>().Where(it => it.Status == 0).Count();
|
||||
|
||||
// 累计任务数
|
||||
screenTotal.TaskTotal = Context.Queryable<DeviceTaskExecute>().Count();
|
||||
|
||||
//累计任务完成数
|
||||
screenTotal.FinishTaskTotal= Context.Queryable<DeviceTaskExecute>().Where(it => it.Status == 0).Count();
|
||||
|
||||
//累计报修数
|
||||
screenTotal.RepairTotal = Context.Queryable<DeviceRepair>().Count();
|
||||
|
||||
//累计维护数
|
||||
screenTotal.FinishRepairTotal = Context.Queryable<DeviceRepair>().Where(it=>it.Status==2).Count();
|
||||
|
||||
return screenTotal;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,6 +92,7 @@ namespace ZR.Service.MES.dev
|
||||
/// <returns></returns>
|
||||
public DeviceInspect AddDeviceInspect(DeviceInspect model)
|
||||
{
|
||||
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,8 @@ namespace ZR.Service.MES.dev.IService
|
||||
|
||||
TaskLineResultDto TaskLinebyDay(DeviceDefaultDto devicedefault);
|
||||
PersonnelResponseResultDto PersonResponse(DeviceDefaultDto devicedefault);
|
||||
FullScreenTotal GetAllTotal();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user