设备维修报修列表看板端接口
This commit is contained in:
9
EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListInput.cs
Normal file
9
EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListInput.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
|
{
|
||||||
|
public class PadRepairListInput
|
||||||
|
{
|
||||||
|
public string status { get; set; }
|
||||||
|
|
||||||
|
public string equip_info { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
24
EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListOutput.cs
Normal file
24
EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListOutput.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
|
{
|
||||||
|
public class PadRepairListOutput
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
|
||||||
|
public string code { get; set; }
|
||||||
|
|
||||||
|
public string name { get; set; }
|
||||||
|
public string equip_id { get; set; }
|
||||||
|
public string equip_id_id { get; set; }
|
||||||
|
public string apply_user_id { get; set; }
|
||||||
|
public string apply_user_id_id { get; set; }
|
||||||
|
public string expect_complete_time { get; set; }
|
||||||
|
public string is_ugent { get; set; }
|
||||||
|
public string description { get; set; }
|
||||||
|
public string remark { get; set; }
|
||||||
|
public string create_time { get; set; }
|
||||||
|
public string complete_time { get; set; }
|
||||||
|
public string repairer_id { get; set; }
|
||||||
|
public string repairer_id_id { get; set; }
|
||||||
|
public string status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -59,5 +59,11 @@ namespace Tnb.EquipMgr.Interfaces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task<dynamic> GetRepairRecordList(EquipQueryInput input);
|
public Task<dynamic> GetRepairRecordList(EquipQueryInput input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 看板端设备报修维修列表接口
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<dynamic> GetPadRepairList(PadRepairListInput input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,9 +6,11 @@ using JNPF.DependencyInjection;
|
|||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
|
using JNPF.Systems.Entitys.System;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.BasicData;
|
||||||
using Tnb.EquipMgr.Entities;
|
using Tnb.EquipMgr.Entities;
|
||||||
using Tnb.EquipMgr.Entities.Dto;
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
using Tnb.EquipMgr.Interfaces;
|
using Tnb.EquipMgr.Interfaces;
|
||||||
@@ -177,5 +179,64 @@ namespace Tnb.EquipMgr
|
|||||||
|
|
||||||
return PageResult<EquipRepairRecordQueryOutput>.SqlSugarPageResult(result);
|
return PageResult<EquipRepairRecordQueryOutput>.SqlSugarPageResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<dynamic> GetPadRepairList(PadRepairListInput input)
|
||||||
|
{
|
||||||
|
List<string> statusList = new List<string>();
|
||||||
|
if (!string.IsNullOrEmpty(input.status))
|
||||||
|
{
|
||||||
|
switch (input.status)
|
||||||
|
{
|
||||||
|
case "1" :
|
||||||
|
statusList.Add(RepairApplyStatus.TOBEEXECUTED);
|
||||||
|
statusList.Add(RepairApplyStatus.REFUSE);
|
||||||
|
break;
|
||||||
|
case "2" :
|
||||||
|
statusList.Add(RepairApplyStatus.TOBERECEIVED);
|
||||||
|
statusList.Add(RepairApplyStatus.RECEIVED);
|
||||||
|
statusList.Add(RepairApplyStatus.OUTAPPLYAPPROVE);
|
||||||
|
statusList.Add(RepairApplyStatus.APPROVEPASS);
|
||||||
|
statusList.Add(RepairApplyStatus.APPROVENOTPASS);
|
||||||
|
statusList.Add(RepairApplyStatus.TOBEOUTAPPLY);
|
||||||
|
break;
|
||||||
|
case "3" :
|
||||||
|
statusList.Add(RepairApplyStatus.COMPLETED);
|
||||||
|
statusList.Add(RepairApplyStatus.CLOSE);
|
||||||
|
statusList.Add(RepairApplyStatus.REPEAL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var db = _repository.AsSugarClient();
|
||||||
|
var result = await db.Queryable<EqpRepairApply>()
|
||||||
|
.LeftJoin<UserEntity>((a,b)=>a.apply_user_id==b.Id)
|
||||||
|
.LeftJoin<UserEntity>((a,b,c)=>a.repairer_id==c.Id)
|
||||||
|
.LeftJoin<EqpEquipment>((a,b,c,d)=>a.equip_id==d.id)
|
||||||
|
.LeftJoin<DictionaryTypeEntity>((a,b,c,d,e)=>e.EnCode==DictConst.RepairStatus)
|
||||||
|
.LeftJoin<DictionaryDataEntity>((a,b,c,d,e,f)=>e.Id==f.DictionaryTypeId && a.status==f.EnCode)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.equip_info),(a,b,c,d)=>d.code.Contains(input.equip_info) || d.name.Contains(input.equip_info))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.status),(a,b,c,d)=>statusList.Contains(a.status))
|
||||||
|
.Select((a,b,c,d,e,f) => new PadRepairListOutput
|
||||||
|
{
|
||||||
|
id = a.id,
|
||||||
|
equip_id = d.code+"/"+d.name,
|
||||||
|
equip_id_id = a.equip_id,
|
||||||
|
code = a.code,
|
||||||
|
name = a.name,
|
||||||
|
apply_user_id =b.RealName,
|
||||||
|
apply_user_id_id =b.Id,
|
||||||
|
is_ugent = a.is_ugent==1 ? "是" : "否",
|
||||||
|
description = a.description,
|
||||||
|
create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
|
complete_time = a.complete_time==null ? "" : a.complete_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
|
expect_complete_time = a.expect_complete_time==null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
|
repairer_id = c.RealName,
|
||||||
|
repairer_id_id = c.Id,
|
||||||
|
remark = a.remark,
|
||||||
|
status = f.FullName
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user