Patch level : 12.0 966
Files correlati : f90.exe fpmenu.men d181.des f181.dir f181.trr all-masks f90104.sql Commento : - Implementata copia file cartacei nel percorso della WebApp costruito secondo documentazione. - Eliminazione cartella pacchetto dalla cartella WebApp nel caso di eliminazione di un pacchetto provvisorio o in errore. - Aggiunto controllo di associazione file ad annesso, nel caso quel tipo di annesso ci fosse gia' un file associato.
This commit is contained in:
parent
1bcaf8c75c
commit
337e7d9438
@ -1,10 +1,14 @@
|
||||
#include <experimental/filesystem>
|
||||
|
||||
#include "f90.h"
|
||||
#include "f90100.h"
|
||||
|
||||
#include "lffiles.h"
|
||||
#include "isam.h"
|
||||
#include "../f1/f1lib.h"
|
||||
#include "../fp/fplib.h"
|
||||
#include "urldefid.h"
|
||||
#include "progind.h"
|
||||
#include "f90100.h"
|
||||
#include "f901tab.h"
|
||||
#include "f90100b.h"
|
||||
#include "f90100d.h"
|
||||
@ -392,8 +396,15 @@ void TMonitor_mask::controllo_errori() const
|
||||
warning_box("Selezionare un'estrazione.");
|
||||
}
|
||||
|
||||
void TMonitor_mask::delete_estr_fld(const TString& idestr)
|
||||
{
|
||||
static const TFilename dir = TString() << F9CONF.get_addr_doc() << SLASH << F9CONF.get_ambiente() << SLASH << idestr << SLASH;
|
||||
unsigned long long i = experimental::filesystem::remove_all((const char*)dir);
|
||||
}
|
||||
|
||||
void TMonitor_mask::delete_pack(const bool all) const
|
||||
{
|
||||
// Se nello sheet non c'e' selezionata alcuna riga viene richiamata col flag all = true
|
||||
bool flag = false;
|
||||
TSheet_field& sf = sfield(S_ELAB);
|
||||
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||
@ -437,6 +448,7 @@ void TMonitor_mask::delete_pack(const bool all) const
|
||||
return;
|
||||
}
|
||||
fp_db().sq_commit();
|
||||
delete_estr_fld(id_estr);
|
||||
if (!all)
|
||||
break;
|
||||
}
|
||||
|
@ -147,6 +147,7 @@ class TMonitor_mask : public TAutomask
|
||||
|
||||
// Controllo estr. mask
|
||||
void controllo_errori() const;
|
||||
static void delete_estr_fld(const TString& idestr);
|
||||
void delete_pack(bool all = false) const;
|
||||
|
||||
// Riempie sheet per visualizzare le estrazioni
|
||||
|
@ -222,9 +222,9 @@ void TF9_categorie_doc_msk::new_annesso(const TString& catdoc_padre)
|
||||
TCategorie_doc::annesso ann;
|
||||
if (!_categorie_doc.get_ann(catann, ann))
|
||||
{
|
||||
const TString& descr = new_ann.get(102);
|
||||
const TString& tipo = new_ann.get(103);
|
||||
const bool obblig = new_ann.get_bool(104);
|
||||
const TString& descr = new_ann.get(102);
|
||||
const TString& tipo = new_ann.get(103);
|
||||
const bool obblig = new_ann.get_bool(104);
|
||||
correct_spell_catdoc(catann);
|
||||
_categorie_doc.add_annesso(catdoc_padre, catann, descr, tipo, obblig);
|
||||
fill_annessi(catdoc_padre);
|
||||
|
@ -646,6 +646,22 @@ bool TGestione_doc_cartacei_f9_msk::load_file(const TFilename& file, const TStri
|
||||
}
|
||||
else
|
||||
{
|
||||
// Controllo che non sto gia' utilizzando questa categoria di annesso per questa registrazione
|
||||
// Prendo la lista degli annessi per questa registrazione e li controllo in cerca della categoria
|
||||
TF9_doccart doccart;
|
||||
vector<annesso_t> list_annessi;
|
||||
doccart.mov2listann_vect(numreg, list_annessi);
|
||||
bool exist = false;
|
||||
for(auto it = list_annessi.begin(); it != list_annessi.end(); ++it)
|
||||
{
|
||||
if(it->catdocann == catdocann)
|
||||
exist = true;
|
||||
}
|
||||
if(exist)
|
||||
{
|
||||
message_box("Attenzione: la registrazione num. %s ha gia' un annesso associato con questo tipo di annesso.", (const char*)numreg);
|
||||
return false;
|
||||
}
|
||||
f9annessi.zero();
|
||||
f9annessi.put(F9A_NUMREG, numreg);
|
||||
f9annessi.put(F9A_FILENAME, file.name());
|
||||
@ -765,7 +781,10 @@ void TGestione_doc_cartacei_f9_msk::open_import_win()
|
||||
if (!is_annesso || catannpadre.full() && catdocann.full())
|
||||
{
|
||||
if (load_file(f, numreg, is_annesso, catannpadre, catdocann))
|
||||
{
|
||||
message_box("File caricato.");
|
||||
fill();
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box("Se il documento e' un annesso, si prega di inserire le\ninformazioni per la categoria documentale dell'annesso.");
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <Windows.h>
|
||||
|
||||
#include "f9lib01.h"
|
||||
|
||||
#include "f1lib.h"
|
||||
@ -163,7 +165,37 @@ bool TEstrazione::check_periodo_def() const
|
||||
|
||||
void TEstrazione::copy_file_to_webapp_fld(const movimento_t& movimento) const
|
||||
{
|
||||
// todo:
|
||||
// f9pwa + ambiente + idlancio(ID drd) + categoria_documento(drt) + nome_documento
|
||||
static const TFilename base = TString() << _head.addr_cart << SLASH << _head.cod_soc << SLASH << _head.id_estr << SLASH;
|
||||
TToken_string categorie;
|
||||
TToken_string files;
|
||||
|
||||
if(movimento.cartaceo && movimento.catdoc != nullptr)
|
||||
{
|
||||
categorie.add(movimento.catdoc->catdoc, 0);
|
||||
files.add(movimento.nomefilecart, 0);
|
||||
}
|
||||
if(!movimento.annessi.empty())
|
||||
{
|
||||
for (auto it = movimento.annessi.begin(); it != movimento.annessi.end(); ++it)
|
||||
{
|
||||
categorie.add(it->catdocann);
|
||||
files.add(TF9_doccart::get_full_path_file_cartaceo(it->filename));
|
||||
}
|
||||
}
|
||||
#ifdef DBG
|
||||
CHECK(files.items() == categorie.items(), "Numero di file diverso dal numero di categorie");
|
||||
#endif
|
||||
|
||||
for(int i = 0; i < files.items(); ++i)
|
||||
{
|
||||
TFilename file = files.get(i);
|
||||
TFilename dest; dest << base << categorie.get(i) << SLASH << file.name();
|
||||
make_dir(dest.path());
|
||||
const bool f = CopyFile(file, dest, false);
|
||||
if (!f)
|
||||
error_box("Errore nel copiare il file nella cartella di destinazione: %s", (const char*)dest);
|
||||
}
|
||||
}
|
||||
|
||||
void TEstrazione::fill_id(TLocalisamfile& clifo, TString& statopaiv, TString& idfisc, TString& paiv, TString& codfis)
|
||||
@ -481,6 +513,7 @@ const char* TEstrazione::diagnostica_mov()
|
||||
if (mov_i.catdoc)
|
||||
check_annessi(mov_i, numreg);
|
||||
}
|
||||
|
||||
if (mov_i.estratto)
|
||||
{
|
||||
if (mov_i.cartaceo)
|
||||
@ -491,7 +524,6 @@ const char* TEstrazione::diagnostica_mov()
|
||||
if (filecart.mov2doc(reg, file) && file.exist())
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -501,6 +533,7 @@ const char* TEstrazione::diagnostica_mov()
|
||||
mov_i.descr_estr = movimento_t::no_filecart;
|
||||
}
|
||||
}
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
}
|
||||
ok &= mov_i.err;
|
||||
@ -588,23 +621,26 @@ const char* TEstrazione::diagnostica_mov()
|
||||
++_stats.fv_estr;
|
||||
}
|
||||
|
||||
if (mov_i.estratto && mov_i.cartaceo)
|
||||
if (mov_i.estratto)
|
||||
{
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << it->numreg;
|
||||
if (filecart.mov2doc(reg, file) && file.exist())
|
||||
if(mov_i.cartaceo)
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
else
|
||||
{
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Non e' stato possibile reperire il file del documento cartaceo per questo movimento.";
|
||||
mov_i.descr_estr = movimento_t::no_filecart;
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << it->numreg;
|
||||
if (filecart.mov2doc(reg, file) && file.exist())
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
}
|
||||
else
|
||||
{
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Non e' stato possibile reperire il file del documento cartaceo per questo movimento.";
|
||||
mov_i.descr_estr = movimento_t::no_filecart;
|
||||
}
|
||||
}
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
}
|
||||
ok &= !mov_i.err;
|
||||
@ -1192,8 +1228,8 @@ std::map<TString, TCategorie_doc::annesso>::iterator TCategorie_doc::find_anness
|
||||
void TCategorie_doc::add_annesso(const TString& catdoc_padre, const TString& catdoc_ann, const TString& descr,
|
||||
const TString& class_ann, const bool obblig)
|
||||
{
|
||||
CHECK(catdoc_padre && *catdoc_padre && catdoc_ann && *catdoc_ann && class_ann && *class_ann,
|
||||
"add_annesso failed: some parameters are NULL or keys are empty");
|
||||
if(!(catdoc_padre && *catdoc_padre && catdoc_ann && *catdoc_ann && class_ann && *class_ann))
|
||||
fatal_box("add_annesso failed: some parameters are NULL or keys are empty");
|
||||
annesso ann{ catdoc_padre, catdoc_ann, descr, class_ann, obblig };
|
||||
_rows_annessi.insert({ catdoc_padre, ann });
|
||||
|
||||
@ -1203,10 +1239,8 @@ void TCategorie_doc::add_annesso(const TString& catdoc_padre, const TString& cat
|
||||
void TCategorie_doc::add_categoria(const TString& catdoc, const TString& descr, const TString& class_sost, const TString& caus_sost,
|
||||
const TString& causcont, const TString& tipocaus)
|
||||
{
|
||||
#ifdef DBG
|
||||
CHECK(catdoc && *catdoc && class_sost && *class_sost && caus_sost && *caus_sost,
|
||||
"add_categoria failed: some parameters are NULL or keys are empty");
|
||||
#endif
|
||||
if(!(catdoc && *catdoc && class_sost && *class_sost && caus_sost && *caus_sost))
|
||||
fatal_box("add_categoria failed: some parameters are NULL or keys are empty");
|
||||
classe_doc cd = { catdoc, descr, class_sost, caus_sost, causcont, tipocaus };
|
||||
_rows.emplace_back(std::make_shared<classe_doc>(cd));
|
||||
save_cat();
|
||||
|
Loading…
x
Reference in New Issue
Block a user