sistemata lettura inevasi steup

This commit is contained in:
2024-07-19 12:06:57 +02:00
parent b3acb22495
commit 54390e7198
3 changed files with 72 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import it.integry.ems.service.dto.LoginAziendaDTO;
import it.integry.ems.status.ServiceChecker;
import it.integry.ems_model.config.EmsRestConstants;
import it.integry.ems_model.entity.StbActivity;
import it.integry.ems_model.utility.UtilityDate;
import it.integry.ems_model.utility.UtilityHashMap;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -91,7 +92,7 @@ public class SteUPController {
) {
ServiceRestResponse response = new ServiceRestResponse();
try {
response.setJsonObject(steUPService.getGrigliaPluRepo(codMdep, codJfas, activityTypeId, codCmac));
response.setJsonObject(steUPService.getGrigliaPluRepo(codMdep, codJfas, activityTypeId, codCmac, UtilityDate.getTodayWithoutTime()));
response.setEsito(EsitoType.OK);
} catch (Exception e) {
logger.error(request.getRequestURI(), e);

View File

@@ -692,7 +692,7 @@ public class SteUPService {
barcodes = chkVolantino(codJfas, codMdep, barcodes, verificaVolantino, dataCreation);
}else if(activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)){
List<HashMap<String, Object>> pluRepo = getGrigliaPluRepo(codMdep,codJfas,activityTypeId,null);
List<HashMap<String, Object>> pluRepo = getGrigliaPluRepo(codMdep,codJfas,activityTypeId,null, dataCreation);
if(repartiFreschi != null && repartiFreschi.contains(codJfas)){
List<String> finalBarcodes = barcodes;
barcodes = pluRepo.stream().filter(a-> !finalBarcodes.contains(((String) a.get("barcode")))).map(a->(String) a.get("barcode")).collect(Collectors.toList());
@@ -798,7 +798,7 @@ public class SteUPService {
return toReturn;
}
public List<HashMap<String, Object>> getGrigliaPluRepo(String codMdep, String codJfas, String activityTypeId, String codCmac) throws Exception {
public List<HashMap<String, Object>> getGrigliaPluRepo(String codMdep, String codJfas, String activityTypeId, String codCmac, Date dataCreation) throws Exception {
String sql = "SELECT dbo.steup_getListinoDepo( " + UtilityDB.valueToString(codMdep) + ") as cod_vlis";
String codVlis = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
if (UtilityString.isNullOrEmpty(codVlis))
@@ -862,7 +862,7 @@ public class SteUPService {
" AND DATEDIFF(DAY, data_validita, CAST(GETDATE() AS DATE)) < 7\n" +
" AND g.tipo_variazione = 'I'\n" +
" UNION " +
" SELECT cod_mart FROM dbo.steup_getInevasi("+ UtilityDB.valueToString(codMdep)+", " + UtilityDB.valueToString(codJfas)+"))";
" SELECT cod_mart FROM dbo.steup_getInevasi("+ UtilityDB.valueToString(codMdep)+", " + UtilityDB.valueToString(codJfas)+", " + UtilityDB.valueToString(dataCreation) + "))";
}
} else {
/*