diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs new file mode 100644 index 00000000..cae96d36 --- /dev/null +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs @@ -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; } + } +} diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs index 2fe6f947..6fb1fa6c 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs @@ -99,7 +99,6 @@ namespace Tnb.EquipMgr } [HttpGet] - [AllowAnonymous] public async Task GetMaintainInfo([FromQuery] MaintainInfoQueryinput input) { Dictionary dicstatus = new Dictionary(); diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs index f4a3d718..e7cbfec5 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs @@ -15,6 +15,7 @@ using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; +using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; @@ -113,7 +114,8 @@ namespace Tnb.EquipMgr if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "保存成功" : result.ErrorMessage; } - public async Task GetTools() + [HttpPost] + public async Task GetTools(ToolInput toolinput) { Dictionary dic = new Dictionary(); dic.Add("26149307089941", "在库"); @@ -123,20 +125,28 @@ namespace Tnb.EquipMgr dic.Add("26149312750101", "外协"); dic.Add("26149320818965", "维修"); List result = new(); - var ToolMolds = await _db.Queryable().ToListAsync(); + var BasLocations = await _db.Queryable().ToListAsync(); + var ToolMolds = await _db.Queryable() + .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(); + info.id=tool.id; 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; - + info.location_id= BasLocations.Where(p => p.id == tool.location_id).Any() ? BasLocations.Where(p => p.id == tool.location_id).First().location_code : ""; result.Add(info); } - - return ToolMolds; + return result; } } } \ No newline at end of file diff --git a/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs b/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs index f87d775f..5634bf81 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs @@ -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);