Commit 77b1cfff by jiawei.su

someupdate

parent b0746d2a
......@@ -8,6 +8,8 @@ using Siger.Middlelayer.Repository.Repositories.Interface;
using Siger.ApiCommon.Filters;
using Siger.Middlelayer.AccRepository.Response;
using Siger.ApiCommon.Result;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Siger.ApiACC.Controllers
......@@ -71,6 +73,16 @@ namespace Siger.ApiACC.Controllers
result.Add(item);
}
var output = new ResponseMachineMonitor
{
sum=new ResponseAutomationMachineStatusTotal {
waittingTotal =result.Where(f=>f.status==(int)Automation.MachineStatus.Waiting).Count(),
produceTotal= result.Where(f => f.status == (int)Automation.MachineStatus.Produce).Count(),
complateTotal= result.Where(f => f.status == (int)Automation.MachineStatus.Complated).Count(),
disableTotal= result.Where(f => f.enable ==0).Count(),
},
dts=result
};
return new ObjectResult(result);
}
[HttpGet]
......
......@@ -18,4 +18,18 @@ namespace Siger.Middlelayer.AccRepository.Response
public int status { get; set; }
public string lastupdate { get; set; }
}
public class ResponseAutomationMachineStatusTotal
{
public int waittingTotal { get; set; }
public int produceTotal { get; set; }
public int complateTotal { get; set; }
public int disableTotal { get; set; }
}
public class ResponseMachineMonitor
{
public ResponseAutomationMachineStatusTotal sum { get; set; }
public List<ResponseAutomationMachineStatus> dts { get; set; }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment