From 4fc6dd5d8c8c3b5015c38409caef91db361a31d9 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Wed, 29 Nov 2023 16:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/qc/QcinspectionItemController.cs | 27 +++++-- ZR.Model/MES/qc/QcInspectionitem.cs | 75 +++++++++++++++++++ ZR.Model/MES/qc/{QuRough.cs => QcRough.cs} | 0 .../qc/IService/IQcinspectionItemService.cs | 14 ++++ ZR.Service/mes/qc/QcinspectionItemService.cs | 40 ++++++++++ 5 files changed, 148 insertions(+), 8 deletions(-) create mode 100644 ZR.Model/MES/qc/QcInspectionitem.cs rename ZR.Model/MES/qc/{QuRough.cs => QcRough.cs} (100%) create mode 100644 ZR.Service/mes/qc/IService/IQcinspectionItemService.cs create mode 100644 ZR.Service/mes/qc/QcinspectionItemService.cs diff --git a/ZR.Admin.WebApi/Controllers/mes/qc/QcinspectionItemController.cs b/ZR.Admin.WebApi/Controllers/mes/qc/QcinspectionItemController.cs index ebc77b80..79717aa3 100644 --- a/ZR.Admin.WebApi/Controllers/mes/qc/QcinspectionItemController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/qc/QcinspectionItemController.cs @@ -6,7 +6,9 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Text.Json; using ZR.Admin.WebApi.Extensions; - +using ZR.Model.MES.qu; +using ZR.Service.mes.qc.IService; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace ZR.Admin.WebApi.Controllers.mes.qc { @@ -15,22 +17,31 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc [Route("mes/qc/IQC")] public class QcinspectionItemController : BaseController { - readonly IQcinspectionItemService qcinspection; + private readonly IQcinspectionItemService qcinspection; public QcinspectionItemController(IQcinspectionItemService qcinspection) { - this.qcinspection= qcinspection; + this.qcinspection = qcinspection; } - - [HttpGet] - public ActionResult Get() + /// + /// 返回检测项列表 + /// + /// + [HttpGet("getinspectionItemList")] + public IActionResult GetinspectionItemList(string inspectionModule="",string inspectionType="") { - return qcinspection.Get(); + + List data = qcinspection.GetinspectionItemList(inspectionModule, inspectionType); + + + + return ToResponse(new ApiResult(200, "success", data)); + } } - + } diff --git a/ZR.Model/MES/qc/QcInspectionitem.cs b/ZR.Model/MES/qc/QcInspectionitem.cs new file mode 100644 index 00000000..9826a2c8 --- /dev/null +++ b/ZR.Model/MES/qc/QcInspectionitem.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.MES.qu +{ + /// + /// 检测项 + /// + [SugarTable("qc_inspectionitem")] + public class QcInspectionitem + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public int Id { get; set; } + /// + /// 检测编码 + /// + [SugarColumn(ColumnName = "inspection_code")] + public string InspectionCode { get; set; } + /// + /// 检测名称 + /// + [SugarColumn(ColumnName = "inspection_name")] + public string InspectionName { get; set; } + /// + /// 检测类别 + /// + [SugarColumn(ColumnName = "inspection_type")] + public string InspectionType { get; set; } + + /// + /// 检测类别 + /// + [SugarColumn(ColumnName = "inspectionModule")] + public string InspectionModule { get; set; } + /// + /// 序号 + /// + [SugarColumn(ColumnName = "order_")] + public int? Order { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName = "TENANT_ID")] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName = "REVISION")] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CREATED_BY")] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CREATED_TIME")] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UPDATED_BY")] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/MES/qc/QuRough.cs b/ZR.Model/MES/qc/QcRough.cs similarity index 100% rename from ZR.Model/MES/qc/QuRough.cs rename to ZR.Model/MES/qc/QcRough.cs diff --git a/ZR.Service/mes/qc/IService/IQcinspectionItemService.cs b/ZR.Service/mes/qc/IService/IQcinspectionItemService.cs new file mode 100644 index 00000000..7f7c45ed --- /dev/null +++ b/ZR.Service/mes/qc/IService/IQcinspectionItemService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ZR.Model.MES.qu; + +namespace ZR.Service.mes.qc.IService +{ + public interface IQcinspectionItemService + { + public List GetinspectionItemList(string inspectionModule, string inspectionType ); + } +} diff --git a/ZR.Service/mes/qc/QcinspectionItemService.cs b/ZR.Service/mes/qc/QcinspectionItemService.cs new file mode 100644 index 00000000..c4bf573f --- /dev/null +++ b/ZR.Service/mes/qc/QcinspectionItemService.cs @@ -0,0 +1,40 @@ +using Infrastructure.Attribute; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ZR.Model.mes.pro; +using ZR.Model.MES.qu; +using ZR.Service.mes.qc.IService; +using ZR.Service.mes.qu.IService; +using static System.Runtime.InteropServices.JavaScript.JSType; + +namespace ZR.Service.mes.qc +{ + + + [AppService(ServiceType = typeof(IQcinspectionItemService), ServiceLifetime = LifeTime.Transient)] + public class QcinspectionItemService : BaseService, IQcinspectionItemService + { + public List GetinspectionItemList() + { + return Queryable().ToList(); + } + + public List GetinspectionItemList(string inspectionModule, string inspectionType) + { + + var predicate = Expressionable.Create() + .AndIF(!string.IsNullOrEmpty(inspectionModule), it => it.InspectionModule == inspectionModule) + .AndIF(!string.IsNullOrEmpty(inspectionType), it => it.InspectionType == inspectionType) + .ToExpression(); + + + + return Queryable().Where(predicate).OrderBy(x => x.Order).ToList(); + } + } +}