2024-09-19 09:34:54 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Infrastructure.Attribute;
|
|
|
|
|
|
using DOAN.Service.JobKanban.IService;
|
|
|
|
|
|
using DOAN.Model.MES.product;
|
|
|
|
|
|
using DOAN.Model.MES.base_;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DOAN.Service.JobKanban
|
|
|
|
|
|
{
|
|
|
|
|
|
[AppService(ServiceType = typeof(IWorkorderProgressService), ServiceLifetime = LifeTime.Transient)]
|
|
|
|
|
|
public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderProgressService
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public List<BaseWorkRoute> GetRoutes()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Context.Queryable<BaseWorkRoute>().Where(it => it.Status == 1).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<BaseGroup> GetGroups()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Context.Queryable<BaseGroup>().Where(it => it.Status == 1).ToList();
|
|
|
|
|
|
}
|
2024-09-19 09:42:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<ProWorkorder> GetWorkOrderList(string group_code, string line_code, DateTime handleDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
handleDate = handleDate.ToLocalTime().Date;
|
|
|
|
|
|
|
|
|
|
|
|
return Context.Queryable<ProWorkorder>().Where(it => it.GroupCode == group_code)
|
|
|
|
|
|
.Where(it => it.LineCode == line_code)
|
|
|
|
|
|
.Where(it => it.WorkorderDate == handleDate)
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
}
|
2024-09-19 09:53:04 +08:00
|
|
|
|
|
|
|
|
|
|
public int StartWorkOrder(string workorder)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Context.Updateable<ProWorkorder>().SetColumns(it => it.Status == 2)
|
|
|
|
|
|
.Where(it => it.Workorder == workorder).ExecuteCommand();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int FinishWorkOrder(string workorder)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Context.Updateable<ProWorkorder>().SetColumns(it => it.Status == 3)
|
|
|
|
|
|
.Where(it => it.Workorder == workorder).ExecuteCommand();
|
|
|
|
|
|
}
|
2024-09-19 09:34:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|