工单排产
This commit is contained in:
parent
18d65a50f2
commit
27b218ec4a
@ -0,0 +1,42 @@
|
||||
using DOAN.Service.MES.product;
|
||||
using DOAN.Model.MES.product.Dto;
|
||||
using DOAN.Service.MES.product.IService;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using DOAN.Model.System;
|
||||
using MiniExcelLibs;
|
||||
using DOAN.Model.System.Dto;
|
||||
using DOAN.Model;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产排产
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/productManagement/ProWorkorderSchedule")]
|
||||
public class ProWorkorderScheduleController : BaseController
|
||||
{
|
||||
private readonly IProWorkorderSchedule _ProWorkorderSchedule;
|
||||
|
||||
public ProWorkorderScheduleController(IProWorkorderSchedule ProWorkorderSchedule)
|
||||
{
|
||||
_ProWorkorderSchedule = ProWorkorderSchedule;
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询生产工单列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("list")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:proworkorder:list")]
|
||||
public IActionResult QueryProWorkorder([FromBody] ProWorkorderQueryDto parm)
|
||||
{
|
||||
var response = _ProWorkorderSchedule.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
57
DOAN.Model/MES/product/Dto/ProWorkorderScheduleDto.cs
Normal file
57
DOAN.Model/MES/product/Dto/ProWorkorderScheduleDto.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.MES.product.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单排产查询对象
|
||||
/// </summary>
|
||||
public class ProWorkorderScheduleQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单排产输入输出对象
|
||||
/// </summary>
|
||||
public class ProWorkorderScheduleDto
|
||||
{
|
||||
[Required(ErrorMessage = "工位任务id不能为空")]
|
||||
public string TaskId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工单id不能为空")]
|
||||
public string FkWorkorderId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工艺路线id不能为空")]
|
||||
public int FkWorkRouteId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工序id不能为空")]
|
||||
public int FkWorkProcessId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工位id不能为空")]
|
||||
public int FkWorkStationId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "设备id不能为空")]
|
||||
public int FkDeviceId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "班组id不能为空")]
|
||||
public int FkGroupId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "人员不能为空")]
|
||||
public string FkOperatorId { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
88
DOAN.Model/MES/product/ProWorkorderSchedule.cs
Normal file
88
DOAN.Model/MES/product/ProWorkorderSchedule.cs
Normal file
@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.MES.product
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单排产
|
||||
/// </summary>
|
||||
[SugarTable("pro_workorder_schedule")]
|
||||
public class ProWorkorderSchedule
|
||||
{
|
||||
/// <summary>
|
||||
/// 工位任务id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "task_id")]
|
||||
public string TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_workorder_id")]
|
||||
public string FkWorkorderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工艺路线id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_work_route_id")]
|
||||
public int FkWorkRouteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_work_process_id")]
|
||||
public int FkWorkProcessId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工位id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_work_station_id")]
|
||||
public int FkWorkStationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_device_id")]
|
||||
public int FkDeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 班组id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_group_id")]
|
||||
public int FkGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人员
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_operator_id")]
|
||||
public string FkOperatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
17
DOAN.Service/MES/product/IService/IProWorkorderSchedule.cs
Normal file
17
DOAN.Service/MES/product/IService/IProWorkorderSchedule.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Model.MES.product.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Service.MES.product.IService
|
||||
{
|
||||
|
||||
public interface IProWorkorderSchedule : IBaseService<ProWorkorder>
|
||||
{
|
||||
PagedInfo<ProWorkorderDto> GetList(ProWorkorderQueryDto parm);
|
||||
}
|
||||
}
|
||||
61
DOAN.Service/MES/product/ProWorkorderSchedule.cs
Normal file
61
DOAN.Service/MES/product/ProWorkorderSchedule.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Model.MES.product.Dto;
|
||||
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.Repository;
|
||||
|
||||
|
||||
|
||||
namespace DOAN.Service.MES.product
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProWorkorderSchedule), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProWorkorderSchedule : BaseService<ProWorkorder>, IProWorkorderSchedule
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询生产工单列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<ProWorkorderDto> GetList(ProWorkorderQueryDto parm)
|
||||
{
|
||||
if (parm.WorkorderDate != null && parm.WorkorderDate.Length > 0)
|
||||
{
|
||||
parm.WorkorderDate[0] = parm.WorkorderDate[0].Date;
|
||||
parm.WorkorderDate[1] = parm.WorkorderDate[1].Date;
|
||||
|
||||
}
|
||||
|
||||
var predicate = Expressionable.Create<ProWorkorder>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.ProductionName), it => it.ProductionName.Contains(parm.ProductionName))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.ProductionCode), it => it.ProductionCode.Contains(parm.ProductionCode))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.CustomCode), it => it.CustomCode.Contains(parm.CustomCode))
|
||||
.AndIF(parm.WorkorderDate != null && parm.WorkorderDate[0] > DateTime.MinValue, it => it.WorkorderDate >= parm.WorkorderDate[0])
|
||||
.AndIF(parm.WorkorderDate != null && parm.WorkorderDate[1] > DateTime.MinValue, it => it.WorkorderDate <= parm.WorkorderDate[1])
|
||||
.AndIF(parm.Year > 0, it => it.Year == parm.Year)
|
||||
.AndIF(parm.Week > 0, it => it.Week == parm.Week)
|
||||
.AndIF(parm.Date > 0, it => it.Date == parm.Date)
|
||||
;
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(it => it.WorkorderDate)
|
||||
.ToPage<ProWorkorder, ProWorkorderDto>(parm);
|
||||
|
||||
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user