Merge branch 'master' into develop
This commit is contained in:
@@ -249,7 +249,7 @@ public class OrdiniAcquistoExportServices {
|
||||
query = UtilityDB.addwhereCond(query, whereCond, false);
|
||||
HashMap<String, Object> datiOrd = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
|
||||
if (datiOrd == null || datiOrd.size() == 0 )
|
||||
if (datiOrd == null || datiOrd.size() == 0)
|
||||
throw new Exception("Ordine non trovato");
|
||||
|
||||
String codMdep = UtilityHashMap.getValueIfExists(datiOrd, "cod_mdep");
|
||||
@@ -316,14 +316,14 @@ public class OrdiniAcquistoExportServices {
|
||||
|
||||
query = "SELECT IsNull(cod_art_for, bar_code) as cod_art_for, "
|
||||
+ " dtb_ordr.qta_ord / dtb_ordr.qta_cnf as qta_ord, "
|
||||
+ " Datepart(year,dtb_ordr.data_ord) as 'anno_ord', "
|
||||
+ " Datepart(year,dtb_ordr.data_ord) as 'anno_ord', "
|
||||
+ " dtb_ordr.num_ord, "
|
||||
+ " dtb_ordr.riga_ord "
|
||||
+ " FROM dtb_ordt, "
|
||||
+ " dtb_ordr left outer join mtb_aart on dtb_ordr.cod_mart = mtb_aart.cod_mart "
|
||||
+ " WHERE dtb_ordt.gestione = dtb_ordr.gestione AND "
|
||||
+ " dtb_ordt.data_ord = dtb_ordr.data_ord AND "
|
||||
+ " dtb_ordt.num_ord = dtb_ordr.num_ord ";
|
||||
+ " dtb_ordr.riga_ord "
|
||||
+ " FROM dtb_ordt, "
|
||||
+ " dtb_ordr left outer join mtb_aart on dtb_ordr.cod_mart = mtb_aart.cod_mart "
|
||||
+ " WHERE dtb_ordt.gestione = dtb_ordr.gestione AND "
|
||||
+ " dtb_ordt.data_ord = dtb_ordr.data_ord AND "
|
||||
+ " dtb_ordt.num_ord = dtb_ordr.num_ord ";
|
||||
|
||||
query = UtilityDB.addwhereCond(query, whereCond, true);
|
||||
|
||||
@@ -331,7 +331,7 @@ public class OrdiniAcquistoExportServices {
|
||||
List<HashMap<String, Object>> righeOrdine = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
StringBuilder fileString = new StringBuilder();
|
||||
Integer countRigheOrd = righeOrdine.size();
|
||||
for(HashMap<String, Object> riga: righeOrdine ) {
|
||||
for (HashMap<String, Object> riga : righeOrdine) {
|
||||
String codArtForn = UtilityHashMap.getValueIfExists(riga, "cod_art_for");
|
||||
BigDecimal qtaOrd = UtilityHashMap.getValueIfExists(riga, "qta_ord");
|
||||
qtaOrd = IntegerUtility.round(qtaOrd.multiply(new BigDecimal(1000)), 2);
|
||||
@@ -340,7 +340,7 @@ public class OrdiniAcquistoExportServices {
|
||||
Integer numOrd = UtilityHashMap.getValueIfExists(riga, "num_ord");
|
||||
Integer rigaOrd = UtilityHashMap.getValueIfExists(riga, "riga_ord");
|
||||
String rifOrd = String.format("%0" + 6 + "d", numOrd);
|
||||
if ( rifOrd.length() > 6)
|
||||
if (rifOrd.length() > 6)
|
||||
rifOrd = UtilityString.right(rifOrd, 6);
|
||||
rifOrd = rifOrd.substring(0, 2) + "-" + rifOrd.substring(2, 6);
|
||||
|
||||
@@ -355,14 +355,14 @@ public class OrdiniAcquistoExportServices {
|
||||
+ UtilityString.FillString(rifOrd, ' ', 7, "R")
|
||||
+ UtilityString.FillString(String.valueOf(rigaOrd), '0', 5, "L");
|
||||
|
||||
stringFile = stringFile + "\r ";
|
||||
stringFile = stringFile + CommonConstants.A_CAPO;
|
||||
fileString.append(stringFile);
|
||||
}
|
||||
Integer countRowFile = (fileString.toString()).split(CommonConstants.A_CAPO).length;
|
||||
if (countRowFile.compareTo(countRigheOrd) != 0)
|
||||
throw new Exception(
|
||||
String.format(
|
||||
"Errore nella creazione del file elaborate %s su %s",
|
||||
"Errore nella creazione del file elaborate %s su %s",
|
||||
countRowFile, countRigheOrd));
|
||||
//Salvare il file
|
||||
File fileTmp = new File(fileNameTmp);
|
||||
@@ -542,7 +542,7 @@ public class OrdiniAcquistoExportServices {
|
||||
return entityExportResponse;
|
||||
}
|
||||
|
||||
public EntityExportResponse exportOrdiniSlim2K(String type, String format) throws Exception{
|
||||
public EntityExportResponse exportOrdiniSlim2K(String type, String format) throws Exception {
|
||||
EntityExportResponse<List<File>> entityExportResponse = new EntityExportResponse<List<File>>();
|
||||
|
||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||
|
||||
Reference in New Issue
Block a user