Merge branch 'master' into develop
This commit is contained in:
@@ -3,6 +3,7 @@ package it.integry.ems.service;
|
||||
import it.integry.ems.properties.EmsProperties;
|
||||
import it.integry.ems.report.dto.ReportTypeDTO;
|
||||
import it.integry.ems.service.exception.EmptyReportException;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems_model.entity.WtbJreptSetup;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
@@ -32,8 +33,6 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
@Service
|
||||
@Scope("request")
|
||||
public class PrinterService {
|
||||
@@ -239,10 +238,11 @@ public class PrinterService {
|
||||
return reportProcessor.getReportForReportType(reportTypeDTO);
|
||||
}
|
||||
|
||||
public String printReportType(ReportTypeDTO reportTypeDTO) throws Exception {
|
||||
public void printReportType(ReportTypeDTO reportTypeDTO) throws Exception {
|
||||
WtbJreptSetup impostazioniStampa = reportProcessor.getReportForReportType(reportTypeDTO);
|
||||
if (impostazioniStampa == null) {
|
||||
throw new Exception("Nessuna configurazione trovata per il tipo report " + reportTypeDTO.getReportType().toString());
|
||||
logger.warn("Nessuna configurazione trovata per il tipo report " + reportTypeDTO.getReportType().toString());
|
||||
return;
|
||||
}
|
||||
String printerName = impostazioniStampa.getPrinterName();
|
||||
Integer numberOfCopies = impostazioniStampa.getPrintQuantity();
|
||||
@@ -256,16 +256,15 @@ public class PrinterService {
|
||||
switch (impostazioniStampa.getOrientation()) {
|
||||
case PORTRAIT:
|
||||
orientation = Orientation.PORTRAIT;
|
||||
|
||||
break;
|
||||
|
||||
case LANDSCAPE:
|
||||
orientation = Orientation.LANDSCAPE;
|
||||
|
||||
break;
|
||||
default:
|
||||
case AUTO:
|
||||
orientation = Orientation.AUTO;
|
||||
|
||||
case AUTO:
|
||||
default:
|
||||
orientation = Orientation.AUTO;
|
||||
break;
|
||||
}
|
||||
numberOfCopies = numberOfCopies == null ? 1 : numberOfCopies;
|
||||
@@ -273,8 +272,6 @@ public class PrinterService {
|
||||
print(printerName, new ByteArrayInputStream(bytes), "application/pdf", orientation);
|
||||
}
|
||||
|
||||
return printerName;
|
||||
|
||||
} else {
|
||||
throw new EmptyReportException();
|
||||
}
|
||||
|
||||
@@ -120,7 +120,8 @@ public class EmsEngineController {
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody ReportTypeDTO reportTypeDTO) {
|
||||
try {
|
||||
return ServiceRestResponse.createPositiveResponse(printerService.printReportType(reportTypeDTO));
|
||||
printerService.printReportType(reportTypeDTO);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
return ServiceRestResponse.createNegativeResponse(configuration, e);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class GiacenzaService {
|
||||
List<CarelliGiacenzaProg> carelliGiacenzaProgs = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, CarelliGiacenzaProg.class, OperationType.INSERT);
|
||||
|
||||
List<EntityBase> entityRet = entityProcessor.processEntityList(carelliGiacenzaProgs, null, false, true, false, multiDBTransactionManager, false, false,
|
||||
new RequestDataDTO());
|
||||
RequestDataDTO.systemMockupData());
|
||||
UtilityEntity.throwEntitiesException(entityRet);
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class GiacenzaService {
|
||||
List<CarelliGiacenzaProg> carelliGiacenzaProgs = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, CarelliGiacenzaProg.class, OperationType.DELETE);
|
||||
|
||||
List<EntityBase> entityRet = entityProcessor.processEntityList(carelliGiacenzaProgs, null, false, true, false, multiDBTransactionManager, false, false,
|
||||
new RequestDataDTO());
|
||||
RequestDataDTO.systemMockupData());
|
||||
|
||||
UtilityEntity.throwEntitiesException(entityRet);
|
||||
}
|
||||
@@ -429,7 +429,7 @@ public class GiacenzaService {
|
||||
.setDataDoc(UtilityLocalDate.localDateToDate(collo.getDataCollo()))
|
||||
.setDataDistribuzione(new Date());
|
||||
collo.setOperation(OperationType.UPDATE);
|
||||
entityProcessor.processEntity(collo, false, false, "", multiDBTransactionManager, new RequestDataDTO(),false, false);
|
||||
entityProcessor.processEntity(collo, false, false, "", multiDBTransactionManager, RequestDataDTO.systemMockupData(),false, false);
|
||||
UtilityEntity.throwEntityException(collo);
|
||||
}
|
||||
}
|
||||
@@ -448,7 +448,7 @@ public class GiacenzaService {
|
||||
calls.add(() -> {
|
||||
try {
|
||||
for (EntityBase entityBase : entityList) {
|
||||
entityProcessor.processEntity(entityBase, false, true, "", multiDBTransactionManager, new RequestDataDTO(), false, false);
|
||||
entityProcessor.processEntity(entityBase, false, true, "", multiDBTransactionManager, RequestDataDTO.systemMockupData(), false, false);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -309,7 +309,7 @@ public class ExchangeOrdiniImportService {
|
||||
.setDataInizProd(field.getDataInizProd())
|
||||
.setCodVzon(field.getCodVzon())
|
||||
.setDataOrd(field.getDataInizProd());
|
||||
agribookFieldService.createField(multiDb, dto, EXCHANGE_USER, new RequestDataDTO());
|
||||
agribookFieldService.createField(multiDb, dto, EXCHANGE_USER, RequestDataDTO.systemMockupData());
|
||||
|
||||
break;
|
||||
case UPDATE:
|
||||
|
||||
Reference in New Issue
Block a user