Merge branch 'develop' into feature/Feature-Task
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251014154051 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (isCustomer(IntegryCustomer.Auricchio) || isCustomer(IntegryCustomer.Florapulia)) return;
|
||||
updateSetupValue("DATI_AZIENDA", "SETUP", "INVIO_EMAIL_NEW", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251014182929 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
executeStatement("INSERT INTO stb_gest_setup VALUES (\n" +
|
||||
" 'w_vedi_invoic_dlg',\n" +
|
||||
" 'SASU',\n" +
|
||||
" 'NAI_NAZIONE_PARTIVA',\n" +
|
||||
" 'S',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" '2025-10-14 18:17:28.000',\n" +
|
||||
" 'Administrator',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 0)");
|
||||
|
||||
executeStatement("INSERT INTO stb_gest_setup VALUES (\n" +
|
||||
" 'w_vedi_invoic_dlg',\n" +
|
||||
" 'SASU_CORA',\n" +
|
||||
" 'NAI_NAZIONE_PARTIVA',\n" +
|
||||
" 'S',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" '2025-10-14 18:17:28.000',\n" +
|
||||
" 'Administrator',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 0)");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251015102126 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_CLIENTE_REP", null,
|
||||
null, false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_ARTICOLO_REP", null,
|
||||
null, false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_CLIENTE_STATISTICO_REP", null,
|
||||
null, false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_ARTICOLO_STATISTICO_REP", null,
|
||||
null, false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
if(isCustomer(IntegryCustomer.Fiume)) {
|
||||
updateSetupValue("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_CLIENTE_REP", "D_VMOVIM_CLIENTE_REP_LICOR");
|
||||
updateSetupValue("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_ARTICOLO_REP", "D_VMOVIM_ARTICOLO_REP_LICOR");
|
||||
updateSetupValue("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_CLIENTE_STATISTICO_REP", "D_VMOVIM_CLIENTE_STATISTICO_REP_LICOR");
|
||||
updateSetupValue("W_VMOVIMENTAZIONI_DISP", "DATAWINDOW", "D_VMOVIM_ARTICOLO_STATISTICO_REP", "D_VMOVIM_ARTICOLO_STATISTICO_REP_LICOR");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,8 @@ import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import java.util.Date;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -39,7 +40,7 @@ public class StbActivityPublications extends EntityBase {
|
||||
|
||||
@PK
|
||||
@SqlField(value = "data_pub", nullable = false, defaultObjectValue = CommonConstants.TIMESTAMP)
|
||||
private Date dataPub;
|
||||
private LocalDate dataPub;
|
||||
|
||||
@SqlField(value = "custom_activity_description", maxLength = 1024)
|
||||
private String customActivityDescription;
|
||||
@@ -74,11 +75,11 @@ public class StbActivityPublications extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataPub() {
|
||||
public LocalDate getDataPub() {
|
||||
return dataPub;
|
||||
}
|
||||
|
||||
public StbActivityPublications setDataPub(Date dataPub) {
|
||||
public StbActivityPublications setDataPub(LocalDate dataPub) {
|
||||
this.dataPub = dataPub;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -77,8 +77,11 @@ public class UtilityQuery {
|
||||
" TempCount.* " +
|
||||
"FROM TempResult, " +
|
||||
" TempCount " +
|
||||
"ORDER BY row_number " +
|
||||
"OFFSET (" + pageNumber + " - 1) * " + pageSize + " ROWS FETCH NEXT " + pageSize + " ROWS ONLY";
|
||||
"ORDER BY row_number ";
|
||||
|
||||
if (pageNumber > 0 && pageSize > 0) {
|
||||
sql += "OFFSET (" + pageNumber + " - 1) * " + pageSize + " ROWS FETCH NEXT " + pageSize + " ROWS ONLY";
|
||||
}
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
@@ -131,20 +131,23 @@ public class ActivityController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_UPLOAD_STB_ACTIVITY_FILE_ATTACHMENT, method = RequestMethod.POST)
|
||||
@PostMapping(value = "uploadStbActivityFileAttachment")
|
||||
public ServiceRestResponse uploadStbActivityFileAttachment(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam() String activityId,
|
||||
@RequestPart() MultipartFile[] files) throws Exception {
|
||||
if (files == null || files.length == 0) {
|
||||
if (files == null || files.length == 0)
|
||||
throw new Exception("Nessun file è stato rilevato");
|
||||
}
|
||||
|
||||
StbActivity stbActivity = activityService.uploadAttachment(activityId, files);
|
||||
return ServiceRestResponse.createPositiveResponse(activityService.uploadAttachment(activityId, files));
|
||||
}
|
||||
|
||||
ServiceRestResponse serviceRestResponse = ServiceRestResponse.createPositiveResponse();
|
||||
serviceRestResponse.setEntityList(stbActivity.getStbActivityFile());
|
||||
@GetMapping(value = "activity/removeAttachment")
|
||||
public ServiceRestResponse removeAttachment(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam() String activityId,
|
||||
@RequestParam() String fileName) throws Exception {
|
||||
|
||||
return serviceRestResponse;
|
||||
activityService.removeAttachment(activityId, fileName);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_ACTIVITY_GET_ACTIVITY, method = RequestMethod.GET)
|
||||
@@ -390,4 +393,13 @@ public class ActivityController {
|
||||
public ServiceRestResponse getAvgResolutionTime(@RequestParam(CommonConstants.PROFILE_DB) String config) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(activityService.getAvgResolutionTime());
|
||||
}
|
||||
|
||||
@RequestMapping(value = "activity/insertPubblication", method = RequestMethod.POST)
|
||||
public ServiceRestResponse changeCodJcom(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody(required = false) ActivityPublicationDTO activityPublicationDTO) throws Exception {
|
||||
|
||||
activityService.insertPubblication(activityPublicationDTO);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package it.integry.ems.activity.dto
|
||||
|
||||
import java.time.LocalDate
|
||||
|
||||
class ActivityPublicationDTO {
|
||||
private String activityId;
|
||||
private String activityDescription;
|
||||
private String projectDescription;
|
||||
private LocalDate dataPubblicazione;
|
||||
private List<String> commesse;
|
||||
|
||||
String getActivityId() {
|
||||
return activityId
|
||||
}
|
||||
|
||||
void setActivityId(String activityId) {
|
||||
this.activityId = activityId
|
||||
}
|
||||
|
||||
String getActivityDescription() {
|
||||
return activityDescription
|
||||
}
|
||||
|
||||
void setActivityDescription(String activityDescription) {
|
||||
this.activityDescription = activityDescription
|
||||
}
|
||||
|
||||
String getProjectDescription() {
|
||||
return projectDescription
|
||||
}
|
||||
|
||||
void setProjectDescription(String projectDescription) {
|
||||
this.projectDescription = projectDescription
|
||||
}
|
||||
|
||||
LocalDate getDataPubblicazione() {
|
||||
return dataPubblicazione
|
||||
}
|
||||
|
||||
void setDataPubblicazione(LocalDate dataPubblicazione) {
|
||||
this.dataPubblicazione = dataPubblicazione
|
||||
}
|
||||
|
||||
List<String> getCommesse() {
|
||||
return commesse
|
||||
}
|
||||
|
||||
void setCommesse(List<String> commesse) {
|
||||
this.commesse = commesse
|
||||
}
|
||||
}
|
||||
@@ -127,12 +127,19 @@ public class ActivityService {
|
||||
}
|
||||
|
||||
public void removeAttachment(String activityId, String fileName) throws Exception {
|
||||
StbActivityFile activityFile = new StbActivityFile();
|
||||
if (activityId == null || fileName == null)
|
||||
throw new Exception("activityId e fileName sono obbligatori");
|
||||
|
||||
StbActivityFile activityFile = new StbActivityFile()
|
||||
.setId(activityId)
|
||||
.setFileName(fileName);
|
||||
activityFile.setOperation(OperationType.DELETE);
|
||||
activityFile.setId(activityId);
|
||||
activityFile.setFileName(fileName);
|
||||
entityProcessor.processEntity(activityFile, multiDBTransactionManager);
|
||||
multiDBTransactionManager.commitAll();
|
||||
|
||||
StbActivity stbActivity = new StbActivity().setActivityId(activityId);
|
||||
stbActivity.getStbActivityFile().add(activityFile);
|
||||
stbActivity.setOperation(OperationType.NO_OP);
|
||||
|
||||
entityProcessor.processEntity(stbActivity, multiDBTransactionManager);
|
||||
}
|
||||
|
||||
public List<AttivitaDTO> save(List<AttivitaDTO> listAttivita) throws Exception {
|
||||
@@ -755,6 +762,33 @@ public class ActivityService {
|
||||
}
|
||||
}
|
||||
|
||||
public void insertPubblication(ActivityPublicationDTO activityPublicationDTO) throws Exception {
|
||||
List<StbActivityPublications> publications = new ArrayList<>();
|
||||
if (UtilityString.isNullOrEmpty(activityPublicationDTO.getActivityDescription()))
|
||||
throw new Exception("La descrizione personalizzata dell'attività non può essere vuota");
|
||||
if (UtilityString.isNullOrEmpty(activityPublicationDTO.getProjectDescription()))
|
||||
throw new Exception("La descrizione personalizzata del progetto non può essere vuota");
|
||||
|
||||
if (activityPublicationDTO.getCommesse() == null || activityPublicationDTO.getCommesse().isEmpty())
|
||||
throw new Exception("Deve essere selezionata almeno una commessa per la pubblicazione");
|
||||
|
||||
if (activityPublicationDTO.getDataPubblicazione() == null)
|
||||
throw new Exception("La data di pubblicazione non può essere vuota");
|
||||
|
||||
for(String codJcom: activityPublicationDTO.getCommesse()){
|
||||
StbActivityPublications publication = new StbActivityPublications()
|
||||
.setActivityId(activityPublicationDTO.getActivityId())
|
||||
.setCodJcom(codJcom)
|
||||
.setDataPub(activityPublicationDTO.getDataPubblicazione())
|
||||
.setCustomActivityDescription(activityPublicationDTO.getActivityDescription())
|
||||
.setCustomProjectDescription(activityPublicationDTO.getProjectDescription());
|
||||
publication.setOperation(OperationType.INSERT);
|
||||
publications.add(publication);
|
||||
}
|
||||
|
||||
UtilityEntity.throwEntitiesException(entityProcessor.processEntityList(publications, true));
|
||||
}
|
||||
|
||||
public ActivityDTO changeCodJcom(String activityId, String codJcom, String parentActivityId) throws Exception {
|
||||
String sql =
|
||||
Query.format("SELECT cod_jcom FROM stb_activity WHERE activity_id = %s", activityId);
|
||||
@@ -957,7 +991,7 @@ public class ActivityService {
|
||||
" task.dapagare AS da_pagare,\n " +
|
||||
" task.acanone AS a_canone\n ";
|
||||
if (daInstallare) {
|
||||
sql += ", lastUpdt.data AS ultimo_aggiornamento\n";
|
||||
sql += ", CAST(lastUpdt.data AS DATETIME) AS ultimo_aggiornamento\n";
|
||||
} else {
|
||||
sql += ", CAST(NULL AS DATETIME) AS ultimo_aggiornamento\n";
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ public class ArticoloDTO {
|
||||
@SqlField("mtb_aart.descrizione")
|
||||
private String descrizione;
|
||||
|
||||
@SqlField("CONCAT(mtb_aart.cod_mart, ' - ', mtb_aart.descrizione)")
|
||||
private String articolo;
|
||||
|
||||
@SqlField("mtb_aart.unt_mis")
|
||||
private String untMis;
|
||||
|
||||
@@ -84,6 +87,15 @@ public class ArticoloDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getArticolo() {
|
||||
return articolo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setArticolo(String articolo) {
|
||||
this.articolo = articolo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public class WMSArticoloService {
|
||||
|
||||
String query = "SELECT mtb_aart.cod_mart AS [mtb_aart.cod_mart], " +
|
||||
" mtb_aart.descrizione AS [mtb_aart.descrizione], " +
|
||||
" CONCAT(mtb_aart.cod_mart, ' - ', mtb_aart.descrizione) AS [CONCAT(mtb_aart.cod_mart, ' - ', mtb_aart.descrizione)], " +
|
||||
" mtb_aart.descrizione_estesa AS [mtb_aart.descrizione_estesa], " +
|
||||
" mtb_aart.unt_mis AS [mtb_aart.unt_mis], " +
|
||||
" mtb_aart.cod_mgrp AS [mtb_aart.cod_mgrp], " +
|
||||
|
||||
@@ -334,7 +334,7 @@ public class SystemService {
|
||||
for (String profile : profiles) {
|
||||
String dbName = settingsModel.getDbNameFromProfileDb(profile);
|
||||
|
||||
//MD5 utilizzato da Ordikids
|
||||
//MD5 utilizzato da Ordikids e Farmmes
|
||||
if (UtilityString.isNullOrEmpty(password) && !UtilityString.isNullOrEmpty(md5User)) {
|
||||
foundUser = userCacheService.retrieveUser(dbName, md5User);
|
||||
} else
|
||||
@@ -351,7 +351,7 @@ public class SystemService {
|
||||
|
||||
if (foundUser == null) {
|
||||
logger.error(String.format("Credenziali non valide utente: %s ( %s) ",
|
||||
username, multiDBTransactionManager.getPrimaryConnection().getCatalog() + " )"));
|
||||
UtilityString.isNull(username,md5User), UtilityString.isNull(profileDB,multiDBTransactionManager.getPrimaryConnection().getCatalog()) + " )"));
|
||||
throw new Exception("Credenziali non valide");
|
||||
} else if (!foundUser.isAttivo()) {
|
||||
throw new Exception("Utente non attivo");
|
||||
|
||||
Reference in New Issue
Block a user