Merge branch 'develop' into feature/RefactoringGestioneColli
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_20250430154023 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetup("TASK", "SETUP", "DEFAULT_ACTIVITY_TYPE", null,
|
||||||
|
"Tipo attività di default proposto in inserimento ore", false, null, false, false,
|
||||||
|
true, false, false, null, false, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250502095239 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
createSetup("TASK", "AGENDA", "SEND_EMAIL", "N",
|
||||||
|
"Se abilitata invia una mail all'amministrazione quando vengono inserite o modificate delle assenze.", false, "SI_NO", false, false,
|
||||||
|
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250502115240 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
createSetup("TASK", "SETUP", "MANAGE_ACTIVITIES", "S",
|
||||||
|
"Permette di scegliere se gestire o meno le attività. Se non abilitata permetterà la sola visualizzazione del calendario e gestione assenze.", false, "SI_NO", false, false,
|
||||||
|
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250502120455 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
createSetup("TASK", "AGENDA", "EXCLUDE_WEEKEND", "N",
|
||||||
|
"Permette di scegliere se considerare o meno il weekend nel calendario.", false, "SI_NO", false, false,
|
||||||
|
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250502164926 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("ALTER TABLE jtb_giustifica ADD flag_permesso bit");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -146,6 +146,7 @@ public class UserCacheService {
|
|||||||
(application == IntegryApplicationEnum.PVM && x.isWeb()) ||
|
(application == IntegryApplicationEnum.PVM && x.isWeb()) ||
|
||||||
(application == IntegryApplicationEnum.CONSEGNA && x.isWeb()) ||
|
(application == IntegryApplicationEnum.CONSEGNA && x.isWeb()) ||
|
||||||
(application == IntegryApplicationEnum.WMS && x.isWeb()) ||
|
(application == IntegryApplicationEnum.WMS && x.isWeb()) ||
|
||||||
|
(application == IntegryApplicationEnum.TASK && x.isWeb()) ||
|
||||||
(application == IntegryApplicationEnum.GESTIONALE_BASE && x.isInternal())))
|
(application == IntegryApplicationEnum.GESTIONALE_BASE && x.isInternal())))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
@@ -171,6 +172,7 @@ public class UserCacheService {
|
|||||||
(application == IntegryApplicationEnum.PVM && x.isWeb()) ||
|
(application == IntegryApplicationEnum.PVM && x.isWeb()) ||
|
||||||
(application == IntegryApplicationEnum.CONSEGNA && x.isWeb()) ||
|
(application == IntegryApplicationEnum.CONSEGNA && x.isWeb()) ||
|
||||||
(application == IntegryApplicationEnum.WMS && x.isWeb()) ||
|
(application == IntegryApplicationEnum.WMS && x.isWeb()) ||
|
||||||
|
(application == IntegryApplicationEnum.TASK && x.isWeb()) ||
|
||||||
(application == IntegryApplicationEnum.GESTIONALE_BASE && x.isInternal())))
|
(application == IntegryApplicationEnum.GESTIONALE_BASE && x.isInternal())))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ public class JtbGiustifica extends EntityBase {
|
|||||||
@SqlField(value = "cod_intercode", maxLength = 5)
|
@SqlField(value = "cod_intercode", maxLength = 5)
|
||||||
private String codIntercode;
|
private String codIntercode;
|
||||||
|
|
||||||
|
@SqlField(value = "flag_permesso", defaultObjectValue = "0")
|
||||||
|
private Boolean flagPermesso;
|
||||||
|
|
||||||
@EntityChild
|
@EntityChild
|
||||||
private List<JtbGiustificaRow> jtbGiustificaRow = new ArrayList<>();
|
private List<JtbGiustificaRow> jtbGiustificaRow = new ArrayList<>();
|
||||||
|
|
||||||
@@ -104,6 +107,15 @@ public class JtbGiustifica extends EntityBase {
|
|||||||
this.jtbGiustificaRow = jtbGiustificaRow;
|
this.jtbGiustificaRow = jtbGiustificaRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getFlagPermesso() {
|
||||||
|
return flagPermesso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbGiustifica setFlagPermesso(Boolean flagPermesso) {
|
||||||
|
this.flagPermesso = flagPermesso;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void insertChilds() throws Exception {
|
protected void insertChilds() throws Exception {
|
||||||
for (JtbGiustificaRow jtbGiustificaRow : getJtbGiustificaRow()) {
|
for (JtbGiustificaRow jtbGiustificaRow : getJtbGiustificaRow()) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import it.integry.ems.response.FileItem;
|
|||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.zip.*;
|
import java.util.zip.*;
|
||||||
|
|
||||||
@@ -131,4 +132,26 @@ public class UtilityZip {
|
|||||||
|
|
||||||
return outputStream.toByteArray();
|
return outputStream.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<byte[]> extractZipFile(byte[] zipFile) throws Exception {
|
||||||
|
List<byte[]> extractedFiles = new ArrayList<>();
|
||||||
|
ByteArrayInputStream inputStream = new ByteArrayInputStream(zipFile);
|
||||||
|
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
|
||||||
|
|
||||||
|
while (zipInputStream.getNextEntry() != null) {
|
||||||
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len;
|
||||||
|
while ((len = zipInputStream.read(buffer)) > 0) {
|
||||||
|
outputStream.write(buffer, 0, len);
|
||||||
|
}
|
||||||
|
extractedFiles.add(outputStream.toByteArray());
|
||||||
|
zipInputStream.closeEntry();
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
zipInputStream.close();
|
||||||
|
inputStream.close();
|
||||||
|
return extractedFiles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -22,52 +22,43 @@ import java.util.List;
|
|||||||
@Scope(value = "request")
|
@Scope(value = "request")
|
||||||
public class UserAbsenceController {
|
public class UserAbsenceController {
|
||||||
|
|
||||||
private final Logger logger = LogManager.getLogger();
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserAbsenceService userAbsenceService;
|
private UserAbsenceService userAbsenceService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RequestDataDTO requestDataDTO;
|
|
||||||
|
|
||||||
|
|
||||||
@PreAuthorize("isAuthenticated()")
|
@PreAuthorize("isAuthenticated()")
|
||||||
@RequestMapping(value = "/retrieve", method = RequestMethod.GET)
|
@RequestMapping(value = "/retrieve", method = RequestMethod.GET)
|
||||||
public ServiceRestResponse retrieveAssenze(HttpServletRequest request,
|
public ServiceRestResponse retrieveAssenze(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
|
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
|
||||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) throws Exception {
|
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) throws Exception {
|
||||||
return ServiceRestResponse.createPositiveResponse(userAbsenceService.retrieveAssenze(startDate, endDate));
|
return ServiceRestResponse.createPositiveResponse(userAbsenceService.retrieveAssenze(startDate, endDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/available-justifications", method = RequestMethod.GET)
|
@RequestMapping(value = "/available-justifications", method = RequestMethod.GET)
|
||||||
public ServiceRestResponse retrieve(HttpServletRequest request) throws Exception {
|
public ServiceRestResponse retrieve(@RequestParam(CommonConstants.PROFILE_DB) String config) throws Exception {
|
||||||
return ServiceRestResponse.createPositiveResponse(userAbsenceService.getGiustificativo());
|
return ServiceRestResponse.createPositiveResponse(userAbsenceService.getGiustificativo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("isAuthenticated()")
|
@PreAuthorize("isAuthenticated()")
|
||||||
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse registerAbsence(HttpServletRequest request,
|
public ServiceRestResponse registerAbsence(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
@RequestBody List<UserAbsenceRequestDTO> absenceRequest) throws Exception {
|
||||||
@RequestBody List<UserAbsenceRequestDTO> userAbsences) throws Exception {
|
userAbsenceService.registerAbsence(absenceRequest);
|
||||||
userAbsenceService.registerAbsence(userAbsences, requestDataDTO.getUsername());
|
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("isAuthenticated()")
|
@PreAuthorize("isAuthenticated()")
|
||||||
@RequestMapping(value = "/modify", method = RequestMethod.POST)
|
@RequestMapping(value = "/modify", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse modifyAbsence(HttpServletRequest request,
|
public ServiceRestResponse modifyAbsence(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
@RequestBody UserAbsenceRequestDTO absenceRequest) throws Exception {
|
||||||
@RequestBody UserAbsenceRequestDTO absence) throws Exception {
|
userAbsenceService.modifyAbsence(absenceRequest);
|
||||||
userAbsenceService.modifyAbsence(absence, requestDataDTO.getUsername());
|
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("isAuthenticated()")
|
@PreAuthorize("isAuthenticated()")
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse deleteAbsence(HttpServletRequest request,
|
public ServiceRestResponse deleteAbsence(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
@RequestBody UserAbsenceRequestDTO absenceRequest) throws Exception {
|
||||||
@RequestBody UserAbsenceRequestDTO absence) throws Exception {
|
userAbsenceService.deleteAbsence(absenceRequest);
|
||||||
userAbsenceService.deleteAbsence(absence, requestDataDTO.getUsername());
|
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.ems.activity.dto;
|
|||||||
|
|
||||||
import it.integry.ems_model.annotation.SqlField;
|
import it.integry.ems_model.annotation.SqlField;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class AssenzaDTO {
|
public class AssenzaDTO {
|
||||||
@@ -18,6 +19,12 @@ public class AssenzaDTO {
|
|||||||
@SqlField("note")
|
@SqlField("note")
|
||||||
private String note;
|
private String note;
|
||||||
|
|
||||||
|
@SqlField("ore_assenza")
|
||||||
|
private BigDecimal oreAssenza;
|
||||||
|
|
||||||
|
@SqlField("cod_jflav")
|
||||||
|
private String codJflav;
|
||||||
|
|
||||||
public String getUserName() {
|
public String getUserName() {
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
@@ -53,4 +60,22 @@ public class AssenzaDTO {
|
|||||||
this.note = note;
|
this.note = note;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getOreAssenza() {
|
||||||
|
return oreAssenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AssenzaDTO setOreAssenza(BigDecimal oreAssenza) {
|
||||||
|
this.oreAssenza = oreAssenza;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJflav() {
|
||||||
|
return codJflav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AssenzaDTO setCodJflav(String codJflav) {
|
||||||
|
this.codJflav = codJflav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
package it.integry.ems.activity.dto;
|
package it.integry.ems.activity.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
public class UserAbsenceRequestDTO {
|
public class UserAbsenceRequestDTO {
|
||||||
|
|
||||||
private String username;
|
private String codJflav;
|
||||||
private LocalDate dataInizio;
|
private LocalDate dataInizio;
|
||||||
private LocalDate dataFine;
|
private LocalDate dataFine;
|
||||||
private String giustificativo;
|
private String giustificativo;
|
||||||
private String note;
|
private String note;
|
||||||
|
private String fullname;
|
||||||
|
private BigDecimal oreAssenza;
|
||||||
|
|
||||||
public String getUsername() {
|
public String getCodJflav() {
|
||||||
return username;
|
return codJflav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserAbsenceRequestDTO setUsername(String username) {
|
public UserAbsenceRequestDTO setCodJflav(String codJflav) {
|
||||||
this.username = username;
|
this.codJflav = codJflav;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,4 +57,22 @@ public class UserAbsenceRequestDTO {
|
|||||||
this.note = note;
|
this.note = note;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFullname() {
|
||||||
|
return fullname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserAbsenceRequestDTO setFullname(String fullname) {
|
||||||
|
this.fullname = fullname;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getOreAssenza() {
|
||||||
|
return oreAssenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserAbsenceRequestDTO setOreAssenza(BigDecimal oreAssenza) {
|
||||||
|
this.oreAssenza = oreAssenza;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,14 @@ import it.integry.ems.service.EntityProcessor;
|
|||||||
import it.integry.ems.service.MailService;
|
import it.integry.ems.service.MailService;
|
||||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||||
import it.integry.ems.user.service.UserService;
|
import it.integry.ems.user.service.UserService;
|
||||||
|
import it.integry.ems.utility.UtilityDebug;
|
||||||
import it.integry.ems.utility.UtilityEntity;
|
import it.integry.ems.utility.UtilityEntity;
|
||||||
import it.integry.ems_model.entity.JtbGiustifica;
|
import it.integry.ems_model.entity.JtbGiustifica;
|
||||||
import it.integry.ems_model.entity.JtbRLavt;
|
import it.integry.ems_model.entity.JtbRLavt;
|
||||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||||
|
import it.integry.ems_model.service.SetupGest;
|
||||||
import it.integry.ems_model.types.OperationType;
|
import it.integry.ems_model.types.OperationType;
|
||||||
|
import it.integry.ems_model.utility.Query;
|
||||||
import it.integry.ems_model.utility.UtilityDB;
|
import it.integry.ems_model.utility.UtilityDB;
|
||||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||||
import it.integry.ems_model.utility.UtilityString;
|
import it.integry.ems_model.utility.UtilityString;
|
||||||
@@ -24,6 +27,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.time.DayOfWeek;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -41,52 +45,72 @@ public class UserAbsenceService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MultiDBTransactionManager multiDBTransactionManager;
|
private MultiDBTransactionManager multiDBTransactionManager;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SetupGest setupGest;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RequestDataDTO requestDataDTO;
|
private RequestDataDTO requestDataDTO;
|
||||||
|
|
||||||
public List<AssenzaDTO> retrieveAssenze(LocalDate startDate, LocalDate endDate) throws SQLException, IOException, PrimaryDatabaseNotPresentException, DataConverterNotFoundException, InstantiationException, IllegalAccessException {
|
public List<AssenzaDTO> retrieveAssenze(LocalDate startDate, LocalDate endDate) throws Exception {
|
||||||
String sql = "SELECT jrl_flav_users.user_name,\n" +
|
String sql = Query.format(
|
||||||
" data_lav,\n" +
|
"SELECT jrl_flav_users.user_name,\n" +
|
||||||
" jtb_rlavt.giustificativo,\n" +
|
" data_lav,\n" +
|
||||||
" jtb_rlavt.note\n" +
|
" jtb_rlavt.giustificativo,\n" +
|
||||||
"FROM jtb_rlavt\n" +
|
" jtb_rlavt.note,\n" +
|
||||||
" INNER JOIN jrl_flav_users ON jrl_flav_users.cod_jflav = jtb_rlavt.cod_jflav\n" +
|
" jtb_rlavt.ore_assenza,\n" +
|
||||||
"WHERE giustificativo IS NOT NULL\n" +
|
" jtb_rlavt.cod_jflav\n" +
|
||||||
" AND jtb_rlavt.data_lav BETWEEN " + UtilityDB.valueToString(startDate) + " AND " + UtilityDB.valueToString(endDate) + "\n" +
|
"FROM jtb_rlavt\n" +
|
||||||
" AND jrl_flav_users.flag_jflav_default = 'S'";
|
" LEFT OUTER JOIN jrl_flav_users\n" +
|
||||||
|
" ON jrl_flav_users.cod_jflav = jtb_rlavt.cod_jflav AND jrl_flav_users.flag_jflav_default = 'S'\n" +
|
||||||
|
"WHERE giustificativo IS NOT NULL\n" +
|
||||||
|
" AND jtb_rlavt.data_lav BETWEEN %s AND %s",
|
||||||
|
startDate, endDate
|
||||||
|
);
|
||||||
|
|
||||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, AssenzaDTO.class);
|
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, AssenzaDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<JtbGiustifica> getGiustificativo() throws Exception {
|
public List<JtbGiustifica> getGiustificativo() throws Exception {
|
||||||
String sql = "SELECT giustificativo\n" +
|
String sql = "SELECT giustificativo, flag_permesso\n" +
|
||||||
"FROM jtb_giustifica\n" +
|
"FROM jtb_giustifica\n" +
|
||||||
"WHERE flag_attivo = 'S'";
|
"WHERE flag_attivo = 'S'";
|
||||||
|
|
||||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, JtbGiustifica.class);
|
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, JtbGiustifica.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerAbsence(List<UserAbsenceRequestDTO> assenzeList, String username) throws Exception {
|
public void registerAbsence(List<UserAbsenceRequestDTO> assenzeList) throws Exception {
|
||||||
String codJflav = userService.retrieveCodJflav(username);
|
boolean sendEmail = sendEmail();
|
||||||
String fullname = requestDataDTO.getUser().getFullname();
|
|
||||||
|
|
||||||
List<JtbRLavt> jtbRLavtList = new ArrayList<>();
|
List<JtbRLavt> jtbRLavtList = new ArrayList<>();
|
||||||
|
|
||||||
for (UserAbsenceRequestDTO assenzaItem : assenzeList) {
|
for (UserAbsenceRequestDTO assenzaItem : assenzeList) {
|
||||||
|
|
||||||
if (assenzaItem.getDataInizio() == null) throw new Exception("Errore nella data inizio");
|
if (assenzaItem.getDataInizio() == null) throw new Exception("Data inizio mancante");
|
||||||
if (assenzaItem.getDataFine() == null) throw new Exception("Errore nella data fine");
|
if (assenzaItem.getDataFine() == null) throw new Exception("Data fine mancante");
|
||||||
|
|
||||||
|
String codJflav;
|
||||||
|
String fullname;
|
||||||
|
if (UtilityString.isNullOrEmpty(assenzaItem.getCodJflav())) {
|
||||||
|
codJflav = userService.retrieveCodJflav(requestDataDTO.getUsername());
|
||||||
|
fullname = requestDataDTO.getUser().getFullname();
|
||||||
|
} else {
|
||||||
|
codJflav = assenzaItem.getCodJflav();
|
||||||
|
fullname = assenzaItem.getFullname();
|
||||||
|
}
|
||||||
|
|
||||||
for (LocalDate currentDate = assenzaItem.getDataInizio();
|
for (LocalDate currentDate = assenzaItem.getDataInizio();
|
||||||
currentDate.isBefore(assenzaItem.getDataFine()) || currentDate.isEqual(assenzaItem.getDataFine());
|
currentDate.isBefore(assenzaItem.getDataFine()) || currentDate.isEqual(assenzaItem.getDataFine());
|
||||||
currentDate = currentDate.plusDays(1)) {
|
currentDate = currentDate.plusDays(1)) {
|
||||||
|
|
||||||
|
if (!isGiornoLavorativo(currentDate)) continue;
|
||||||
|
|
||||||
JtbRLavt jtbRLavt = new JtbRLavt()
|
JtbRLavt jtbRLavt = new JtbRLavt()
|
||||||
.setGiustificativo(assenzaItem.getGiustificativo())
|
.setGiustificativo(assenzaItem.getGiustificativo())
|
||||||
.setDataLav(UtilityLocalDate.localDateToDate(currentDate))
|
.setDataLav(UtilityLocalDate.localDateToDate(currentDate))
|
||||||
.setCodJflav(codJflav)
|
.setCodJflav(codJflav).
|
||||||
|
setOreAssenza(assenzaItem.getOreAssenza())
|
||||||
.setNote(assenzaItem.getNote());
|
.setNote(assenzaItem.getNote());
|
||||||
jtbRLavt
|
jtbRLavt
|
||||||
.setOperation(OperationType.INSERT_OR_UPDATE);
|
.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||||
@@ -94,98 +118,111 @@ public class UserAbsenceService {
|
|||||||
jtbRLavtList.add(jtbRLavt);
|
jtbRLavtList.add(jtbRLavt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jtbRLavtList.isEmpty()) return;
|
||||||
String startDate = CommonConstants.DATE_DMY_SLASHED_FORMATTER.format(assenzaItem.getDataInizio());
|
|
||||||
String endDate = CommonConstants.DATE_DMY_SLASHED_FORMATTER.format(assenzaItem.getDataFine());
|
|
||||||
|
|
||||||
String giustificativo = WordUtils.capitalize(assenzaItem.getGiustificativo().toLowerCase());
|
|
||||||
String note = assenzaItem.getNote();
|
|
||||||
|
|
||||||
UtilityEntity.throwEntitiesException(entityProcessor.processEntityList(jtbRLavtList, multiDBTransactionManager, true));
|
UtilityEntity.throwEntitiesException(entityProcessor.processEntityList(jtbRLavtList, multiDBTransactionManager, true));
|
||||||
|
|
||||||
String subject = String.format("%s di %s", giustificativo, fullname);
|
if (sendEmail) {
|
||||||
String message = String.format("%s di %s per il periodo dal: %s al: %s.", giustificativo, fullname, startDate, endDate);
|
String startDate = CommonConstants.DATE_DMY_SLASHED_FORMATTER.format(assenzaItem.getDataInizio());
|
||||||
|
String endDate = CommonConstants.DATE_DMY_SLASHED_FORMATTER.format(assenzaItem.getDataFine());
|
||||||
|
|
||||||
|
String giustificativo = WordUtils.capitalize(assenzaItem.getGiustificativo().toLowerCase());
|
||||||
|
String note = assenzaItem.getNote();
|
||||||
|
|
||||||
|
String subject = String.format("%s di %s", giustificativo, fullname);
|
||||||
|
String message = String.format("%s di %s per il periodo dal: %s al: %s.", giustificativo, fullname, startDate, endDate);
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(note)) {
|
||||||
|
message = message.concat(String.format("\nNote: %s", note));
|
||||||
|
}
|
||||||
|
|
||||||
|
mailService.sendMail("amministrazione@integry.it", "m.morelli@integry.it", subject, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void modifyAbsence(UserAbsenceRequestDTO assenza) throws Exception {
|
||||||
|
boolean sendEmail = sendEmail();
|
||||||
|
if (assenza.getDataInizio() == null) throw new Exception("Data inizio mancante");
|
||||||
|
|
||||||
|
String giustificativo = WordUtils.capitalize(assenza.getGiustificativo().toLowerCase());
|
||||||
|
String note = assenza.getNote();
|
||||||
|
|
||||||
|
processAbsence(assenza, OperationType.UPDATE);
|
||||||
|
|
||||||
|
String fullname = "";
|
||||||
|
if (UtilityString.isNullOrEmpty(assenza.getCodJflav())) {
|
||||||
|
fullname = requestDataDTO.getUser().getFullname();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sendEmail) {
|
||||||
|
String subject = String.format("Modifica %s di %s", giustificativo, fullname);
|
||||||
|
String message = String.format("%s di %s per il giorno: %s.", giustificativo, fullname, assenza.getDataInizio());
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(note)) {
|
if (!UtilityString.isNullOrEmpty(note)) {
|
||||||
message = message.concat(String.format("\nNote: %s", note));
|
message = message.concat(String.format("\nNote: %s", note));
|
||||||
}
|
}
|
||||||
|
|
||||||
mailService.sendMail("amministrazione@integry.it", "m.morelli@integry.it", subject, message);
|
mailService.sendMail("amministrazione@integry.it", null, subject, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void modifyAbsence(UserAbsenceRequestDTO assenza, String username) throws Exception {
|
public void deleteAbsence(UserAbsenceRequestDTO assenza) throws Exception {
|
||||||
String codJflav;
|
boolean sendEmail = sendEmail();
|
||||||
String fullname;
|
if (assenza.getDataInizio() == null) throw new Exception("Data inizio mancante");
|
||||||
|
|
||||||
if (UtilityString.isNullOrEmpty(assenza.getUsername())) {
|
|
||||||
codJflav = userService.retrieveCodJflav(username);
|
|
||||||
fullname = requestDataDTO.getUser().getFullname();
|
|
||||||
} else {
|
|
||||||
codJflav = userService.retrieveCodJflav(assenza.getUsername());
|
|
||||||
fullname = userService.retrieveFullName(assenza.getUsername());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (assenza.getDataInizio() == null) throw new Exception("Errore nella data inizio");
|
|
||||||
|
|
||||||
JtbRLavt jtbRLavt = new JtbRLavt();
|
|
||||||
|
|
||||||
jtbRLavt.setGiustificativo(assenza.getGiustificativo())
|
|
||||||
.setDataLav(UtilityLocalDate.localDateToDate(assenza.getDataInizio()))
|
|
||||||
.setCodJflav(codJflav)
|
|
||||||
.setNote(assenza.getNote())
|
|
||||||
.setOperation(OperationType.UPDATE);
|
|
||||||
|
|
||||||
String giustificativo = WordUtils.capitalize(assenza.getGiustificativo().toLowerCase());
|
String giustificativo = WordUtils.capitalize(assenza.getGiustificativo().toLowerCase());
|
||||||
String note = assenza.getNote();
|
String note = assenza.getNote();
|
||||||
|
|
||||||
UtilityEntity.throwEntitiesException(entityProcessor.processEntity(jtbRLavt, multiDBTransactionManager));
|
processAbsence(assenza, OperationType.DELETE);
|
||||||
|
|
||||||
String subject = String.format("Modifica %s di %s", giustificativo, fullname);
|
if (sendEmail) {
|
||||||
String message = String.format("%s di %s per il giorno: %s.", giustificativo, fullname, assenza.getDataInizio());
|
String subject = String.format("Eliminazione %s di %s", giustificativo, assenza.getFullname());
|
||||||
|
String message = String.format("%s di %s per il giorno: %s.", giustificativo, assenza.getFullname(), assenza.getDataInizio());
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(note)) {
|
if (!UtilityString.isNullOrEmpty(note)) {
|
||||||
message = message.concat(String.format("\nNote: %s", note));
|
message = message.concat(String.format("\nNote: %s", note));
|
||||||
|
}
|
||||||
|
|
||||||
|
mailService.sendMail("amministrazione@integry.it", null, subject, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
mailService.sendMail("amministrazione@integry.it", null, subject, message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAbsence(UserAbsenceRequestDTO assenza, String username) throws Exception {
|
private void processAbsence(UserAbsenceRequestDTO assenza, OperationType op) throws Exception {
|
||||||
String codJflav;
|
String codJflav;
|
||||||
String fullname;
|
if (UtilityString.isNullOrEmpty(assenza.getCodJflav())) {
|
||||||
|
codJflav = userService.retrieveCodJflav(requestDataDTO.getUsername());
|
||||||
if (UtilityString.isNullOrEmpty(assenza.getUsername())) {
|
|
||||||
codJflav = userService.retrieveCodJflav(username);
|
|
||||||
fullname = requestDataDTO.getUser().getFullname();
|
|
||||||
} else {
|
} else {
|
||||||
codJflav = userService.retrieveCodJflav(assenza.getUsername());
|
codJflav = assenza.getCodJflav();
|
||||||
fullname = userService.retrieveFullName(assenza.getUsername());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assenza.getDataInizio() == null) throw new Exception("Errore nella data inizio");
|
JtbRLavt jtbRLavt = new JtbRLavt()
|
||||||
|
.setGiustificativo(assenza.getGiustificativo())
|
||||||
JtbRLavt jtbRLavt = new JtbRLavt();
|
|
||||||
|
|
||||||
jtbRLavt.setGiustificativo(assenza.getGiustificativo())
|
|
||||||
.setDataLav(UtilityLocalDate.localDateToDate(assenza.getDataInizio()))
|
.setDataLav(UtilityLocalDate.localDateToDate(assenza.getDataInizio()))
|
||||||
.setCodJflav(codJflav)
|
.setCodJflav(codJflav)
|
||||||
.setNote(assenza.getNote())
|
.setNote(assenza.getNote());
|
||||||
.setOperation(OperationType.DELETE);
|
jtbRLavt.setOperation(op);
|
||||||
|
|
||||||
String giustificativo = WordUtils.capitalize(assenza.getGiustificativo().toLowerCase());
|
|
||||||
String note = assenza.getNote();
|
|
||||||
|
|
||||||
UtilityEntity.throwEntitiesException(entityProcessor.processEntity(jtbRLavt, multiDBTransactionManager));
|
UtilityEntity.throwEntitiesException(entityProcessor.processEntity(jtbRLavt, multiDBTransactionManager));
|
||||||
|
|
||||||
String subject = String.format("Eliminazione %s di %s", giustificativo, fullname);
|
|
||||||
String message = String.format("%s di %s per il giorno: %s.", giustificativo, fullname, assenza.getDataInizio());
|
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(note)) {
|
|
||||||
message = message.concat(String.format("\nNote: %s", note));
|
|
||||||
}
|
|
||||||
|
|
||||||
mailService.sendMail("amministrazione@integry.it", null, subject, message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
private boolean sendEmail() throws Exception {
|
||||||
|
if (UtilityDebug.isDebugExecution()) return false;
|
||||||
|
|
||||||
|
return setupGest.getSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), "TASK", "AGENDA", "SEND_EMAIL");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGiornoLavorativo(LocalDate data) throws Exception {
|
||||||
|
String sql = Query.format(
|
||||||
|
"SELECT CAST(COUNT(*) AS BIT)\n" +
|
||||||
|
"FROM jtb_ricorrenze\n" +
|
||||||
|
"WHERE data = %s",
|
||||||
|
UtilityLocalDate.formatDate(data, CommonConstants.DATE_FORMAT_YMD)
|
||||||
|
);
|
||||||
|
boolean isFestivo = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
DayOfWeek giornoDellaSettimana = data.getDayOfWeek();
|
||||||
|
|
||||||
|
return giornoDellaSettimana != DayOfWeek.SATURDAY &&
|
||||||
|
giornoDellaSettimana != DayOfWeek.SUNDAY && !isFestivo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -117,7 +117,7 @@ public class DocumentiExporter extends BaseEntityExporter implements IEntityExpo
|
|||||||
break;
|
break;
|
||||||
case INTESA:
|
case INTESA:
|
||||||
DocumentiIntesaExportService intesaExportService = context.getBean(DocumentiIntesaExportService.class);
|
DocumentiIntesaExportService intesaExportService = context.getBean(DocumentiIntesaExportService.class);
|
||||||
entityExportResponse = intesaExportService.export(whereCond, type, format, anomalie);
|
entityExportResponse = intesaExportService.export(whereCond, type, format);
|
||||||
break;
|
break;
|
||||||
case EXCEL:
|
case EXCEL:
|
||||||
case CSV:
|
case CSV:
|
||||||
|
|||||||
@@ -40,11 +40,9 @@ public class DocumentiIntesaExportService {
|
|||||||
|
|
||||||
private final Logger logger = LogManager.getLogger();
|
private final Logger logger = LogManager.getLogger();
|
||||||
|
|
||||||
public EntityExportResponse<List<FileItem>> export(String whereCond, String type, String format, List<AnomalieDTO> anomalie) throws Exception {
|
public EntityExportResponse<List<FileItem>> export(String whereCond, String type, String format) throws Exception {
|
||||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||||
|
|
||||||
EntityExportResponse<List<FileItem>> entityExportResponse = new EntityExportResponse<>();
|
EntityExportResponse<List<FileItem>> entityExportResponse = new EntityExportResponse<>();
|
||||||
entityExportResponse.setAnomalie(anomalie);
|
|
||||||
|
|
||||||
char charSeparator = ';';
|
char charSeparator = ';';
|
||||||
String fileName = "index";
|
String fileName = "index";
|
||||||
@@ -88,7 +86,8 @@ public class DocumentiIntesaExportService {
|
|||||||
" NULL AS agente,\n" +
|
" NULL AS agente,\n" +
|
||||||
" IIF(doc.cod_vdes IS NOT NULL, vtb_dest.indirizzo, gtb_anag.indirizzo) AS destinazione,\n" +
|
" IIF(doc.cod_vdes IS NOT NULL, vtb_dest.indirizzo, gtb_anag.indirizzo) AS destinazione,\n" +
|
||||||
" doc.cod_vvet AS consegnatario,\n" +
|
" doc.cod_vvet AS consegnatario,\n" +
|
||||||
" NULL AS tipo_documento\n" +
|
" NULL AS tipo_documento,\n" +
|
||||||
|
" doc.ser_doc AS serie\n" +
|
||||||
"FROM dtb_doct doc\n" +
|
"FROM dtb_doct doc\n" +
|
||||||
" INNER JOIN dtb_tipi ON doc.cod_dtip = dtb_tipi.cod_dtip\n" +
|
" INNER JOIN dtb_tipi ON doc.cod_dtip = dtb_tipi.cod_dtip\n" +
|
||||||
" INNER JOIN gtb_anag ON doc.cod_anag = gtb_anag.cod_anag\n" +
|
" INNER JOIN gtb_anag ON doc.cod_anag = gtb_anag.cod_anag\n" +
|
||||||
@@ -166,12 +165,7 @@ public class DocumentiIntesaExportService {
|
|||||||
|
|
||||||
entityProcessor.processEntityList(dtbDocPdfList, true);
|
entityProcessor.processEntityList(dtbDocPdfList, true);
|
||||||
|
|
||||||
if (logger.isInfoEnabled() && dtbDocPdfList.isEmpty()) {
|
if (logger.isInfoEnabled() && dtbDocPdfList.isEmpty()) throw new Exception("Nessun file firmato inviato");
|
||||||
String anomalia = "Nessun file firmato inviato";
|
|
||||||
logger.error(anomalia);
|
|
||||||
anomalie.add(AnomalieDTO.warning(anomalia));
|
|
||||||
return entityExportResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<FileItem> listFileToZip = new ArrayList<>();
|
List<FileItem> listFileToZip = new ArrayList<>();
|
||||||
listFileToZip.add(indexFile);
|
listFileToZip.add(indexFile);
|
||||||
|
|||||||
@@ -354,6 +354,13 @@ public class SystemController {
|
|||||||
return ServiceRestResponse.createPositiveResponse(systemService.getGestSetupList(stbGestSetupList, requestDataDTO.getUsername(), codMdep));
|
return ServiceRestResponse.createPositiveResponse(systemService.getGestSetupList(stbGestSetupList, requestDataDTO.getUsername(), codMdep));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "updateGestSetup", method = RequestMethod.POST)
|
||||||
|
public ServiceRestResponse updateGestSetup(@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||||
|
@RequestParam(required = false) String username,
|
||||||
|
@RequestBody StbGestSetup stbGestSetup) throws Exception {
|
||||||
|
return ServiceRestResponse.createPositiveResponse(systemService.updateGestSetup(stbGestSetup, username));
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@RequestMapping(value = EmsRestConstants.PATH_SEND_MAIL, method = RequestMethod.POST)
|
@RequestMapping(value = EmsRestConstants.PATH_SEND_MAIL, method = RequestMethod.POST)
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
@@ -554,16 +561,16 @@ public class SystemController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = EmsRestConstants.PATH_USERS, method = RequestMethod.GET)
|
@RequestMapping(value = EmsRestConstants.PATH_USERS, method = RequestMethod.GET)
|
||||||
public ServiceRestResponse getUsers(HttpServletRequest request,
|
public ServiceRestResponse getUsers(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
|
||||||
@RequestParam(value = "username", required = false) String userName) throws Exception {
|
@RequestParam(value = "username", required = false) String userName) throws Exception {
|
||||||
|
|
||||||
try {
|
return ServiceRestResponse.createPositiveResponse(systemService.getUsers(userName));
|
||||||
return ServiceRestResponse.createPositiveResponse(systemService.getUsers(userName));
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(request.getRequestURI(), e);
|
@RequestMapping(value = "getForzaLavoro", method = RequestMethod.GET)
|
||||||
return ServiceRestResponse.createNegativeResponse(e);
|
public ServiceRestResponse getForzaLavoro(@RequestParam(CommonConstants.PROFILE_DB) String config) throws Exception {
|
||||||
}
|
|
||||||
|
return ServiceRestResponse.createPositiveResponse(systemService.getForzaLavoro());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = EmsRestConstants.PATH_ATTACH_FILE_ACTIVITY, method = RequestMethod.POST)
|
@RequestMapping(value = EmsRestConstants.PATH_ATTACH_FILE_ACTIVITY, method = RequestMethod.POST)
|
||||||
|
|||||||
@@ -456,7 +456,6 @@ public class SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<UserDTO> getUsers(String userName) throws Exception {
|
public List<UserDTO> getUsers(String userName) throws Exception {
|
||||||
|
|
||||||
String sql = "SELECT DISTINCT jrl_flav_users.user_name, stb_user.full_name, stb_user.e_mail, stb_user.key_group\n" +
|
String sql = "SELECT DISTINCT jrl_flav_users.user_name, stb_user.full_name, stb_user.e_mail, stb_user.key_group\n" +
|
||||||
"FROM jrl_flav_users\n" +
|
"FROM jrl_flav_users\n" +
|
||||||
" INNER JOIN stb_user ON stb_user.user_name = jrl_flav_users.user_name\n" +
|
" INNER JOIN stb_user ON stb_user.user_name = jrl_flav_users.user_name\n" +
|
||||||
@@ -467,6 +466,13 @@ public class SystemService {
|
|||||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, UserDTO.class);
|
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, UserDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<JtbFlav> getForzaLavoro() throws Exception {
|
||||||
|
String sql = "SELECT *\n" +
|
||||||
|
"FROM jtb_flav\n" +
|
||||||
|
"WHERE data_fine_lavoro IS NULL";
|
||||||
|
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, JtbFlav.class);
|
||||||
|
}
|
||||||
|
|
||||||
public ServiceRestResponse getActivityProcessTree(String activityParent, String codJcom, String userName, String dataInizio, String dataFine) throws Exception {
|
public ServiceRestResponse getActivityProcessTree(String activityParent, String codJcom, String userName, String dataInizio, String dataFine) throws Exception {
|
||||||
String whereCond = "";
|
String whereCond = "";
|
||||||
|
|
||||||
@@ -669,6 +675,22 @@ public class SystemService {
|
|||||||
return setupList;
|
return setupList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EntityBase updateGestSetup(StbGestSetup stbGestSetup, String username) throws Exception {
|
||||||
|
if (username != null){
|
||||||
|
WtbGestSetupUser wtbGestSetupUser = new WtbGestSetupUser();
|
||||||
|
wtbGestSetupUser.setGestName(stbGestSetup.getGestName());
|
||||||
|
wtbGestSetupUser.setKeySection(stbGestSetup.getKeySection());
|
||||||
|
wtbGestSetupUser.setSection(stbGestSetup.getSection());
|
||||||
|
wtbGestSetupUser.setValue(stbGestSetup.getValue());
|
||||||
|
wtbGestSetupUser.setUserName(username);
|
||||||
|
wtbGestSetupUser.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
return entityProcessor.processEntity(wtbGestSetupUser, multiDBTransactionManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
stbGestSetup.setOperation(OperationType.UPDATE);
|
||||||
|
return entityProcessor.processEntity(stbGestSetup, multiDBTransactionManager);
|
||||||
|
}
|
||||||
|
|
||||||
public void migrateStbFilesAttachedContentsToObjectStorage() throws Exception {
|
public void migrateStbFilesAttachedContentsToObjectStorage() throws Exception {
|
||||||
int cores = Runtime.getRuntime().availableProcessors();
|
int cores = Runtime.getRuntime().availableProcessors();
|
||||||
|
|||||||
Reference in New Issue
Block a user