From 6f6a5ecb50b1fbd6e8263ef45542d764338ee380 Mon Sep 17 00:00:00 2001
From: zhoukeda <1315948824@qq.com>
Date: Tue, 19 Sep 2023 16:50:57 +0800
Subject: [PATCH 1/4] =?UTF-8?q?pad=20=E7=BB=84=E8=A3=85=E5=8C=85=E8=A3=85?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dto/PrdManage/PADPackageTaskPageOutput.cs | 89 +++++++++++++++++++
.../Tnb.ProductionMgr/PrdPackReportService.cs | 51 +++++++++++
2 files changed, 140 insertions(+)
create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs
new file mode 100644
index 00000000..aaa52ab4
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs
@@ -0,0 +1,89 @@
+namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
+{
+ public class PADPackageTaskPageOutput
+ {
+ public string id { get; set; }
+
+ ///
+ /// 生产任务编号
+ ///
+ public string? mo_task_code { get; set; }
+
+ ///
+ /// 工单Id
+ ///
+ public string? mo_id { get; set; }
+
+ ///
+ /// 物料Id
+ ///
+ public string material_id { get; set; }
+
+ public string material_code { get; set; }
+ public string material_name { get; set; }
+
+ ///
+ /// 产线id
+ ///
+ public string? workline_id { get; set; }
+
+ public string? workline_name { get; set; }
+
+ ///
+ /// 生产bom id
+ ///
+ public string? bom_id { get; set; }
+
+ ///
+ /// 任务单状态
+ ///
+ public string? mo_task_status { get; set; }
+
+
+
+ ///
+ /// 已完工数量
+ ///
+ public int? complete_qty { get; set; }
+
+ ///
+ /// 报废数量
+ ///
+ public int? scrap_qty { get; set; }
+
+ ///
+ /// 已排产数量
+ ///
+ public int? scheduled_qty { get; set; }
+
+ ///
+ /// 排产类型:1、注塑、挤出2、组装、包装
+ ///
+ public int? schedule_type { get; set; }
+
+ public int? reported_work_qty { get; set; }
+
+ ///
+ /// 计划开始时间
+ ///
+ public string? estimated_start_date { get; set; }
+
+ ///
+ /// 计划结束时间
+ ///
+ public string? estimated_end_date { get; set; }
+ ///
+ /// 父任务Id
+ ///
+ public string? parent_id { get; set; }
+
+ ///
+ /// 工序id
+ ///
+ public string process_id { get; set; }
+
+ public string process_name { get; set; }
+
+ public string mbom_process_id { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
index 81854de2..4e6f5fb3 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
@@ -10,6 +10,7 @@ using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.Systems.Entitys.Permission;
+using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Mvc;
@@ -239,5 +240,55 @@ namespace Tnb.ProductionMgr
}
}
}
+
+ ///
+ /// pda端根据工位获取组装包装列表
+ ///
+ ///
+ [HttpPost]
+ public async Task GetPadList(PrdPackReportQueryInput input)
+ {
+ if (string.IsNullOrEmpty(input.stationId))
+ {
+ return new
+ {
+ pagination = new PageResult(),
+ list = Array.Empty()
+ };
+ }
+
+ var result = await _db.Queryable()
+ .LeftJoin((a, b) => a.material_id == b.id)
+ .LeftJoin((a, b, c) => a.process_id == c.id)
+ .LeftJoin((a, b, c, d) => a.workline_id == d.Id)
+ .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
+ .Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==2)
+ .OrderByDescending((a, b) => a.create_time)
+ .Select((a, b, c, d, e) => new PADPackageTaskPageOutput
+ {
+ id = a.id,
+ mo_task_code = a.mo_task_code,
+ mo_id = a.mo_id,
+ material_id = a.material_id,
+ material_code = b.code,
+ material_name = b.name,
+ workline_id = a.workline_id,
+ workline_name = d.FullName,
+ bom_id = a.bom_id,
+ mo_task_status = e.FullName,
+ complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
+ scrap_qty = a.scrap_qty,
+ scheduled_qty = a.scheduled_qty,
+ reported_work_qty = a.reported_work_qty,
+ estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
+ estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
+ parent_id = a.parent_id,
+ process_id = a.process_id,
+ process_name = c.process_name,
+ mbom_process_id = a.mbom_process_id,
+ }).ToPagedListAsync(input.currentPage, input.pageSize);
+
+ return PageResult.SqlSugarPageResult(result);
+ }
}
}
From 3592d78fb5cb045e8a04422c51a169bc75d882c7 Mon Sep 17 00:00:00 2001
From: zhoukeda <1315948824@qq.com>
Date: Tue, 19 Sep 2023 18:17:13 +0800
Subject: [PATCH 2/4] =?UTF-8?q?pad=E6=B3=A8=E5=A1=91=E6=8C=A4=E5=87=BA?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Tnb.ProductionMgr/PrdPackReportService.cs | 50 +++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
index 4e6f5fb3..86b5f0a3 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
@@ -240,6 +240,56 @@ namespace Tnb.ProductionMgr
}
}
}
+
+ ///
+ /// pda端根据工位获取注塑挤出列表
+ ///
+ ///
+ [HttpPost]
+ public async Task GetInjectionMoldingList(PrdPackReportQueryInput input)
+ {
+ if (string.IsNullOrEmpty(input.stationId))
+ {
+ return new
+ {
+ pagination = new PageResult(),
+ list = Array.Empty()
+ };
+ }
+
+ var result = await _db.Queryable()
+ .LeftJoin((a, b) => a.material_id == b.id)
+ .LeftJoin((a, b, c) => a.process_id == c.id)
+ .LeftJoin((a, b, c, d) => a.workline_id == d.Id)
+ .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
+ .Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==1)
+ .OrderByDescending((a, b) => a.create_time)
+ .Select((a, b, c, d, e) => new PADPackageTaskPageOutput
+ {
+ id = a.id,
+ mo_task_code = a.mo_task_code,
+ mo_id = a.mo_id,
+ material_id = a.material_id,
+ material_code = b.code,
+ material_name = b.name,
+ workline_id = a.workline_id,
+ workline_name = d.FullName,
+ bom_id = a.bom_id,
+ mo_task_status = e.FullName,
+ complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
+ scrap_qty = a.scrap_qty,
+ scheduled_qty = a.scheduled_qty,
+ reported_work_qty = a.reported_work_qty,
+ estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
+ estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
+ parent_id = a.parent_id,
+ process_id = a.process_id,
+ process_name = c.process_name,
+ mbom_process_id = a.mbom_process_id,
+ }).ToPagedListAsync(input.currentPage, input.pageSize);
+
+ return PageResult.SqlSugarPageResult(result);
+ }
///
/// pda端根据工位获取组装包装列表
From f636b1251794532e1140aef5b1602f2b2b30ada3 Mon Sep 17 00:00:00 2001
From: zhoukeda <1315948824@qq.com>
Date: Wed, 20 Sep 2023 11:32:00 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=8A=E6=A8=A1=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Entity/CheckMoldInput.cs | 9 ++++++
.../Tnb.ProductionMgr/PrdPackReportService.cs | 30 ++++++++++++-------
2 files changed, 29 insertions(+), 10 deletions(-)
create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs
new file mode 100644
index 00000000..eac56daa
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs
@@ -0,0 +1,9 @@
+namespace Tnb.ProductionMgr.Entities.Entity
+{
+ public class CheckMoldInput
+ {
+ public string mo_task_id { get; set; }
+
+ public string mold_qrcode { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
index 86b5f0a3..1ee4f9d0 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Aspose.Cells.Drawing;
-using JNPF.Common.Extension;
+using JNPF.Common.Extension;
using JNPF.Common.Filter;
using JNPF.Common.Security;
using JNPF.DependencyInjection;
@@ -14,15 +8,14 @@ using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System;
using Mapster;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.CodeAnalysis.Operations;
-using NPOI.POIFS.Properties;
-using Spire.Pdf.Widget;
using SqlSugar;
using Tnb.BasicData;
using Tnb.BasicData.Entities;
using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using Tnb.ProductionMgr.Interfaces;
+using Tnb.ProductionMgr.Entities.Entity;
+
namespace Tnb.ProductionMgr
{
@@ -340,5 +333,22 @@ namespace Tnb.ProductionMgr
return PageResult.SqlSugarPageResult(result);
}
+
+ ///
+ /// pda端根据工位获取组装包装列表
+ ///
+ ///
+ [HttpPost]
+ public async Task CheckMold(CheckMoldInput input)
+ {
+ PrdMoTask prdMoTask = await _db.Queryable().SingleAsync(x => x.id == input.mo_task_id);
+ BasQrcode basQrcode = await _db.Queryable().Where(x=>x.source_name=="TOOL_MOLDS" && x.code==input.mold_qrcode).FirstAsync();
+ if (prdMoTask != null && basQrcode!=null)
+ {
+ return prdMoTask.mold_id == basQrcode.source_id;
+ }
+
+ return false;
+ }
}
}
From 9f21a1986ec3898183e1a28aa9f882aba2a27ff4 Mon Sep 17 00:00:00 2001
From: zhoukeda <1315948824@qq.com>
Date: Wed, 20 Sep 2023 17:13:24 +0800
Subject: [PATCH 4/4] bug
---
.../Dto/PrdManage/PADPackageTaskPageOutput.cs | 6 ++++++
.../Tnb.ProductionMgr/PrdPackReportService.cs | 16 ++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs
index aaa52ab4..93b18d85 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs
@@ -85,5 +85,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
public string process_name { get; set; }
public string mbom_process_id { get; set; }
+ public string equip_id { get; set; }
+ public string equip_code { get; set; }
+ public string equip_name { get; set; }
+ public string mold_id { get; set; }
+ public string mold_code { get; set; }
+ public string mold_name { get; set; }
}
}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
index 1ee4f9d0..6ed5f27f 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
@@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData;
using Tnb.BasicData.Entities;
+using Tnb.EquipMgr.Entities;
using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using Tnb.ProductionMgr.Interfaces;
@@ -253,11 +254,12 @@ namespace Tnb.ProductionMgr
var result = await _db.Queryable()
.LeftJoin((a, b) => a.material_id == b.id)
.LeftJoin((a, b, c) => a.process_id == c.id)
- .LeftJoin((a, b, c, d) => a.workline_id == d.Id)
- .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
+ .LeftJoin((a, b, c, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
+ .LeftJoin((a,b,c,e,f)=>a.eqp_id==f.id)
+ .LeftJoin((a,b,c,e,f,g)=>a.mold_id==g.id)
.Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==1)
.OrderByDescending((a, b) => a.create_time)
- .Select((a, b, c, d, e) => new PADPackageTaskPageOutput
+ .Select((a, b, c, e,f,g) => new PADPackageTaskPageOutput
{
id = a.id,
mo_task_code = a.mo_task_code,
@@ -266,7 +268,7 @@ namespace Tnb.ProductionMgr
material_code = b.code,
material_name = b.name,
workline_id = a.workline_id,
- workline_name = d.FullName,
+ // workline_name = d.FullName,
bom_id = a.bom_id,
mo_task_status = e.FullName,
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
@@ -279,6 +281,12 @@ namespace Tnb.ProductionMgr
process_id = a.process_id,
process_name = c.process_name,
mbom_process_id = a.mbom_process_id,
+ equip_id = a.eqp_id,
+ equip_code = f.code,
+ equip_name = f.name,
+ mold_id = a.mold_id,
+ mold_code = g.mold_code,
+ mold_name = g.mold_name,
}).ToPagedListAsync(input.currentPage, input.pageSize);
return PageResult.SqlSugarPageResult(result);