|
@ -311,7 +311,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran |
|
|
var log = new VmiLog |
|
|
var log = new VmiLog |
|
|
{ |
|
|
{ |
|
|
LogType = logType, |
|
|
LogType = logType, |
|
|
ChangedType = VmiType.In, |
|
|
ChangedType = VmiType.Out, |
|
|
ChangedNumber = changedNumber, |
|
|
ChangedNumber = changedNumber, |
|
|
ChangedTime = DateTime.Now, |
|
|
ChangedTime = DateTime.Now, |
|
|
ChangedBy = _currentUser.UserName, |
|
|
ChangedBy = _currentUser.UserName, |
|
@ -423,10 +423,18 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran |
|
|
return fileName; |
|
|
return fileName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
/// <summary>
|
|
|
public void VmiLogInsertTest() |
|
|
/// 补货数据导出
|
|
|
|
|
|
/// </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>
|
|
|
/// <summary>
|
|
@ -529,12 +537,17 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran |
|
|
{ |
|
|
{ |
|
|
if (log.Qty >= decimal.Zero) |
|
|
if (log.Qty >= decimal.Zero) |
|
|
{ |
|
|
{ |
|
|
|
|
|
log.LogType = VmiLogType.Type500; |
|
|
|
|
|
log.ChangedType = VmiType.In; |
|
|
var data = new VmiBalance(); |
|
|
var data = new VmiBalance(); |
|
|
data.InjectFrom(log); |
|
|
data.InjectFrom(log); |
|
|
await In(VmiLogType.Type500, null, data).ConfigureAwait(false); |
|
|
await In(VmiLogType.Type500, null, data).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
|
|
log.LogType = VmiLogType.Type600; |
|
|
|
|
|
log.ChangedType = VmiType.Out; |
|
|
|
|
|
log.Qty=-log.Qty; |
|
|
await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false); |
|
|
await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|