Merge remote-tracking branch 'origin/develop' into develop
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,20 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250429110700 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("update stb_menu set descrizione = 'Allineamento Numero Documenti' where cod_opz = 'cg049'",
|
||||||
|
"update stb_menu_opz set descrizione = 'Allineamento Numero Documenti' where cod_opz = 'cg049'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -436,6 +436,14 @@ public class MesProductionControllerV2 {
|
|||||||
return ServiceRestResponse.createPositiveResponse(mesProductionService.versaMaterialeSuOrdine(dto));
|
return ServiceRestResponse.createPositiveResponse(mesProductionService.versaMaterialeSuOrdine(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "cambioLottoGiornalieroOrdiniLav")
|
||||||
|
public @ResponseBody
|
||||||
|
ServiceRestResponse cambioLottoGiornalieroOrdiniLav(@RequestParam(required = false) String codJfas) throws Exception {
|
||||||
|
mesProductionService.cambioLottoGiornalieroOrdiniLav(codJfas);
|
||||||
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "duplicaOrdiniGiornoDopo")
|
@PostMapping(value = "duplicaOrdiniGiornoDopo")
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ServiceRestResponse duplicaOrdiniGiornoDopo(@RequestParam String codJfas) throws Exception {
|
ServiceRestResponse duplicaOrdiniGiornoDopo(@RequestParam String codJfas) throws Exception {
|
||||||
|
|||||||
@@ -2106,7 +2106,7 @@ public class MesProductionServiceV2 {
|
|||||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, AttachmentDTO.class);
|
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, AttachmentDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void duplicaOrdiniGiornoDopo(String codJfas) throws Exception {
|
public void cambioLottoGiornalieroOrdiniLav(String codJfas) throws Exception {
|
||||||
try {
|
try {
|
||||||
String sql = Query.format(
|
String sql = Query.format(
|
||||||
"WITH setup AS (SELECT *\n" +
|
"WITH setup AS (SELECT *\n" +
|
||||||
@@ -2128,14 +2128,11 @@ public class MesProductionServiceV2 {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<MtbPartitaMag> listaPartite = new ArrayList<>();
|
|
||||||
|
|
||||||
for (OrdineLavorazioneDTO dto : ordini) {
|
for (OrdineLavorazioneDTO dto : ordini) {
|
||||||
Date dataOrd = UtilityDate.getTodayWithoutTime();
|
Date dataOrd = UtilityDate.getTodayWithoutTime();
|
||||||
|
|
||||||
String partitaMag = listaPartite.stream().filter(x -> UtilityDate.isSameDay(x.getDataScad(), dto.getDataScad()) && x.getCodMart().equalsIgnoreCase(dto.getCodProd())).findFirst().orElse(new MtbPartitaMag()).getPartitaMag();
|
String partitaMag = PartitaMagRules.suggestCodePartitaMag(multiDBTransactionManager.getPrimaryConnection(),
|
||||||
if (UtilityString.isNullOrEmpty(partitaMag)) {
|
|
||||||
partitaMag = PartitaMagRules.suggestCodePartitaMag(multiDBTransactionManager.getPrimaryConnection(),
|
|
||||||
new DatiPartitaMagDTO()
|
new DatiPartitaMagDTO()
|
||||||
.setCodMart(dto.getCodProd())
|
.setCodMart(dto.getCodProd())
|
||||||
.setDataOrd(dataOrd)
|
.setDataOrd(dataOrd)
|
||||||
@@ -2146,20 +2143,12 @@ public class MesProductionServiceV2 {
|
|||||||
.setCodMart(dto.getCodProd())
|
.setCodMart(dto.getCodProd())
|
||||||
.setPartitaMag(partitaMag)
|
.setPartitaMag(partitaMag)
|
||||||
.setDataScad(dto.getDataScad())
|
.setDataScad(dto.getDataScad())
|
||||||
.setNote(dto.getNoteLav()), true);
|
|
||||||
|
|
||||||
MtbPartitaMag mtbPartitaMag = (MtbPartitaMag) listPartitaMag.stream().filter(x -> x.getTableName().equalsIgnoreCase(MtbPartitaMag.ENTITY)).findFirst().orElseThrow(Exception::new);
|
|
||||||
listaPartite.add(mtbPartitaMag);
|
|
||||||
}
|
|
||||||
|
|
||||||
DtbOrdt ordLav = new DtbOrdt()
|
|
||||||
.setGestione(dto.getGestione())
|
|
||||||
.setDataOrd(dto.getDataOrd())
|
.setDataOrd(dto.getDataOrd())
|
||||||
.setNumOrd(dto.getNumOrd())
|
.setNumOrd(dto.getNumOrd())
|
||||||
.setPartitaMag(partitaMag);
|
.setGestione(dto.getGestione())
|
||||||
ordLav.setOperation(OperationType.UPDATE);
|
.setCodJfas(dto.getCodJfas())
|
||||||
|
.setNote(dto.getNoteLav()), true);
|
||||||
|
|
||||||
entityProcessor.processEntity(ordLav, true, multiDBTransactionManager);
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
multiDBTransactionManager.rollbackAll();
|
multiDBTransactionManager.rollbackAll();
|
||||||
@@ -2168,7 +2157,7 @@ public class MesProductionServiceV2 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void duplicaOrdiniGiornoDopoOld(String codJfas) throws Exception {
|
public void duplicaOrdiniGiornoDopo(String codJfas) throws Exception {
|
||||||
String sql = Query.format(
|
String sql = Query.format(
|
||||||
"WITH setup AS (SELECT *\n" +
|
"WITH setup AS (SELECT *\n" +
|
||||||
" FROM stb_gest_setup_det\n" +
|
" FROM stb_gest_setup_det\n" +
|
||||||
|
|||||||
Reference in New Issue
Block a user