From fec3dbbed75d4263df0caff677f33350fb332505 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周一, 16 12月 2024 09:01:01 +0800 Subject: [PATCH] 22 --- LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs | 63 ++++++++++++++++++++++++++++--- 1 files changed, 56 insertions(+), 7 deletions(-) diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs index c77a4e3..b8ca267 100644 --- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs @@ -29,6 +29,7 @@ private readonly SqlSugarRepository<Mes_Package_LineQueue> _mesPackage_LineQueueRep; private readonly SqlSugarRepository<WmsRecordUpiReplenish> _wmsRecordUpiReplenishRep; private readonly SqlSugarRepository<WmsRecordUpiProcess> _wmsRecordUpiProcessRep; + private readonly SqlSugarRepository<V_Station_Quan> _V_Station_Quan; public WmsCommonnQueryService(SqlSugarRepository<WmsRbLineTask> wmsRbLineTaskRep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep , SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep @@ -39,6 +40,7 @@ , SqlSugarRepository<Mes_Package_LineQueue> mesPackage_LineQueueRep , SqlSugarRepository<WmsRecordUpiReplenish> wmsRecordUpiReplenishRep , SqlSugarRepository<WmsRecordUpiProcess> wmsRecordUpiProcessRep + , SqlSugarRepository<V_Station_Quan> V_Station_Quan_Rep ) { _wmsRecordUpiReplenishRep = wmsRecordUpiReplenishRep; @@ -51,6 +53,7 @@ _mesPackage_UnLine_RecordRep = mesPackage_UnLine_RecordRep; _mesPackage_LineQueueRep = mesPackage_LineQueueRep; _wmsRecordUpiProcessRep = wmsRecordUpiProcessRep; + _V_Station_Quan = V_Station_Quan_Rep; } /// <summary> @@ -144,18 +147,36 @@ [Description("WmsCommonnQuery/QueryCurrentOrder")] public async Task<Mes_Order_Gather> QueryCurrentOrder() { - //鑾峰彇涓婄彮鏃堕棿銆� - var sysConfig_wms_wms_unline_oper = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); - if (sysConfig_wms_wms_unline_oper == null || sysConfig_wms_wms_unline_oper.Value == "鏃�") + ////鑾峰彇涓婄彮鏃堕棿銆� + //var sysConfig_wms_wms_unline_oper = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); + //if (sysConfig_wms_wms_unline_oper == null || sysConfig_wms_wms_unline_oper.Value == "鏃�") + //{ + // return null; + //} + //var arr = sysConfig_wms_wms_unline_oper.Value.Split('|'); + //var packagecode = arr[0]; + //var packObj = await _mesPackageGatherRep.AsQueryable().FirstAsync(x => x.PackageCode == packagecode); + //if (packObj == null) + //{ + // throw Oops.Oh($"娌℃湁鎵惧埌鍖厈packagecode}鐨勬眹鎬绘暟鎹�"); + //} + + //var list = await _mesOrderGatherRep.AsQueryable() + // .Where(x => x.Info5 == packObj.Info5) + // .FirstAsync(); // 纭繚鑾峰彇缁撴灉涓� List + + //return list; // 缁撴灉 + + var packageQueue = await _mesPackage_LineQueueRep.AsQueryable().Where(x => 1 == 1).ToListAsync(); + var single_packageQueue = packageQueue.OrderBy(x => x.Id).FirstOrDefault(); + if (single_packageQueue == null) { return null; } - var arr = sysConfig_wms_wms_unline_oper.Value.Split('|'); - var packagecode = arr[0]; - var packObj = await _mesPackageGatherRep.AsQueryable().FirstAsync(x => x.PackageCode == packagecode); + var packObj = await _mesPackageGatherRep.AsQueryable().FirstAsync(x => x.PackageCode == single_packageQueue.PackageCode); if (packObj == null) { - throw Oops.Oh($"娌℃湁鎵惧埌鍖厈packagecode}鐨勬眹鎬绘暟鎹�"); + throw Oops.Oh($"娌℃湁鎵惧埌鍖厈single_packageQueue.PackageCode}鐨勬眹鎬绘暟鎹�"); } var list = await _mesOrderGatherRep.AsQueryable() @@ -919,5 +940,33 @@ return startDate.AddDays(6); // 鍥犱负璧峰鏃ユ湡宸茬粡鏄懆涓�锛屾墍浠ョ洿鎺ュ姞6澶╁嵆鍙緱鍒板懆鏃� } + + + + /// <summary> + /// 涓嶅垎椤垫煡璇㈠簱浣嶄俊鎭� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpGet] + [ApiDescriptionSettings(Name = "ListView")] + [Description("WmsCommonnQuery/ListView")] + public async Task<List<LocationViewOutput>> ListView([FromQuery] WmsBasePlaceInput input) + { + var query = await _V_Station_Quan.AsQueryable() + .WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => + u.PlaceCode.Contains(input.SearchKey.Trim()) + // || u.WareContainerCode.Contains(input.SearchKey.Trim()) + //|| u.Lane==input.Lane + //|| u.Row==input.Row + ) + .OrderBy(u => u.LaneNo) + //.OrderBy(u => u.Row) + .OrderBy(u => u.LayerNo) + .OrderBy(u => u.ColumnNo) + .Select<LocationViewOutput>().ToListAsync(); + return query; + } + } -- Gitblit v1.9.3