non far scaricare la griglia al termine dell'ispezione se si tratta di rotture di stock no freschi

This commit is contained in:
2024-09-18 12:28:03 +02:00
parent 44f127ab9b
commit 9db3002acc
2 changed files with 8 additions and 5 deletions

View File

@@ -96,7 +96,7 @@ public class SteUPController {
) { ) {
ServiceRestResponse response = new ServiceRestResponse(); ServiceRestResponse response = new ServiceRestResponse();
try { try {
response.setJsonObject(steUPService.getGrigliaPluRepo(codMdep, codJfas, activityTypeId, codCmac, UtilityDate.getTodayWithoutTime())); response.setJsonObject(steUPService.getGrigliaPluRepo(codMdep, codJfas, activityTypeId, codCmac, UtilityDate.getTodayWithoutTime(), false));
response.setEsito(EsitoType.OK); response.setEsito(EsitoType.OK);
} catch (Exception e) { } catch (Exception e) {
logger.error(request.getRequestURI(), e); logger.error(request.getRequestURI(), e);

View File

@@ -692,8 +692,7 @@ public class SteUPService {
boolean verificaVolantino = UtilityString.equalsIgnoreCase(tipoAttivitaVerificaVolantino, activityTypeId); boolean verificaVolantino = UtilityString.equalsIgnoreCase(tipoAttivitaVerificaVolantino, activityTypeId);
barcodes = chkVolantino(codJfas, codMdep, barcodes, verificaVolantino, dataCreation); barcodes = chkVolantino(codJfas, codMdep, barcodes, verificaVolantino, dataCreation);
} else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) { } else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) {
List<HashMap<String, Object>> pluRepo = getGrigliaPluRepo(codMdep, codJfas, activityTypeId, null, dataCreation, true);
List<HashMap<String, Object>> pluRepo = getGrigliaPluRepo(codMdep, codJfas, activityTypeId, null, dataCreation);
if (repartiFreschi != null && repartiFreschi.contains(codJfas)) { if (repartiFreschi != null && repartiFreschi.contains(codJfas)) {
List<String> finalBarcodes = barcodes; List<String> finalBarcodes = barcodes;
barcodes = new ArrayList<>(); barcodes = new ArrayList<>();
@@ -814,7 +813,9 @@ public class SteUPService {
return toReturn; return toReturn;
} }
public List<HashMap<String, Object>> getGrigliaPluRepo(String codMdep, String codJfas, String activityTypeId, String codCmac, Date dataCreation) throws Exception { public List<HashMap<String, Object>> getGrigliaPluRepo(String codMdep, String codJfas,
String activityTypeId, String codCmac, Date dataCreation,
boolean chkRotturaStock) throws Exception {
String sql = "SELECT dbo.steup_getListinoDepo( " + UtilityDB.valueToString(codMdep) + ") as cod_vlis"; String sql = "SELECT dbo.steup_getListinoDepo( " + UtilityDB.valueToString(codMdep) + ") as cod_vlis";
String codVlis = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql); String codVlis = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
if (UtilityString.isNullOrEmpty(codVlis)) if (UtilityString.isNullOrEmpty(codVlis))
@@ -853,7 +854,7 @@ public class SteUPService {
} else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) { } else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) {
if (repartiFreschi.contains(codJfas)) { if (repartiFreschi.contains(codJfas)) {
sql = "Select cod_mart,descrizione,bar_code as barcode,cod_msgr from steup_getGrigliaVendita(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ")"; sql = "Select cod_mart,descrizione,bar_code as barcode,cod_msgr from steup_getGrigliaVendita(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ")";
} else { } else if (chkRotturaStock) {
sql = "SELECT cod_mart,descrizione,bar_code as barcode,cod_msgr\n" + sql = "SELECT cod_mart,descrizione,bar_code as barcode,cod_msgr\n" +
"FROM steup_getAssortimento(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ")\n" + "FROM steup_getAssortimento(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ")\n" +
"WHERE cod_mart NOT IN (SELECT cod_mart\n" + "WHERE cod_mart NOT IN (SELECT cod_mart\n" +
@@ -879,6 +880,8 @@ public class SteUPService {
" AND g.tipo_variazione = 'I'\n" + " AND g.tipo_variazione = 'I'\n" +
" UNION " + " UNION " +
" SELECT cod_mart FROM dbo.steup_getInevasi(" + UtilityDB.valueToString(codMdep) + ", " + UtilityDB.valueToString(codJfas) + ", " + UtilityDB.valueToString(dataCreation) + "))"; " SELECT cod_mart FROM dbo.steup_getInevasi(" + UtilityDB.valueToString(codMdep) + ", " + UtilityDB.valueToString(codJfas) + ", " + UtilityDB.valueToString(dataCreation) + "))";
} else {
return new ArrayList<>();
} }
} else { } else {
/* /*