Aggiornamento last access datetime in nuova login ed aggiunto enum in typeExport JasperDTO

This commit is contained in:
2024-08-28 16:56:33 +02:00
parent 009a523aa9
commit d6bfb1efbc
4 changed files with 15 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ public class JasperDTO {
private String jsonSource;
private String whereCond;
private String typeExport;
private TypeExportEnum typeExport;
private WtbJreptSetup.Orientation orientation;
@SqlField("b64_jrxml")
private String b64ReportJrxml;
@@ -139,11 +139,11 @@ public class JasperDTO {
this.subreports = subreports;
}
public String getTypeExport() {
public TypeExportEnum getTypeExport() {
return typeExport;
}
public JasperDTO setTypeExport(String typeExport) {
public JasperDTO setTypeExport(TypeExportEnum typeExport) {
this.typeExport = typeExport;
return this;
}

View File

@@ -408,7 +408,7 @@ public class ReportProcessor {
}
byte[] bytes;
JasperDTO.TypeExportEnum type = JasperDTO.TypeExportEnum.fromString(jasperDTO.getTypeExport());
JasperDTO.TypeExportEnum type = jasperDTO.getTypeExport();
if (type == null) {
type = JasperDTO.TypeExportEnum.PDF;
}
@@ -458,7 +458,7 @@ public class ReportProcessor {
private byte[] exportReportImage(JasperPrint jp, JasperDTO jasperDTO) throws JRException, IOException {
byte[] pdfReport = JasperExportManager.exportReportToPdf(jp);
return UtilityPdf.convertPdfToImage(pdfReport, jasperDTO.getTypeExport(), jasperDTO.getWidth(), jasperDTO.getHeight(), jasperDTO.getColorScale());
return UtilityPdf.convertPdfToImage(pdfReport, jasperDTO.getTypeExport().getText(), jasperDTO.getWidth(), jasperDTO.getHeight(), jasperDTO.getColorScale());
}
private static byte[] exportReportXlsx(JasperPrint jp) throws Exception {

View File

@@ -44,7 +44,7 @@ public class SettingsController implements IFileWatcherEvents {
@Autowired
private EmsProperties emsProperties;
private ArrayList<Runnable> mOnConfigUpdated = new ArrayList<>();
private final ArrayList<Runnable> mOnConfigUpdated = new ArrayList<>();
private File configurationFile;
private final ObjectMapper objectMapper = new ObjectMapper();

View File

@@ -10,6 +10,7 @@ import it.integry.ems.user.service.UserService;
import it.integry.ems_model.entity.StbAuthToken;
import it.integry.ems_model.entity.StbDevices;
import it.integry.ems_model.entity.StbUser;
import it.integry.ems_model.types.OperationType;
import it.integry.ems_model.utility.UtilityDB;
import it.integry.ems_model.utility.UtilityLocalDate;
import it.integry.ems_model.utility.UtilityString;
@@ -94,6 +95,14 @@ public class AuthService {
}
if (multiDBTransactionManager != null) {
StbUser stbUser = new StbUser()
.setUserName(userData.getUser().getUserName())
.setLastAccessDatetime(new Date());
stbUser.setOperation(OperationType.UPDATE);
entityProcessor.processEntity(stbUser, multiDBTransactionManager);
StbDevices stbDevices = deviceService.createIfNotExist(requestDataDTO.getApplication().toString(), deviceId);
// Ottengo access_token se token già creato per device id
@@ -123,7 +132,6 @@ public class AuthService {
applicationEventPublisher.publishEvent(new TokenCreateEvent(primaryProfileDb, stbAuthToken));
return new JwtResponse()
.setAccessToken(stbAuthToken.getAccessToken())
.setRefreshToken(stbAuthToken.getRefreshToken())