From 68b975c49830fec10e9fcf7936d3ba30f47ea6a0 Mon Sep 17 00:00:00 2001
From: zhoukeda <1315948824@qq.com>
Date: Wed, 28 Jun 2023 15:31:02 +0800
Subject: [PATCH] bug
---
.../Dto/PrdManage/PackSechelToBeIssueListOutput.cs | 4 ++--
.../Tnb.ProductionMgr.Entities/Entity/PrdMo.cs | 5 +++++
.../Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs | 5 +++++
ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs | 10 ++++++----
4 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs
index 5a71e3ce..66d4d2ec 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs
@@ -71,11 +71,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
///
/// 预计开始时间
///
- public DateTime? estimated_start_date { get; set; }
+ public string? estimated_start_date { get; set; }
///
/// 预计结束时间
///
- public DateTime? estimated_end_date { get; set; }
+ public string? estimated_end_date { get; set; }
///
/// 工序名称
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs
index 4a2a743f..f456faf7 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs
@@ -222,5 +222,10 @@ public partial class PrdMo : BaseEntity
/// 父工单id
///
public string parent_id { get; set; }
+
+ ///
+ /// 物料单位
+ ///
+ public string? unit_id { get; set; }
}
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs
index 097e9df0..d2135450 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs
@@ -187,5 +187,10 @@ public partial class PrdMoTask : BaseEntity
/// 最后一道工序完成数量
///
public int? last_process_complete_qty { get; set; }
+
+ ///
+ /// 物料单位
+ ///
+ public string? unit_id { get; set; }
}
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
index 571761ec..f78051c0 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
@@ -379,8 +379,8 @@ namespace Tnb.ProductionMgr
// scheduled_qty = SqlFunc.Subqueryable().Where(it => it.mo_id == a.mo_id).Sum(it => it.scheduled_qty),
scheduled_qty = a.scheduled_qty,
plan_qty = SqlFunc.Subqueryable().Where(it => it.id == a.mo_id).Select(it => it.plan_qty),
- estimated_start_date = a.estimated_start_date,
- estimated_end_date = a.estimated_end_date,
+ estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm"),
+ estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm"),
bom_id = d.id,
bom_version = d.version
})
@@ -415,8 +415,8 @@ namespace Tnb.ProductionMgr
scheduled_qty = a.scheduled_qty,
plan_qty = d.plan_qty,
process_task_qty = a.process_task_qty,
- estimated_start_date = a.estimated_start_date,
- estimated_end_date = a.estimated_end_date,
+ estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm"),
+ estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm"),
process_name = e.process_name,
bom_version = SqlFunc.Subqueryable().Where(it => it.material_id == a.material_id).Select(it => it.version)
})
@@ -658,6 +658,7 @@ namespace Tnb.ProductionMgr
var mo = await db.Queryable().FirstAsync(it => it.id == input.mo_id);
var moCode = mo?.mo_code;
var taskCode = await db.Queryable().Where(it => !string.IsNullOrEmpty(it.mo_task_code) && it.mo_task_code.Contains(moCode)).OrderByDescending(it => it.mo_task_code).Select(it => it.mo_task_code).FirstAsync();
+ moTask.unit_id = mo.unit_id;
if (taskCode.IsNullOrEmpty())
{
moTask.mo_task_code = $"{moCode}-01";
@@ -770,6 +771,7 @@ namespace Tnb.ProductionMgr
moTask.estimated_end_date = input.estimated_end_date;
moTask.scheduled_qty = input.scheduled_qty;
var mo = await _db.Queryable().FirstAsync(it => it.id == input.mo_id);
+ moTask.unit_id = mo.unit_id;
var moCode = mo?.mo_code;
// var taskCode = await _db.Queryable().Where(it => string.IsNullOrEmpty(it.parent_id) && !string.IsNullOrEmpty(it.mo_task_code) && it.mo_task_code.Contains(moCode))
// .OrderByDescending(it => it.mo_task_code)