Gestito complete id per versioni costi di trasporto
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250115162836 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
this.executeStatement(
|
||||
"ALTER TABLE mtb_lisv_data_spese\n" +
|
||||
" ADD CONSTRAINT mtb_lisv_data_spese_pk\n" +
|
||||
" PRIMARY KEY (id);"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -1347,4 +1347,22 @@ public class SalesRules extends QueryRules {
|
||||
|
||||
vtbViaggi.setVtbViaggiList(viaggiGiorno);
|
||||
}
|
||||
|
||||
public static Long completeIdMtbLisvDataSpese(Connection connection, MtbLisvDataSpese mtbLisvDataSpese) throws SQLException {
|
||||
VtbListData vtbListData = (VtbListData) mtbLisvDataSpese.getParent();
|
||||
|
||||
Date dataIniz = vtbListData.getDataIniz();
|
||||
|
||||
String sql = Query.format(
|
||||
"SELECT id\n" +
|
||||
"FROM mtb_lisv_data_spese mlds\n" +
|
||||
" INNER JOIN dbo.vtb_list_data vld\n" +
|
||||
" ON mlds.cod_vlis = vld.cod_vlis AND mlds.versione = vld.versione AND vld.data_iniz = %s\n" +
|
||||
"WHERE id = %s",
|
||||
dataIniz,
|
||||
mtbLisvDataSpese.getId()
|
||||
);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,3 +653,13 @@ then
|
||||
setRapConvVend(rapConvVend)
|
||||
}
|
||||
end
|
||||
|
||||
rule "completeIdMtbLisvDataSpese"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity : MtbLisvDataSpese(id != null && operation != OperationType.DELETE)
|
||||
then
|
||||
Long id = SalesRules.completeIdMtbLisvDataSpese(conn, $entity);
|
||||
modify ( $entity ) { setId(id), setOperation(id == null ? OperationType.INSERT : $entity.getOperation()) }
|
||||
end
|
||||
@@ -56,9 +56,8 @@ public class ContrattiDiVenditaHandlerService {
|
||||
try {
|
||||
String historyProfileDb = settingsController.getHistoryProfileDb();
|
||||
|
||||
Map<String, List<AvailableConnectionsModel>> databases = settingsModel.getAvailableConnections()
|
||||
Map<String, List<AvailableConnectionsModel>> databases = settingsModel.getAvailableConnections(true)
|
||||
.stream()
|
||||
.filter(AvailableConnectionsModel::getInternalDb)
|
||||
.filter(x -> !historyProfileDb.equalsIgnoreCase(x.getProfileName()))
|
||||
.collect(Collectors.groupingBy(AvailableConnectionsModel::getDbName));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user