1
This commit is contained in:
15
EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs
Normal file
15
EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
public class ToolInput
|
||||
{
|
||||
public string? sort { get; set; }
|
||||
public string? keyword { get; set; }
|
||||
public string? status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,6 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> GetMaintainInfo([FromQuery] MaintainInfoQueryinput input)
|
||||
{
|
||||
Dictionary<string, string> dicstatus = new Dictionary<string, string>();
|
||||
|
||||
@@ -113,7 +113,8 @@ namespace Tnb.EquipMgr
|
||||
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
return result.IsSuccess ? "保存成功" : result.ErrorMessage;
|
||||
}
|
||||
public async Task<dynamic> GetTools()
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetTools(ToolInput toolinput)
|
||||
{
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
dic.Add("26149307089941", "在库");
|
||||
@@ -123,7 +124,15 @@ namespace Tnb.EquipMgr
|
||||
dic.Add("26149312750101", "外协");
|
||||
dic.Add("26149320818965", "维修");
|
||||
List<dynamic> result = new();
|
||||
var ToolMolds = await _db.Queryable<ToolMolds>().ToListAsync();
|
||||
var ToolMolds = await _db.Queryable<ToolMolds>()
|
||||
.WhereIF(!string.IsNullOrEmpty(toolinput.keyword),p=>p.mold_code!.Contains(toolinput.keyword!)|| p.mold_name!.Contains(toolinput.keyword!))
|
||||
.WhereIF(!string.IsNullOrEmpty(toolinput.status), p => p.mold_status== dic.Where(p=>p.Value== toolinput.status).First().Key)
|
||||
.ToListAsync();
|
||||
if (string.IsNullOrEmpty(toolinput.sort))
|
||||
{
|
||||
if(toolinput.sort== "mold_code")
|
||||
ToolMolds= ToolMolds.OrderByDescending(p=>p.mold_code).ToList();
|
||||
}
|
||||
foreach (var tool in ToolMolds)
|
||||
{
|
||||
dynamic info = new ExpandoObject();
|
||||
@@ -132,7 +141,6 @@ namespace Tnb.EquipMgr
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Tnb.QcMgr
|
||||
insert.itemid = QcCheckExecD.itemid;
|
||||
insert.create_id = QcCheckExecD.create_id;
|
||||
insert.create_time = QcCheckExecD.create_time;
|
||||
insert.postdata =
|
||||
insert.postdata = item.postItemForm;
|
||||
insert.result = item.result;
|
||||
insert.checkindex = (i + 1).ToString();
|
||||
QcCheckExecDinsert.Add(insert);
|
||||
|
||||
Reference in New Issue
Block a user