2024-12-03 19:21:32 +08:00
|
|
|
using DOAN.Model.MES.product;
|
|
|
|
|
using DOAN.Model.Public;
|
|
|
|
|
using DOAN.Service.Mobile.IService;
|
|
|
|
|
using DOAN.Service.Public.IPublicService;
|
|
|
|
|
using Infrastructure.Attribute;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DOAN.Service.Mobile;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 广告管理Service业务层处理
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AppService(ServiceType = typeof(IReportFlowService), ServiceLifetime = LifeTime.Transient)]
|
|
|
|
|
public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowService
|
|
|
|
|
{
|
|
|
|
|
public ProWorkorder GetWorkOrderDetail(string workorder)
|
|
|
|
|
{
|
2024-12-03 19:39:52 +08:00
|
|
|
return Context.Queryable<ProWorkorder>().Where(x => x.Workorder == workorder).First();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProReportwork01 GetProcessReportWorkDetail(string workorder, string process)
|
|
|
|
|
{
|
|
|
|
|
return Context.Queryable<ProReportwork01>().Where(x => x.Workorder == workorder && x.ProcessCode == process).First();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ProcessReportWork(string workorder, string process, int finish_num,int bad_num,string Worker)
|
|
|
|
|
{
|
|
|
|
|
int result = 0;
|
|
|
|
|
bool Exist= Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder&&it.ProcessCode==process).Any();
|
|
|
|
|
if (Exist)
|
|
|
|
|
{
|
|
|
|
|
result= Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessCode == process)
|
|
|
|
|
.SetColumns(it => it.FinishNum == finish_num)
|
|
|
|
|
.SetColumns(it => it.BadNum == bad_num)
|
|
|
|
|
.SetColumns(it => it.Worker == Worker)
|
|
|
|
|
.SetColumns(it => it.JobDate == DateTime.Today)
|
|
|
|
|
.SetColumns(it => it.UpdatedBy == Worker)
|
|
|
|
|
.SetColumns(it => it.UpdatedTime == DateTime.Now)
|
|
|
|
|
.ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ProReportwork01 proReportwork01=new ProReportwork01();
|
|
|
|
|
proReportwork01.Id = XueHua;
|
|
|
|
|
proReportwork01.Workorder = workorder;
|
|
|
|
|
proReportwork01.ProcessCode = process;
|
|
|
|
|
proReportwork01.FinishNum = finish_num;
|
|
|
|
|
proReportwork01.BadNum = bad_num;
|
|
|
|
|
proReportwork01.Worker = Worker;
|
|
|
|
|
proReportwork01.JobDate = DateTime.Today;
|
|
|
|
|
proReportwork01.CreatedBy = Worker;
|
|
|
|
|
proReportwork01.CreatedTime = DateTime.Now;
|
|
|
|
|
result= Context.Insertable(proReportwork01).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return result>0;
|
2024-12-03 19:21:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|