Fix su sql server connection in menu configurator
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

(cherry picked from commit 6f3d8a7ef5)
This commit is contained in:
2025-08-05 11:14:45 +02:00
parent 36c425941a
commit 49b4fca63c

View File

@@ -1,6 +1,7 @@
package it.integry.ems.menu.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.microsoft.sqlserver.jdbc.SQLServerConnection;
import com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement;
import it.integry.annotations.PostContextAutowired;
import it.integry.annotations.PostContextConstruct;
@@ -100,6 +101,7 @@ public class MenuConfigurationService {
}
private void internalRefresh(Connection connection, MenuConfigDTO menuConfig, boolean forceRefresh) throws Exception {
SQLServerConnection sqlServerConnection = connection.unwrap(SQLServerConnection.class);
final Azienda azienda = Azienda.getDefaultAzienda(connection);
if (azienda.getTipoAzienda() == null)
@@ -120,7 +122,7 @@ public class MenuConfigurationService {
"descrizione, gest_name, entity_name, picture_menu, picture_select, object_type, flag_printer_setup, parameter, note, open_type, is_deprecated)" +
" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
try (SQLServerPreparedStatement insertBulkPs = (SQLServerPreparedStatement) connection.prepareStatement(insertStbMenuOpzSQL)) {
try (SQLServerPreparedStatement insertBulkPs = (SQLServerPreparedStatement) sqlServerConnection.prepareStatement(insertStbMenuOpzSQL)) {
for (StbMenuOpzDTO stbMenuOpzDto : menuConfig.getStbMenuOpz()) {
insertBulkPs.setString(1, stbMenuOpzDto.getCodOpz());
@@ -168,7 +170,7 @@ public class MenuConfigurationService {
"pos_tipo_azienda, pos_cliente, descrizione_estesa) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
try (SQLServerPreparedStatement insertBulkPs = (SQLServerPreparedStatement) connection.prepareStatement(insertStbMenuSql)) {
try (SQLServerPreparedStatement insertBulkPs = (SQLServerPreparedStatement) sqlServerConnection.prepareStatement(insertStbMenuSql)) {
for (StbMenuDTO stbMenuDto : stbMenus) {
insertBulkPs.setString(1, stbMenuDto.getCodOpz());