From 615957e66d9e271326c412fda894dcf3c9933c99 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Tue, 31 Oct 2023 18:20:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=82=B9=E5=B7=A1=E6=A3=80=20=E4=BF=9D?= =?UTF-8?q?=E5=85=BB=E6=B2=A1=E5=AD=90=E9=A1=B9=E7=9B=AE=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Listener/GenerateMaintainPlanTimeWorker.cs | 5 +++++ .../Listener/GenerateSpotInspectionPlanTimeWorker.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs index 4cd3f922..4abed741 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs @@ -119,6 +119,11 @@ namespace JNPF.TaskScheduler.Listener }); } + if (spotInsRecordDs.Count<=0) + { + return; + } + var dbResult = db.Ado.UseTran(() => { if (tobeCreateList != null && tobeCreateList.Count > 0) diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs index 044515eb..48498fb4 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs @@ -148,6 +148,11 @@ namespace JNPF.TaskScheduler.Listener remark = tobeCreateItem.remark }); } + + if (spotInsRecordDs.Count<=0) + { + return; + } var dbResult = db.Ado.UseTran(() => { From 8c31205e70a15b662c79562bd76c537101910d81 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Wed, 1 Nov 2023 00:01:24 +0800 Subject: [PATCH 2/4] bug --- .../Tnb.EquipMgr/EquSpotInsRecordService.cs | 3 +- .../GenerateMaintainPlanTimeWorker.cs | 64 +++++++++---------- .../GenerateSpotInspectionPlanTimeWorker.cs | 63 +++++++++--------- 3 files changed, 65 insertions(+), 65 deletions(-) diff --git a/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs b/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs index ae8bc2a6..ec2b381f 100644 --- a/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs @@ -59,7 +59,7 @@ namespace Tnb.EquipMgr string status = queryJson.ContainsKey("status") ? (queryJson["status"].ToString() ?? "") : ""; DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; - + string now = DateTime.Now.ToString("yyyy-MM-dd"); if (string.IsNullOrEmpty(input.sidx)) { input.sidx = "a.create_time"; @@ -80,6 +80,7 @@ namespace Tnb.EquipMgr .WhereIF(!string.IsNullOrEmpty(equioInfo),(a,b,c)=>b.code.Contains(equioInfo)|| b.name.Contains(equioInfo)) .WhereIF(status=="3" && start_time!=null,a=>a.spot_record_date_time>=start_time) .WhereIF(status=="3" && end_time!=null,a=>a.spot_record_date_time<=end_time) + .Where(a=>a.create_time.Value.ToString("yyyy-MM-dd")==now) .OrderBy($"{input.sidx} {input.sort}") .Select((a, b, c,d) => new EqpSpotInsRecordListOutput { diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs index 4abed741..a58f132d 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs @@ -18,17 +18,18 @@ namespace JNPF.TaskScheduler.Listener // } [SpareTime("0 0 0 * * ?", "生成设备保养计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)] - public void GenerateSpotInspectionPlan(SpareTimer timer, long count) + public async void GenerateSpotInspectionPlan(SpareTimer timer, long count) { Log.Information("----------------------开始生成设备保养计划----------------------"); try { - List eqpSpotInsTemEquipHsByOne = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "1"); - List eqpSpotInsTemEquipHsByCirculate = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "2"); + var db = _repository.CopyNew(); + List eqpSpotInsTemEquipHsByOne = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "1").ToListAsync(); + List eqpSpotInsTemEquipHsByCirculate = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "2").ToListAsync(); List tobeCreateList = new List(); List tobeCreateTemplets = new List(); - var db = _repository.AsSugarClient(); + foreach (var item in eqpSpotInsTemEquipHsByOne) { @@ -56,7 +57,7 @@ namespace JNPF.TaskScheduler.Listener if (tobeCreateTemplets != null && tobeCreateTemplets.Count > 0) { - List equipments = db.Queryable().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToList(); + List equipments = await db.Queryable().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToListAsync(); int index = 1; foreach (var item in tobeCreateTemplets) { @@ -67,7 +68,6 @@ namespace JNPF.TaskScheduler.Listener string code = $"{DateTime.Now.ToString("yyyyMMdd")+(index++).ToString().PadLeft(3,'0')}"; tobeCreateList.Add(new EqpMaintainRecordH() { - id = SnowflakeIdHelper.NextId(), code = code, // equip_type_id = item.equip_type_id, equip_id = item.equip_id, @@ -90,14 +90,14 @@ namespace JNPF.TaskScheduler.Listener if (tobeCreateList != null && tobeCreateList.Count > 0) { List templetIDs = tobeCreateList.Select(x => x.maintain_tem_equip_id).ToList(); - List spotInsTemEquipDs = db.Queryable().Where(x => templetIDs.Contains(x.maintain_tem_equip_id)).ToList(); + List spotInsTemEquipDs = await db.Queryable().Where(x => templetIDs.Contains(x.maintain_tem_equip_id)).ToListAsync(); List spotInsItemIDs = spotInsTemEquipDs.Select(x => x.maintain_item_id).ToList(); - List spotCheckItems = db.Queryable().Where(x => spotInsItemIDs.Contains(x.id)).ToList(); + List spotCheckItems = await db.Queryable().Where(x => spotInsItemIDs.Contains(x.id)).ToListAsync(); + List spotInsRecordDs = new List(); foreach (var tobeCreatePlan in tobeCreateList) { - List spotInsRecordDs = new List(); List spotInsItems = spotInsTemEquipDs .Where(x => x.maintain_tem_equip_id == tobeCreatePlan.maintain_tem_equip_id) .Select(x => x.maintain_item_id).ToList(); @@ -119,30 +119,30 @@ namespace JNPF.TaskScheduler.Listener }); } - if (spotInsRecordDs.Count<=0) - { - return; - } - - var dbResult = db.Ado.UseTran(() => - { - if (tobeCreateList != null && tobeCreateList.Count > 0) - { - db.Insertable(tobeCreateList).ExecuteCommand(); - } - - if (spotInsRecordDs != null && spotInsRecordDs.Count > 0) - { - db.Insertable(spotInsRecordDs).ExecuteCommand(); - } - }); - if (!dbResult.IsSuccess) - { - Console.WriteLine(dbResult.ErrorMessage); - Log.Error(dbResult.ErrorMessage); - } - Log.Information($"---------------生成{tobeCreateList.Count}个计划---------------"); } + if (spotInsRecordDs.Count<=0) + { + return; + } + + var dbResult = db.Ado.UseTran(() => + { + if (tobeCreateList != null && tobeCreateList.Count > 0) + { + db.Insertable(tobeCreateList).ExecuteCommand(); + } + + if (spotInsRecordDs != null && spotInsRecordDs.Count > 0) + { + db.Insertable(spotInsRecordDs).ExecuteCommand(); + } + }); + if (!dbResult.IsSuccess) + { + Console.WriteLine(dbResult.ErrorMessage); + Log.Error(dbResult.ErrorMessage); + } + Log.Information($"---------------生成{tobeCreateList.Count}个计划---------------"); } } catch (Exception e) diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs index 48498fb4..6fd44130 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs @@ -18,17 +18,17 @@ namespace JNPF.TaskScheduler.Listener // } [SpareTime("0 0,30 * * * ?", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)] - public void GenerateSpotInspectionPlan(SpareTimer timer, long count) + public async void GenerateSpotInspectionPlan(SpareTimer timer, long count) { Log.Information("----------------------开始生成点巡检计划----------------------"); try { - List eqpSpotInsTemEquipHsByOne = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "1"); - List eqpSpotInsTemEquipHsByCirculate = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "2"); + var db = _repository.CopyNew(); + List eqpSpotInsTemEquipHsByOne = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "1").ToListAsync(); + List eqpSpotInsTemEquipHsByCirculate = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "2").ToListAsync(); List tobeCreateList = new List(); List tobeCreateTemplets = new List(); - var db = _repository.AsSugarClient(); foreach (var item in eqpSpotInsTemEquipHsByOne) { @@ -80,7 +80,7 @@ namespace JNPF.TaskScheduler.Listener if (tobeCreateTemplets != null && tobeCreateTemplets.Count > 0) { - List equipments = db.Queryable().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToList(); + List equipments = await db.Queryable().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToListAsync(); int index = 1; foreach (var item in tobeCreateTemplets) { @@ -114,14 +114,14 @@ namespace JNPF.TaskScheduler.Listener if (tobeCreateList != null && tobeCreateList.Count > 0) { List templetIDs = tobeCreateList.Select(x => x.spot_ins_tem_equip_id).ToList(); - List spotInsTemEquipDs = db.Queryable().Where(x => templetIDs.Contains(x.spot_ins_tem_equip_id)).ToList(); + List spotInsTemEquipDs = await db.Queryable().Where(x => templetIDs.Contains(x.spot_ins_tem_equip_id)).ToListAsync(); List spotInsItemIDs = spotInsTemEquipDs.Select(x => x.spot_ins_item_id).ToList(); - List spotCheckItems = db.Queryable().Where(x => spotInsItemIDs.Contains(x.id)).ToList(); + List spotCheckItems = await db.Queryable().Where(x => spotInsItemIDs.Contains(x.id)).ToListAsync(); + List spotInsRecordDs = new List(); foreach (var tobeCreatePlan in tobeCreateList) { - List spotInsRecordDs = new List(); List spotInsItems = spotInsTemEquipDs .Where(x => x.spot_ins_tem_equip_id == tobeCreatePlan.spot_ins_tem_equip_id) .Select(x => x.spot_ins_item_id).ToList(); @@ -130,7 +130,6 @@ namespace JNPF.TaskScheduler.Listener { spotInsRecordDs.Add(new EqpSpotInsRecordD() { - id = SnowflakeIdHelper.NextId(), spot_ins_record_id = tobeCreatePlan.id, spot_ins_tem_equip_id = tobeCreatePlan.spot_ins_tem_equip_id, spot_ins_item_id = tobeCreateItem.id, @@ -149,30 +148,30 @@ namespace JNPF.TaskScheduler.Listener }); } - if (spotInsRecordDs.Count<=0) - { - return; - } - - var dbResult = db.Ado.UseTran(() => - { - if (tobeCreateList != null && tobeCreateList.Count > 0) - { - db.Insertable(tobeCreateList).ExecuteCommand(); - } - - if (spotInsRecordDs != null && spotInsRecordDs.Count > 0) - { - db.Insertable(spotInsRecordDs).ExecuteCommand(); - } - }); - if (!dbResult.IsSuccess) - { - Console.WriteLine(dbResult.ErrorMessage); - Log.Error(dbResult.ErrorMessage); - } - Log.Information($"---------------生成{tobeCreateList.Count}个计划---------------"); } + if (spotInsRecordDs.Count<=0) + { + return; + } + + var dbResult = await db.Ado.UseTranAsync(async () => + { + if (tobeCreateList != null && tobeCreateList.Count > 0) + { + await db.Insertable(tobeCreateList).ExecuteCommandAsync(); + } + + if (spotInsRecordDs != null && spotInsRecordDs.Count > 0) + { + await db.Insertable(spotInsRecordDs).ExecuteCommandAsync(); + } + }); + if (!dbResult.IsSuccess) + { + Console.WriteLine(dbResult.ErrorMessage); + Log.Error(dbResult.ErrorMessage); + } + Log.Information($"---------------生成{tobeCreateList.Count}个计划---------------"); } } catch (Exception e) From b1984e55488e9c4262daf99cfc5cbe46e3a5765d Mon Sep 17 00:00:00 2001 From: qianjiawei <1184704771@qq.com> Date: Thu, 2 Nov 2023 10:14:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=A8=A1=E5=85=B7=E4=BF=9D=E5=85=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/PadMainListOutput.cs | 27 +++++++++ .../Dto/PdaMaintainInput.cs | 20 +++++++ .../ToolMoldMaintainRunService.cs | 58 +++++++++++++++++-- 3 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs create mode 100644 EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs new file mode 100644 index 00000000..054a8d4f --- /dev/null +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; +using System.Threading.Tasks; + +namespace Tnb.EquipMgr.Entities.Dto +{ + public class PadMainListOutput + { + public string plan_id { get; set; } + public string mold_id { get; set; } + + public string mold_code { get; set; } + + public string mold_name { get; set; } + + public string mold_status { get; set; } + public string status { get; set; } + public string createuser { get; set; } + public string createtime { get; set; } + public string plan_start_time { get; set; } + public string starttime { get; set; } + + } +} diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs new file mode 100644 index 00000000..dfeffb72 --- /dev/null +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using JNPF.Common.Filter; + +namespace Tnb.EquipMgr.Entities.Dto +{ + public class PdaMaintainInput : PageInputBase + { + public string status { get; set; } + + public string maintain_info { get; set; } + + public DateTime? start_time { get; set; } + public DateTime? end_time { get; set; } + + } +} diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs index 6fb1fa6c..0bb50b4c 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Dynamic; using System.Linq; +using System.Numerics; using System.Reactive.Joins; using System.Text; using System.Threading.Tasks; @@ -12,6 +13,7 @@ using DingTalk.Api.Request; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; +using JNPF.Common.Filter; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; @@ -62,12 +64,14 @@ namespace Tnb.EquipMgr List result = new(); var planMoldRelations = await _db.Queryable() .LeftJoin((a, b) => a.maintain_plan_id == b.id)//ToolMoldMaintainPlan - .LeftJoin((a, b, c) => b.plan_code == c.plan_code) + .LeftJoin((a, b, c) => a.mold_id == c.id) + .LeftJoin((a, b, c,d) => d.plan_code == b.plan_code&&d.mold_code==c.mold_code) .Where(a => a.maintain_plan_id == planId) - .Select((a, b, c) => new + .Select((a, b, c,d) => new { mold_id = a.mold_id, - plan_start_time = c.plan_start_time, + plan_start_time = d.plan_start_time, + designer=d.designer }) .ToListAsync(); var moldids = planMoldRelations.Select(x => x.mold_id).ToList(); @@ -75,7 +79,7 @@ namespace Tnb.EquipMgr foreach (var planMoldRelation in planMoldRelations) { - var mold= molds.Where(p=>p.id== planMoldRelation.mold_id).FirstOrDefault(); + var mold = molds.Where(p => p.id == planMoldRelation.mold_id).FirstOrDefault(); if (mold != null) { dynamic info = new ExpandoObject(); @@ -84,6 +88,7 @@ namespace Tnb.EquipMgr info.mold_name = mold.mold_name; info.mold_status = (await _dictionaryDataService.GetInfo(mold.mold_status!))?.FullName; info.maintain_qty = mold.maintain_qty; + info.designer = planMoldRelation.designer == null ? "" : planMoldRelation.designer; info.plan_start_time = planMoldRelation.plan_start_time == null ? "" : ((DateTime)planMoldRelation.plan_start_time).ToString("yyyy-MM-dd"); var moldEqpRelation = await _db.Queryable().FirstAsync(it => it.mold_id == mold.id); if (moldEqpRelation != null) @@ -183,6 +188,51 @@ namespace Tnb.EquipMgr return result; } + [HttpPost] + public async Task GetPdaMaintainInfo(PdaMaintainInput input) + { + DateTime? start_time = input.start_time; + DateTime? end_time = input.end_time; + if (string.IsNullOrEmpty(input.sidx)) + { + input.sidx = "b.create_time"; + input.sort = "desc"; + } + else + { + input.sidx = "b." + input.sidx; + } + var records = await _db.Queryable().Select(p => p.plan_id + p.mold_id).ToListAsync(); + var result= await _db.Queryable() + .LeftJoin((a, b) => a.maintain_plan_id == b.id) + .LeftJoin((a, b, c) => a.mold_id == c.id) + .LeftJoin((a, b, c, d) => b.plan_code == d.plan_code && c.mold_code == d.mold_code) + .LeftJoin((a, b, c, d, e) => e.plan_id == b.id && e.mold_id == c.id) + .LeftJoin((a, b, c, d, e, f) => b.create_id == f.Id) + .LeftJoin((a, b, c, d, e, f,g) => c.mold_status == g.Id) + .Where((a, b, c, d, e, f) => b.create_time != null) + .WhereIF(!string.IsNullOrEmpty(input.maintain_info), (a, b, c, d, e, f, g) => c.mold_code!.Contains(input.maintain_info) || c.mold_name!.Contains(input.maintain_info)) + .WhereIF(start_time != null, (a, b, c, d, e, f, g) => b.create_time != null && b.create_time >= start_time) + .WhereIF(end_time != null, (a, b, c, d, e, f, g) => b.create_time != null && b.create_time <= end_time) + .WhereIF(input.status == "待保养", (a, b, c, d, e, f, g) => !records.Contains(a.maintain_plan_id + a.mold_id)) + .WhereIF(input.status == "已完成", (a, b, c, d, e, f, g) => records.Contains(a.maintain_plan_id + a.mold_id)) + .Select((a, b, c, d, e, f, g) => new PadMainListOutput + { + plan_id = b.id, + mold_id = c.id, + mold_code = c.mold_code!, + mold_name = c.mold_name!, + mold_status=g.FullName!, + status = input.status, + createuser = f.RealName, + createtime = b.create_time == null ? "" : b.create_time.Value.ToString(DbTimeFormat.SS), + plan_start_time = b.plan_start_date == null ? "" : b.plan_start_date.Value.ToString(DbTimeFormat.SS), + starttime = d.plan_start_time == null ? "" : d.plan_start_time.Value.ToString(DbTimeFormat.SS), + }).OrderBy($"{input.sidx} {input.sort}").ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); + return PageResult.SqlSugarPageResult(result); + } + + /// /// 根据计划Id、模具ID获取,保养组及项目信息 /// From 95ecfd18149a9875b1f30e18a2ec83004b22a01f Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 2 Nov 2023 11:45:44 +0800 Subject: [PATCH 4/4] 1 --- .../Entity/EqpEquipment.cs | 5 +++++ .../Dto/PrdManage/PADPackageTaskPageOutput.cs | 18 ++++++++++++++++++ .../Dto/PrdManage/PrdReportCrInput.cs | 5 +++++ .../Entity/PrdReport.cs | 5 +++++ .../Tnb.ProductionMgr/PrdPackReportService.cs | 7 ++++++- 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs index aeb2e3b9..c94ec696 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs @@ -207,5 +207,10 @@ public partial class EqpEquipment : BaseEntity /// 二维码 /// public string? qrcode { get; set; } + + /// + /// 挤出件类型 + /// + public string? tube { get; set; } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs index 0c618be8..a0365f28 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs @@ -126,5 +126,23 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 实际完工日期 /// public string? act_end_date { get; set; } + /// + /// 挤出件类型 + /// + public string? tube { get; set; } + /// + /// 最小包装 + /// + public decimal? minpacking { get; set; } + + /// + /// 主单位数量 + /// + public string? main_num { get; set; } + + /// + /// 副单位数量(kg) + /// + public string? deputy_num { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs index cfc83410..1009a132 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs @@ -103,6 +103,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 工位 /// public string? station { get; set; } + + /// + /// 料箱二维码 + /// + public string material_box_qrcode { get; set; } } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs index f6a573a3..d1980bec 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs @@ -124,5 +124,10 @@ public partial class PrdReport : BaseEntity /// 工序id /// public string? process_id { get; set; } + + /// + /// 料箱二维码 + /// + public string material_box_qrcode { get; set; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index 1bc6d536..d975fe21 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -400,13 +400,14 @@ namespace Tnb.ProductionMgr .LeftJoin((a,b,c,d,e,f,g,h)=>a.material_id==h.output_material_id && a.eqp_id==h.equip_id && a.mold_id==h.molds_id && h.enabled==1) .LeftJoin((a,b,c,d,e,f,g,h,i)=>a.process_id==i.process_id && i.enabled==1) .LeftJoin((a,b,c,d,e,f,g,h,i,j)=>a.mo_id==j.id) + .LeftJoin((a,b,c,d,e,f,g,h,i,j,k)=>a.material_id==k.material_id && k.auxiliary_unit_id=="kg") .Where((a, b) => a.workstation_id == input.stationId && (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode || a.mo_task_status == DictConst.InProgressEnCode) ) .WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code)) //.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status) .WhereIF(statusList.Count>0,a=>statusList.Contains(a.mo_task_status)) .WhereIF(status=="3" && start_time!=null,a=>a.act_end_date>=start_time) .WhereIF(status=="3" && end_time!=null,a=>a.act_end_date<=end_time) - .Select((a, b, c, d, e,f,g,h,i,j) => new PADPackageTaskPageOutput + .Select((a, b, c, d, e,f,g,h,i,j,k) => new PADPackageTaskPageOutput { id = a.id, mo_task_code = a.mo_task_code, @@ -443,6 +444,10 @@ namespace Tnb.ProductionMgr act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS), plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS), + tube = f.tube, + minpacking = b.minpacking, + main_num = k.number_of_primary_unit, + deputy_num = k.number_of_auxiliary_unit, }) .MergeTable() .OrderBy($"{input.sidx} {input.sort}")