Merge branch 'develop' into Refactoring_Spedizione__MoreRefact

# Conflicts:
#	app/build.gradle
#	app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java
This commit is contained in:
Giuseppe Scorrano 2020-09-25 10:21:19 +02:00
commit 498d213a07
3 changed files with 146 additions and 72 deletions

View File

@ -175,7 +175,8 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
cyclicRecover(sessionsIterator, onComplete, onFailed);
}, ex -> {
tmpOnFailed.run(ex, recoveredMtbColtID);
});
}
);
}, ex -> {
tmpOnFailed.run(ex, recoveredMtbColtID);
});

View File

@ -31,7 +31,8 @@ public class ProdRecuperoMaterialeHelper {
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
String sql = "SELECT jtb_fasi.cod_jfas, " +
String sql = "WITH ul_list AS ( " +
" SELECT jtb_fasi.cod_jfas, " +
" jtb_fasi.descrizione AS descrizione_fase, " +
" mtb_colr.gestione, " +
" mtb_colr.data_collo, " +
@ -42,7 +43,6 @@ public class ProdRecuperoMaterialeHelper {
" mtb_colr.cod_tagl, " +
" SUM(mtb_colr.qta_col) AS qta_col, " +
" SUM(mtb_colr.num_cnf) AS num_cnf, " +
" mtb_colr.ser_collo, " +
" mtb_colr.partita_mag, " +
" mtb_colr.cod_jcom, " +
" mtb_colr.num_collo_rif, " +
@ -58,13 +58,14 @@ public class ProdRecuperoMaterialeHelper {
" dtb_ord_steps.gestione as gestione_ord, " +
" dtb_ord_steps.hr_num as hr, " +
" mtb_colr.riga_ord, " +
" CONVERT(INTEGER, ROUND((CAST(dtb_ord_steps.hr_num AS DECIMAL(20, 5)) / SUM(dtb_ord_steps.hr_num) OVER (PARTITION BY mtb_colr.num_collo)) * 100, 0)) as percentage_hr " +
" CONVERT(INTEGER, ROUND((CAST(dtb_ord_steps.hr_num AS DECIMAL(20, 5)) / " +
" SUM(dtb_ord_steps.hr_num) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
" 0)) as percentage_hr " +
" FROM mtb_colr " +
" INNER JOIN mtb_colt ON mtb_colr.num_collo = mtb_colt.num_collo " +
" AND mtb_colr.data_collo = mtb_colt.data_collo " +
" AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
" AND mtb_colr.gestione = mtb_colt.gestione " +
" " +
" INNER JOIN dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
" AND dtb_ord_steps.gestione = mtb_colr.gestione " +
" AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
@ -101,7 +102,78 @@ public class ProdRecuperoMaterialeHelper {
" mtb_colr.riga_ord, " +
" dtb_ord_steps.hr_num " +
" HAVING SUM(mtb_colr.qta_col) > 0 " +
"ORDER BY data_collo DESC";
"), max_ul AS ( " +
" SELECT " +
" cod_jfas, " +
" descrizione_fase, " +
" gestione, " +
" cod_mart, " +
" cod_col, " +
" cod_tagl, " +
" ser_collo, " +
" partita_mag, " +
" cod_jcom, " +
" descrizione_art, " +
" unt_mis, " +
" num_collo_rif, " +
" data_collo_rif, " +
" ser_collo_rif, " +
" gestione_rif, " +
" segno, " +
" num_ord, " +
" data_ord, " +
" gestione_ord, " +
" riga_ord, " +
" hr, " +
" MAX (datetime_row) as max_datetime_row " +
" FROM ul_list " +
" GROUP BY cod_jfas, " +
" descrizione_fase, " +
" gestione, " +
" cod_mart, " +
" cod_col, " +
" cod_tagl, " +
" ser_collo, " +
" partita_mag, " +
" cod_jcom, " +
" descrizione_art, " +
" unt_mis, " +
" num_collo_rif, " +
" data_collo_rif, " +
" ser_collo_rif, " +
" gestione_rif, " +
" segno, " +
" num_ord, " +
" data_ord, " +
" gestione_ord, " +
" riga_ord, " +
" hr " +
") " +
" " +
"SELECT qta_col, num_cnf, * FROM max_ul " +
"LEFT OUTER JOIN ul_list ON " +
" ISNULL(max_ul.cod_jfas, '') = ISNULL(ul_list.cod_jfas, '') AND " +
" ISNULL(max_ul.descrizione_fase, '') = ISNULL(ul_list.descrizione_fase, '') AND " +
" ISNULL(max_ul.gestione, '') = ISNULL(ul_list.gestione, '') AND " +
" ISNULL(max_ul.cod_mart, '') = ISNULL(ul_list.cod_mart, '') AND " +
" ISNULL(max_ul.cod_col, '') = ISNULL(ul_list.cod_col, '') AND " +
" ISNULL(max_ul.cod_tagl, '') = ISNULL(ul_list.cod_tagl, '') AND " +
" ISNULL(max_ul.ser_collo, '') = ISNULL(ul_list.ser_collo, '') AND " +
" ISNULL(max_ul.partita_mag, '') = ISNULL(ul_list.partita_mag, '') AND " +
" ISNULL(max_ul.cod_jcom, '') = ISNULL(ul_list.cod_jcom, '') AND " +
" ISNULL(max_ul.descrizione_art, '') = ISNULL(ul_list.descrizione_art, '') AND " +
" ISNULL(max_ul.unt_mis, '') = ISNULL(ul_list.unt_mis, '') AND " +
" ISNULL(max_ul.num_collo_rif, '') = ISNULL(ul_list.num_collo_rif, '') AND " +
" ISNULL(max_ul.data_collo_rif, '') = ISNULL(ul_list.data_collo_rif, '') AND " +
" ISNULL(max_ul.ser_collo_rif, '') = ISNULL(ul_list.ser_collo_rif, '') AND " +
" ISNULL(max_ul.gestione_rif, '') = ISNULL(ul_list.gestione_rif, '') AND " +
" ISNULL(max_ul.segno, '') = ISNULL(ul_list.segno, '') AND " +
" ISNULL(max_ul.num_ord, '') = ISNULL(ul_list.num_ord, '') AND " +
" ISNULL(max_ul.data_ord, '') = ISNULL(ul_list.data_ord, '') AND " +
" ISNULL(max_ul.gestione_ord, '') = ISNULL(ul_list.gestione_ord, '') AND " +
" ISNULL(max_ul.riga_ord, '') = ISNULL(ul_list.riga_ord, '') AND " +
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
" max_ul.max_datetime_row = ul_list.datetime_row";
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {}.getType();
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<List<HistoryVersamentoProdULRestDTO>>() {

View File

@ -45,6 +45,7 @@ public class HoneyWellBarcodeReader implements BarcodeReaderInterface {
List<String> compatibleModels = new ArrayList<String>();
compatibleModels.add("EDA50");
compatibleModels.add("EDA51");
compatibleModels.add("CT60");
if(compatibleModels.contains(model)) {
return true;