Merge branch 'master' 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
# Conflicts: # ems-engine/src/main/java/it/integry/ems/machine/service/MachineService.java
This commit is contained in:
@@ -39,10 +39,10 @@ public class DownloadController {
|
||||
if (fileContent != null) {
|
||||
String filename = downloadFileHandlerService.getDownloadFileName(uuid);
|
||||
|
||||
String mimeType = Files.probeContentType(Paths.get(fileName));
|
||||
MediaType mediaType = mimetypesFileTypeMap.getContentType(fileName);
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType(mimeType))
|
||||
.contentType(mediaType)
|
||||
.contentLength(fileContent.length)
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition
|
||||
.builder("attachment")
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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_20251201180420 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
String value = null;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.RossoGargano_RossoGargano)) {
|
||||
value = "01";
|
||||
}
|
||||
|
||||
createSetupQuery("COD_MDEP", "COD_MDEP", "SELECT COD_MDEP FROM MTB_DEPO ORDER BY 1");
|
||||
createSetup("PVM", "MACCHINARI_PROD", "DEPOSITO_RICAMBI", value,
|
||||
"Deposito sulla quale ci sono i ricambi, usato durante la creazione di ordini di lavoro delle manutenzioni",
|
||||
false, "COD_MDEP", false, false, false,
|
||||
false, false, null, false, "SELECT COD_MDEP FROM MTB_DEPO ORDER BY 1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,18 +2,16 @@ package it.integry.ems.machine.service;
|
||||
|
||||
import it.integry.ems.exception.MissingDataException;
|
||||
import it.integry.ems.machine.dto.CreateManutenzioneRequestDTO;
|
||||
import it.integry.ems.production.service.ProductionService;
|
||||
import it.integry.ems.service.AziendaService;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.exception.GestSetupNotFoundException;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
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.UtilityList;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -35,14 +33,21 @@ public class MachineService {
|
||||
|
||||
@Autowired
|
||||
private AziendaService aziendaService;
|
||||
|
||||
@Autowired
|
||||
private ProductionService productionService;
|
||||
private SetupGest setupGest;
|
||||
|
||||
public CtbAmac createManutenzione(CreateManutenzioneRequestDTO dto) throws Exception {
|
||||
if (!dto.isValid()) {
|
||||
throw new MissingDataException("Dto incompleto");
|
||||
}
|
||||
|
||||
String codMdepRicambi = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "PVM", "MACCHINARI_PROD", "DEPOSITO_RICAMBI");
|
||||
|
||||
if (UtilityString.isNullOrEmpty(codMdepRicambi)) {
|
||||
throw new GestSetupNotFoundException("PVM", "MACCHINARI_PROD", "DEPOSITO_RICAMBI");
|
||||
}
|
||||
|
||||
try {
|
||||
CtbAmacManutenzioni ctbAmacManutenzioni = new CtbAmacManutenzioni()
|
||||
.setDescrizione(dto.getDescrizione())
|
||||
@@ -151,68 +156,5 @@ public class MachineService {
|
||||
} finally {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
}
|
||||
|
||||
//$id = array_get($data, "id");
|
||||
// $codCmac = array_get($data, "codCmac");
|
||||
//
|
||||
// $ctbAmac = new EntityItem("ctb_amac");
|
||||
// $ctbAmac
|
||||
// ->no_op()
|
||||
// ->set("codCmac", $codCmac);
|
||||
//
|
||||
// $ctbAmacManutenzioni = new EntityItem("ctb_amac_manutenzioni");
|
||||
// $ctbAmacManutenzioni
|
||||
// ->set("descrizione", $data["descrizione"])
|
||||
// ->setDate("dataManutenzione", $data["dataManutenzione"])
|
||||
// ->setDatetime("dataIniz", $data["dataIniz"])
|
||||
// ->setDatetime("dataFine", $data["dataFine"])
|
||||
// ->set("stato", $data["stato"])
|
||||
// ->set("esito", $data["esito"])
|
||||
// ->set("oreLavoro", $data["oreLavoro"])
|
||||
// ->set("esitoPositivo", array_get($data, "esito_positivo") == "1" ? 1 : 0)
|
||||
// ->set("manutenzioneOrdinaria", array_get($data, "manutenzione_ordinaria") == "1" ? 1 : 0)
|
||||
// ->set("nomeSquadra", $data["nomeSquadra"]);
|
||||
//
|
||||
// if ($id) {
|
||||
// $ctbAmacManutenzioni
|
||||
// ->update()
|
||||
// ->set("id", $id);
|
||||
// } else {
|
||||
// $ctbAmacManutenzioni
|
||||
// ->insert()
|
||||
// ->setDate("dataInserimento", Date::getToday());
|
||||
// }
|
||||
//
|
||||
// $ctbAmac->onlyPkMaster(false)->set("ctbAmacManutenzioni")->append($ctbAmacManutenzioni);
|
||||
//
|
||||
// $ret = $ctbAmac->send();
|
||||
// if ($ret->is_KO()) {
|
||||
// return $ret;
|
||||
// }
|
||||
//
|
||||
// $uploads = $_FILES;
|
||||
//
|
||||
// if (empty($uploads)) {
|
||||
// return $ret;
|
||||
// }
|
||||
//
|
||||
// $resultMac = $ret->get_entity();
|
||||
// $manutenzione = $resultMac["ctbAmacManutenzioni"][0];
|
||||
// foreach ($uploads as $file) {
|
||||
// $filePath = $file["tmp_name"];
|
||||
// if (file_exists($filePath)) {
|
||||
// $crlAmacManutenzioniFiles = new \EntityItem("crl_amac_manutenzioni_files");
|
||||
//
|
||||
// $crlAmacManutenzioniFiles
|
||||
// ->insert()
|
||||
// ->set("idManutenzione", array_get($manutenzione, "id"));
|
||||
//
|
||||
// $ret = Allegati\StbFilesAttached::upload($file, $crlAmacManutenzioniFiles);
|
||||
// if ($ret->is_KO()) {
|
||||
// return $ret;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,17 @@ public class OrdiniNewCliImportService {
|
||||
}
|
||||
}
|
||||
|
||||
EntityBase findCtbAnag = arrayEntity.stream().filter(x -> x.getClass().equals(CtbAnag.class)).findFirst().orElse(null);
|
||||
EntityBase findCtbAnag = arrayEntity.stream().filter(x -> {
|
||||
if (x.getClass().equals(CtbAnag.class)){
|
||||
return true;
|
||||
}
|
||||
if (x instanceof GtbAnag){
|
||||
GtbAnag gtbAnag1 = (GtbAnag) x ;
|
||||
|
||||
return gtbAnag1.getCtbAnag() != null;
|
||||
}
|
||||
return false;
|
||||
}).findFirst().orElse(null);
|
||||
|
||||
if (findCtbAnag == null && isNewClie && !UtilityString.isNullOrEmpty(codCcon)) {
|
||||
CtbAnag ctbAnag = new CtbAnag();
|
||||
|
||||
@@ -599,9 +599,9 @@ public class VariazioniPvService {
|
||||
" listino.prz_vend_iva AS 'prz_pieno_iva',\n" +
|
||||
" promozione.cod_promo,\n" +
|
||||
" promozione.descr_promo,\n" +
|
||||
" promozione.data_fine,\n" +
|
||||
" vtb_list_data.data_fine,\n" +
|
||||
" mtb_aart.ingredienti,\n" +
|
||||
" ISNULL(promozione.data_iniz, listino.data_iniz) AS 'data_iniz',\n" +
|
||||
" ISNULL(vtb_list_data.data_iniz, listino.data_iniz) AS 'data_iniz',\n" +
|
||||
" stb_gest_setup.value AS 'reparto_cassa',\n" +
|
||||
" mtb_aart.note AS 'annotazioni_art',\n" +
|
||||
" CASE\n" +
|
||||
@@ -641,6 +641,7 @@ public class VariazioniPvService {
|
||||
" LEFT OUTER JOIN dbo.getpromozionevendita('[DATA_VARIAZIONE]', NULL, '[COD_VLIS]', NULL, NULL) promozione\n" +
|
||||
" ON listino.cod_vlis = promozione.cod_vlis AND listino.cod_mart = promozione.cod_mart AND\n" +
|
||||
" (( promozione.data_fine = '[DATA_VARIAZIONE]' AND promozione.chiusura_immediata = 0) OR promozione.data_fine <> '[DATA_VARIAZIONE]' )\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON promozione.cod_vlis = vtb_list_data.cod_vlis and promozione.versione = vtb_list_data.versione\n" +
|
||||
" LEFT OUTER JOIN vtb_promo ON promozione.cod_promo = vtb_promo.cod_promo\n" +
|
||||
"WHERE vtb_promo.cod_promo_intercode IS NULL\n" +
|
||||
((variazioniPvDTO.getTipoReportEnum() == VariazioniReportType.LISTINO) ?
|
||||
|
||||
Reference in New Issue
Block a user