Commit 44a6e3b0 authored by Karel Slaný's avatar Karel Slaný Committed by Martin Straka

Updated Gov::SrvcMvRtVt.

parent 00662362
......@@ -39,12 +39,12 @@ static const char xml_template[] =
" <d:duvod/>""\n"
" <d:osobaRC/>""\n"
" <d:cisloRP_prevod/>""\n"
" <d:prijmeni>__repl__SURNAME__</d:prijmeni>""\n"
" <d:prijmeni>__repl_SURNAME__</d:prijmeni>""\n"
" <d:jmeno>__repl_NAME__</d:jmeno>""\n"
" <d:rodnePrijmeni/>""\n"
" <d:datumNarozeni>__repl__BIRTH_DATE__</d:datumNarozeni>""\n"
" <d:datumNarozeni>__repl_BIRTH_DATE__</d:datumNarozeni>""\n"
" <d:datumNarozeni_prevod/>""\n"
" <d:cisloRP>__repl__DRIVE_LICENSE_ID__</d:cisloRP>""\n"
" <d:cisloRP>__repl_DRIVE_LICENSE_ID__</d:cisloRP>""\n"
" <d:vystup>PDF</d:vystup>""\n"
" </d:zadost>""\n"
" </d:crrVypisBody>""\n"
......@@ -149,8 +149,8 @@ QByteArray Gov::SrvcMvCrrVbh::binaryXmlContent(
{
QString xml(xml_template);
xml.replace("__repl_NAME__", dbOwnerInfo.personName().firstName());
xml.replace("__repl__SURNAME__", dbOwnerInfo.personName().lastName());
xml.replace("__repl__BIRTH_DATE__", dbOwnerInfo.birthInfo().date().toString("yyyy-MM-dd"));
xml.replace("__repl__DRIVE_LICENSE_ID__", m_drivingLicenceId);
xml.replace("__repl_SURNAME__", dbOwnerInfo.personName().lastName());
xml.replace("__repl_BIRTH_DATE__", dbOwnerInfo.birthInfo().date().toString("yyyy-MM-dd"));
xml.replace("__repl_DRIVE_LICENSE_ID__", m_drivingLicenceId);
return xml.toUtf8();
}
......@@ -23,37 +23,135 @@
#include "src/datovka_shared/gov_services/service/gov_mv_rt_vt.h"
#define SRVC_SHORT_NAME "GovMvRtVt"
#define SRVC_FULL_NAME "Výpis z Rejstříku trestů"
#define SRVC_ANNOTATION "CzechPOINT@home - Žádost o výpis z Rejstříku trestů"
#define SRVC_IDENTIFICATION "CzechPOINT@home - 262"
#define SRVC_XML_TEMPLATE "<?xml version='1.0' encoding='utf-8'?><d:root xmlns:d=\"http://software602.cz/sample\" xmlns:date=\"http://exslt.org/dates-and-times\" xmlns:rs=\"http://portal.gov.cz/rejstriky/ISRS/1.2/\" ancestor_id=\"\" folder_id=\"\" formdata_id=\"\" fsuser_id=\"\" institute_type=\"\" ldapPass=\"\" nazev=\"\" page=\"0\" page_id=\"\" query_seq=\"1\" register=\"262\" retry=\"0\" seq=\"\" templateVersion_id=\"\" url=\"\" url_release=\"\" user_name=\"\" version=\"1.4o\" xml:lang=\"cs\"><d:gw_sn/><d:gw_form_name/><d:stav_form/><d:stav_rizeni><d:vydano>0</d:vydano></d:stav_rizeni><d:requestZadostVM><zvm:czechPointUrl xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\"/><zvm:vydejniMisto xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\"/><zvm:X509CertificateVM xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\" KeyName=\"\"/><zvm:zadostVM xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\" identZadost=\"\" vystupDokument=\"V\"><zvm:ucel zkratka=\"BEZUH\"/><zvm:mail/><zvm:osoba rozlisovatJmPr=\"true\"><com:jmeno xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\">xNAME</com:jmeno><com:prijmeniRodne xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\"/><com:prijmeniNynejsi xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\">xSURNAME</com:prijmeniNynejsi><com:datumNarozeni xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\"><com:den>xBIRTH_DATE_DAY</com:den><com:mesic>xBIRTH_DATE_MONTH</com:mesic><com:rok>xBIRTH_DATE_YEAR</com:rok></com:datumNarozeni><com:pohlavi xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\" zkratka=\"\"/><com:rodneCislo xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\"/><com:mistoNarozeni xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\"><com:stat zkratka=\"\">CZ</com:stat><com:okres>xREGION</com:okres><com:obec>xCITY</com:obec></com:mistoNarozeni><zvm:statniPrislusnost zkratka=\"\"/><zvm:bydlisteStPrislusnostMin zkratka=\"\"/></zvm:osoba></zvm:zadostVM></d:requestZadostVM></d:root>"
static const char xml_template[] =
"<?xml version='1.0' encoding='utf-8'?>"
"<d:root xmlns:d=\"http://software602.cz/sample\" "
"xmlns:date=\"http://exslt.org/dates-and-times\" "
"xmlns:rs=\"http://portal.gov.cz/rejstriky/ISRS/1.2/\" ancestor_id=\"\" "
"folder_id=\"\" formdata_id=\"\" fsuser_id=\"\" institute_type=\"\" "
"ldapPass=\"\" nazev=\"\" page=\"0\" page_id=\"\" query_seq=\"1\" "
"register=\"262\" retry=\"0\" seq=\"\" templateVersion_id=\"\" url=\"\" "
"url_release=\"\" user_name=\"\" version=\"1.4o\" xml:lang=\"cs\">""\n"
" <d:gw_sn/>""\n"
" <d:gw_form_name/>""\n"
" <d:stav_form/>""\n"
" <d:stav_rizeni>""\n"
" <d:vydano>0</d:vydano>""\n"
" </d:stav_rizeni>""\n"
" <d:requestZadostVM>""\n"
" <zvm:czechPointUrl xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\"/>""\n"
" <zvm:vydejniMisto xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\"/>""\n"
" <zvm:X509CertificateVM xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\" KeyName=\"\"/>""\n"
" <zvm:zadostVM xmlns:zvm=\"http://fo.rt.cleverlance.com/zadostVM_2.0\" identZadost=\"\" vystupDokument=\"V\">""\n"
" <zvm:ucel zkratka=\"BEZUH\"/>""\n"
" <zvm:mail/>""\n"
" <zvm:osoba rozlisovatJmPr=\"true\">""\n"
" <com:jmeno xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\">__repl_NAME__</com:jmeno>""\n"
" <com:prijmeniRodne xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\"/>""\n"
" <com:prijmeniNynejsi xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\">__repl_SURNAME__</com:prijmeniNynejsi>""\n"
" <com:datumNarozeni xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\">""\n"
" <com:den>__repl_BIRTH_DATE_DAY__</com:den>""\n"
" <com:mesic>__repl_BIRTH_DATE_MONTH__</com:mesic>""\n"
" <com:rok>__repl_BIRTH_DATE_YEAR__</com:rok>""\n"
" </com:datumNarozeni>""\n"
" <com:pohlavi xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\" zkratka=\"\"/>""\n"
" <com:rodneCislo xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\"/>""\n"
" <com:mistoNarozeni xmlns:com=\"http://fo.rt.cleverlance.com/commons_2.0\">""\n"
" <com:stat zkratka=\"\">CZ</com:stat>""\n"
" <com:okres>__repl_REGION__</com:okres>""\n"
" <com:obec>__repl_CITY__</com:obec>""\n"
" </com:mistoNarozeni>""\n"
" <zvm:statniPrislusnost zkratka=\"\"/>""\n"
" <zvm:bydlisteStPrislusnostMin zkratka=\"\"/>""\n"
" </zvm:osoba>""\n"
" </zvm:zadostVM>""\n"
" </d:requestZadostVM>""\n"
"</d:root>";
GovMvRtVt::GovMvRtVt(void)
: GovService(QStringLiteral(SRVC_SHORT_NAME),
QStringLiteral(SRVC_FULL_NAME), QStringLiteral(GOV_MV_FULL_NAME),
QStringLiteral(GOV_MV_DB_ID), QStringLiteral(SRVC_ANNOTATION),
QStringLiteral(SRVC_IDENTIFICATION), QStringLiteral(GOV_MV_XML_FILE_NAME),
QString())
Gov::SrvcMvRtVt::SrvcMvRtVt(void)
{
}
GovMvRtVt::~GovMvRtVt(void)
const QString &Gov::SrvcMvRtVt::internalId(void) const
{
static const QString shortName("SrvcMvRtVt");
return shortName;
}
const QByteArray GovMvRtVt::createXmlAttachment(
const Isds::DbOwnerInfo &dbOwnerInfo, XmlRequiredFileds reqFields)
const QString &Gov::SrvcMvRtVt::fullName(void) const
{
Q_UNUSED(reqFields);
static const QString fullName(tr("Printout from the criminal records"));
// Výpis z Rejstříku trestů
return fullName;
}
const QString &Gov::SrvcMvRtVt::instituteName(void) const
{
static const QString instituteName(GOV_MV_FULL_NAME);
return instituteName;
}
const QString &Gov::SrvcMvRtVt::boxId(void) const
{
static const QString boxId(GOV_MV_DB_ID);
return boxId;
}
const QString &Gov::SrvcMvRtVt::dmAnnotation(void) const
{
static const QString dmAnnotation("CzechPOINT@home - Žádost o výpis z Rejstříku trestů");
return dmAnnotation;
}
const QString &Gov::SrvcMvRtVt::dmSenderIdent(void) const
{
static const QString dmSenderIdent("CzechPOINT@home - 262");
return dmSenderIdent;
}
const QString &Gov::SrvcMvRtVt::dmFileDescr(void) const
{
static const QString dmFileDescr(GOV_MV_XML_FILE_NAME);
return dmFileDescr;
}
bool Gov::SrvcMvRtVt::canSend(enum Isds::Type::DbType dbType) const
{
/* TODO -- Check all required types. */
return (dbType == Isds::Type::BT_FO);
}
QString xml(QStringLiteral(SRVC_XML_TEMPLATE));
xml.replace("xNAME", dbOwnerInfo.personName().firstName());
xml.replace("xSURNAME", dbOwnerInfo.personName().lastName());
xml.replace("xBIRTH_DATE_DAY", dbOwnerInfo.birthInfo().date().toString("d"));
xml.replace("xBIRTH_DATE_MONTH", dbOwnerInfo.birthInfo().date().toString("M"));
xml.replace("xBIRTH_DATE_YEAR", dbOwnerInfo.birthInfo().date().toString("yyyy"));
xml.replace("xREGION", dbOwnerInfo.birthInfo().county());
xml.replace("xCITY", dbOwnerInfo.birthInfo().city());
QList<Gov::RequiredInput> Gov::SrvcMvRtVt::requiredFields(void) const
{
/* No fields required. */
return QList<RequiredInput>();
}
bool Gov::SrvcMvRtVt::setRequiredField(const QString &key, const QString &val)
{
Q_UNUSED(key);
Q_UNUSED(val);
/* No fields required. */
return false;
}
bool Gov::SrvcMvRtVt::haveAllMandatoryFields(void) const
{
/* No fields required. */
return true;
}
QByteArray Gov::SrvcMvRtVt::binaryXmlContent(
const Isds::DbOwnerInfo &dbOwnerInfo) const
{
QString xml(xml_template);
xml.replace("__repl_NAME__", dbOwnerInfo.personName().firstName());
xml.replace("__repl_SURNAME__", dbOwnerInfo.personName().lastName());
xml.replace("__repl_BIRTH_DATE_DAY__", dbOwnerInfo.birthInfo().date().toString("d"));
xml.replace("__repl_BIRTH_DATE_MONTH__", dbOwnerInfo.birthInfo().date().toString("M"));
xml.replace("__repl_BIRTH_DATE_YEAR__", dbOwnerInfo.birthInfo().date().toString("yyyy"));
xml.replace("__repl_REGION__", dbOwnerInfo.birthInfo().county());
xml.replace("__repl_CITY__", dbOwnerInfo.birthInfo().city());
return xml.toUtf8();
}
......@@ -23,39 +23,63 @@
#pragma once
#include "src/datovka_shared/gov_services/service/gov_service.h"
#include <QCoreApplication> /* Q_DECLARE_TR_FUNCTIONS */
/*!
* GOV MV service
* Name: Žádost o výpis z Rejstříku trestů
* DS: xhzkdqv - Automat CzP (Ministerstvo vnitra)
* XML: czpathome.xml - nutno doplnit Jméno, Příjmení, Datum narození
* (YYYY-MM-DD), Stát, Okres, Město.
* Source DS type: FO
*/
class GovMvRtVt : public GovService {
#include "src/datovka_shared/gov_services/service/gov_service.h"
public:
namespace Gov {
/*!
* @brief Constructor.
*/
GovMvRtVt(void);
* GOV MV service
* Name: Žádost o výpis z Rejstříku trestů
* DS: xhzkdqv - Automat CzP (Ministerstvo vnitra)
* XML: czpathome.xml - nutno doplnit Jméno, Příjmení, Datum narození
* (YYYY-MM-DD), Stát, Okres, Město.
* Source DS type: FO
*/
class SrvcMvRtVt : public Service {
Q_DECLARE_TR_FUNCTIONS(SrvcMvCrrVbh)
public:
/*!
* @brief Constructor.
*/
SrvcMvRtVt(void);
/*!
* @brief Destructor.
*/
virtual
~GovMvRtVt(void) Q_DECL_OVERRIDE;
virtual
const QString &internalId(void) const Q_DECL_OVERRIDE;
/*!
* @brief Create and fill XML attachment content.
*
* @param[in] dbOwnerInfo DS owner info.
* @param[in] reqFields Gov service required information.
* @return XML string for attachment.
*/
virtual
const QByteArray createXmlAttachment(const Isds::DbOwnerInfo &dbOwnerInfo,
XmlRequiredFileds reqFields) Q_DECL_OVERRIDE;
};
virtual
const QString &fullName(void) const Q_DECL_OVERRIDE;
virtual
const QString &instituteName(void) const Q_DECL_OVERRIDE;
virtual
const QString &boxId(void) const Q_DECL_OVERRIDE;
virtual
const QString &dmAnnotation(void) const Q_DECL_OVERRIDE;
virtual
const QString &dmSenderIdent(void) const Q_DECL_OVERRIDE;
virtual
const QString &dmFileDescr(void) const Q_DECL_OVERRIDE;
virtual
bool canSend(enum Isds::Type::DbType dbType) const Q_DECL_OVERRIDE;
virtual
QList<RequiredInput> requiredFields(void) const Q_DECL_OVERRIDE;
virtual
bool setRequiredField(const QString &key, const QString &val) Q_DECL_OVERRIDE;
virtual
bool haveAllMandatoryFields(void) const Q_DECL_OVERRIDE;
virtual
QByteArray binaryXmlContent(const Isds::DbOwnerInfo &dbOwnerInfo) const Q_DECL_OVERRIDE;
};
}
......@@ -24,16 +24,16 @@
#include "src/datovka_shared/gov_services/model/gov_form_list_model.h"
#include "src/datovka_shared/gov_services/model/gov_service_list_model.h"
#include "src/datovka_shared/gov_services/service/gov_mv_crr_vbh.h"
#include "src/datovka_shared/gov_services/service/gov_mv_ir_vp.h"
//#include "src/datovka_shared/gov_services/service/gov_mv_ir_vp.h"
#include "src/datovka_shared/gov_services/service/gov_mv_rt_vt.h"
#include "src/datovka_shared/gov_services/service/gov_mv_skd_vp.h"
#include "src/datovka_shared/gov_services/service/gov_mv_vr_vp.h"
#include "src/datovka_shared/gov_services/service/gov_mv_zr_vp.h"
#include "src/datovka_shared/gov_services/service/gov_mv_rtpo_vt.h"
//#include "src/datovka_shared/gov_services/service/gov_mv_skd_vp.h"
//#include "src/datovka_shared/gov_services/service/gov_mv_vr_vp.h"
//#include "src/datovka_shared/gov_services/service/gov_mv_zr_vp.h"
//#include "src/datovka_shared/gov_services/service/gov_mv_rtpo_vt.h"
#include "src/datovka_shared/gov_services/service/gov_service.h"
#include "src/datovka_shared/gov_services/service/gov_szr_rob_vu.h"
#include "src/datovka_shared/gov_services/service/gov_szr_rob_vvu.h"
#include "src/datovka_shared/gov_services/service/gov_szr_ros_vv.h"
//#include "src/datovka_shared/gov_services/service/gov_szr_rob_vu.h"
//#include "src/datovka_shared/gov_services/service/gov_szr_rob_vvu.h"
//#include "src/datovka_shared/gov_services/service/gov_szr_ros_vv.h"
#include "src/datovka_shared/isds/message_interface.h"
#include "src/datovka_shared/log/log.h"
#include "src/datovka_shared/log/memory_log.h"
......@@ -68,24 +68,26 @@ void GovWrapper::initGovServices(void)
m_govServices.clear();
/* Výpis z Registru obyvatel */
GovSzrRobVu *gs1 = new GovSzrRobVu();
m_govServices.insert(gs1->serviceId(), gs1);
Gov::Service *gs;
/* Výpis o využití údajů z registru obyvatel */
GovSzrRobVvu *gs2 = new GovSzrRobVvu();
m_govServices.insert(gs2->serviceId(), gs2);
// /* Výpis z Registru obyvatel */
// GovSzrRobVu *gs1 = new GovSzrRobVu();
// m_govServices.insert(gs1->serviceId(), gs1);
/* Veřejný výpis z registru osob */
GovSzrRosVv *gs3 = new GovSzrRosVv();
m_govServices.insert(gs3->serviceId(), gs3);
// /* Výpis o využití údajů z registru obyvatel */
// GovSzrRobVvu *gs2 = new GovSzrRobVvu();
// m_govServices.insert(gs2->serviceId(), gs2);
// /* Veřejný výpis z registru osob */
// GovSzrRosVv *gs3 = new GovSzrRosVv();
// m_govServices.insert(gs3->serviceId(), gs3);
/* Výpis bodového hodnocení z Centrálního registru řidičů */
Gov::Service *gs4 = new (std::nothrow) Gov::SrvcMvCrrVbh;
if (gs4 != Q_NULLPTR) {
const QString &key(gs4->internalId());
gs = new (std::nothrow) Gov::SrvcMvCrrVbh;
if (gs != Q_NULLPTR) {
const QString &key(gs->internalId());
if (!m_govServices.contains(key)) {
m_govServices.insert(key, gs4);
m_govServices.insert(key, gs);
} else {
logError(
"Key '%s' already exists in gov services container.",
......@@ -93,29 +95,38 @@ void GovWrapper::initGovServices(void)
}
}
/* Výpis z Rejstříku trestů právnických osob */
GovMvRtpoVt *gs5 = new GovMvRtpoVt();
m_govServices.insert(gs5->serviceId(), gs5);
// /* Výpis z Rejstříku trestů právnických osob */
// GovMvRtpoVt *gs5 = new GovMvRtpoVt();
// m_govServices.insert(gs5->serviceId(), gs5);
/* Výpis z Rejstříku trestů */
GovMvRtVt *gs6 = new GovMvRtVt();
m_govServices.insert(gs6->serviceId(), gs6);
gs = new (std::nothrow) Gov::SrvcMvRtVt;
if (gs != Q_NULLPTR) {
const QString &key(gs->internalId());
if (!m_govServices.contains(key)) {
m_govServices.insert(key, gs);
} else {
logError(
"Key '%s' already exists in gov services container.",
key.toUtf8().constData());
}
}
/* Výpis z živnostenského rejstříku */
GovMvZrVp *gs7 = new GovMvZrVp();
m_govServices.insert(gs7->serviceId(), gs7);
// /* Výpis z živnostenského rejstříku */
// GovMvZrVp *gs7 = new GovMvZrVp();
// m_govServices.insert(gs7->serviceId(), gs7);
/* Výpis z veřejného rejstříku */
GovMvVrVp *gs8 = new GovMvVrVp();
m_govServices.insert(gs8->serviceId(), gs8);
// /* Výpis z veřejného rejstříku */
// GovMvVrVp *gs8 = new GovMvVrVp();
// m_govServices.insert(gs8->serviceId(), gs8);
/* Výpis z insolvenčního rejstříku */
GovMvIrVp *gs9 = new GovMvIrVp();
m_govServices.insert(gs9->serviceId(), gs9);
// /* Výpis z insolvenčního rejstříku */
// GovMvIrVp *gs9 = new GovMvIrVp();
// m_govServices.insert(gs9->serviceId(), gs9);
/* Výpis ze seznamu kvalifikovaných dodavatelů */
GovMvSkdVp *gs10 = new GovMvSkdVp();
m_govServices.insert(gs10->serviceId(), gs10);
// /* Výpis ze seznamu kvalifikovaných dodavatelů */
// GovMvSkdVp *gs10 = new GovMvSkdVp();
// m_govServices.insert(gs10->serviceId(), gs10);
}
void GovWrapper::loadServicesToModel(const QVariant &srvcModelVariant) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment