This commit is contained in:
qianjiawei
2023-09-20 23:08:04 +08:00
parent f636b12517
commit 0f57d7d396
9 changed files with 310 additions and 72 deletions

View File

@@ -1,3 +1,4 @@
using System.Dynamic;
using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Enums;
using JNPF.Common.Extension;
@@ -112,5 +113,30 @@ namespace Tnb.EquipMgr
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
return result.IsSuccess ? "保存成功" : result.ErrorMessage;
}
public async Task<dynamic> GetTools()
{
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("26149307089941", "在库");
dic.Add("26149309121045", "生产");
dic.Add("26149311082005", "保养");
dic.Add("26149314425877", "报废");
dic.Add("26149312750101", "外协");
dic.Add("26149320818965", "维修");
List<dynamic> result = new();
var ToolMolds = await _db.Queryable<ToolMolds>().ToListAsync();
foreach (var tool in ToolMolds)
{
dynamic info = new ExpandoObject();
info.mold_code=tool.mold_code;
info.mold_name = tool.mold_name;
info.mold_status= dic.Where(p=>p.Key==tool.mold_status).Any()? dic.Where(p => p.Key == tool.mold_status).First().Value:"";
info.warehosue_id=tool.warehosue_id;
info.location_id=tool.location_id;
result.Add(info);
}
return ToolMolds;
}
}
}