Fix metodo post merge...
This commit is contained in:
@@ -137,64 +137,6 @@ namespace EgwCoreLib.Lux.Data.Services.Sales
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua fix TipoImg righe child dell' Offer indicato
|
||||
/// </summary>
|
||||
/// <param name="offerId">Key</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> FixImgTypeAsync(int offerId)
|
||||
{
|
||||
return await TraceAsync($"{_className}.FixImgType", async (activity) =>
|
||||
{
|
||||
// 1. Recupero righe
|
||||
var rows = await _repo.GetByParentAsync(offerId);
|
||||
if (rows == null) return false;
|
||||
|
||||
// 2. Trovo quelle da sistemare
|
||||
var list2fix = rows
|
||||
.Where(x => x.ImgType == ImageType.ND)
|
||||
.ToList();
|
||||
|
||||
// 3. Se non c'è nulla da fare → ritorno (nessun cambio necessario)
|
||||
if (list2fix.Count == 0)
|
||||
return true;
|
||||
|
||||
|
||||
// 5. Aggiorno i record
|
||||
foreach (var row in list2fix)
|
||||
{
|
||||
// se è calcolato il selling item --> img calcolata
|
||||
if (row.SellingItemNav != null && (row.SellingItemNav.SourceType == ItemSourceType.Jwd || row.SellingItemNav.SourceType == ItemSourceType.FileBTL))
|
||||
{
|
||||
row.ImgType = ImageType.Calculated;
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Salvo
|
||||
bool success = await _repo.SaveRowsAsync(list2fix);
|
||||
|
||||
if (success)
|
||||
{
|
||||
await ClearCacheAsync($"{_redisBaseKey}:Offer:*");
|
||||
await ClearCacheAsync($"{_redisBaseKey}:{_className}:*");
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<OfferRowModel?> GetByUidAsync(string offerRowUid)
|
||||
{
|
||||
return await TraceAsync($"{_className}.GetByUid", async (activity) =>
|
||||
{
|
||||
return await GetOrSetCacheAsync(
|
||||
$"{_redisBaseKey}:{_className}:ByUid:{offerRowUid}",
|
||||
async () => await _repo.GetByUidAsync(offerRowUid),
|
||||
LongCache
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<OfferRowModel?> GetByIdAsync(int offerRowId)
|
||||
{
|
||||
return await TraceAsync($"{_className}.GetById", async (activity) =>
|
||||
@@ -262,40 +204,6 @@ namespace EgwCoreLib.Lux.Data.Services.Sales
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua update delle info legate al file per il Offer indicato
|
||||
/// </summary>
|
||||
/// <param name="updRec">Riga Offer coi dati da aggiornare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> UpdateFileDataAsync(OfferRowModel updRec)
|
||||
{
|
||||
return await TraceAsync($"{_className}.UpdateFileData", async (activity) =>
|
||||
{
|
||||
var currRec = await _repo.GetByIdAsync(updRec.OfferRowID);
|
||||
|
||||
if (currRec == null)
|
||||
return false;
|
||||
|
||||
currRec.FileName = updRec.FileName;
|
||||
currRec.FileResource = updRec.FileResource;
|
||||
currRec.FileSize = updRec.FileSize;
|
||||
currRec.SerStruct = updRec.SerStruct;
|
||||
currRec.ImgType = Core.Enums.ImageType.Calculated;
|
||||
|
||||
activity?.SetTag("db.operation", "UPDATE");
|
||||
|
||||
bool success = await _repo.UpdateAsync(currRec);
|
||||
|
||||
if (success)
|
||||
{
|
||||
await ClearCacheAsync($"{_redisBaseKey}:Offer:*");
|
||||
await ClearCacheAsync($"{_redisBaseKey}:{_className}:*");
|
||||
}
|
||||
|
||||
return success;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua update del valore serializzato della Riga Offer
|
||||
/// </summary>
|
||||
@@ -434,7 +342,7 @@ namespace EgwCoreLib.Lux.Data.Services.Sales
|
||||
{
|
||||
operation = "INSERT";
|
||||
success = await _repo.AddAsync(upsRec);
|
||||
|
||||
|
||||
if (!success) return null; // Return null on insert failure
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.1.2603.1812</Version>
|
||||
<Version>1.1.2603.1813</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
|
||||
<Version>1.1.2603.1812</Version>
|
||||
<Version>1.1.2603.1813</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 1.1.2603.1812</h4>
|
||||
<h4>Versione: 1.1.2603.1813</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2603.1812
|
||||
1.1.2603.1813
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2603.1812</version>
|
||||
<version>1.1.2603.1813</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user