route_code
This commit is contained in:
parent
edaa3419e0
commit
85cc6f0797
@ -23,9 +23,9 @@ namespace DOAN.WebApi.Controllers.MES.mm
|
||||
{
|
||||
private readonly IMmPreparantTaskService preparantTaskService;
|
||||
|
||||
public MmPreparantTaskController(IMmPreparantTaskService preparantTaskService)
|
||||
public MmPreparantTaskController(IMmPreparantTaskService preparantTaskService)
|
||||
{
|
||||
this.preparantTaskService=preparantTaskService;
|
||||
this.preparantTaskService = preparantTaskService;
|
||||
}
|
||||
|
||||
//TODO 获取产线
|
||||
@ -38,18 +38,27 @@ namespace DOAN.WebApi.Controllers.MES.mm
|
||||
|
||||
//TODO 获取工单
|
||||
[HttpGet("get_workoder")]
|
||||
public IActionResult GetWorkOrder(DateTime searchDate,string route_code)
|
||||
public IActionResult GetWorkOrder(DateTime searchDate, string route_code)
|
||||
{
|
||||
if (searchDate == DateTime.MinValue || string.IsNullOrEmpty(route_code))
|
||||
if (searchDate == DateTime.MinValue )
|
||||
{
|
||||
return SUCCESS(null);
|
||||
|
||||
|
||||
}
|
||||
var response = preparantTaskService.GetWorkOrder(searchDate, route_code);
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
//TODO 获取任务及其详情
|
||||
[HttpGet("get_task_info")]
|
||||
public IActionResult GetTaskInfo(string workorder)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workorder)) { return SUCCESS(null); }
|
||||
var response = preparantTaskService.GetTaskInfo(workorder);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -36,5 +36,34 @@ namespace DOAN.Model.MES.mm.Dto
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 任务及其配料详情
|
||||
/// </summary>
|
||||
|
||||
public class MmPreparationTaskAndInfoDto
|
||||
{
|
||||
[Required(ErrorMessage = "雪花id不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string SerialNum { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "任务code(工单号_no)不能为空")]
|
||||
public string TaskCode { get; set; }
|
||||
|
||||
public string FkWorkorder { get; set; }
|
||||
|
||||
public int? PreparationStatus { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
public List<MmTaskMaterialInfoDto> mmTaskMaterialInfoDtos { get; set; } = new List<MmTaskMaterialInfoDto>();
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.mm.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -14,5 +15,9 @@ namespace DOAN.Service.MES.mm.IService
|
||||
List<BaseWorkRoute> GetProcessRouteList();
|
||||
|
||||
List<ProWorkorder> GetWorkOrder(DateTime searchDate, string route_code);
|
||||
|
||||
List<MmPreparationTaskAndInfoDto> GetTaskInfo(string workorder);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,10 +26,20 @@ namespace DOAN.Service.MES.mm
|
||||
{
|
||||
searchDate = searchDate.ToLocalTime().Date;
|
||||
return Context.Queryable<ProWorkorder>().Where(it => it.WorkorderDate == searchDate)
|
||||
.Where(it => it.FkRouteCode == route_code)
|
||||
.WhereIF(string.IsNullOrEmpty(route_code),it => it.FkRouteCode == route_code)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取任务详情
|
||||
/// </summary>
|
||||
/// <param name="workorder"></param>
|
||||
/// <returns></returns>
|
||||
public List<MmPreparationTaskAndInfoDto> GetTaskInfo(string workorder)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user