查询报损单
This commit is contained in:
parent
ba1b8393ef
commit
80ebdcd48a
@ -1,17 +1,17 @@
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.quality;
|
||||
using DOAN.Model.MES.quality.Dto;
|
||||
using DOAN.Service.MES.quality;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
using DOAN.Service.MES.quality.FQC.IService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//创建时间:2024-10-10
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
namespace DOAN.WebApi.Controllers.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别
|
||||
/// </summary>
|
||||
//[Verify]
|
||||
[Route("mes/productManagement/QcDefectConfig")]
|
||||
[Route("mes/qualityManagement/QcDefectConfig")]
|
||||
public class QcDefectConfigController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
@ -48,7 +48,7 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
public IActionResult GetQcDefectConfig(int Id)
|
||||
{
|
||||
var response = _QcDefectConfigService.GetInfo(Id);
|
||||
|
||||
|
||||
var info = response.Adapt<QcDefectConfig>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
@ -1,20 +1,20 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.MES.quality;
|
||||
using DOAN.Model.MES.quality.Dto;
|
||||
using DOAN.Service.MES.quality;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Infrastructure;
|
||||
using Aliyun.OSS;
|
||||
using DOAN.Service.MES.quality.IPQC.IService;
|
||||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||||
using DOAN.Model.MES.quality.IPQC;
|
||||
|
||||
//创建时间:2024-09-30
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
namespace DOAN.WebApi.Controllers.MES.quality.IPQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/productManagement/QcDefectCollection")]
|
||||
[Route("mes/qualityManagement/QcDefectCollection")]
|
||||
public class QcDefectCollectionController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
@ -87,9 +87,9 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
|
||||
//TODO 复制同种物料
|
||||
[HttpGet("copySameMaterial")]
|
||||
public IActionResult CopySameMaterial(string id)
|
||||
public IActionResult CopySameMaterial(string id)
|
||||
{
|
||||
if(string.IsNullOrEmpty(id))
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
throw new CustomException("id为空");
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Infrastructure;
|
||||
using Aliyun.OSS;
|
||||
using DOAN.Service.MES.quality.IPQC.IService;
|
||||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||||
using DOAN.Model.MES.quality.IPQC;
|
||||
using DOAN.Service.MES.quality.IQC.IService;
|
||||
using DOAN.Service.MES.quality.IPQC;
|
||||
|
||||
//创建时间:2024-09-30
|
||||
namespace DOAN.WebApi.Controllers.MES.quality.IQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/qualityManagement/QcDefectCollection")]
|
||||
public class QcReportLossController : BaseController
|
||||
{
|
||||
private IQcReportService qcReportService;
|
||||
|
||||
public QcReportLossController(IQcReportService qcReportService)
|
||||
{
|
||||
this.qcReportService = qcReportService;
|
||||
|
||||
|
||||
|
||||
}
|
||||
//TODO 获取报损单
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:list")]
|
||||
public IActionResult QueryQcDefectCollection([FromQuery] QcDefectCollectionQueryDto2 parm)
|
||||
{
|
||||
var response = qcReportService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,4 +27,8 @@
|
||||
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="MES\quality\FQC\Dto\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.MES.quality
|
||||
namespace DOAN.Model.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 成品缺陷
|
||||
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.quality.Dto
|
||||
namespace DOAN.Model.MES.quality.IPQC.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集查询对象
|
||||
@ -13,7 +13,7 @@ namespace DOAN.Model.MES.quality.Dto
|
||||
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
@ -67,4 +67,22 @@ namespace DOAN.Model.MES.quality.Dto
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 报损单
|
||||
/// </summary>
|
||||
public class QcDefectCollectionQueryDto2 : PagerInfo
|
||||
{
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
//public int? Tqm { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
namespace DOAN.Model.MES.quality
|
||||
namespace DOAN.Model.MES.quality.IPQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集
|
||||
@ -1,11 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.quality.Dto
|
||||
namespace DOAN.Model.MES.quality.IQC.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别查询对象
|
||||
/// </summary>
|
||||
public class QcDefectConfigQueryDto : PagerInfo
|
||||
public class QcDefectConfigQueryDto : PagerInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Code { get; set; }
|
||||
@ -1,5 +1,4 @@
|
||||
|
||||
namespace DOAN.Model.MES.quality
|
||||
namespace DOAN.Model.MES.quality.IQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别
|
||||
@ -1,8 +1,8 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.quality;
|
||||
using DOAN.Model.MES.quality.Dto;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
|
||||
namespace DOAN.Service.MES.quality
|
||||
namespace DOAN.Service.MES.quality.FQC.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别service接口
|
||||
@ -1,11 +1,11 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.quality;
|
||||
using DOAN.Model.MES.quality.Dto;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.MES.quality;
|
||||
using DOAN.Service.MES.quality.FQC.IService;
|
||||
using Infrastructure.Attribute;
|
||||
|
||||
namespace DOAN.Service.Business
|
||||
namespace DOAN.Service.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别Service业务层处理
|
||||
@ -21,7 +21,7 @@ namespace DOAN.Service.Business
|
||||
public PagedInfo<QcDefectConfigDto> GetList(QcDefectConfigQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<QcDefectConfig>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name),it=>it.Name.Contains(parm.Name))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name.Contains(parm.Name))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code.Contains(parm.Code))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Group), it => it.Group.Contains(parm.Group))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.QcType), it => it.QcType.Contains(parm.QcType))
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.MES.quality;
|
||||
using DOAN.Model.MES.quality.Dto;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||||
using DOAN.Model.MES.quality.IPQC;
|
||||
|
||||
namespace DOAN.Service.MES.quality
|
||||
namespace DOAN.Service.MES.quality.IPQC.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集service接口
|
||||
@ -4,8 +4,6 @@ using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.MES.quality;
|
||||
using DOAN.Model.MES.quality.Dto;
|
||||
using DOAN.Repository;
|
||||
|
||||
using System.Linq;
|
||||
@ -16,8 +14,11 @@ using DOAN.Model.MES.mm;
|
||||
using NPOI.SS.UserModel;
|
||||
using MathNet.Numerics.Distributions;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using DOAN.Service.MES.quality.IPQC.IService;
|
||||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||||
using DOAN.Model.MES.quality.IPQC;
|
||||
|
||||
namespace DOAN.Service.MES.quality
|
||||
namespace DOAN.Service.MES.quality.IPQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集Service业务层处理
|
||||
@ -46,7 +47,7 @@ namespace DOAN.Service.MES.quality
|
||||
.GroupBy((t, i) => i.MaterialCode)
|
||||
.Select((t, i) => new
|
||||
{
|
||||
MaterialCode = i.MaterialCode,
|
||||
i.MaterialCode,
|
||||
ActualNum = SqlFunc.AggregateSum(i.Quantity)
|
||||
}).ToList();
|
||||
|
||||
@ -148,7 +149,7 @@ namespace DOAN.Service.MES.quality
|
||||
newqcDefect.PlanNum = qcDefect.PlanNum;
|
||||
newqcDefect.ActualNum = qcDefect.ActualNum;
|
||||
newqcDefect.CreatedBy = qcDefect.CreatedBy;
|
||||
newqcDefect.CreatedTime=DateTime.Now;
|
||||
newqcDefect.CreatedTime = DateTime.Now;
|
||||
int result = Context.Insertable(newqcDefect).ExecuteCommand();
|
||||
if (result == 0)
|
||||
{
|
||||
15
DOAN.Service/MES/quality/IQC/IService/IQcReportService.cs
Normal file
15
DOAN.Service/MES/quality/IQC/IService/IQcReportService.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||||
using DOAN.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Service.MES.quality.IQC.IService
|
||||
{
|
||||
public interface IQcReportService
|
||||
{
|
||||
PagedInfo<QcDefectCollectionDto> GetList(QcDefectCollectionQueryDto2 parm);
|
||||
}
|
||||
}
|
||||
46
DOAN.Service/MES/quality/IQC/QcReportService.cs
Normal file
46
DOAN.Service/MES/quality/IQC/QcReportService.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using DOAN.Infrastructure;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.quality.IPQC;
|
||||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.MES.quality.IQC.IService;
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Service.MES.quality.IQC
|
||||
{
|
||||
[AppService(ServiceType = typeof(IQcReportService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class QcReportService : BaseService<QcDefectCollection>, IQcReportService
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询报损单
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<QcDefectCollectionDto> GetList(QcDefectCollectionQueryDto2 parm)
|
||||
{
|
||||
parm.DateTime = ConvertDateTime.ConvertLocalDate(parm.DateTime ?? DateTime.MinValue);
|
||||
var predicate = Expressionable.Create<QcDefectCollection>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.MaterialCode), it => it.MaterialCode.Contains(parm.MaterialCode))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.MaterialName), it => it.MaterialName.Contains(parm.MaterialName))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.LineCode), it => it.LineCode.Contains(parm.LineCode))
|
||||
.AndIF(parm.DateTime != null && parm.DateTime > DateTime.MinValue.AddYears(1), it => it.DateTime == parm.DateTime)
|
||||
.And(it => it.Tqm == 1||it.Tqm==2)
|
||||
;
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(it => it.MaterialCode)
|
||||
.ToPage<QcDefectCollection, QcDefectCollectionDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user