update: localstorage
parent
89a252e8e7
commit
fb75e82964
|
|
@ -114,8 +114,9 @@ namespace eSPJ.Services
|
|||
};
|
||||
}
|
||||
|
||||
// Save files
|
||||
var uploadPath = Path.Combine(_env.WebRootPath, "uploads", "penjemputan", DateTime.Now.ToString("yyyy-MM-dd"));
|
||||
var uploadDateFolder = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
var uploadPath = Path.Combine(_env.WebRootPath, "uploads", "penjemputan", uploadDateFolder);
|
||||
var uploadBaseUrl = $"/uploads/penjemputan/{uploadDateFolder}";
|
||||
if (!Directory.Exists(uploadPath))
|
||||
{
|
||||
Directory.CreateDirectory(uploadPath);
|
||||
|
|
@ -147,7 +148,7 @@ namespace eSPJ.Services
|
|||
{
|
||||
await file.CopyToAsync(stream);
|
||||
}
|
||||
tpsData.FotoKedatangan.Add(fileName);
|
||||
tpsData.FotoKedatangan.Add($"{uploadBaseUrl}/{fileName}");
|
||||
}
|
||||
|
||||
// Save foto timbangan
|
||||
|
|
@ -171,7 +172,7 @@ namespace eSPJ.Services
|
|||
|
||||
tpsData.Timbangan.Add(new TimbanganItem
|
||||
{
|
||||
FotoFileName = fileName,
|
||||
FotoFileName = $"{uploadBaseUrl}/{fileName}",
|
||||
Berat = new List<decimal> { (i < request.BeratTimbangan.Count ? request.BeratTimbangan[i] : 0) },
|
||||
LokasiAngkut = new List<string>(),
|
||||
JenisSampah = new List<JenisSampah> { jenisSampah },
|
||||
|
|
@ -190,10 +191,9 @@ namespace eSPJ.Services
|
|||
{
|
||||
await file.CopyToAsync(stream);
|
||||
}
|
||||
tpsData.FotoPetugas.Add(fileName);
|
||||
tpsData.FotoPetugas.Add($"{uploadBaseUrl}/{fileName}");
|
||||
}
|
||||
|
||||
// Load existing data and append
|
||||
var allData = await GetAllTpsDataAsync();
|
||||
allData.Add(tpsData);
|
||||
await SaveTpsDataAsync(allData);
|
||||
|
|
@ -220,9 +220,7 @@ namespace eSPJ.Services
|
|||
{
|
||||
try
|
||||
{
|
||||
// TODO: Integrate with OpenRouter API
|
||||
// For now, return mock response
|
||||
await Task.Delay(500); // Simulate API call
|
||||
await Task.Delay(500);
|
||||
|
||||
return new OcrTimbanganResponse
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue