diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.part.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.part.cs new file mode 100644 index 00000000..4e224964 --- /dev/null +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.part.cs @@ -0,0 +1,13 @@ +using SqlSugar; + +namespace Tnb.EquipMgr.Entities +{ + public partial class EqpRepairApply + { + /// + /// 故障名称 + /// + [SugarColumn(IsIgnore = true)] + public string? fault_name { get; set; } + } +} \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs b/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs index de39f2f4..d5388b94 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs @@ -11,6 +11,7 @@ using JNPF.VisualDev; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using SQLitePCL; using SqlSugar; using Tnb.BasicData; using Tnb.EquipMgr.Entities; @@ -281,10 +282,12 @@ namespace Tnb.EquipMgr public async Task GetRepairApplyDetail(Dictionary dic) { string id = dic["id"]; - + var db = _repository.AsSugarClient(); EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id); - EqpRepairOutApply eqpRepairOutApply = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.repair_apply_id == id); + EqpRepairOutApply eqpRepairOutApply = await db.Queryable().FirstAsync(x => x.repair_apply_id == id); + EqpFault eqpFault = await db.Queryable().SingleAsync(x => x.id == eqpRepairApply.fault_id); + eqpRepairApply.fault_name = eqpFault != null ? eqpFault.fault_name : ""; return new RepairApplyDetailOutput() { eqpRepairApply = eqpRepairApply, diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index 170faaf5..545a4c9c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -37,6 +37,8 @@ namespace Tnb.WarehouseMgr private readonly IVisualDevService _visualDevService; private readonly IRunService _runService; private readonly IBillRullService _billRullService; + private static Dictionary _carryMap = new(); + public WmsCheckTaskService( ISqlSugarRepository repository, IWareHouseService wareHouseService, @@ -288,6 +290,11 @@ namespace Tnb.WarehouseMgr [HttpGet] public async Task GetTaskDetailByCheckType([FromQuery] CheckDetailQuery input) { + if(_carryMap.Count == 0) + { + _carryMap = await _db.Queryable().ToDictionaryAsync(x => x.id, x => x.carry_code); + } + var filterExpable = Expressionable.Create() .And((a, b, c) => a.wh_id == input.warehouse_id) .And((a, b, c) => a.is_type == ((int)EnumLocationType.存储库位).ToString()) @@ -307,17 +314,16 @@ namespace Tnb.WarehouseMgr .Where(filterExpable.ToExpression()) .Select() .ToListAsync(); - var carryIds = carryCodes?.Select(x => x.carry_id) ?? Enumerable.Empty(); - var checkStockDs = await _db.Queryable().Where(it => carryIds.Contains(it.carry_id)).ToListAsync(); - List outputs = checkStockDs.GroupBy(g => new { g.material_code, g.code_batch, g.location_code, g.carry_code }).Select(x => new CheckTaskDetailOutput + + List outputs = carryCodes.GroupBy(g => new { g.material_code, g.code_batch, g.location_code, g.carry_id }).Select(x => new CheckTaskDetailOutput { material_code = x.Key.material_code, code_batch = x.Key.code_batch, location_code = x.Key.location_code, - carry_code = x.Key.carry_code, - pr_qty = x.Sum(d => d.pr_qty), + carry_code = _carryMap[x.Key.carry_id]?.ToString() ?? string.Empty, + pr_qty = x.Sum(d => d.codeqty), closing_status = WmsWareHouseConst.CLOSINGSTATUS_WJS_ID, - qty = x.Sum(d => d.qty), + qty = 0, }) .ToList(); return outputs; diff --git a/apihost/Tnb.API.Entry/Startup.cs b/apihost/Tnb.API.Entry/Startup.cs index 3dbfefd2..1efe0fb4 100644 --- a/apihost/Tnb.API.Entry/Startup.cs +++ b/apihost/Tnb.API.Entry/Startup.cs @@ -57,7 +57,7 @@ public class Startup : AppStartup //定时任务 services.AddHostedService(); - services.AddHostedService(); + //services.AddHostedService(); }