Cambiati alcuni datasource
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:
18
.idea/copilotDiffState.xml
generated
18
.idea/copilotDiffState.xml
generated
File diff suppressed because one or more lines are too long
@@ -19,6 +19,15 @@ public class DataSource extends BasicDataSource {
|
||||
|
||||
private AvailableConnectionsModel connectionModel;
|
||||
|
||||
/**
|
||||
* Instanzia un nuovo datasource.
|
||||
* @deprecated
|
||||
* Il datasource non deve essere istanziato direttamente ma bisogna utilizzare il metodo {@link it.integry.ems.sync.MultiDBTransaction.BasicConnectionPool#getConnection(String)} per ottenere una connessione.
|
||||
*/
|
||||
@Deprecated
|
||||
public DataSource() {
|
||||
super();
|
||||
}
|
||||
|
||||
public EmsRestConstants.DB_TYPE getTypeDB() {
|
||||
return connectionModel.getConnectionType();
|
||||
@@ -31,6 +40,7 @@ public class DataSource extends BasicDataSource {
|
||||
* @return una connessione dal pool
|
||||
* @throws SQLException se si verifica un errore di accesso al database
|
||||
*/
|
||||
|
||||
public Connection getConnection() throws SQLException {
|
||||
// Restituisce una nuova connessione dal pool di BasicDataSource, wrappata nel nostro tipo Connection
|
||||
final Connection connection = Connection.fromConnection(super.getConnection());
|
||||
|
||||
@@ -35,12 +35,12 @@ import java.util.TimerTask;
|
||||
|
||||
public class EmailWatcherListener extends TimerTask {
|
||||
|
||||
private Logger logger = LogManager.getLogger();
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
private EmailListenerInfo emailListenerInfo;
|
||||
private EmsProperties prop;
|
||||
private SetupGest setupGest;
|
||||
private ResponseJSONObjectMapper jsonObjectMapper;
|
||||
private final EmailListenerInfo emailListenerInfo;
|
||||
private final EmsProperties prop;
|
||||
private final SetupGest setupGest;
|
||||
private final ResponseJSONObjectMapper jsonObjectMapper;
|
||||
|
||||
public EmailWatcherListener(EmailListenerInfo emailListenerInfo, EmsProperties prop,
|
||||
SetupGest setupGest, ResponseJSONObjectMapper jsonObjectMapper) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import it.integry.ems.Import.base.IEntityImporter;
|
||||
import it.integry.ems.Import.dto.AnomalieDTO;
|
||||
import it.integry.ems.Import.dto.ImportRequestDTO;
|
||||
import it.integry.ems.Import.enums.EntityImportType;
|
||||
import it.integry.ems.datasource.DataSource;
|
||||
import it.integry.ems.dto.*;
|
||||
import it.integry.ems.exception.MissingDataException;
|
||||
import it.integry.ems.export.base.EntityExportResponse;
|
||||
@@ -32,6 +31,7 @@ import it.integry.ems.service.dto.AttachmentDTO;
|
||||
import it.integry.ems.service.dto.EntityFieldDTO;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.BasicConnectionPool;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
@@ -130,6 +130,9 @@ public class EmsServices {
|
||||
@Autowired
|
||||
private SettingsController settingsController;
|
||||
|
||||
@Autowired
|
||||
private BasicConnectionPool basicConnectionPool;
|
||||
|
||||
public EntityImportResponse<List<EntityBase>> importEntity(String type, String format, ImportRequestDTO body, boolean headless) throws Exception {
|
||||
logger.debug("Starting import [Type: " + type + ", Format: " + format + "]");
|
||||
String gestName = "IMPORT_" + type;
|
||||
@@ -279,7 +282,7 @@ public class EmsServices {
|
||||
|
||||
boolean anyError = checkForErrorsAndAddToResponse(entityImporter, tmpResult, result, gestName, format, fileContent, fileName, anomaliaIsError, headless);
|
||||
|
||||
if (!anyError && fileContent != null && !anomaliaIsError){
|
||||
if (!anyError && fileContent != null && !anomaliaIsError) {
|
||||
File file = new File(fileName);
|
||||
FileUtils.writeByteArrayToFile(file, fileContent);
|
||||
moveFileImported(type, format, file, entityImporter, tmpResult);
|
||||
@@ -505,7 +508,7 @@ public class EmsServices {
|
||||
@Nullable String mimeType,
|
||||
@Nullable MrlPartitaMagAttached mrlPartitaMagAttached,
|
||||
@Nullable Date datetimeAttach) throws Exception {
|
||||
return uploadStbFilesAttached(idAttach, filename, fileContent,descrizione,mimeType, null, mrlPartitaMagAttached, datetimeAttach);
|
||||
return uploadStbFilesAttached(idAttach, filename, fileContent, descrizione, mimeType, null, mrlPartitaMagAttached, datetimeAttach);
|
||||
|
||||
}
|
||||
|
||||
@@ -570,7 +573,7 @@ public class EmsServices {
|
||||
if (mrlPartitaMagAttached != null)
|
||||
stbFilesAttached.setMrlPartitaMagAttached(mrlPartitaMagAttached);
|
||||
|
||||
if (drlDocAttached != null )
|
||||
if (drlDocAttached != null)
|
||||
stbFilesAttached.setDrlDocAttached(drlDocAttached);
|
||||
|
||||
entityProcessor.processEntity(stbFilesAttached, multiDBTransactionManager);
|
||||
@@ -714,7 +717,7 @@ public class EmsServices {
|
||||
}
|
||||
}
|
||||
|
||||
if (!UtilityList.isNullOrEmpty(createZipDTO.getListDtbDocPdf())){
|
||||
if (!UtilityList.isNullOrEmpty(createZipDTO.getListDtbDocPdf())) {
|
||||
List<DtbDocPdf> listDtbDocPdf = createZipDTO.getListDtbDocPdf().stream()
|
||||
.peek(dtbDocPdf -> dtbDocPdf.setOperation(OperationType.SELECT_OBJECT))
|
||||
.collect(Collectors.toList());
|
||||
@@ -996,7 +999,6 @@ public class EmsServices {
|
||||
" FROM azienda";
|
||||
|
||||
|
||||
|
||||
for (Connection connection : mdb.getActiveConnections()) {
|
||||
HashMap<String, Object> resultDbInfo = UtilityDB.executeSimpleQueryOnlyFirstRow(connection, sql);
|
||||
|
||||
@@ -1021,44 +1023,81 @@ public class EmsServices {
|
||||
}
|
||||
|
||||
private void importClientieOrdiniQuore() throws Exception {
|
||||
DataSource ds = new DataSource();
|
||||
ds.initialize(settingsModel.getDefaultProfile());
|
||||
try (Connection connection = basicConnectionPool.getConnection(settingsModel.getDefaultProfile())) {
|
||||
boolean enabled = Boolean.parseBoolean(setupGest.getSetup(connection,
|
||||
"IMPORT_ORDINI WEB", "CONQUIST", "ENABLED"));
|
||||
String folder = setupGest.getSetup(connection, "IMPORT_ORDINI WEB", "CONQUIST", "FOLDER");
|
||||
|
||||
Boolean enabled = Boolean.parseBoolean(setupGest.getSetup(ds.getConnection(),
|
||||
"IMPORT_ORDINI WEB", "CONQUIST", "ENABLED"));
|
||||
String folder = setupGest.getSetup(ds.getConnection(), "IMPORT_ORDINI WEB", "CONQUIST", "FOLDER");
|
||||
ds.close();
|
||||
if (UtilityString.isNullOrEmpty(folder))
|
||||
throw new Exception("IMPORT_ORDINI WEB/CONQUIST/FOLDER non configurato correttamente");
|
||||
|
||||
if (UtilityString.isNullOrEmpty(folder))
|
||||
throw new Exception("IMPORT_ORDINI WEB/CONQUIST/FOLDER non configurato correttamente");
|
||||
if (enabled && "/ems-api".equals(properties.getRootApi())) {
|
||||
String csv, auth;
|
||||
String database = settingsModel.getDefaultProfile();
|
||||
|
||||
if (enabled && "/ems-api".equals(properties.getRootApi())) {
|
||||
String csv, auth;
|
||||
String database = settingsModel.getDefaultProfile();
|
||||
File errorDirectory = new File(folder + "/import/error");
|
||||
if (!errorDirectory.exists())
|
||||
errorDirectory.mkdir();
|
||||
|
||||
File errorDirectory = new File(folder + "/import/error");
|
||||
if (!errorDirectory.exists())
|
||||
errorDirectory.mkdir();
|
||||
File[] files = getFileListQuore(folder, "clienti_");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File f = files[i];
|
||||
if (f.exists()) {
|
||||
csv = FileUtils.readFileToString(f);
|
||||
|
||||
File[] files = getFileListQuore(folder, "clienti_");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File f = files[i];
|
||||
if (f.exists()) {
|
||||
csv = FileUtils.readFileToString(f);
|
||||
auth = RestUtil.generateAuth(database, database, "POST", "", "text/plain",
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_CLIENTI_CQ);
|
||||
|
||||
auth = RestUtil.generateAuth(database, database, "POST", "", "text/plain",
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_CLIENTI_CQ);
|
||||
Client client = ClientBuilder.newClient();
|
||||
WebTarget resource = client.target(properties.getEndPointWS()).path(
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_CLIENTI_CQ);
|
||||
Response responseEms = resource.queryParam(CommonConstants.PROFILE_DB, database)
|
||||
.request().header("Authorization", database + ":" + auth)
|
||||
.post(Entity.text(csv));
|
||||
|
||||
Client client = ClientBuilder.newClient();
|
||||
WebTarget resource = client.target(properties.getEndPointWS()).path(
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_CLIENTI_CQ);
|
||||
Response responseEms = resource.queryParam(CommonConstants.PROFILE_DB, database)
|
||||
.request().header("Authorization", database + ":" + auth)
|
||||
.post(Entity.text(csv));
|
||||
String value = responseEms.readEntity(String.class);
|
||||
logger.info("CLIENTI RESPONSE: " + value);
|
||||
if (!UtilityString.isNullOrEmpty(value)) {
|
||||
ServiceRestResponse resp = jsonObjectMapper.readValue(value, ServiceRestResponse.class);
|
||||
|
||||
String value = responseEms.readEntity(String.class);
|
||||
logger.info("CLIENTI RESPONSE: " + value);
|
||||
if (!UtilityString.isNullOrEmpty(value)) {
|
||||
if (resp.getEsito() == EsitoType.KO) {
|
||||
File dest = new File(folder + "/import/error/" + f.getName());
|
||||
FileOutputStream fos = new FileOutputStream(dest);
|
||||
FileInputStream is = new FileInputStream(f);
|
||||
IOUtils.copy(is, fos);
|
||||
is.close();
|
||||
fos.close();
|
||||
f.delete();
|
||||
|
||||
logger.error("ERRORE IMPORTAZIONE CLIENTI CQ: " + value);
|
||||
throw new Exception("Errore importazione clienti CQ");
|
||||
} else if (resp.getEsito() == EsitoType.OK) {
|
||||
// cancellazione file clienti
|
||||
f.delete();
|
||||
}
|
||||
}
|
||||
responseEms.close();
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
|
||||
files = getFileListQuore(folder, "ordini_");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File f = files[i];
|
||||
if (f.exists()) {
|
||||
csv = FileUtils.readFileToString(f);
|
||||
|
||||
auth = RestUtil.generateAuth(database, database, "POST", "", "text/plain",
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_ORDINI_CQ);
|
||||
|
||||
Client client = ClientBuilder.newClient();
|
||||
WebTarget resource = client.target(properties.getEndPointWS()).path(
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_ORDINI_CQ);
|
||||
Response responseEms = resource.queryParam(CommonConstants.PROFILE_DB, database)
|
||||
.request().header("Authorization", database + ":" + auth)
|
||||
.post(Entity.text(csv));
|
||||
|
||||
String value = responseEms.readEntity(String.class);
|
||||
ServiceRestResponse resp = jsonObjectMapper.readValue(value, ServiceRestResponse.class);
|
||||
|
||||
if (resp.getEsito() == EsitoType.KO) {
|
||||
@@ -1070,54 +1109,15 @@ public class EmsServices {
|
||||
fos.close();
|
||||
f.delete();
|
||||
|
||||
logger.error("ERRORE IMPORTAZIONE CLIENTI CQ: " + value);
|
||||
throw new Exception("Errore importazione clienti CQ");
|
||||
} else if (resp.getEsito() == EsitoType.OK) {
|
||||
// cancellazione file clienti
|
||||
f.delete();
|
||||
logger.error("ERRORE IMPORTAZIONE ORDINI CQ: " + value);
|
||||
throw new Exception("Errore importazione ORDINI CQ");
|
||||
}
|
||||
}
|
||||
responseEms.close();
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
responseEms.close();
|
||||
client.close();
|
||||
|
||||
files = getFileListQuore(folder, "ordini_");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File f = files[i];
|
||||
if (f.exists()) {
|
||||
csv = FileUtils.readFileToString(f);
|
||||
|
||||
auth = RestUtil.generateAuth(database, database, "POST", "", "text/plain",
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_ORDINI_CQ);
|
||||
|
||||
Client client = ClientBuilder.newClient();
|
||||
WebTarget resource = client.target(properties.getEndPointWS()).path(
|
||||
properties.getRootApi() + EmsRestConstants.PATH_IMPORT_ORDINI_CQ);
|
||||
Response responseEms = resource.queryParam(CommonConstants.PROFILE_DB, database)
|
||||
.request().header("Authorization", database + ":" + auth)
|
||||
.post(Entity.text(csv));
|
||||
|
||||
String value = responseEms.readEntity(String.class);
|
||||
ServiceRestResponse resp = jsonObjectMapper.readValue(value, ServiceRestResponse.class);
|
||||
|
||||
if (resp.getEsito() == EsitoType.KO) {
|
||||
File dest = new File(folder + "/import/error/" + f.getName());
|
||||
FileOutputStream fos = new FileOutputStream(dest);
|
||||
FileInputStream is = new FileInputStream(f);
|
||||
IOUtils.copy(is, fos);
|
||||
is.close();
|
||||
fos.close();
|
||||
// cancellazione file ordini
|
||||
f.delete();
|
||||
|
||||
logger.error("ERRORE IMPORTAZIONE ORDINI CQ: " + value);
|
||||
throw new Exception("Errore importazione ORDINI CQ");
|
||||
}
|
||||
responseEms.close();
|
||||
client.close();
|
||||
|
||||
// cancellazione file ordini
|
||||
f.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import it.integry.ems.activity.dto.DescrizioneTipiAttivitaDTO;
|
||||
import it.integry.ems.activity.dto.ModellinoDTO;
|
||||
import it.integry.ems.activity.dto.SteUPEntryDTO;
|
||||
import it.integry.ems.activity.dto.SteUpScoreDTO;
|
||||
import it.integry.ems.datasource.DataSource;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.component.SQLServerDBSchemaManager;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTable;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTableColumn;
|
||||
@@ -22,6 +21,7 @@ import it.integry.ems.service.MailService;
|
||||
import it.integry.ems.service.ReportProcessor;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.sync.MultiDBTransaction.BasicConnectionPool;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.system.service.SystemService;
|
||||
@@ -84,7 +84,8 @@ public class SteUPService {
|
||||
|
||||
@Autowired
|
||||
private SettingsModel settingsModel;
|
||||
|
||||
@Autowired
|
||||
private BasicConnectionPool basicConnectionPool;
|
||||
|
||||
|
||||
private UserDTO authUser(String md5User) throws Exception {
|
||||
@@ -122,10 +123,10 @@ public class SteUPService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HashMap<String, Object> login(String profileDb, String username, String password) throws Exception {
|
||||
return login(profileDb, UtilityHash.generateMd5(String.format("%s%s", username, password)));
|
||||
}
|
||||
|
||||
public HashMap<String, Object> login(String profileDb, String md5User) throws Exception {
|
||||
HashMap<String, Object> toReturn = new HashMap<>();
|
||||
|
||||
@@ -655,7 +656,7 @@ public class SteUPService {
|
||||
String content = new String(contentB64);
|
||||
barcodes = UtilityString.splitStringToMultipleLine(content, CommonConstants.A_CAPO);
|
||||
saveFile = false;
|
||||
} else if (UtilityDebug.isDebugExecution() ) {
|
||||
} else if (UtilityDebug.isDebugExecution()) {
|
||||
barcodes = UtilityDB.executeSimpleQueryOnlyFirstColumn(multiDBTransactionManager.getPrimaryConnection(),
|
||||
"select cod_mart from stb_activity where parent_activity_id = 'C0000843821'");
|
||||
} else {
|
||||
@@ -691,7 +692,7 @@ public class SteUPService {
|
||||
} else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) {
|
||||
List<HashMap<String, Object>> pluRepo = getGrigliaPluRepo(codMdep, codJfas, activityTypeId, null, dataCreation, true, barcodes);
|
||||
if (repartiFreschi != null && repartiFreschi.contains(codJfas)) {
|
||||
if ( barcodes != null && !barcodes.isEmpty()) {
|
||||
if (barcodes != null && !barcodes.isEmpty()) {
|
||||
List<String> finalBarcodes = barcodes;
|
||||
barcodes = new ArrayList<>();
|
||||
|
||||
@@ -712,7 +713,7 @@ public class SteUPService {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
barcodes.addAll(pluRepo.stream().filter(x -> x.get("barcode") != null).map(x->x.get("barcode").toString()).collect(Collectors.toList()));
|
||||
barcodes.addAll(pluRepo.stream().filter(x -> x.get("barcode") != null).map(x -> x.get("barcode").toString()).collect(Collectors.toList()));
|
||||
}
|
||||
// barcodes = pluRepo.stream().filter(a-> !finalBarcodes.contains(((String) a.get("barcode")))).map(a->(String) a.get("barcode")).collect(Collectors.toList());
|
||||
} else {
|
||||
@@ -861,11 +862,11 @@ public class SteUPService {
|
||||
sql =
|
||||
"SELECT griglia.cod_mart, \n" +
|
||||
"descrizione, \n" +
|
||||
(chkRotturaStock?"mvw_barcode.cod_barre":"griglia.bar_code") + " as barcode, \n" +
|
||||
(chkRotturaStock ? "mvw_barcode.cod_barre" : "griglia.bar_code") + " as barcode, \n" +
|
||||
"cod_msgr\n " +
|
||||
" from steup_getGrigliaVendita(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ") griglia " +
|
||||
(chkRotturaStock?" INNER JOIN mvw_barcode on griglia.cod_mart_kit = mvw_barcode.cod_mart ":"") +
|
||||
" WHERE griglia.cod_mart NOT IN (SELECT cod_mart\n" +
|
||||
" from steup_getGrigliaVendita(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ") griglia " +
|
||||
(chkRotturaStock ? " INNER JOIN mvw_barcode on griglia.cod_mart_kit = mvw_barcode.cod_mart " : "") +
|
||||
" WHERE griglia.cod_mart NOT IN (SELECT cod_mart\n" +
|
||||
" FROM (SELECT cod_mart,\n" +
|
||||
" cod_mdep,\n" +
|
||||
" data_validita,\n" +
|
||||
@@ -951,61 +952,58 @@ public class SteUPService {
|
||||
|
||||
public void uploadAttachmentTmp() throws Exception {
|
||||
|
||||
DataSource ds = new DataSource();
|
||||
String integry = "WINACT";
|
||||
ds.initialize(integry);
|
||||
try (Connection connection = basicConnectionPool.getConnection("WINACT")) {
|
||||
|
||||
String sql =
|
||||
"select a.activity_id, t.activity_id_new, f.file_name, f.last_upd " +
|
||||
"from stb_activity a inner join stb_activity_file f on a.activity_id = f.id " +
|
||||
"inner join winact_tmp_isp t on a.activity_id = t.activity_id " +
|
||||
"where parent_activity_id in ( " +
|
||||
"select activity_id " +
|
||||
"from stb_activity " +
|
||||
"where parent_activity_id is null " +
|
||||
"and effective_date = '2021/12/03' ) and activity_id_new in ('C0000348319')";
|
||||
String sql =
|
||||
"select a.activity_id, t.activity_id_new, f.file_name, f.last_upd " +
|
||||
"from stb_activity a inner join stb_activity_file f on a.activity_id = f.id " +
|
||||
"inner join winact_tmp_isp t on a.activity_id = t.activity_id " +
|
||||
"where parent_activity_id in ( " +
|
||||
"select activity_id " +
|
||||
"from stb_activity " +
|
||||
"where parent_activity_id is null " +
|
||||
"and effective_date = '2021/12/03' ) and activity_id_new in ('C0000348319')";
|
||||
|
||||
List<HashMap<String, Object>> resDati = UtilityDB.executeSimpleQuery(ds.getConnection(), sql);
|
||||
List<HashMap<String, Object>> resDati = UtilityDB.executeSimpleQuery(connection, sql);
|
||||
|
||||
for (HashMap<String, Object> dati : resDati) {
|
||||
System.out.println(dati.get("activity_id_new") + " " + dati.get("file_name"));
|
||||
for (HashMap<String, Object> dati : resDati) {
|
||||
logger.debug(dati.get("activity_id_new") + " " + dati.get("file_name"));
|
||||
|
||||
sql =
|
||||
"SELECT content " +
|
||||
" FROM stb_activity_file " +
|
||||
" WHERE id = " + UtilityDB.valueToString(dati.get("activity_id")) + " AND " +
|
||||
"file_name = " + UtilityDB.valueToString(dati.get("file_name"));
|
||||
sql = "SELECT content " +
|
||||
" FROM stb_activity_file " +
|
||||
" WHERE id = " + UtilityDB.valueToString(dati.get("activity_id")) + " AND " +
|
||||
"file_name = " + UtilityDB.valueToString(dati.get("file_name"));
|
||||
|
||||
byte[] content = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(ds.getConnection(), sql);
|
||||
byte[] content = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
StbActivityFile stbActivityFile =
|
||||
new StbActivityFile()
|
||||
.setFileName((String) dati.get("file_name"))
|
||||
.setContent(content)
|
||||
.setLastUpd((Date) dati.get("last_upd"));
|
||||
StbActivityFile stbActivityFile =
|
||||
new StbActivityFile()
|
||||
.setFileName((String) dati.get("file_name"))
|
||||
.setContent(content)
|
||||
.setLastUpd((Date) dati.get("last_upd"));
|
||||
|
||||
stbActivityFile.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
List<StbActivityFile> files = new ArrayList<>();
|
||||
files.add(stbActivityFile);
|
||||
stbActivityFile.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
List<StbActivityFile> files = new ArrayList<>();
|
||||
files.add(stbActivityFile);
|
||||
|
||||
StbActivity stbActivity =
|
||||
new StbActivity()
|
||||
.setActivityId((String) dati.get("activity_id_new"))
|
||||
.setStbActivityFile(files);
|
||||
StbActivity stbActivity =
|
||||
new StbActivity()
|
||||
.setActivityId((String) dati.get("activity_id_new"))
|
||||
.setStbActivityFile(files);
|
||||
|
||||
|
||||
stbActivity.setOperation(OperationType.NO_OP);
|
||||
stbActivity.setOperation(OperationType.NO_OP);
|
||||
|
||||
entityProcessor.processEntity(stbActivity, multiDBTransactionManager);
|
||||
entityProcessor.processEntity(stbActivity, multiDBTransactionManager);
|
||||
|
||||
if (stbActivity.getException() != null) {
|
||||
logger.error("uploadAttachment", stbActivity.getException());
|
||||
}
|
||||
|
||||
if (stbActivity.getException() != null) {
|
||||
logger.error("uploadAttachment", stbActivity.getException());
|
||||
}
|
||||
|
||||
multiDBTransactionManager.commitAll();
|
||||
}
|
||||
|
||||
multiDBTransactionManager.commitAll();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -200,8 +200,6 @@ public class DocumentiConsortileService {
|
||||
|
||||
// Connessione al database dell'azienda agricola
|
||||
if (j == 0) {
|
||||
DataSource dsSync = new DataSource();
|
||||
dsSync.initialize(profileDB);
|
||||
multiDBTransactionManagerAzAgr.setPrimaryDs(profileDB);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user