生产工艺查询
This commit is contained in:
parent
2b5e1a596a
commit
aa3bf64bdd
@ -95,5 +95,18 @@ namespace RIZO.Admin.WebApi.PLC.Controllers
|
||||
return ToResponse(_PlcProductionDataService.Delete(idArr));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询产线PLC生产工艺参数
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getProcessParameter")]
|
||||
[ActionPermissionFilter(Permission = "plcproductiondata:list")]
|
||||
public IActionResult GetProcessParameter([FromQuery] PlcProductionDataQueryDto parm)
|
||||
{
|
||||
var response = _PlcProductionDataService.GetProcessParameter(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,13 @@ namespace RIZO.Admin.WebApi.PLC.Model.Dto
|
||||
/// </summary>
|
||||
public class PlcProductionDataQueryDto : PagerInfo
|
||||
{
|
||||
public DateTime? startTime { get; set; }
|
||||
public DateTime? endTime { get; set; }
|
||||
public string? ProductCode { get; set; }
|
||||
public string? ProductName { get; set; }
|
||||
public string? PartCode { get; set; }
|
||||
public string? PartName { get; set; }
|
||||
public string? ReworkFlag { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -12,6 +12,8 @@ namespace RIZO.Admin.WebApi.PLC.Service.IService
|
||||
{
|
||||
PagedInfo<PlcProductionDataDto> GetList(PlcProductionDataQueryDto parm);
|
||||
|
||||
PagedInfo<PlcProductionDataDto> GetProcessParameter(PlcProductionDataQueryDto parm);
|
||||
|
||||
PlcProductionData GetInfo(int Id);
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,81 @@ namespace RIZO.Admin.WebApi.PLC.Service
|
||||
public PagedInfo<PlcProductionDataDto> GetList(PlcProductionDataQueryDto parm)
|
||||
{
|
||||
var predicate = QueryExp(parm);
|
||||
#region
|
||||
if (!string.IsNullOrEmpty(parm.ProductName))
|
||||
{
|
||||
predicate = predicate.And(x => x.ProductName == parm.ProductName);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.ProductCode))
|
||||
{
|
||||
predicate = predicate.And(x => x.ProductCode == parm.ProductCode);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.PartName))
|
||||
{
|
||||
predicate = predicate.And(x => x.PartName == parm.PartName);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.PartCode))
|
||||
{
|
||||
predicate = predicate.And(x => x.PartCode == parm.PartCode);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.ReworkFlag))
|
||||
{
|
||||
predicate = predicate.And(x => x.ReworkFlag == parm.ReworkFlag);
|
||||
}
|
||||
if (parm.startTime != null && parm.startTime > DateTime.MinValue)
|
||||
{
|
||||
predicate = predicate.And(x => x.CreatedTime >= parm.startTime);
|
||||
}
|
||||
if (parm.endTime != null && parm.endTime > DateTime.MinValue)
|
||||
{
|
||||
predicate = predicate.And(x => x.CreatedTime <= parm.endTime);
|
||||
}
|
||||
#endregion
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<PlcProductionData, PlcProductionDataDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询产线PLC生产工艺参数
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<PlcProductionDataDto> GetProcessParameter(PlcProductionDataQueryDto parm)
|
||||
{
|
||||
var predicate = QueryExp(parm);
|
||||
#region
|
||||
if (!string.IsNullOrEmpty(parm.ProductName))
|
||||
{
|
||||
predicate = predicate.And(x => x.ProductName == parm.ProductName);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.ProductCode))
|
||||
{
|
||||
predicate = predicate.And(x => x.ProductCode == parm.ProductCode);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.PartName))
|
||||
{
|
||||
predicate = predicate.And(x => x.PartName == parm.PartName);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.PartCode))
|
||||
{
|
||||
predicate = predicate.And(x => x.PartCode == parm.PartCode);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(parm.ReworkFlag))
|
||||
{
|
||||
predicate = predicate.And(x => x.ReworkFlag == parm.ReworkFlag);
|
||||
}
|
||||
if (parm.startTime != null && parm.startTime > DateTime.MinValue)
|
||||
{
|
||||
predicate = predicate.And(x => x.CreatedTime >= parm.startTime);
|
||||
}
|
||||
if (parm.endTime != null && parm.endTime > DateTime.MinValue)
|
||||
{
|
||||
predicate = predicate.And(x => x.CreatedTime <= parm.endTime);
|
||||
}
|
||||
#endregion
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<PlcProductionData, PlcProductionDataDto>(parm);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user