调整获取金蝶数据
This commit is contained in:
@@ -32,6 +32,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
public class ErpService : IErpService
|
||||
{
|
||||
private IMapper _mapper;
|
||||
private AppOptions _appOptions;
|
||||
private ErpOptions _erpOptions;
|
||||
private ILogger<ErpService> _logger;
|
||||
private ERPGWSoapClient _client;
|
||||
@@ -40,17 +41,21 @@ namespace WMS.Web.Domain.Services.Public
|
||||
private readonly ISingleDataService _singleDataService;
|
||||
public readonly ITransactionRepositories _transactionRepositories;
|
||||
private readonly ILoginRepositories _loginRepositories;
|
||||
private readonly IBasicsRepositories _basicsRepositories;
|
||||
public ErpService(
|
||||
IMapper mapper,
|
||||
IOptions<ErpOptions> erpOptions,
|
||||
IOptions<AppOptions> appOptions,
|
||||
ILogger<ErpService> logger,
|
||||
IMemoryCache memoryCache,
|
||||
IInStockTaskRepositories inStockTaskRepositories,
|
||||
ITransactionRepositories transactionRepositories,
|
||||
ISingleDataService singleDataService,
|
||||
ILoginRepositories loginRepositories)
|
||||
ILoginRepositories loginRepositories, IBasicsRepositories basicsRepositories)
|
||||
{
|
||||
this._basicsRepositories = basicsRepositories;
|
||||
this._erpOptions = erpOptions?.Value;
|
||||
this._appOptions = appOptions?.Value;
|
||||
this._mapper = mapper;
|
||||
this._logger = logger;
|
||||
this._memoryCache = memoryCache;
|
||||
@@ -90,6 +95,13 @@ namespace WMS.Web.Domain.Services.Public
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var stocks= await _basicsRepositories.GetUcStockAsync(ManagementSystemCode.GLXT0004.ToString(), "", _appOptions.CompanyId);
|
||||
if(stocks.Count==0)
|
||||
return ResultList<ErpPurchaseInStockResultDto>.ReFailure(ResultCodes.ErpStockNoData);
|
||||
var stocks_codes = stocks.Select(x => x.Code).ToList();
|
||||
|
||||
|
||||
//1.先登录金蝶-拿到token
|
||||
var token_result = await this.Init();
|
||||
if (!token_result.IsSuccess)
|
||||
@@ -110,6 +122,20 @@ namespace WMS.Web.Domain.Services.Public
|
||||
//4.明细关闭状态:正常
|
||||
//5.仓库:wms系统的仓库值---现在这个没有加,因为还单点没有和金蝶同步
|
||||
param.FilterString = "FCreateDate>='" + beginTime + "' and FCreateDate<='" + endTime + "' and FDocumentStatus='C' and (FBillTypeID='83d822ca3e374b4ab01e5dd46a0062bd' or FBillTypeID='6d01d059713d42a28bb976c90a121142') and FMRPCloseStatus='A'";
|
||||
param.FilterString = param.FilterString + " and FSOSTOCKID.FNumber in (";
|
||||
|
||||
var str = "";
|
||||
int index = 0;
|
||||
foreach (var scode in stocks_codes)
|
||||
{
|
||||
index++;
|
||||
if (index == stocks_codes.Count)
|
||||
str = str + $"'{scode}'";
|
||||
else
|
||||
str = str + $"'{scode}'" + ",";
|
||||
}
|
||||
param.FilterString = param.FilterString +str+ ")";
|
||||
|
||||
query.Data = JsonConvert.SerializeObject(param);
|
||||
var json = JsonConvert.SerializeObject(query);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user