金蝶组织使用
This commit is contained in:
@@ -1548,6 +1548,22 @@
|
|||||||
<param name="materialId"></param>
|
<param name="materialId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.Public.IErpBasicDataExtendService.GetMaterialUnitName(System.Collections.Generic.List{WMS.Web.Core.Dto.Erp.ErpMaterialDto},System.Int32)">
|
||||||
|
<summary>
|
||||||
|
获取物料基本单位名称
|
||||||
|
</summary>
|
||||||
|
<param name="erpMaterials"></param>
|
||||||
|
<param name="materialId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.Public.IErpBasicDataExtendService.GetOrgName(System.Collections.Generic.List{WMS.Web.Core.Dto.Erp.Org.ErpOrgDto},System.Int32)">
|
||||||
|
<summary>
|
||||||
|
获取组织名称
|
||||||
|
</summary>
|
||||||
|
<param name="erpOrgs"></param>
|
||||||
|
<param name="orgId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.Public.IErpService.BillQueryForPurchaseInStock">
|
<member name="M:WMS.Web.Domain.IService.Public.IErpService.BillQueryForPurchaseInStock">
|
||||||
<summary>
|
<summary>
|
||||||
erp:单据查询-采购入库单
|
erp:单据查询-采购入库单
|
||||||
@@ -2359,6 +2375,22 @@
|
|||||||
<param name="materialId"></param>
|
<param name="materialId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.Public.ErpBasicDataExtendService.GetMaterialUnitName(System.Collections.Generic.List{WMS.Web.Core.Dto.Erp.ErpMaterialDto},System.Int32)">
|
||||||
|
<summary>
|
||||||
|
获取物料基本单位名称
|
||||||
|
</summary>
|
||||||
|
<param name="erpMaterials"></param>
|
||||||
|
<param name="materialId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.Public.ErpBasicDataExtendService.GetOrgName(System.Collections.Generic.List{WMS.Web.Core.Dto.Erp.Org.ErpOrgDto},System.Int32)">
|
||||||
|
<summary>
|
||||||
|
获取组织名称
|
||||||
|
</summary>
|
||||||
|
<param name="erpOrgs"></param>
|
||||||
|
<param name="orgId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Services.Public.ErpService">
|
<member name="T:WMS.Web.Domain.Services.Public.ErpService">
|
||||||
<summary>
|
<summary>
|
||||||
erp数据交互服务
|
erp数据交互服务
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using WMS.Web.Core.Dto.Erp;
|
using WMS.Web.Core.Dto.Erp;
|
||||||
|
using WMS.Web.Core.Dto.Erp.Org;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.IService.Public
|
namespace WMS.Web.Domain.IService.Public
|
||||||
{
|
{
|
||||||
@@ -32,5 +33,21 @@ namespace WMS.Web.Domain.IService.Public
|
|||||||
/// <param name="materialId"></param>
|
/// <param name="materialId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
string GetMaterialSpecifications(List<ErpMaterialDto> erpMaterials, int materialId);
|
string GetMaterialSpecifications(List<ErpMaterialDto> erpMaterials, int materialId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取物料基本单位名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="erpMaterials"></param>
|
||||||
|
/// <param name="materialId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
string GetMaterialUnitName(List<ErpMaterialDto> erpMaterials, int materialId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取组织名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="erpOrgs"></param>
|
||||||
|
/// <param name="orgId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
string GetOrgName(List<ErpOrgDto> erpOrgs, int orgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using WMS.Web.Core.Dto.Erp;
|
using WMS.Web.Core.Dto.Erp;
|
||||||
|
using WMS.Web.Core.Dto.Erp.Org;
|
||||||
using WMS.Web.Domain.Infrastructure;
|
using WMS.Web.Domain.Infrastructure;
|
||||||
using WMS.Web.Domain.IService.Public;
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
|
||||||
@@ -62,5 +63,29 @@ namespace WMS.Web.Domain.Services.Public
|
|||||||
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||||
return mat == null ? "" : mat.Specifications;
|
return mat == null ? "" : mat.Specifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取物料基本单位名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="erpMaterials"></param>
|
||||||
|
/// <param name="materialId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetMaterialUnitName(List<ErpMaterialDto> erpMaterials, int materialId)
|
||||||
|
{
|
||||||
|
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||||
|
return mat == null ? "" : mat.BaseUnitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取组织名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="erpOrgs"></param>
|
||||||
|
/// <param name="orgId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetOrgName(List<ErpOrgDto> erpOrgs, int orgId)
|
||||||
|
{
|
||||||
|
var org = erpOrgs.Where(x => x.Id == orgId).FirstOrDefault();
|
||||||
|
return org == null ? "" : org.Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,12 +55,18 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ResultPagedList<InStockQueryResponse>> GetPagedList(InStockQueryRequest dto)
|
public async Task<ResultPagedList<InStockQueryResponse>> GetPagedList(InStockQueryRequest dto)
|
||||||
{
|
{
|
||||||
//1.获取物料集合
|
//1.获取物料集合和组织集合
|
||||||
var materials_result = await _erpService.BillQueryForMaterial();
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
if (!materials_result.IsSuccess)
|
if (!materials_result.IsSuccess)
|
||||||
return ResultPagedList<InStockQueryResponse>.ReFailure(materials_result);
|
return ResultPagedList<InStockQueryResponse>.ReFailure(materials_result);
|
||||||
var materials = materials_result.Data.ToList();
|
var materials = materials_result.Data.ToList();
|
||||||
|
|
||||||
|
//组织集合
|
||||||
|
var orgs_result = await _erpService.BillQueryForOrg();
|
||||||
|
if (!orgs_result.IsSuccess)
|
||||||
|
return ResultPagedList<InStockQueryResponse>.ReFailure(orgs_result);
|
||||||
|
var orgs = orgs_result.Data.ToList();
|
||||||
|
|
||||||
//物料集合;模糊查询后的物料集合
|
//物料集合;模糊查询后的物料集合
|
||||||
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||||
materials = materials.Where(w => EF.Functions.Like(w.MaterialNumber, "%" + dto.MaterialNumber + "%")).ToList();
|
materials = materials.Where(w => EF.Functions.Like(w.MaterialNumber, "%" + dto.MaterialNumber + "%")).ToList();
|
||||||
@@ -109,7 +115,7 @@ namespace WMS.Web.Repositories
|
|||||||
Type=s.order.Type.GetRemark(),
|
Type=s.order.Type.GetRemark(),
|
||||||
SourceBillNo=s.detail.SourceBillNo,
|
SourceBillNo=s.detail.SourceBillNo,
|
||||||
Supplier="",
|
Supplier="",
|
||||||
Org="",
|
Org= _erpBasicDataExtendService.GetOrgName(orgs, s.detail.OrgId),
|
||||||
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.detail.MaterialId),
|
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.detail.MaterialId),
|
||||||
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.detail.MaterialId),
|
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.detail.MaterialId),
|
||||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialId),
|
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialId),
|
||||||
|
|||||||
@@ -60,11 +60,16 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ResultPagedList<InStockTaskQueryResponse>> GetPagedList(InStockTaskQueryRequest dto)
|
public async Task<ResultPagedList<InStockTaskQueryResponse>> GetPagedList(InStockTaskQueryRequest dto)
|
||||||
{
|
{
|
||||||
//1.获取物料集合
|
//1.获取物料集合和组织集合
|
||||||
var materials_result = await _erpService.BillQueryForMaterial();
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
if (!materials_result.IsSuccess)
|
if (!materials_result.IsSuccess)
|
||||||
return ResultPagedList<InStockTaskQueryResponse>.ReFailure(materials_result);
|
return ResultPagedList<InStockTaskQueryResponse>.ReFailure(materials_result);
|
||||||
var materials = materials_result.Data.ToList();
|
var materials = materials_result.Data.ToList();
|
||||||
|
//组织集合
|
||||||
|
var orgs_result = await _erpService.BillQueryForOrg();
|
||||||
|
if (!orgs_result.IsSuccess)
|
||||||
|
return ResultPagedList<InStockTaskQueryResponse>.ReFailure(orgs_result);
|
||||||
|
var orgs = orgs_result.Data.ToList();
|
||||||
|
|
||||||
//物料集合;模糊查询后的物料集合
|
//物料集合;模糊查询后的物料集合
|
||||||
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||||
@@ -119,7 +124,7 @@ namespace WMS.Web.Repositories
|
|||||||
Status = s.order.Status.GetRemark(),
|
Status = s.order.Status.GetRemark(),
|
||||||
SourceBillNo = s.order.SourceBillNo,
|
SourceBillNo = s.order.SourceBillNo,
|
||||||
Supplier = "",
|
Supplier = "",
|
||||||
Org = "",
|
Org = _erpBasicDataExtendService.GetOrgName(orgs,s.detail.OrgId),
|
||||||
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials,s.detail.MaterialId),
|
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials,s.detail.MaterialId),
|
||||||
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.detail.MaterialId),
|
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.detail.MaterialId),
|
||||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialId),
|
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialId),
|
||||||
|
|||||||
@@ -25,19 +25,24 @@ namespace WMS.Web.Repositories
|
|||||||
private readonly ILoginRepositories _loginRepositories;
|
private readonly ILoginRepositories _loginRepositories;
|
||||||
private readonly RepositoryDbContext _context;
|
private readonly RepositoryDbContext _context;
|
||||||
private readonly ISingleDataService _singleDataService;
|
private readonly ISingleDataService _singleDataService;
|
||||||
|
private readonly IErpService _erpService;
|
||||||
|
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
|
||||||
|
|
||||||
public InventoryDetailsRepositories(RepositoryDbContext context,
|
public InventoryDetailsRepositories(RepositoryDbContext context,
|
||||||
IMapper mapper,
|
IMapper mapper,
|
||||||
|
IErpService erpService,
|
||||||
ILoginRepositories loginRepositories,
|
ILoginRepositories loginRepositories,
|
||||||
IServiceProvider serviceProvider,
|
IServiceProvider serviceProvider,
|
||||||
ISingleDataService singleDataService)
|
ISingleDataService singleDataService,
|
||||||
|
IErpBasicDataExtendService erpBasicDataExtendService)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
|
_erpService = erpService;
|
||||||
_serviceProvider = serviceProvider;
|
_serviceProvider = serviceProvider;
|
||||||
_loginRepositories = loginRepositories;
|
_loginRepositories = loginRepositories;
|
||||||
_singleDataService = singleDataService;
|
_singleDataService = singleDataService;
|
||||||
|
_erpBasicDataExtendService = erpBasicDataExtendService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,11 +52,25 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ResultPagedList<InventoryDetailsQueryResponse>> GetPagedList(InventoryDetailsQueryRequest dto)
|
public async Task<ResultPagedList<InventoryDetailsQueryResponse>> GetPagedList(InventoryDetailsQueryRequest dto)
|
||||||
{
|
{
|
||||||
|
//1.获取物料集合和组织集合
|
||||||
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
|
if (!materials_result.IsSuccess)
|
||||||
|
return ResultPagedList<InventoryDetailsQueryResponse>.ReFailure(materials_result);
|
||||||
|
var materials = materials_result.Data.ToList();
|
||||||
|
|
||||||
|
//物料集合;模糊查询后的物料集合
|
||||||
|
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||||
|
materials = materials.Where(w => EF.Functions.Like(w.MaterialNumber, "%" + dto.MaterialNumber + "%")).ToList();
|
||||||
|
|
||||||
var query = _context.InventoryDetails
|
var query = _context.InventoryDetails
|
||||||
.Where(adv => 1 == 1);
|
.Where(adv => 1 == 1);
|
||||||
|
|
||||||
//if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
//物料ID在模糊后的物料
|
||||||
// query = query.Where(w => EF.Functions.Like(w.detail.BillNo, "%" + dto.BillNo + "%"));
|
if (materials != null && materials.Count != 0 && !string.IsNullOrEmpty(dto.MaterialNumber))
|
||||||
|
{
|
||||||
|
var mids = materials.Select(x => x.MaterialId).ToList();
|
||||||
|
query = query.Where(w => mids.Contains(w.MaterialId));
|
||||||
|
}
|
||||||
|
|
||||||
if (dto.StockId.HasValue)
|
if (dto.StockId.HasValue)
|
||||||
query = query.Where(w => w.StockId == dto.StockId.Value);
|
query = query.Where(w => w.StockId == dto.StockId.Value);
|
||||||
@@ -66,13 +85,13 @@ namespace WMS.Web.Repositories
|
|||||||
var list = await query.Select(s => new InventoryDetailsQueryResponse()
|
var list = await query.Select(s => new InventoryDetailsQueryResponse()
|
||||||
{
|
{
|
||||||
Id=s.Id,
|
Id=s.Id,
|
||||||
MaterialName = "",
|
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.MaterialId),
|
||||||
MaterialNumber = "",
|
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.MaterialId),
|
||||||
Specifications = "",
|
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.MaterialId),
|
||||||
Stock = "",
|
Stock = "",
|
||||||
Qty = s.Qty,
|
Qty = s.Qty,
|
||||||
SubStock ="",
|
SubStock ="",
|
||||||
Unit = ""
|
Unit = _erpBasicDataExtendService.GetMaterialUnitName(materials, s.MaterialId),
|
||||||
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
|
|
||||||
response.Data = list;
|
response.Data = list;
|
||||||
|
|||||||
Reference in New Issue
Block a user