IQC开始
This commit is contained in:
parent
ce2e23ca02
commit
7ba84f96cd
@ -14,11 +14,11 @@ using ZR.Service.mes.qu.IService;
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.qu
|
||||
{
|
||||
[Route("mes/qu/rough")]
|
||||
public class QuRoughController : BaseController
|
||||
public class QcRoughController : BaseController
|
||||
{
|
||||
private readonly IQuRoughService quRoughService;
|
||||
private readonly IQcRoughService quRoughService;
|
||||
|
||||
public QuRoughController(IQuRoughService quRoughService)
|
||||
public QcRoughController(IQcRoughService quRoughService)
|
||||
{
|
||||
this.quRoughService = quRoughService;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
using Infrastructure.Extensions;
|
||||
using JinianNet.JNTemplate;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using ZR.Admin.WebApi.Controllers;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.MES.wm;
|
||||
using ZR.Service.mes.pro;
|
||||
using ZR.Service.mes.wm;
|
||||
using ZR.Service.mes.wm.IService;
|
||||
|
||||
|
||||
[Route("mes/wm/return")]
|
||||
public class MaterialReturnController : BaseController
|
||||
{
|
||||
private readonly IMaterialreturnService materialreturn;
|
||||
|
||||
public MaterialReturnController(IMaterialreturnService materialreturn)
|
||||
{
|
||||
this.materialreturn = materialreturn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询领料单
|
||||
/// </summary>
|
||||
/// <param name="pageNum"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="week"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getmaterialreturn")]
|
||||
public IActionResult Getmaterialreturn(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
|
||||
(List<WmMaterialreturn>, int) data = materialreturn.Getmaterialreturn(pageNum, pageSize, year, week, date);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -6,61 +6,63 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Model.MES.qu
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 毛坯统计表
|
||||
///</summary>
|
||||
[SugarTable("qu_rough")]
|
||||
public class QuRough
|
||||
[SugarTable("qc_rough")]
|
||||
public class QcRough
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产工单id
|
||||
/// 领料单id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_pro_order_id")]
|
||||
public string FkProOrderId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "fk_materialRequisition_id")]
|
||||
public string FkMaterialrequisitionId { get; set; }
|
||||
/// <summary>
|
||||
/// 需要数量
|
||||
/// 应到数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "require_num")]
|
||||
public int? RequireNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实际数量
|
||||
/// 实际到达数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "actual_number")]
|
||||
public int? ActualNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 合格数
|
||||
/// 抽检比例%
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "randomRate")]
|
||||
public int? RandomRate { get; set; }
|
||||
/// <summary>
|
||||
/// 合格数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "oks")]
|
||||
public int? Oks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 不合格数
|
||||
/// 不合格数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ngs")]
|
||||
public string Ngs { get; set; }
|
||||
|
||||
public int? Ngs { get; set; }
|
||||
/// <summary>
|
||||
/// 合格率
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "oks_ratio")]
|
||||
public string OksRatio { get; set; }
|
||||
|
||||
|
||||
public decimal? OksRatio { get; set; }
|
||||
/// <summary>
|
||||
/// 是否上料
|
||||
/// 是否可以上料
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "isFeeding")]
|
||||
public int IsFeeding { get; set; }
|
||||
|
||||
public string IsFeeding { get; set; }
|
||||
/// <summary>
|
||||
/// 乐观锁
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "REVISION")]
|
||||
public int? Revision { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
///</summary>
|
||||
@ -82,4 +84,6 @@ namespace ZR.Model.MES.qu
|
||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
81
ZR.Model/MES/wm/WmMaterialreturn.cs
Normal file
81
ZR.Model/MES/wm/WmMaterialreturn.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Model.MES.wm
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产退料
|
||||
///</summary>
|
||||
[SugarTable("wm_materialreturn")]
|
||||
public class WmMaterialreturn
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 领料单id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_mrqr_id")]
|
||||
public string FkMrqrId { get; set; }
|
||||
/// <summary>
|
||||
/// 年
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "year")]
|
||||
public int? Year { get; set; }
|
||||
/// <summary>
|
||||
/// 周
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "week")]
|
||||
public int? Week { get; set; }
|
||||
/// <summary>
|
||||
/// 日
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "date")]
|
||||
public int? Date { get; set; }
|
||||
/// <summary>
|
||||
/// 毛坯零件号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "workblankpartnumber")]
|
||||
public string Workblankpartnumber { get; set; }
|
||||
/// <summary>
|
||||
/// 退料数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "requirenum")]
|
||||
public int? Requirenum { 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; }
|
||||
}
|
||||
}
|
||||
@ -26,6 +26,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="MES\qu\DTO\" />
|
||||
<Folder Include="MES\qc\DTO\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -9,7 +9,7 @@ using ZR.Model.MES.qu;
|
||||
|
||||
namespace ZR.Service.mes.qu.IService
|
||||
{
|
||||
public interface IQuRoughService
|
||||
public interface IQcRoughService
|
||||
{
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule);
|
||||
}
|
||||
@ -14,8 +14,8 @@ using ZR.Service.mes.qu.IService;
|
||||
|
||||
namespace ZR.Service.mes.qu
|
||||
{
|
||||
[AppService(ServiceType = typeof(IQuRoughService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class QuRoughService : BaseService<QuRough>, IQuRoughService
|
||||
[AppService(ServiceType = typeof(IQcRoughService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class QcRoughService : BaseService<QcRough>, IQcRoughService
|
||||
{
|
||||
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule)
|
||||
15
ZR.Service/mes/wm/IService/IMaterialreturnService.cs
Normal file
15
ZR.Service/mes/wm/IService/IMaterialreturnService.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.wm;
|
||||
|
||||
namespace ZR.Service.mes.wm.IService
|
||||
{
|
||||
public interface IMaterialreturnService
|
||||
{
|
||||
|
||||
public (List<WmMaterialreturn>, int) Getmaterialreturn(int pageNum, int pageSize, int year, int week, int date);
|
||||
}
|
||||
}
|
||||
@ -17,11 +17,9 @@ namespace ZR.Service.mes.wm
|
||||
|
||||
|
||||
[AppService(ServiceType = typeof(IMaterialRequisitionService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MaterialRequisitionService : BaseService<QuRough>, IMaterialRequisitionService
|
||||
public class MaterialRequisitionService : BaseService<WmMaterialrequisition>, IMaterialRequisitionService
|
||||
{
|
||||
public MaterialRequisitionService() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public (List<WmMaterialrequisition>, int) GetmaterialsRequisition(int pageNum, int pageSize, int year, int week, int date)
|
||||
{
|
||||
|
||||
35
ZR.Service/mes/wm/MaterialreturnService.cs
Normal file
35
ZR.Service/mes/wm/MaterialreturnService.cs
Normal file
@ -0,0 +1,35 @@
|
||||
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.qu;
|
||||
using ZR.Model.MES.wm;
|
||||
using ZR.Service.mes.wm.IService;
|
||||
|
||||
namespace ZR.Service.mes.wm
|
||||
{
|
||||
|
||||
|
||||
[AppService(ServiceType = typeof(IMaterialreturnService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MaterialreturnService : BaseService<WmMaterialreturn>, IMaterialreturnService
|
||||
{
|
||||
public (List<WmMaterialreturn>, int) Getmaterialreturn(int pageNum, int pageSize, int year, int week, int date)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmMaterialreturn>()
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(date > 0, it => it.Date == date)
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
|
||||
List<WmMaterialreturn> materialreturnsList = Context.Queryable<WmMaterialreturn>().Where(predicate).OrderBy(it => it.Id).ToPageList(pageNum, pageSize, ref totalCount);
|
||||
|
||||
return (materialreturnsList, totalCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user