获取工单

This commit is contained in:
qianhao.xu 2024-07-23 09:28:17 +08:00
parent 840b5e0227
commit 8c55bad4fb
3 changed files with 27 additions and 2 deletions

View File

@ -54,6 +54,16 @@ namespace DOAN.Admin.WebApi.Controllers.JobKanban
//工单
[HttpGet("get_workorder")]
public IActionResult GetWorkOrderList(DateTime today,string LineCode)
{
if(today == DateTime.MinValue|| string.IsNullOrEmpty(LineCode))
{
return SUCCESS(null);
}
var response = _LoginOrSetService.GetWorkOrderList(today, LineCode);
return SUCCESS(response);
}

View File

@ -1,4 +1,6 @@
using DOAN.Model.MES.base_;
using DOAN.Model.MES.product;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
@ -12,5 +14,7 @@ namespace DOAN.Service.JobKanban.IService
List<BaseGroup> GetGroupList();
string[] GetRouteList();
List<ProWorkorder> GetWorkOrderList(DateTime today, string LineCode);
}
}

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using DOAN.Model.MES.andon;
using DOAN.Model.MES.base_;
using DOAN.Model.MES.base_.Dto;
using DOAN.Model.MES.product;
using DOAN.Service.JobKanban.IService;
using DOAN.Service.MES.andon.IService;
using Infrastructure.Attribute;
@ -19,13 +20,23 @@ namespace DOAN.Service.JobKanban
public List<BaseGroup> GetGroupList()
{
return Context.Queryable<BaseGroup>().Where(it=>it.Status==1).ToList();
return Context.Queryable<BaseGroup>().Where(it => it.Status == 1).ToList();
}
public string[] GetRouteList()
{
return Context.Queryable<BaseWorkRoute>()
.Where(it => it.Status == 1).Select(it=>it.Code).ToArray();
.Where(it => it.Status == 1).Select(it => it.Code).ToArray();
}
public List<ProWorkorder> GetWorkOrderList(DateTime today, string LineCode)
{
today = today.Date;
return Context.Queryable<ProWorkorder>()
.Where(it => it.WorkorderDate == today)
.Where(it => it.RouteId == LineCode)
.ToList();
}
}