mahao 1 year ago
parent
commit
dab7052dbc
  1. 21
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

21
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -311,7 +311,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
var log = new VmiLog
{
LogType = logType,
ChangedType = VmiType.In,
ChangedType = VmiType.Out,
ChangedNumber = changedNumber,
ChangedTime = DateTime.Now,
ChangedBy = _currentUser.UserName,
@ -423,10 +423,18 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
return fileName;
}
[HttpGet]
public void VmiLogInsertTest()
/// <summary>
/// 补货数据导出
/// </summary>
[HttpPost]
public async Task<string> ReplenishedExportAsync(RequestDto input)
{
new InfluxHelper(_cfg).Insert(new VmiLog(GuidGenerator.Create()));
var entities = await _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>())
.ToListAsync().ConfigureAwait(false);
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var content = this.GetContent(entities, "补货数据_");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
}
/// <summary>
@ -529,12 +537,17 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
{
if (log.Qty >= decimal.Zero)
{
log.LogType = VmiLogType.Type500;
log.ChangedType = VmiType.In;
var data = new VmiBalance();
data.InjectFrom(log);
await In(VmiLogType.Type500, null, data).ConfigureAwait(false);
}
else
{
log.LogType = VmiLogType.Type600;
log.ChangedType = VmiType.Out;
log.Qty=-log.Qty;
await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false);
}
}

Loading…
Cancel
Save