From 3ace768283b4fcdfe9815e6b77e84cdef2125823 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 4 Dec 2023 17:01:38 +0800 Subject: [PATCH 1/3] 1 --- ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs index 1a350944..9ef16b97 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs @@ -105,7 +105,7 @@ namespace Tnb.ProductionMgr } if (string.IsNullOrEmpty(input.sidx)) { - input.sidx = "create_time"; + input.sidx = "promoter_time"; input.sort = "desc"; } From 1ee00e692ac974e5747983cc1ac1071fd2d640e6 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Tue, 5 Dec 2023 14:14:58 +0800 Subject: [PATCH 2/3] 1 --- .../Dto/PrdManage/AndonPadListOutput.cs | 2 ++ .../Tnb.ProductionMgr/AndonRecordService.cs | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs index c522a234..11d503c0 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs @@ -12,5 +12,7 @@ namespace Tnb.ProductionMgr.Entities.Dto public string? end_repair_time { get; set; } public string? confirm_time { get; set; } public string status { get; set; } + public string breakdown_name { get; set; } + public string andon_type_name { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs index 9ef16b97..d2d2ce09 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs @@ -116,8 +116,10 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d) => a.create_id == d.Id) .LeftJoin((a, b, c, d, e) => e.EnCode == DictConst.AndonStatus) .LeftJoin((a, b, c, d, e, f) => a.status == f.EnCode && e.Id == f.DictionaryTypeId) + .LeftJoin((a,b,c,d,e,f,g)=>a.breakdown==g.id) + .LeftJoin((a,b,c,d,e,f,g,h)=>a.andon_type_id==h.id) .WhereIF(statusList.Count > 0, a => statusList.Contains(a.status)) - .Select((a, b, c, d, e, f) => new AndonPadListOutput + .Select((a, b, c, d, e, f,g,h) => new AndonPadListOutput { id = a.id, andon_info_name = b.name, @@ -129,6 +131,8 @@ namespace Tnb.ProductionMgr end_repair_time = a.end_repair_time == null ? "" : a.end_repair_time.Value.ToString(DbTimeFormat.SS), confirm_time = a.confirm_time == null ? "" : a.confirm_time.Value.ToString(DbTimeFormat.SS), status = f.FullName, + andon_type_name = h.name, + breakdown_name = g.name }) .MergeTable() .OrderBy($"{input.sidx} {input.sort}") @@ -142,7 +146,10 @@ namespace Tnb.ProductionMgr public async Task AddAndon(AddAndonInput input) { AndonInfo andonInfo = await _db.Queryable().SingleAsync(x => x.id == input.andon_info_id); + AndonBreakDown andonBreakDown = await _db.Queryable().SingleAsync(x => x.id == input.andon_breakdown_id); AndonRecords andonRecords = input.Adapt(); + andonRecords.breakdown = input.andon_breakdown_id; + andonRecords.breakdown_type = andonBreakDown?.type_id; DbResult result = await _db.Ado.UseTranAsync(async () => { @@ -279,6 +286,7 @@ namespace Tnb.ProductionMgr { _ = await _db.Updateable() .SetColumns(x => x.repair_id == _userManager.UserId) + .SetColumns(x=>x.status==DictConst.AndonStatusYXY) .SetColumns(x => x.response_time == DateTime.Now) .ExecuteCommandAsync(); Dictionary postData = new() @@ -320,6 +328,7 @@ namespace Tnb.ProductionMgr { _ = await _db.Updateable() .SetColumns(x => x.start_repair_time == DateTime.Now) + .SetColumns(x=>x.status==DictConst.AndonStatusCLZ) .Where(x => x.id == id) .ExecuteCommandAsync(); return true; @@ -356,6 +365,7 @@ namespace Tnb.ProductionMgr { _ = await _db.Updateable() .SetColumns(x => x.end_repair_time == DateTime.Now) + .SetColumns(x=>x.status==DictConst.AndonStatusDQR) .Where(x => x.id == id) .ExecuteCommandAsync(); return true; @@ -392,6 +402,7 @@ namespace Tnb.ProductionMgr { _ = await _db.Updateable() .SetColumns(x => x.confirm_time == DateTime.Now) + .SetColumns(x=>x.status==DictConst.AndonStatusYWC) .Where(x => x.id == id) .ExecuteCommandAsync(); return true; From 5c099f7ee93cd37e63eadc618a2a94ecf0421228 Mon Sep 17 00:00:00 2001 From: qianjiawei <1184704771@qq.com> Date: Wed, 6 Dec 2023 11:38:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=9D=E5=85=BBpda?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs b/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs index b1e45c66..56dde5cc 100644 --- a/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs @@ -106,7 +106,11 @@ namespace Tnb.EquipMgr a.last_execute_time = a.date_last_execute_time == null ? "" : a.date_last_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); }) .ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50); - + var EqpMaintainRecordHs = await db.Queryable().Where(p => list.list.Select(p => p.equip_id_id).ToList().Contains(p.equip_id)).ToListAsync(); + foreach (var data in list.list) + { + data.last_execute_time = EqpMaintainRecordHs.Where(x => data.equip_id_id == x.equip_id && x.execute_time != null).Any() ? EqpMaintainRecordHs.Where(x => data.equip_id_id == x.equip_id && x.execute_time != null).OrderByDescending(x => x.execute_time).FirstOrDefault()!.execute_time!.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; + } return PageResult.SqlSugarPageResult(list); }