diff --git a/RIZO.Admin.WebApi/Controllers/Mes/ProductionPreparation/QualityControlController.cs b/RIZO.Admin.WebApi/Controllers/Mes/ProductionPreparation/QualityControlController.cs new file mode 100644 index 0000000..8c4d0ad --- /dev/null +++ b/RIZO.Admin.WebApi/Controllers/Mes/ProductionPreparation/QualityControlController.cs @@ -0,0 +1,100 @@ +using Microsoft.AspNetCore.Mvc; +using RIZO.Model.Mes.Dto.ProductionPreparation; +using RIZO.Model.Mes.ProductionPreparation; +using RIZO.Service.Mes.IMesService.ProductionPreparation; + +//创建时间:2025-11-29 +namespace RIZO.Admin.WebApi.Controllers.Mes.ProductionPreparation +{ + /// + /// 质量控制主表 + /// + [Route("mes/QualityControl")] + public class QualityControlController : BaseController + { + /// + /// 质量控制主表接口 + /// + private readonly IQualityControlService _QualityControlService; + + public QualityControlController(IQualityControlService QualityControlService) + { + _QualityControlService = QualityControlService; + } + + /// + /// 查询质量控制主表列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "qualitycontrol:list")] + public IActionResult QueryQualityControl([FromQuery] QualityControlQueryDto parm) + { + var response = _QualityControlService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询质量控制主表详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "qualitycontrol:query")] + public IActionResult GetQualityControl(long Id) + { + var response = _QualityControlService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加质量控制主表 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "qualitycontrol:add")] + [Log(Title = "质量控制主表", BusinessType = BusinessType.INSERT)] + public IActionResult AddQualityControl([FromBody] QualityControlDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _QualityControlService.AddQualityControl(modal); + + return SUCCESS(response); + } + + /// + /// 更新质量控制主表 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "qualitycontrol:edit")] + [Log(Title = "质量控制主表", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateQualityControl([FromBody] QualityControlDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _QualityControlService.UpdateQualityControl(modal); + + return ToResponse(response); + } + + /// + /// 删除质量控制主表 + /// + /// + [HttpPost("delete/{ids}")] + [ActionPermissionFilter(Permission = "qualitycontrol:delete")] + [Log(Title = "质量控制主表", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteQualityControl([FromRoute]string ids) + { + var idArr = Tools.SplitAndConvert(ids); + + return ToResponse(_QualityControlService.Delete(idArr)); + } + + } +} \ No newline at end of file diff --git a/RIZO.Admin.WebApi/Controllers/Mes/ProductionPreparation/QualityControlDetailController.cs b/RIZO.Admin.WebApi/Controllers/Mes/ProductionPreparation/QualityControlDetailController.cs new file mode 100644 index 0000000..1d758ac --- /dev/null +++ b/RIZO.Admin.WebApi/Controllers/Mes/ProductionPreparation/QualityControlDetailController.cs @@ -0,0 +1,100 @@ +using Microsoft.AspNetCore.Mvc; +using RIZO.Model.Mes.Dto.ProductionPreparation; +using RIZO.Model.Mes.ProductionPreparation; +using RIZO.Service.Mes.IMesService.ProductionPreparation; + +//创建时间:2025-11-29 +namespace RIZO.Admin.WebApi.Controllers.Mes.ProductionPreparation +{ + /// + /// 质量控制从表(存储具体检查参数明细) + /// + [Route("mes/QualityControlDetail")] + public class QualityControlDetailController : BaseController + { + /// + /// 质量控制从表(存储具体检查参数明细)接口 + /// + private readonly IQualityControlDetailService _QualityControlDetailService; + + public QualityControlDetailController(IQualityControlDetailService QualityControlDetailService) + { + _QualityControlDetailService = QualityControlDetailService; + } + + /// + /// 查询质量控制从表(存储具体检查参数明细)列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "qualitycontroldetail:list")] + public IActionResult QueryQualityControlDetail([FromQuery] QualityControlDetailQueryDto parm) + { + var response = _QualityControlDetailService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询质量控制从表(存储具体检查参数明细)详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "qualitycontroldetail:query")] + public IActionResult GetQualityControlDetail(long Id) + { + var response = _QualityControlDetailService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加质量控制从表(存储具体检查参数明细) + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "qualitycontroldetail:add")] + [Log(Title = "质量控制从表(存储具体检查参数明细)", BusinessType = BusinessType.INSERT)] + public IActionResult AddQualityControlDetail([FromBody] QualityControlDetailDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _QualityControlDetailService.AddQualityControlDetail(modal); + + return SUCCESS(response); + } + + /// + /// 更新质量控制从表(存储具体检查参数明细) + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "qualitycontroldetail:edit")] + [Log(Title = "质量控制从表(存储具体检查参数明细)", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateQualityControlDetail([FromBody] QualityControlDetailDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _QualityControlDetailService.UpdateQualityControlDetail(modal); + + return ToResponse(response); + } + + /// + /// 删除质量控制从表(存储具体检查参数明细) + /// + /// + [HttpPost("delete/{ids}")] + [ActionPermissionFilter(Permission = "qualitycontroldetail:delete")] + [Log(Title = "质量控制从表(存储具体检查参数明细)", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteQualityControlDetail([FromRoute]string ids) + { + var idArr = Tools.SplitAndConvert(ids); + + return ToResponse(_QualityControlDetailService.Delete(idArr)); + } + + } +} \ No newline at end of file diff --git a/RIZO.Admin.WebApi/RIZO.Admin.WebApi.csproj b/RIZO.Admin.WebApi/RIZO.Admin.WebApi.csproj index a8f1c24..2878396 100644 --- a/RIZO.Admin.WebApi/RIZO.Admin.WebApi.csproj +++ b/RIZO.Admin.WebApi/RIZO.Admin.WebApi.csproj @@ -41,6 +41,7 @@ + diff --git a/RIZO.Model/Mes/Dto/ProductionPreparation/QualityControlDetailDto.cs b/RIZO.Model/Mes/Dto/ProductionPreparation/QualityControlDetailDto.cs new file mode 100644 index 0000000..66d070e --- /dev/null +++ b/RIZO.Model/Mes/Dto/ProductionPreparation/QualityControlDetailDto.cs @@ -0,0 +1,42 @@ + +namespace RIZO.Model.Mes.Dto.ProductionPreparation +{ + /// + /// 质量控制从表(存储具体检查参数明细)查询对象 + /// + public class QualityControlDetailQueryDto : PagerInfo + { + } + + /// + /// 质量控制从表(存储具体检查参数明细)输入输出对象 + /// + public class QualityControlDetailDto + { + [Required(ErrorMessage = "从表主键ID(自增)不能为空")] + public long Id { get; set; } + + [Required(ErrorMessage = "关联主表质控编码(quality_control.qc_code)不能为空")] + public string QcCode { get; set; } + + [Required(ErrorMessage = "检查参数名称(如:环境温度、设备运行状态)不能为空")] + public string ParamName { get; set; } + + [Required(ErrorMessage = "参数值(如:23℃、正常)不能为空")] + public string ParamValue { get; set; } + + public string ParamUnit { get; set; } + + [Required(ErrorMessage = "该参数是否合格(0=不合格,1=合格)不能为空")] + public string IsPass { get; set; } + + public DateTime? CreatedTime { get; set; } + + public string CreatedBy { get; set; } + + + + [ExcelColumn(Name = "该参数是否合格(0=不合格,1=合格)")] + public string IsPassLabel { get; set; } + } +} \ No newline at end of file diff --git a/RIZO.Model/Mes/Dto/ProductionPreparation/QualityControlDto.cs b/RIZO.Model/Mes/Dto/ProductionPreparation/QualityControlDto.cs new file mode 100644 index 0000000..9909d39 --- /dev/null +++ b/RIZO.Model/Mes/Dto/ProductionPreparation/QualityControlDto.cs @@ -0,0 +1,49 @@ + +namespace RIZO.Model.Mes.Dto.ProductionPreparation +{ + /// + /// 质量控制主表查询对象 + /// + public class QualityControlQueryDto : PagerInfo + { + } + + /// + /// 质量控制主表输入输出对象 + /// + public class QualityControlDto + { + [Required(ErrorMessage = "主表主键ID(自增)不能为空")] + public long Id { get; set; } + + [Required(ErrorMessage = "质控编码(唯一标识,格式:QC+日期+序号,如QC20251201001)不能为空")] + public string QcCode { get; set; } + + public string CheckType { get; set; } + + public string CheckDate { get; set; } + + public string LineCode { get; set; } + + public string WorkOrderNo { get; set; } + + public int? CheckResult { get; set; } + + public DateTime? CheckTime { get; set; } + + public string Remark { get; set; } + + public DateTime? CreatedTime { get; set; } + + public string CreatedBy { get; set; } + + public DateTime? UpdatedTime { get; set; } + + public string UpdatedBy { get; set; } + + + + [ExcelColumn(Name = "质控类型")] + public string CheckTypeLabel { get; set; } + } +} \ No newline at end of file diff --git a/RIZO.Model/Mes/ProductionPreparation/QualityControl.cs b/RIZO.Model/Mes/ProductionPreparation/QualityControl.cs new file mode 100644 index 0000000..f794c27 --- /dev/null +++ b/RIZO.Model/Mes/ProductionPreparation/QualityControl.cs @@ -0,0 +1,88 @@ + +namespace RIZO.Model.Mes.ProductionPreparation +{ + /// + /// 质量控制主表 + /// + [SugarTable("quality_control")] + public class QualityControl + { + /// + /// 主表主键ID(自增) + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 质控编码(唯一标识,格式:QC+日期+序号,如QC20251201001) + /// + [SugarColumn(ColumnName = "qc_code")] + public string QcCode { get; set; } + + /// + /// 质控类型 + /// + [SugarColumn(ColumnName = "check_type")] + public string CheckType { get; set; } + + /// + /// 检查日期(格式:YYYY-MM-DD) + /// + [SugarColumn(ColumnName = "check_date")] + public string CheckDate { get; set; } + + /// + /// 关联产线(如:1号产线/2号产线) + /// + [SugarColumn(ColumnName = "line_code")] + public string LineCode { get; set; } + + /// + /// 关联工单编号(可选) + /// + [SugarColumn(ColumnName = "work_order_no")] + public string WorkOrderNo { get; set; } + + /// + /// 检查结果(0=不合格,1=合格) + /// + [SugarColumn(ColumnName = "check_result")] + public int? CheckResult { get; set; } + + /// + /// 检查完成时间 + /// + [SugarColumn(ColumnName = "check_time")] + public DateTime? CheckTime { get; set; } + + /// + /// 备注(如不合格原因) + /// + public string Remark { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "created_time")] + public DateTime? CreatedTime { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "created_by")] + public string CreatedBy { get; set; } + + /// + /// 更新时间(自动同步) + /// + [SugarColumn(ColumnName = "updated_time")] + public DateTime? UpdatedTime { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "updated_by")] + public string UpdatedBy { get; set; } + + } +} \ No newline at end of file diff --git a/RIZO.Model/Mes/ProductionPreparation/QualityControlDetail.cs b/RIZO.Model/Mes/ProductionPreparation/QualityControlDetail.cs new file mode 100644 index 0000000..887028c --- /dev/null +++ b/RIZO.Model/Mes/ProductionPreparation/QualityControlDetail.cs @@ -0,0 +1,59 @@ + +namespace RIZO.Model.Mes.ProductionPreparation +{ + /// + /// 质量控制从表(存储具体检查参数明细) + /// + [SugarTable("quality_control_detail")] + public class QualityControlDetail + { + /// + /// 从表主键ID(自增) + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 关联主表质控编码(quality_control.qc_code) + /// + [SugarColumn(ColumnName = "qc_code")] + public string QcCode { get; set; } + + /// + /// 检查参数名称(如:环境温度、设备运行状态) + /// + [SugarColumn(ColumnName = "param_name")] + public string ParamName { get; set; } + + /// + /// 参数值(如:23℃、正常) + /// + [SugarColumn(ColumnName = "param_value")] + public string ParamValue { get; set; } + + /// + /// 参数单位(如:℃/%/MPa,无单位则留空) + /// + [SugarColumn(ColumnName = "param_unit")] + public string ParamUnit { get; set; } + + /// + /// 该参数是否合格(0=不合格,1=合格) + /// + [SugarColumn(ColumnName = "is_pass")] + public string IsPass { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "created_time")] + public DateTime? CreatedTime { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "created_by")] + public string CreatedBy { get; set; } + + } +} \ No newline at end of file diff --git a/RIZO.Model/RIZO.Model.csproj b/RIZO.Model/RIZO.Model.csproj index 1d9f6c9..e2ca47d 100644 --- a/RIZO.Model/RIZO.Model.csproj +++ b/RIZO.Model/RIZO.Model.csproj @@ -22,7 +22,9 @@ + + diff --git a/RIZO.Service/Mes/IMesService/ProductionPreparation/IQualityControlDetailService.cs b/RIZO.Service/Mes/IMesService/ProductionPreparation/IQualityControlDetailService.cs new file mode 100644 index 0000000..6e228e1 --- /dev/null +++ b/RIZO.Service/Mes/IMesService/ProductionPreparation/IQualityControlDetailService.cs @@ -0,0 +1,21 @@ +using RIZO.Model.Mes.Dto.ProductionPreparation; +using RIZO.Model.Mes.ProductionPreparation; + +namespace RIZO.Service.Mes.IMesService.ProductionPreparation +{ + /// + /// 质量控制从表(存储具体检查参数明细)service接口 + /// + public interface IQualityControlDetailService : IBaseService + { + PagedInfo GetList(QualityControlDetailQueryDto parm); + + QualityControlDetail GetInfo(long Id); + + + QualityControlDetail AddQualityControlDetail(QualityControlDetail parm); + int UpdateQualityControlDetail(QualityControlDetail parm); + + + } +} diff --git a/RIZO.Service/Mes/IMesService/ProductionPreparation/IQualityControlService.cs b/RIZO.Service/Mes/IMesService/ProductionPreparation/IQualityControlService.cs new file mode 100644 index 0000000..200d2e9 --- /dev/null +++ b/RIZO.Service/Mes/IMesService/ProductionPreparation/IQualityControlService.cs @@ -0,0 +1,21 @@ +using RIZO.Model.Mes.Dto.ProductionPreparation; +using RIZO.Model.Mes.ProductionPreparation; + +namespace RIZO.Service.Mes.IMesService.ProductionPreparation +{ + /// + /// 质量控制主表service接口 + /// + public interface IQualityControlService : IBaseService + { + PagedInfo GetList(QualityControlQueryDto parm); + + QualityControl GetInfo(long Id); + + + QualityControl AddQualityControl(QualityControl parm); + int UpdateQualityControl(QualityControl parm); + + + } +} diff --git a/RIZO.Service/Mes/ProductionPreparation/QualityControlDetailService.cs b/RIZO.Service/Mes/ProductionPreparation/QualityControlDetailService.cs new file mode 100644 index 0000000..a46f47e --- /dev/null +++ b/RIZO.Service/Mes/ProductionPreparation/QualityControlDetailService.cs @@ -0,0 +1,79 @@ +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using RIZO.Model.Mes.Dto.ProductionPreparation; +using RIZO.Model.Mes.ProductionPreparation; +using RIZO.Repository; +using RIZO.Service.Mes.IMesService.ProductionPreparation; + +namespace RIZO.Service.Mes.ProductionPreparation +{ + /// + /// 质量控制从表(存储具体检查参数明细)Service业务层处理 + /// + [AppService(ServiceType = typeof(IQualityControlDetailService), ServiceLifetime = LifeTime.Transient)] + public class QualityControlDetailService : BaseService, IQualityControlDetailService + { + /// + /// 查询质量控制从表(存储具体检查参数明细)列表 + /// + /// + /// + public PagedInfo GetList(QualityControlDetailQueryDto parm) + { + var predicate = QueryExp(parm); + + var response = Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + + return response; + } + + + /// + /// 获取详情 + /// + /// + /// + public QualityControlDetail GetInfo(long Id) + { + var response = Queryable() + .Where(x => x.Id == Id) + .First(); + + return response; + } + + /// + /// 添加质量控制从表(存储具体检查参数明细) + /// + /// + /// + public QualityControlDetail AddQualityControlDetail(QualityControlDetail model) + { + return Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改质量控制从表(存储具体检查参数明细) + /// + /// + /// + public int UpdateQualityControlDetail(QualityControlDetail model) + { + return Update(model, true); + } + + /// + /// 查询导出表达式 + /// + /// + /// + private static Expressionable QueryExp(QualityControlDetailQueryDto parm) + { + var predicate = Expressionable.Create(); + + return predicate; + } + } +} \ No newline at end of file diff --git a/RIZO.Service/Mes/ProductionPreparation/QualityControlService.cs b/RIZO.Service/Mes/ProductionPreparation/QualityControlService.cs new file mode 100644 index 0000000..f118498 --- /dev/null +++ b/RIZO.Service/Mes/ProductionPreparation/QualityControlService.cs @@ -0,0 +1,79 @@ +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using RIZO.Model.Mes.Dto.ProductionPreparation; +using RIZO.Model.Mes.ProductionPreparation; +using RIZO.Repository; +using RIZO.Service.Mes.IMesService.ProductionPreparation; + +namespace RIZO.Service.Mes +{ + /// + /// 质量控制主表Service业务层处理 + /// + [AppService(ServiceType = typeof(IQualityControlService), ServiceLifetime = LifeTime.Transient)] + public class QualityControlService : BaseService, IQualityControlService + { + /// + /// 查询质量控制主表列表 + /// + /// + /// + public PagedInfo GetList(QualityControlQueryDto parm) + { + var predicate = QueryExp(parm); + + var response = Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + + return response; + } + + + /// + /// 获取详情 + /// + /// + /// + public QualityControl GetInfo(long Id) + { + var response = Queryable() + .Where(x => x.Id == Id) + .First(); + + return response; + } + + /// + /// 添加质量控制主表 + /// + /// + /// + public QualityControl AddQualityControl(QualityControl model) + { + return Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改质量控制主表 + /// + /// + /// + public int UpdateQualityControl(QualityControl model) + { + return Update(model, true); + } + + /// + /// 查询导出表达式 + /// + /// + /// + private static Expressionable QueryExp(QualityControlQueryDto parm) + { + var predicate = Expressionable.Create(); + + return predicate; + } + } +} \ No newline at end of file diff --git a/RIZO.Service/RIZO.Service.csproj b/RIZO.Service/RIZO.Service.csproj index 107685d..1e44c4c 100644 --- a/RIZO.Service/RIZO.Service.csproj +++ b/RIZO.Service/RIZO.Service.csproj @@ -28,9 +28,11 @@ + +