From b573a49f4bf6cb0e938a9b04576d6b1eeaae958e Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 4 Sep 2023 17:22:47 +0800 Subject: [PATCH] =?UTF-8?q?PDA=E8=AE=BE=E5=A4=87=E7=82=B9=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=20=E4=BF=9D=E5=85=BB=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.EquipMgr/EquMaintainRecordService.cs | 29 ++++++++++++++++++- .../Tnb.EquipMgr/EquSpotInsRecordService.cs | 27 +++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs b/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs index e69aad04..d80b10d1 100644 --- a/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs @@ -129,7 +129,7 @@ namespace Tnb.EquipMgr foreach (var item in input.details) { await db.Updateable() - .SetColumns(x => x.repeat_descrip == item["repeat_descrip"]) + .SetColumnsIF(item.ContainsKey("repeat_descrip"),x => x.repeat_descrip == item["repeat_descrip"]) .SetColumns(x => x.repeat_result == item["repeat_result"]) .Where(x => x.id == item["id"]).ExecuteCommandAsync(); } @@ -187,5 +187,32 @@ namespace Tnb.EquipMgr return PageResult.SqlSugarPageResult(result); } + + /// + /// 根据id获取保养相关信息 + /// + /// + [HttpPost] + public async Task GetEqpMaintainRecordInfoById(Dictionary dic) + { + string id = dic.ContainsKey("id") ? dic["id"] : ""; + if (string.IsNullOrEmpty(id)) return null; + var db = _repository.AsSugarClient(); + return await db.Queryable() + .LeftJoin((a, b) => a.equip_id==b.id) + .Where((a, b) => a.id == id) + .Select((a, b) => new + { + id = a.id, + equip_id = a.equip_id, + equip_code = b.code, + equip_name = b.name, + create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"), + result_remark = a.result_remark, + result = a.result, + status = a.status, + }).FirstAsync(); + + } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs b/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs index fad3138d..ad2106a0 100644 --- a/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs @@ -162,5 +162,32 @@ namespace Tnb.EquipMgr return PageResult.SqlSugarPageResult(result); } + + /// + /// 根据id获取点巡检相关信息 + /// + /// + [HttpPost] + public async Task GetEqpSpotInsRecordInfoById(Dictionary dic) + { + string id = dic.ContainsKey("id") ? dic["id"] : ""; + if (string.IsNullOrEmpty(id)) return null; + var db = _repository.AsSugarClient(); + return await db.Queryable() + .LeftJoin((a, b) => a.equip_id==b.id) + .Where((a, b) => a.id == id) + .Select((a, b) => new + { + id = a.id, + equip_id = a.equip_id, + equip_code = b.code, + equip_name = b.name, + create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"), + result_remark = a.result_remark, + result = a.result, + status = a.status, + }).FirstAsync(); + + } } } \ No newline at end of file