[ROSSOGARGANO]
- nuovi servizi per la stampa di più report contemporanei - migration per nuovi report controllo giacenze
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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_20250626142053 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
String reportNamePackingList = null;
|
||||
if (isCustomer(IntegryCustomer.RossoGargano)) {
|
||||
reportNamePackingList = "PackingListScarico";
|
||||
}
|
||||
createSetup("PVM", "CONTROLLO_GIACENZE", "REPORT_NAME_PACKING_LIST", reportNamePackingList, "Nome report per stampa packing list post trasferimento", "REPORT_NAME");
|
||||
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250627184608 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
String value = null;
|
||||
if (isCustomer(IntegryCustomer.RossoGargano)){
|
||||
value = "ControlloGiacenzeSintetico";
|
||||
}
|
||||
createSetup("PVM","CONTROLLO_GIACENZE","REPORT_NAME_ELENCO_SINTETICO",value,"Report name per report giacenze sintetico da portale web","REPORT_NAME");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,7 @@ public class EmsRestConstants {
|
||||
public static final String PATH_USERS = PATH + "getUser";
|
||||
public static final String PATH_EXPORT_ORDINI_ACQ = PATH + "exportOrdiniAcquisto";
|
||||
public static final String PATH_PROCESS_REPORT = PATH + "processReport";
|
||||
public static final String PATH_DOWNLOAD_REPORT_LIST = PATH + "downloadReportList";
|
||||
public static final String PATH_DOWNLOAD_REPORT = PATH + "downloadReport";
|
||||
public static final String PATH_PROCESS_REPORT_TYPE = PATH + "processReportType";
|
||||
public static final String PATH_PRINT_REPORT_TYPE = PATH + "printReportType";
|
||||
|
||||
@@ -14,6 +14,7 @@ import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.service.PrinterService;
|
||||
import it.integry.ems.service.ReportProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityPdf;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.GrlAnagJrept;
|
||||
import it.integry.ems_model.entity.JtbDisegniFiles;
|
||||
@@ -84,6 +85,7 @@ public class EmsEngineController {
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_REPORT, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse downloadReport(HttpServletRequest request,
|
||||
@@ -96,6 +98,27 @@ public class EmsEngineController {
|
||||
return ServiceRestResponse.createNegativeResponse("Nessun report generato!");
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_REPORT_LIST, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse downloadReportList(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody JasperDTO[] jasperDTOList)throws Exception {
|
||||
|
||||
FileItem fi = new FileItem();
|
||||
List<byte[]> pdfList = new ArrayList<>();
|
||||
for (JasperDTO jasperDTO : jasperDTOList) {
|
||||
pdfList.add(emsEngineService.processReport(jasperDTO));
|
||||
}
|
||||
byte[] bytes = UtilityPdf.merge(pdfList);
|
||||
|
||||
if (bytes != null) {
|
||||
return ServiceRestResponse.createPositiveResponse(downloadFileHandlerService.generateDownloadItem(new Date().getTime() + ".pdf", bytes));
|
||||
} else {
|
||||
return ServiceRestResponse.createNegativeResponse("Nessun report generato!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_PROCESS_REPORT_TYPE, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse processReportTypeList(HttpServletRequest request,
|
||||
@@ -119,8 +142,8 @@ public class EmsEngineController {
|
||||
ServiceRestResponse printReportTypeList(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody ReportTypeDTO reportTypeDTO) throws Exception {
|
||||
printerService.printReportType(reportTypeDTO);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
printerService.printReportType(reportTypeDTO);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_GET_SETUP_REPORT_TYPE, method = RequestMethod.POST)
|
||||
|
||||
@@ -558,12 +558,13 @@ public class WMSGenericController {
|
||||
ServiceRestResponse spostaULInPosizione(@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody SpostaUlRequestDTO requestDTO) throws Exception {
|
||||
try {
|
||||
wmsGenericService.spostaUL(requestDTO);
|
||||
MtbColt mtbColt = wmsGenericService.spostaUL(requestDTO);
|
||||
mtbColt.setOnlyPkMaster(false);
|
||||
return ServiceRestResponse.createPositiveResponse(mtbColt);
|
||||
} catch (Exception e) {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
throw e;
|
||||
}
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ public class UtilityController {
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_MERGE_PDF, method = RequestMethod.POST)
|
||||
@Deprecated
|
||||
public @ResponseBody
|
||||
ServiceRestResponse mergePDF(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
|
||||
@@ -16,6 +16,7 @@ import it.integry.ems.service.exception.EmptyReportException;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityFile;
|
||||
import it.integry.ems.utility.UtilityPdf;
|
||||
import it.integry.ems.utility.dto.C2EArgDTO;
|
||||
import it.integry.ems.utility.dto.PdfDTO;
|
||||
import it.integry.ems_model.db.ResultSetMapper;
|
||||
@@ -47,6 +48,7 @@ import java.sql.Date;
|
||||
import java.sql.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Scope("request")
|
||||
@@ -191,9 +193,22 @@ public class UtilityService {
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* @param pdfList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public ServiceRestResponse mergePDF(List<PdfDTO> pdfList) throws Exception {
|
||||
byte[] b_pdfOut = this.merge(pdfList);
|
||||
// byte[] b_pdfOut = this.merge(pdfList);
|
||||
List<byte[]> pdfListByteArray = pdfList.stream().map(x -> {
|
||||
try {
|
||||
return UtilityZip.zlib_decompress(Base64.decodeBase64(x.get_b64GzBlobPdf()));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
byte[] b_pdfOut = UtilityPdf.merge(pdfListByteArray);
|
||||
|
||||
if (b_pdfOut == null) {
|
||||
throw new Exception("Nessun file generato");
|
||||
}
|
||||
@@ -208,6 +223,9 @@ public class UtilityService {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Utilizzare il nuovo Servizio in {@link it.integry.ems.utility.UtilityPdf#merge(List)}
|
||||
*/
|
||||
@Deprecated
|
||||
private byte[] merge(final List<PdfDTO> pdfList) throws Exception {
|
||||
ByteArrayOutputStream mergedPDFOutputStream = null;
|
||||
|
||||
Reference in New Issue
Block a user