smartScreen

This commit is contained in:
qianhao.xu
2024-12-19 19:44:47 +08:00
parent dd534102c0
commit 1e026edc8f
6 changed files with 261 additions and 3 deletions

View File

@@ -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();
}
}

View File

@@ -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;
}
}
}

View File

@@ -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>()