提交
This commit is contained in:
parent
1ca03bd2a5
commit
4fc6dd5d8c
@ -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()
|
||||
/// <summary>
|
||||
/// 返回检测项列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getinspectionItemList")]
|
||||
public IActionResult GetinspectionItemList(string inspectionModule="",string inspectionType="")
|
||||
{
|
||||
return qcinspection.Get();
|
||||
|
||||
List<QcInspectionitem> data = qcinspection.GetinspectionItemList(inspectionModule, inspectionType);
|
||||
|
||||
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
75
ZR.Model/MES/qc/QcInspectionitem.cs
Normal file
75
ZR.Model/MES/qc/QcInspectionitem.cs
Normal file
@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace ZR.Model.MES.qu
|
||||
{
|
||||
/// <summary>
|
||||
/// 检测项
|
||||
///</summary>
|
||||
[SugarTable("qc_inspectionitem")]
|
||||
public class QcInspectionitem
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 检测编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "inspection_code")]
|
||||
public string InspectionCode { get; set; }
|
||||
/// <summary>
|
||||
/// 检测名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "inspection_name")]
|
||||
public string InspectionName { get; set; }
|
||||
/// <summary>
|
||||
/// 检测类别
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "inspection_type")]
|
||||
public string InspectionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检测类别
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "inspectionModule")]
|
||||
public string InspectionModule { get; set; }
|
||||
/// <summary>
|
||||
/// 序号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "order_")]
|
||||
public int? Order { get; set; }
|
||||
/// <summary>
|
||||
/// 租户号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TENANT_ID")]
|
||||
public string TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 乐观锁
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "REVISION")]
|
||||
public int? Revision { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
14
ZR.Service/mes/qc/IService/IQcinspectionItemService.cs
Normal file
14
ZR.Service/mes/qc/IService/IQcinspectionItemService.cs
Normal file
@ -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<QcInspectionitem> GetinspectionItemList(string inspectionModule, string inspectionType );
|
||||
}
|
||||
}
|
||||
40
ZR.Service/mes/qc/QcinspectionItemService.cs
Normal file
40
ZR.Service/mes/qc/QcinspectionItemService.cs
Normal file
@ -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<QcInspectionitem>, IQcinspectionItemService
|
||||
{
|
||||
public List<QcInspectionitem> GetinspectionItemList()
|
||||
{
|
||||
return Queryable().ToList();
|
||||
}
|
||||
|
||||
public List<QcInspectionitem> GetinspectionItemList(string inspectionModule, string inspectionType)
|
||||
{
|
||||
|
||||
var predicate = Expressionable.Create<QcInspectionitem>()
|
||||
.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user