smartScreen
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Service.MES.product.IService;
|
||||
using DOAN.Service.MES.SmartScreen.Product.IService;
|
||||
|
||||
namespace DOAN.Admin.WebApi.Controllers.MES.SmartScreen.Product
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 生产智慧屏
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/SmartScreen/Product")]
|
||||
public class ProductSmartScreenController : BaseController
|
||||
{
|
||||
|
||||
private readonly IProductSmartScreenService _productSmartScreenService;
|
||||
|
||||
public ProductSmartScreenController(IProductSmartScreenService productSmartScreenService)
|
||||
{
|
||||
_productSmartScreenService = productSmartScreenService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数字翻牌器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("digital_turntable")]
|
||||
public IActionResult DigitalTurntable()
|
||||
{
|
||||
var response= _productSmartScreenService.DigitalTurntable();
|
||||
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
98
DOAN.Model/MES/SmartScreen/EchartsDto.cs
Normal file
98
DOAN.Model/MES/SmartScreen/EchartsDto.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace DOAN.Model.MES.SmartScreen
|
||||
{
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// echarts 通用Options返回值
|
||||
/// </summary>
|
||||
public class EchartsOptions
|
||||
{
|
||||
public EchartsTitle Title { get; set; } = null;
|
||||
public EchartsXAxis XAxis { get; set; } = null;
|
||||
public EchartsYAxis YAxis { get; set; } = null;
|
||||
public List<EchartsSeries> Series { get; set; } = new List<EchartsSeries>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// echarts图表标题
|
||||
///</summary>
|
||||
public class EchartsTitle
|
||||
{
|
||||
public EchartsTitle(string Text,string SubText)
|
||||
{
|
||||
this.Text = Text;
|
||||
this.SubText = SubText;
|
||||
}
|
||||
|
||||
public EchartsTitle(){}
|
||||
public string Text { get; set; } = string.Empty;
|
||||
public string SubText { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// echarts X轴
|
||||
///</summary>
|
||||
public class EchartsXAxis
|
||||
{
|
||||
public List<string> Data { get; set; } = new List<string>();
|
||||
// public string[] Data { get; set; } =Array.Empty<string>();
|
||||
|
||||
// value 数值轴,适用于连续数据 category 类目轴,适用于离散的类目数据 time 时间轴,适用于连续的时序数据 log 对数轴。适用于对数数据
|
||||
public string Type { get; set; } = "category";
|
||||
public string Max { get; set; }
|
||||
public string Min { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// echarts Y轴
|
||||
///</summary>
|
||||
public class EchartsYAxis
|
||||
{
|
||||
public List<string> Data { get; set; } = new List<string>();
|
||||
|
||||
// value 数值轴,适用于连续数据 category 类目轴,适用于离散的类目数据 time 时间轴,适用于连续的时序数据 log 对数轴。适用于对数数据
|
||||
public string Type { get; set; } = "category";
|
||||
public string Max { get; set; }
|
||||
public string Min { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// echarts图表series返回值
|
||||
///</summary>
|
||||
public class EchartsSeries
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签名称
|
||||
/// </summary>
|
||||
public string Name { get; set; } = "category";
|
||||
|
||||
/// <summary>
|
||||
/// bar-柱状图 line-折线图 EchartsSeriesType enum结构
|
||||
/// </summary>
|
||||
public string Type { get; set; } = "bar";
|
||||
|
||||
/// <summary>
|
||||
/// 参数值
|
||||
/// </summary>
|
||||
public List<EchartsSeriesData> Data { get; set; } = new List<EchartsSeriesData>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// echarts图表series返回值内容
|
||||
///</summary>
|
||||
public class EchartsSeriesData
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签名称
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 参数值
|
||||
/// </summary>
|
||||
public decimal Value { get; set; } = new decimal();
|
||||
}
|
||||
}
|
||||
49
DOAN.Model/MES/SmartScreen/Product/DigitalTurntableModel.cs
Normal file
49
DOAN.Model/MES/SmartScreen/Product/DigitalTurntableModel.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.MES.SmartScreen.Product
|
||||
{
|
||||
/// <summary>
|
||||
/// 数字翻牌器
|
||||
/// </summary>
|
||||
public class DigitalTurntableModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 今日工单数
|
||||
/// </summary>
|
||||
public int WorkorderQuantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 今日已经完成工单数
|
||||
/// </summary>
|
||||
public int FinishedWorkorderQuantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 今日未完成工单数
|
||||
/// </summary>
|
||||
public int UnFinishedWorkorderQuantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 今日生产计划总数
|
||||
/// </summary>
|
||||
public int ProductionPlanQuantity { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 今日生产完成总数
|
||||
/// </summary>
|
||||
public int ProductionFinishQuantity { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 今天动用组数
|
||||
/// </summary>
|
||||
public int GroupQuantity { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Model.MES.SmartScreen.Product;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Service.MES.SmartScreen.Product.IService
|
||||
{
|
||||
public interface IProductSmartScreenService : IBaseService<ProWorkorder>
|
||||
{
|
||||
DigitalTurntableModel DigitalTurntable();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Service.MES.product.IService;
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DOAN.Service.MES.SmartScreen.Product.IService;
|
||||
using DOAN.Model.MES.SmartScreen.Product;
|
||||
|
||||
namespace DOAN.Service.MES.SmartScreen.Product
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产智慧屏
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProductSmartScreenService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProductSmartScreenService : BaseService<ProWorkorder>, IProductSmartScreenService
|
||||
{
|
||||
/// <summary>
|
||||
/// 数字翻牌器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public DigitalTurntableModel DigitalTurntable()
|
||||
{
|
||||
DigitalTurntableModel digital=new DigitalTurntableModel();
|
||||
digital.WorkorderQuantity = Context.Queryable<ProWorkorder>().Where(it=>it.WorkorderDate==DateTime.Today).Count();
|
||||
|
||||
digital.FinishedWorkorderQuantity=Context.Queryable<ProWorkorder>().Where(it => it.WorkorderDate == DateTime.Today)
|
||||
.Where(it=>it.Status==2)
|
||||
.Count();
|
||||
|
||||
digital.UnFinishedWorkorderQuantity = Context.Queryable<ProWorkorder>().Where(it => it.WorkorderDate == DateTime.Today)
|
||||
.Where(it => it.Status <2)
|
||||
.Count();
|
||||
|
||||
digital.ProductionPlanQuantity = Context.Queryable<ProWorkorder>().Where(it => it.WorkorderDate == DateTime.Today).Sum(it=>it.PlanNum??0);
|
||||
|
||||
|
||||
digital.ProductionFinishQuantity = Context.Queryable<ProReportwork01>().Where(it => it.JobDate >= DateTime.Today && it.JobDate < DateTime.Today.AddDays(1))
|
||||
.Where(it => it.ProcessId == 90).Sum(it => it.FinishNum??0);
|
||||
|
||||
|
||||
digital.GroupQuantity=Context.Queryable<ProWorkorder>().Where(it => it.WorkorderDate == DateTime.Today).GroupBy(it=>it.GroupCode).Count();
|
||||
|
||||
|
||||
return digital;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||
|
||||
string NickName= Context.Queryable<SysUser>().Where(it=>it.UserName==Worker).Select(it=>it.NickName).First();
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker : NickName;
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName;
|
||||
if (Exist)
|
||||
{
|
||||
result = Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId)
|
||||
@@ -86,7 +86,7 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
||||
int result = 0;
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == process).Any();
|
||||
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Worker).Select(it => it.NickName).First();
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker : NickName;
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName;
|
||||
if (Exist)
|
||||
{
|
||||
result = Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == process)
|
||||
@@ -132,7 +132,7 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
||||
int result = 0;
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Worker).Select(it => it.NickName).First();
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker : NickName;
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker+"|异常人员|" : NickName;
|
||||
if (Exist)
|
||||
{
|
||||
result = Context.Updateable<ProReportwork01>()
|
||||
|
||||
Reference in New Issue
Block a user