diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs index 5d70733d..03fca641 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs @@ -6,7 +6,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string mo_task_code { get; set; } public string material_id { get; set; } public string material_code { get; set; } - public int? num { get; set; } + public decimal? num { get; set; } public List children { get; set; } = new List(); } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs index f27fc705..88819230 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs @@ -40,9 +40,9 @@ // /// // public string progress_bar { get; set; } - public int? complete_qty { get; set; } + public decimal? complete_qty { get; set; } - public int? scheduled_qty { get; set; } + public decimal? scheduled_qty { get; set; } /// /// 领用设备 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs index f573e992..1b9db7cf 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs @@ -50,24 +50,24 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// /// 已完工数量 /// - public int? complete_qty { get; set; } + public decimal? complete_qty { get; set; } /// /// 报废数量 /// - public int? scrap_qty { get; set; } + public decimal? scrap_qty { get; set; } /// /// 已排产数量 /// - public int? scheduled_qty { get; set; } + public decimal? scheduled_qty { get; set; } /// /// 排产类型:1、注塑、挤出2、组装、包装 /// public int? schedule_type { get; set; } - public int? reported_work_qty { get; set; } + public decimal? reported_work_qty { get; set; } /// /// 计划开始时间 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs index 1fc9976f..51dd742d 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs @@ -44,19 +44,19 @@ /// /// 生产任务数量 /// - public int? scheduled_qty { get; set; } + public decimal? scheduled_qty { get; set; } /// /// 计划数量 /// - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } /// /// 已完成数量 /// - public int? complete_qty { get; set; } + public decimal? complete_qty { get; set; } /// /// 工序任务量 /// - public int? process_task_qty { get; set; } + public decimal? process_task_qty { get; set; } /// /// bom_id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs index a4bd3407..1fa0547f 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs @@ -11,7 +11,7 @@ namespace Tnb.ProductionMgr.Entities.Dto public string plan_start_date { get; set; } public string plan_end_date { get; set; } public string material_id { get; set; } - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } public string unit_id { get; set; } public string mo_status { get; set; } public string ebom_version { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs index 79b029a5..6955a4d0 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs @@ -8,8 +8,8 @@ namespace Tnb.ProductionMgr.Entities.Dto public string mold_id { get; set; } public string eqp_id { get; set; } public string mo_task_status { get; set; } - public int? plan_qty { get; set; } - public int? scheduled_qty { get; set; } + public decimal? plan_qty { get; set; } + public decimal? scheduled_qty { get; set; } public string create_time { get; set; } public string workstation_id { get; set; } public string worker_id { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs index f6e660e3..9b717d81 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs @@ -55,12 +55,12 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// /// 完成数量 /// - public int? complete_qty { get; set; } + public decimal? complete_qty { get; set; } /// /// 计划生产数量 /// - public int? plan_qty { get; set; } - public int? scheduled_qty { get; set; } + public decimal? plan_qty { get; set; } + public decimal? scheduled_qty { get; set; } /// /// 预计开工时间 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskManageListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskManageListOutput.cs index eb79327c..e058ea07 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskManageListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskManageListOutput.cs @@ -9,8 +9,8 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string eqp_id { get; set; } = string.Empty; public string plan_start_date { get; set; } = string.Empty; public string plan_end_date { get; set; } = string.Empty; - public int? plan_qty { get; set; } - public int? complete_qty { get; set; } + public decimal? plan_qty { get; set; } + public decimal? complete_qty { get; set; } public string? mo_task_status { get; set; } = string.Empty; public string? schedule_type { get; set; } = string.Empty; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs index c0c5085d..9a4dbe8d 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs @@ -25,11 +25,11 @@ /// /// 计划生产量 /// - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } /// /// 已完工数量 /// - public int? comple_qty { get; set; } + public decimal? comple_qty { get; set; } /// /// 产品名称 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs index 9deb95d3..2586509b 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs @@ -10,10 +10,10 @@ namespace Tnb.ProductionMgr.Entities.Dto public string? mo_task_id_id { get; set; } = string.Empty; public string? mo_task_type { get; set; } = string.Empty; public string? plan_end_date { get; set; } = string.Empty; - public int? plan_qty { get; set; } - public int? completed_qty { get; set; } + public decimal? plan_qty { get; set; } + public decimal? completed_qty { get; set; } public string? plan_start_date { get; set; } = string.Empty; - public int? reported_work_qty { get; set; } + public decimal? reported_work_qty { get; set; } public string? status { get; set; } = string.Empty; public string mo_code { get; set; } @@ -24,7 +24,7 @@ namespace Tnb.ProductionMgr.Entities.Dto public class ReportRecordListChildrenOutput { - public int? reported_qty { get; set; } + public decimal? reported_qty { get; set; } public string? create_id { get; set; } = string.Empty; public string? create_id_id { get; set; } = string.Empty; diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/WorkOrderAdjustmentListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/WorkOrderAdjustmentListOutput.cs index ec8f2a0a..e8ee1417 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/WorkOrderAdjustmentListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/WorkOrderAdjustmentListOutput.cs @@ -12,9 +12,9 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string material_id_id { get; set; } public string mold_id { get; set; } public string mold_id_id { get; set; } - public int? plan_qty { get; set; } - public int? complete_qty { get; set; } - public int? scheduled_qty { get; set; } + public decimal? plan_qty { get; set; } + public decimal? complete_qty { get; set; } + public decimal? scheduled_qty { get; set; } public string workline_id { get; set; } public string worker_id { get; set; } public string workline_id_id { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ZhuSuBiOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ZhuSuBiOutput.cs index 88459cf1..550c6e0f 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ZhuSuBiOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ZhuSuBiOutput.cs @@ -24,10 +24,10 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string material_name { get; set; } public string workline_name { get; set; } public string report_type { get; set; } - public int qty { get; set; } + public decimal qty { get; set; } public string repoter_name { get; set; } - public int plan_qty { get; set; } - public int remain_plan_qty { get; set; } + public decimal plan_qty { get; set; } + public decimal remain_plan_qty { get; set; } public string report_time { get; set; } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs index 2e8bcb34..b6685740 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs @@ -20,9 +20,9 @@ namespace Tnb.ProductionMgr.Entities public string process_id_id { get; set; } public string process_code { get; set; } public string mbom_process_id { get; set; } - public int? scheduled_qty { get; set; } - public int? reported_work_qty { get; set; } - public int? scrap_qty { get; set; } + public decimal? scheduled_qty { get; set; } + public decimal? reported_work_qty { get; set; } + public decimal? scrap_qty { get; set; } public string plan_start_date { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs index b5384f77..1520f9cb 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs @@ -42,27 +42,27 @@ public partial class PrdMo : BaseEntity /// /// 计划生产数量 /// - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } /// /// 已投入数量 /// - public int? input_qty { get; set; } + public decimal? input_qty { get; set; } /// /// 已完工数量 /// - public int? complete_qty { get; set; } + public decimal? complete_qty { get; set; } /// /// 已报工数量 /// - public int? reported_work_qty { get; set; } + public decimal? reported_work_qty { get; set; } /// /// 报废数量 /// - public int? scrap_qty { get; set; } + public decimal? scrap_qty { get; set; } /// /// 计划开始时间 @@ -227,7 +227,7 @@ public partial class PrdMo : BaseEntity /// /// 已排产数量 /// - public int? scheduled_qty { get; set; } + public decimal? scheduled_qty { get; set; } /// /// 父工单id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs index 3b6d226a..471fda28 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs @@ -67,32 +67,32 @@ public partial class PrdMoTask : BaseEntity /// /// 计划数量 /// - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } /// /// 已投入数量 /// - public int? input_qty { get; set; } + public decimal? input_qty { get; set; } /// /// 已完工数量 /// - public int? complete_qty { get; set; } + public decimal? complete_qty { get; set; } /// /// 已报工数量 /// - public int? reported_work_qty { get; set; } + public decimal? reported_work_qty { get; set; } /// /// 报废数量 /// - public int? scrap_qty { get; set; } + public decimal? scrap_qty { get; set; } /// /// 已排产数量 /// - public int? scheduled_qty { get; set; } + public decimal? scheduled_qty { get; set; } /// /// 排产类型:1、注塑、挤出2、组装、包装 @@ -172,7 +172,7 @@ public partial class PrdMoTask : BaseEntity /// /// 工序任务量 /// - public int? process_task_qty { get; set; } + public decimal? process_task_qty { get; set; } /// /// 工序id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs index b463b200..11245f21 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs @@ -47,12 +47,12 @@ public partial class PrdMoTaskDefectRecord : BaseEntity /// /// 计划生产数量 /// - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } /// /// 报废数量 /// - public int scrap_qty { get; set; } + public decimal scrap_qty { get; set; } /// /// 生产任务单状态 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs index 7f12b6ba..e4657c2b 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs @@ -62,17 +62,17 @@ public partial class PrdReport : BaseEntity /// /// 生产数量 /// - public int? prd_qty { get; set; } + public decimal? prd_qty { get; set; } /// /// 已报工数量 /// - public int? reported_work_qty { get; set; } + public decimal? reported_work_qty { get; set; } /// /// 报工数量 /// - public int? reported_qty { get; set; } + public decimal? reported_qty { get; set; } /// /// 生产任务编码 @@ -97,7 +97,7 @@ public partial class PrdReport : BaseEntity /// /// 条码数量 /// - public int barqty { get; set; } + public decimal barqty { get; set; } /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReportRecord.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReportRecord.cs index 271f13fa..f39ce2ba 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReportRecord.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReportRecord.cs @@ -42,12 +42,12 @@ public partial class PrdReportRecord : BaseEntity /// /// 计划生产数量 /// - public int? plan_qty { get; set; } + public decimal? plan_qty { get; set; } /// /// 完成数量 /// - public int completed_qty { get; set; } + public decimal completed_qty { get; set; } /// /// 任务单号 @@ -68,7 +68,7 @@ public partial class PrdReportRecord : BaseEntity /// /// 已报工数量 /// - public int reported_work_qty { get; set; } + public decimal reported_work_qty { get; set; } /// /// 工单号 diff --git a/ProductionMgr/Tnb.ProductionMgr/BiService.cs b/ProductionMgr/Tnb.ProductionMgr/BiService.cs index 1ddec306..f70c918f 100644 --- a/ProductionMgr/Tnb.ProductionMgr/BiService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/BiService.cs @@ -44,28 +44,28 @@ namespace Tnb.ProductionMgr string monthStr = dayStr.Substring(0, 7); ZhuSuBiOutput output = new ZhuSuBiOutput(); output.day_month_yield = new DayMonthYieldOutput(); - int? monthQualifiedQty = await _db.Queryable() + decimal? monthQualifiedQty = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .Where((a, b) => a.create_time.ToString("yyyy-MM") == monthStr && b.category_id.Contains("ZSJ")) .GroupBy((a, b) => a.org_id) .Select((a, b) => SqlFunc.AggregateSum(a.reported_qty)) .FirstAsync(); - int? monthUnQualifiedQty = await _db.Queryable() + decimal? monthUnQualifiedQty = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .Where((a, b) => a.create_time.ToString("yyyy-MM") == monthStr && b.category_id.Contains("ZSJ")) .GroupBy((a, b) => a.org_id) .Select((a, b) => SqlFunc.AggregateSum(a.scrap_qty)) .FirstAsync(); - int? dayQualifiedQty = await _db.Queryable() + decimal? dayQualifiedQty = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .Where((a, b) => a.create_time.ToString("yyyy-MM-dd") == monthStr && b.category_id.Contains("ZSJ")) .GroupBy((a, b) => a.org_id) .Select((a, b) => SqlFunc.AggregateSum(a.reported_qty)) .FirstAsync(); - int? dayUnQualifiedQty = await _db.Queryable() + decimal? dayUnQualifiedQty = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .Where((a, b) => a.create_time.ToString("yyyy-MM-dd") == monthStr && b.category_id.Contains("ZSJ")) .GroupBy((a, b) => a.org_id) diff --git a/ProductionMgr/Tnb.ProductionMgr/MesForErpService.cs b/ProductionMgr/Tnb.ProductionMgr/MesForErpService.cs index 713d40c1..6eaf7475 100644 --- a/ProductionMgr/Tnb.ProductionMgr/MesForErpService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/MesForErpService.cs @@ -57,6 +57,7 @@ namespace Tnb.ProductionMgr Log.Information($"生产工单接收参数:{JsonConvert.SerializeObject(input)}"); List moList = new List(); + List deleteMoList = new List(); List extendFieldList = new List(); foreach (var item in input) { @@ -146,6 +147,11 @@ namespace Tnb.ProductionMgr Log.Error($"【SavePrdMo】生产工单{mocode}状态不是待下发无法覆盖"); throw Oops.Bah($"【SavePrdMo】生产工单{mocode}状态不是待下发无法覆盖"); } + + if (existMo != null) + { + deleteMoList.Add(mocode); + } item.id = SnowflakeIdHelper.NextId(); item.material_id = basMaterial.id; @@ -165,6 +171,10 @@ namespace Tnb.ProductionMgr } DbResult result = await _db.Ado.UseTranAsync(async () => { + if (!deleteMoList.IsEmpty()) + { + await _db.Deleteable(x => deleteMoList.Contains(x.mo_code)).ExecuteCommandAsync(); + } await _db.Insertable(moList).ExecuteCommandAsync(); }); if (result.IsSuccess) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs index 59d4080c..c61fd85f 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs @@ -752,7 +752,7 @@ namespace Tnb.ProductionMgr { PrdReport prdReport = await _db.Queryable().Where(x => x.barcode == barcode).FirstAsync(); List prdReports = await _db.Queryable().Where(x => x.create_time <= prdReport.create_time && x.barcode != barcode && x.mo_task_id == mo_task_id).ToListAsync(); - int? beforeReportNum = prdReports.Sum(x => x.reported_qty); + decimal? beforeReportNum = prdReports.Sum(x => x.reported_qty); List prdFeedingIds = new(); if (prdMoTask.schedule_type == 1) { diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index d9bc3f60..3e38393b 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -802,7 +802,7 @@ namespace Tnb.ProductionMgr // await _qcCheckPlanService.CreateTask(entity); #endregion //根据工单号获取当前工单包含的已排产数 - int? schedQty = db.Queryable().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty); + decimal? schedQty = db.Queryable().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty); if (mo != null) {//判断如果当前 工单的已排产数大于工单计划数量则更新工单状态为 已排产 @@ -982,7 +982,7 @@ namespace Tnb.ProductionMgr //await db.Insertable(sacipRecord).ExecuteCommandAsync(); //根据工单号获取当前工单包含的已排产数 - int? schedQty = _db.Queryable().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty); + decimal? schedQty = _db.Queryable().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty); // if (mo != null) // {//判断如果当前 工单的已排产数大于工单计划数量则更新工单状态为 已排产 // if (schedQty.HasValue && schedQty.Value >= mo.plan_qty) @@ -2131,8 +2131,8 @@ namespace Tnb.ProductionMgr plan_check_type = WmsWareHouseConst.LINGBUJIANZUIZHONGJIANYAN_ID, }; - int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; - int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; + decimal? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; + decimal? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; entity.oldpronum = reported + scrap; entity.newpronum = input.reported_qty; // entity.triggerevent = EnumTriggerEvent.生产检定量; @@ -2342,9 +2342,11 @@ namespace Tnb.ProductionMgr // } // } - if(!isCheckFlag){ + if(!isCheckFlag) + { + int takeNum = (int)report.reported_qty.Value; List prdVisionResultRecords = await _db.Queryable() - .Where(x => x.status == 0 && x.result.ToUpper()=="OK").OrderByDescending(x => x.create_time).Take(report.reported_qty.Value).ToListAsync(); + .Where(x => x.status == 0 && x.result.ToUpper()=="OK").OrderByDescending(x => x.create_time).Take(takeNum).ToListAsync(); List ids = prdVisionResultRecords.Select(x => x.id).ToList(); @@ -2759,8 +2761,8 @@ namespace Tnb.ProductionMgr processid = prdMoTask.process_id, workid = prdMoTask.workstation_id }; - int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; - int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; + decimal? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; + decimal? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; entity.oldpronum = reported + scrap; entity.newpronum = input.scrap_qty; entity.triggerevent = EnumTriggerEvent.生产检定量; diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs index 5e69c005..23c64a0a 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs @@ -35,15 +35,15 @@ namespace Tnb.QcMgr.Entities /// /// 原先生产数量 /// - public int? oldpronum { get; set; } + public decimal? oldpronum { get; set; } /// /// 新生产数量 /// - public int? newpronum { get; set; } + public decimal? newpronum { get; set; } /// /// 生产次数 /// - public int? pronum { get; set; } + public decimal? pronum { get; set; } public string mo_task_code { get; set; } diff --git a/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs b/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs index 1cb116df..a059242c 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs @@ -384,7 +384,7 @@ namespace Tnb.QcMgr }else if (QcCheckExecH.checktype == WmsWareHouseConst.LINGBUJIANZUIZHONGJIANYAN_ID) { PrdReport prdReport = await db.Queryable().SingleAsync(x=>x.id==QcCheckExecH.report_id); - int pqty = prdReport.reported_qty.Value - rqty; + decimal pqty = prdReport.reported_qty.Value - rqty; if (rqty > Decimal.Parse(QcCheckExecH.checknum)) { throw Oops.Bah("不合格数不能大于抽样数");