diff --git a/src/WMS.Web.Domain/Infrastructure/IChangeBoxRecordRepositories.cs b/src/WMS.Web.Domain/Infrastructure/IChangeBoxRecordRepositories.cs index e48e1183..13d253ba 100644 --- a/src/WMS.Web.Domain/Infrastructure/IChangeBoxRecordRepositories.cs +++ b/src/WMS.Web.Domain/Infrastructure/IChangeBoxRecordRepositories.cs @@ -16,6 +16,6 @@ namespace WMS.Web.Domain.Infrastructure Task AddRange(List list, bool isTransaction = true); // 获取列表 - Task<(List list,int total)> GetListAsync(ChangeBoxRecordQueryRequest dto); + Task<(List list,int total)> GetListAsync(ChangeBoxRecordQueryRequest dto, int companyId = 0); } } diff --git a/src/WMS.Web.Domain/Infrastructure/IMoveBoxRecordRepositories.cs b/src/WMS.Web.Domain/Infrastructure/IMoveBoxRecordRepositories.cs index 9d079af1..99d5e83f 100644 --- a/src/WMS.Web.Domain/Infrastructure/IMoveBoxRecordRepositories.cs +++ b/src/WMS.Web.Domain/Infrastructure/IMoveBoxRecordRepositories.cs @@ -7,13 +7,13 @@ using WMS.Web.Domain.Entitys; namespace WMS.Web.Domain.Infrastructure { - public interface IMoveBoxRecordRepositories + public interface IMoveBoxRecordRepositories { // 新增 Task Add(MoveBoxRecord entity, bool isTransaction = true); /// 批量添加 Task AddRange(List entitys, bool isTransaction = true); // 获取列表 - Task<(List list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto); + Task<(List list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto, int companyId = 0); } } diff --git a/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs b/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs index 9b917767..cfdb13b6 100644 --- a/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs +++ b/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs @@ -17,7 +17,7 @@ namespace WMS.Web.Domain.Infrastructure //根据任务单Id搜索 Task GetByTaskId(int taskId); // 获取列表 - Task<(List list, int total)> GetListAsync(OutStockQueryRequest dto); + Task<(List list, int total)> GetListAsync(OutStockQueryRequest dto, int companyId = 0); /// 查询实体集合 Task> GetEntityList(List ids); /// 修改实体集合 diff --git a/src/WMS.Web.Domain/Infrastructure/IOutStockTaskRepositories.cs b/src/WMS.Web.Domain/Infrastructure/IOutStockTaskRepositories.cs index 0c29481b..7aa1a64c 100644 --- a/src/WMS.Web.Domain/Infrastructure/IOutStockTaskRepositories.cs +++ b/src/WMS.Web.Domain/Infrastructure/IOutStockTaskRepositories.cs @@ -19,7 +19,7 @@ namespace WMS.Web.Domain.Infrastructure /// Task AddRange(List entitys, bool isTransaction = true); // 获取列表 - Task<(List list, int total)> GetListAsync(OutStockTaskQueryRequest dto); + Task<(List list, int total)> GetListAsync(OutStockTaskQueryRequest dto, int companyId = 0); /// 查询实体集合 Task> GetEntityList(List ids); /// diff --git a/src/WMS.Web.Domain/Infrastructure/ITakeStockRepositories.cs b/src/WMS.Web.Domain/Infrastructure/ITakeStockRepositories.cs index 8b3f3a71..2e23ac83 100644 --- a/src/WMS.Web.Domain/Infrastructure/ITakeStockRepositories.cs +++ b/src/WMS.Web.Domain/Infrastructure/ITakeStockRepositories.cs @@ -21,7 +21,7 @@ namespace WMS.Web.Domain.Infrastructure //编辑 Task Edit(TakeStock entity, bool isTransaction = true); // 获取列表 - Task<(List list, int total)> GetListAsync(TakeStockQueryRequest dto); + Task<(List list, int total)> GetListAsync(TakeStockQueryRequest dto, int companyId = 0); /// 查询实体集合 Task> GetEntityList(List ids); } diff --git a/src/WMS.Web.Repositories/ChangeBoxRecordRepositories.cs b/src/WMS.Web.Repositories/ChangeBoxRecordRepositories.cs index b276dc14..928721cf 100644 --- a/src/WMS.Web.Repositories/ChangeBoxRecordRepositories.cs +++ b/src/WMS.Web.Repositories/ChangeBoxRecordRepositories.cs @@ -117,8 +117,10 @@ namespace WMS.Web.Repositories /// /// /// - public async Task<(List list, int total)> GetListAsync(ChangeBoxRecordQueryRequest dto) + public async Task<(List list, int total)> GetListAsync(ChangeBoxRecordQueryRequest dto, int companyId = 0) { + if (companyId == 0) + companyId = _loginRepositories.CompanyId; List ids = new List(); if (!string.IsNullOrEmpty(dto.Creator)) { @@ -164,9 +166,9 @@ namespace WMS.Web.Repositories SerialNumbers = string.Join(",", s.changeBox.SerialNumbers), SrcBox = s.srcBox.BoxBillNo, DestBox = s.destBox.BoxBillNo, - SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.SrcSubStockId), - DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.DestSubStockId), - Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.changeBox.CreatorId), + SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, companyId, s.changeBox.SrcSubStockId), + DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, companyId, s.changeBox.DestSubStockId), + Creator = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.changeBox.CreatorId), CreateTime = s.changeBox.CreateTime.DateToStringSeconds() #endregion @@ -176,7 +178,7 @@ namespace WMS.Web.Repositories public async Task<(object obj, int total)> GetListField(ChangeBoxRecordQueryRequest dto, int companyId) { - return await GetListAsync(dto); + return await GetListAsync(dto, companyId); } } } diff --git a/src/WMS.Web.Repositories/MoveBoxRecordRepositories.cs b/src/WMS.Web.Repositories/MoveBoxRecordRepositories.cs index 1f45bdc7..dbeb1372 100644 --- a/src/WMS.Web.Repositories/MoveBoxRecordRepositories.cs +++ b/src/WMS.Web.Repositories/MoveBoxRecordRepositories.cs @@ -108,8 +108,10 @@ namespace WMS.Web.Repositories /// /// /// - public async Task<(List list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto) + public async Task<(List list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto, int companyId=0) { + if (companyId == 0) + companyId = _loginRepositories.CompanyId; List ids = new List(); if (!string.IsNullOrEmpty(dto.Creator)) { @@ -144,11 +146,11 @@ namespace WMS.Web.Repositories #region dto组装 BillNo = s.moveBox.BillNo, Box = s.box.BoxBillNo, - SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.SrcSubStockId), - DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.DestSubStockId), + SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, companyId, s.moveBox.SrcSubStockId), + DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, companyId, s.moveBox.DestSubStockId), Qty = s.moveBox.Qty, Type = s.moveBox.Type.GetRemark(), - Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.moveBox.CreatorId), + Creator = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.moveBox.CreatorId), CreateTime = s.moveBox.CreateTime.DateToStringSeconds() #endregion @@ -158,7 +160,7 @@ namespace WMS.Web.Repositories public async Task<(object obj, int total)> GetListField(MoveBoxRecordQueryRequest dto, int companyId) { - return await GetListAsync(dto); + return await GetListAsync(dto,companyId); } } } diff --git a/src/WMS.Web.Repositories/OutStockRepositories.cs b/src/WMS.Web.Repositories/OutStockRepositories.cs index 5ed8712c..d9e1ee7b 100644 --- a/src/WMS.Web.Repositories/OutStockRepositories.cs +++ b/src/WMS.Web.Repositories/OutStockRepositories.cs @@ -83,8 +83,10 @@ namespace WMS.Web.Repositories /// /// /// - public async Task<(List list, int total)> GetListAsync(OutStockQueryRequest dto) + public async Task<(List list, int total)> GetListAsync(OutStockQueryRequest dto, int companyId = 0) { + if (companyId == 0) + companyId = _loginRepositories.CompanyId; List ids = new List(); if (!string.IsNullOrEmpty(dto.Creator)) { @@ -161,10 +163,10 @@ namespace WMS.Web.Repositories Id = s.order.Id, BillNo = s.order.BillNo, Type = s.order.Type.GetRemark(), - Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.CreatorId), + Creator = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.order.CreatorId), CreateTime = s.order.CreateTime.DateToStringSeconds(), SuccessSync = s.order.SuccessSync == SyncStatus.Success ? "成功" : "失败", - Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, s.order.StockCode + s.order.OrgCode), + Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, companyId, s.order.StockCode + s.order.OrgCode), SourceBillNoList = s.detail.ErpDetails.Select(s => s.SourceBillNo).ToList(), SaleBillNoList = s.detail.ErpDetails.Select(s => s.SaleBillNo).ToList(), DeliveryOrg = _erpBasicDataExtendService.GetOrgName(orgs, s.order.DeliveryOrgId), @@ -313,7 +315,7 @@ namespace WMS.Web.Repositories public async Task<(object obj, int total)> GetListField(OutStockQueryRequest dto, int companyId) { - return await GetListAsync(dto); + return await GetListAsync(dto, companyId); } public async Task> GetDetailsByBoxId(int boxId) diff --git a/src/WMS.Web.Repositories/OutStockTaskRepositories.cs b/src/WMS.Web.Repositories/OutStockTaskRepositories.cs index 47ed0547..eff18ded 100644 --- a/src/WMS.Web.Repositories/OutStockTaskRepositories.cs +++ b/src/WMS.Web.Repositories/OutStockTaskRepositories.cs @@ -215,8 +215,10 @@ namespace WMS.Web.Repositories /// /// /// - public async Task<(List list, int total)> GetListAsync(OutStockTaskQueryRequest dto) + public async Task<(List list, int total)> GetListAsync(OutStockTaskQueryRequest dto, int companyId = 0) { + if (companyId == 0) + companyId = _loginRepositories.CompanyId; #region erp基础资料 List mIds = new List(); var materials_result = await _erpService.BillQueryForMaterial(); @@ -289,12 +291,12 @@ namespace WMS.Web.Repositories RealityQty = s.detail.RealityQty, CreateTime = s.order.CreateTime.DateToStringSeconds(), OperateTime = s.order.OperateTime.DateToStringSeconds(), - Operator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.OperatorId ?? 0), + Operator = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.order.OperatorId ?? 0), OutStockTime = s.order.OutStockTime.DateToStringSeconds(), - OutStock = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.OutStockId ?? 0), + OutStock = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.order.OutStockId ?? 0), OutStockBeginTime = s.detail.OutStockBeginTime.DateToStringSeconds(), OutStockEndTime = s.detail.OutStockEndTime.DateToStringSeconds(), - Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, s.order.StockCode + s.order.OrgCode), + Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, companyId, s.order.StockCode + s.order.OrgCode), SourceBillNoList = s.detail.ErpDetails.Select(s => s.SourceBillNo).ToList(), SaleBillNoList = s.detail.ErpDetails.Select(s => s.SaleBillNo).ToList(), DeliveryOrg = _erpBasicDataExtendService.GetOrgName(orgs, s.order.DeliveryOrgId), @@ -455,7 +457,7 @@ namespace WMS.Web.Repositories /// public async Task<(object obj, int total)> GetListField(OutStockTaskQueryRequest dto, int companyId) { - return await GetListAsync(dto); + return await GetListAsync(dto, companyId); } /// /// 根据订单号精确搜索 diff --git a/src/WMS.Web.Repositories/TakeStockRepositories.cs b/src/WMS.Web.Repositories/TakeStockRepositories.cs index 8f400916..45cecc8c 100644 --- a/src/WMS.Web.Repositories/TakeStockRepositories.cs +++ b/src/WMS.Web.Repositories/TakeStockRepositories.cs @@ -162,8 +162,10 @@ namespace WMS.Web.Repositories /// /// /// - public async Task<(List list, int total)> GetListAsync(TakeStockQueryRequest dto) + public async Task<(List list, int total)> GetListAsync(TakeStockQueryRequest dto, int companyId = 0) { + if (companyId == 0) + companyId = _loginRepositories.CompanyId; //1.获取物料集合 var materials_result = await _erpService.BillQueryForMaterial(); var materials = materials_result.Data.ToList(); @@ -198,8 +200,8 @@ namespace WMS.Web.Repositories Id = s.order.Id, BillNo = s.order.BillNo, Unit = _erpBasicDataExtendService.GetMaterialUnitName(materials, s.detail.MaterialId), - Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, s.detail.StockCode + s.detail.OrgCode), - SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.detail.SubStockId), + Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, companyId, s.detail.StockCode + s.detail.OrgCode), + SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, companyId, s.detail.SubStockId), Erp_SubStock= _erpBasicDataExtendService.GetStockName(subStocks, s.detail.Erp_SubStockId), MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.detail.MaterialId), MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.detail.MaterialId), @@ -220,7 +222,7 @@ namespace WMS.Web.Repositories public async Task<(object obj, int total)> GetListField(TakeStockQueryRequest dto, int companyId) { - return await GetListAsync(dto); + return await GetListAsync(dto,companyId); } } }