Commit 12300416fbce80bd7fa751a4f0e77cef14152c2b

Authored by Marcus V. Cardoso do Sacramento
0 parents
Exists in master

Criação do Projeto Versão 0.3.0

Showing 376 changed files with 94788 additions and 0 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 376 files displayed.

.gitignore 0 → 100644
  1 +++ a/.gitignore
... ... @@ -0,0 +1,162 @@
  1 +### Arquivos ZIP ###
  2 +*.zip
  3 +*.7z
  4 +*.rar
  5 +
  6 +### Java ###
  7 +*.class
  8 +
  9 +# Mobile Tools for Java (J2ME)
  10 +#.mtj.tmp/
  11 +
  12 +# Package Files #
  13 +#*.jar
  14 +#*.war
  15 +#*.ear
  16 +
  17 +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
  18 +hs_err_pid*
  19 +
  20 +
  21 +### CakePHP ###
  22 +# CakePHP 3
  23 +
  24 +/vendor/*
  25 +/config/app.php
  26 +/tmp/*
  27 +/logs/*
  28 +
  29 +# CakePHP 2
  30 +
  31 +/app/tmp/*
  32 +/app/Config/core.php
  33 +/app/Config/database.php
  34 +/vendors/*
  35 +
  36 +
  37 +### Eclipse ###
  38 +*.pydevproject
  39 +.metadata
  40 +.gradle
  41 +bin/
  42 +tmp/
  43 +*.tmp
  44 +*.bak
  45 +*.swp
  46 +*~.nib
  47 +local.properties
  48 +.settings/
  49 +.loadpath
  50 +
  51 +# Eclipse Core
  52 +.project
  53 +
  54 +# External tool builders
  55 +.externalToolBuilders/
  56 +
  57 +# Locally stored "Eclipse launch configurations"
  58 +*.launch
  59 +
  60 +# CDT-specific
  61 +.cproject
  62 +
  63 +# JDT-specific (Eclipse Java Development Tools)
  64 +.classpath
  65 +
  66 +# Java annotation processor (APT)
  67 +.factorypath
  68 +
  69 +# PDT-specific
  70 +.buildpath
  71 +
  72 +# sbteclipse plugin
  73 +.target
  74 +
  75 +# TeXlipse plugin
  76 +.texlipse
  77 +
  78 +
  79 +### NetBeans ###
  80 +nbproject/private/
  81 +nbbuild/
  82 +dist/
  83 +nbdist/
  84 +nbactions.xml
  85 +nb-configuration.xml
  86 +.nb-gradle/
  87 +
  88 +
  89 +### Intellij ###
  90 +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
  91 +
  92 +*.iml
  93 +
  94 +## Directory-based project format:
  95 +.idea/
  96 +# if you remove the above rule, at least ignore the following:
  97 +
  98 +# User-specific stuff:
  99 +# .idea/workspace.xml
  100 +# .idea/tasks.xml
  101 +# .idea/dictionaries
  102 +
  103 +# Sensitive or high-churn files:
  104 +# .idea/dataSources.ids
  105 +# .idea/dataSources.xml
  106 +# .idea/sqlDataSources.xml
  107 +# .idea/dynamic.xml
  108 +# .idea/uiDesigner.xml
  109 +
  110 +# Gradle:
  111 +# .idea/gradle.xml
  112 +# .idea/libraries
  113 +
  114 +# Mongo Explorer plugin:
  115 +# .idea/mongoSettings.xml
  116 +
  117 +## File-based project format:
  118 +*.ipr
  119 +*.iws
  120 +
  121 +## Plugin-specific files:
  122 +
  123 +# IntelliJ
  124 +/out/
  125 +
  126 +# mpeltonen/sbt-idea plugin
  127 +.idea_modules/
  128 +
  129 +# JIRA plugin
  130 +atlassian-ide-plugin.xml
  131 +
  132 +# Crashlytics plugin (for Android Studio and IntelliJ)
  133 +com_crashlytics_export_strings.xml
  134 +crashlytics.properties
  135 +crashlytics-build.properties
  136 +
  137 +
  138 +### Jboss ###
  139 +jboss/server/all/deploy/project.ext
  140 +jboss/server/default/deploy/project.ext
  141 +jboss/server/minimal/deploy/project.ext
  142 +jboss/server/all/log/*.log
  143 +jboss/server/all/tmp/**/*
  144 +jboss/server/all/data/**/*
  145 +jboss/server/all/work/**/*
  146 +jboss/server/default/log/*.log
  147 +jboss/server/default/tmp/**/*
  148 +jboss/server/default/data/**/*
  149 +jboss/server/default/work/**/*
  150 +jboss/server/minimal/log/*.log
  151 +jboss/server/minimal/tmp/**/*
  152 +jboss/server/minimal/data/**/*
  153 +jboss/server/minimal/work/**/*
  154 +
  155 +# deployed package files #
  156 +
  157 +*.DEPLOYED
  158 +
  159 +
  160 +### TortoiseGit ###
  161 +# Project-level settings
  162 +/.tgitconfig
... ...
CHANGELOG.md 0 → 100644
  1 +++ a/CHANGELOG.md
... ... @@ -0,0 +1,12 @@
  1 +Este Changelog foi gerado automaticamente.
  2 +Veja https://github.com/lkdjiin/git-changelog para mais informações.
  3 +
  4 +# Versão 0.3.0
  5 +* 2016-01-19 Cadastrar Veículos
  6 +* 2016-01-19 Cadastrar usuários
  7 +* 2016-01-19 Acessar Sistema Carros MJ
  8 +* 2016-01-19 Solicitar Carro
  9 +* 2016-01-19 Melhorias da 1ª Sprint
  10 +* 2016-02-15 Distribuir e reservar carro
  11 +* 2016-02-15 Registrar Retorno do Veículo
  12 +* 2016-02-15 Conferir Solicitações
0 13 \ No newline at end of file
... ...
CONTRIBUTING.md 0 → 100644
  1 +++ a/CONTRIBUTING.md
... ... @@ -0,0 +1,30 @@
  1 +Como desenvolver para este projeto?
  2 +============
  3 +
  4 +Política de Mensagem de Commit's
  5 +-------
  6 +
  7 +Conforme definição DIPROS, as mensagens dos Commits deverão ter no mínimo 10 Caracteres ou seguir um dos padrões abaixo relacionados:
  8 +* SATI 12345 - Desenvolvimento de Demanda/Projeto
  9 +* SATI 12345,54321,123 - Desenvolvimento de Demanda/Projeto
  10 +* SATI 12345,SATI 54321,SATI 54321 - Desenvolvimento de Demanda/Projeto
  11 +* OS 1234567-2015 - Desenvolvimento de Demanda/Projeto
  12 +* Redmine 123456 - Desenvolvimento de Demanda/Projeto
  13 +* Redmine 123 - Desenvolvimento de Demanda/Projeto
  14 +* Issue #123 - Desenvolvimento de Demanda/Projeto
  15 +
  16 +Caso os commits se encontram errados corrija a última revisão ou use o commando ```git rebase -i```
  17 +
  18 +
  19 +Licença de Software
  20 +------
  21 +
  22 +Este programa é um software livre; você pode redistribuí-lo e/ou
  23 +modificá-lo dentro dos termos da Licença Pública Geral GNU como
  24 +publicada pela Fundação do Software Livre (FSF); na versão 3 da
  25 +Licença, ou (na sua opinião) qualquer versão.
  26 +
  27 +Este programa é distribuído na esperança de que possa ser útil,
  28 +mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
  29 +a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
  30 +Licença Pública Geral GNU para maiores detalhes, [localizada neste repositório](LICENSE).
0 31 \ No newline at end of file
... ...
LICENSE 0 → 100644
  1 +++ a/LICENSE
... ... @@ -0,0 +1,674 @@
  1 + GNU GENERAL PUBLIC LICENSE
  2 + Version 3, 29 June 2007
  3 +
  4 + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  5 + Everyone is permitted to copy and distribute verbatim copies
  6 + of this license document, but changing it is not allowed.
  7 +
  8 + Preamble
  9 +
  10 + The GNU General Public License is a free, copyleft license for
  11 +software and other kinds of works.
  12 +
  13 + The licenses for most software and other practical works are designed
  14 +to take away your freedom to share and change the works. By contrast,
  15 +the GNU General Public License is intended to guarantee your freedom to
  16 +share and change all versions of a program--to make sure it remains free
  17 +software for all its users. We, the Free Software Foundation, use the
  18 +GNU General Public License for most of our software; it applies also to
  19 +any other work released this way by its authors. You can apply it to
  20 +your programs, too.
  21 +
  22 + When we speak of free software, we are referring to freedom, not
  23 +price. Our General Public Licenses are designed to make sure that you
  24 +have the freedom to distribute copies of free software (and charge for
  25 +them if you wish), that you receive source code or can get it if you
  26 +want it, that you can change the software or use pieces of it in new
  27 +free programs, and that you know you can do these things.
  28 +
  29 + To protect your rights, we need to prevent others from denying you
  30 +these rights or asking you to surrender the rights. Therefore, you have
  31 +certain responsibilities if you distribute copies of the software, or if
  32 +you modify it: responsibilities to respect the freedom of others.
  33 +
  34 + For example, if you distribute copies of such a program, whether
  35 +gratis or for a fee, you must pass on to the recipients the same
  36 +freedoms that you received. You must make sure that they, too, receive
  37 +or can get the source code. And you must show them these terms so they
  38 +know their rights.
  39 +
  40 + Developers that use the GNU GPL protect your rights with two steps:
  41 +(1) assert copyright on the software, and (2) offer you this License
  42 +giving you legal permission to copy, distribute and/or modify it.
  43 +
  44 + For the developers' and authors' protection, the GPL clearly explains
  45 +that there is no warranty for this free software. For both users' and
  46 +authors' sake, the GPL requires that modified versions be marked as
  47 +changed, so that their problems will not be attributed erroneously to
  48 +authors of previous versions.
  49 +
  50 + Some devices are designed to deny users access to install or run
  51 +modified versions of the software inside them, although the manufacturer
  52 +can do so. This is fundamentally incompatible with the aim of
  53 +protecting users' freedom to change the software. The systematic
  54 +pattern of such abuse occurs in the area of products for individuals to
  55 +use, which is precisely where it is most unacceptable. Therefore, we
  56 +have designed this version of the GPL to prohibit the practice for those
  57 +products. If such problems arise substantially in other domains, we
  58 +stand ready to extend this provision to those domains in future versions
  59 +of the GPL, as needed to protect the freedom of users.
  60 +
  61 + Finally, every program is threatened constantly by software patents.
  62 +States should not allow patents to restrict development and use of
  63 +software on general-purpose computers, but in those that do, we wish to
  64 +avoid the special danger that patents applied to a free program could
  65 +make it effectively proprietary. To prevent this, the GPL assures that
  66 +patents cannot be used to render the program non-free.
  67 +
  68 + The precise terms and conditions for copying, distribution and
  69 +modification follow.
  70 +
  71 + TERMS AND CONDITIONS
  72 +
  73 + 0. Definitions.
  74 +
  75 + "This License" refers to version 3 of the GNU General Public License.
  76 +
  77 + "Copyright" also means copyright-like laws that apply to other kinds of
  78 +works, such as semiconductor masks.
  79 +
  80 + "The Program" refers to any copyrightable work licensed under this
  81 +License. Each licensee is addressed as "you". "Licensees" and
  82 +"recipients" may be individuals or organizations.
  83 +
  84 + To "modify" a work means to copy from or adapt all or part of the work
  85 +in a fashion requiring copyright permission, other than the making of an
  86 +exact copy. The resulting work is called a "modified version" of the
  87 +earlier work or a work "based on" the earlier work.
  88 +
  89 + A "covered work" means either the unmodified Program or a work based
  90 +on the Program.
  91 +
  92 + To "propagate" a work means to do anything with it that, without
  93 +permission, would make you directly or secondarily liable for
  94 +infringement under applicable copyright law, except executing it on a
  95 +computer or modifying a private copy. Propagation includes copying,
  96 +distribution (with or without modification), making available to the
  97 +public, and in some countries other activities as well.
  98 +
  99 + To "convey" a work means any kind of propagation that enables other
  100 +parties to make or receive copies. Mere interaction with a user through
  101 +a computer network, with no transfer of a copy, is not conveying.
  102 +
  103 + An interactive user interface displays "Appropriate Legal Notices"
  104 +to the extent that it includes a convenient and prominently visible
  105 +feature that (1) displays an appropriate copyright notice, and (2)
  106 +tells the user that there is no warranty for the work (except to the
  107 +extent that warranties are provided), that licensees may convey the
  108 +work under this License, and how to view a copy of this License. If
  109 +the interface presents a list of user commands or options, such as a
  110 +menu, a prominent item in the list meets this criterion.
  111 +
  112 + 1. Source Code.
  113 +
  114 + The "source code" for a work means the preferred form of the work
  115 +for making modifications to it. "Object code" means any non-source
  116 +form of a work.
  117 +
  118 + A "Standard Interface" means an interface that either is an official
  119 +standard defined by a recognized standards body, or, in the case of
  120 +interfaces specified for a particular programming language, one that
  121 +is widely used among developers working in that language.
  122 +
  123 + The "System Libraries" of an executable work include anything, other
  124 +than the work as a whole, that (a) is included in the normal form of
  125 +packaging a Major Component, but which is not part of that Major
  126 +Component, and (b) serves only to enable use of the work with that
  127 +Major Component, or to implement a Standard Interface for which an
  128 +implementation is available to the public in source code form. A
  129 +"Major Component", in this context, means a major essential component
  130 +(kernel, window system, and so on) of the specific operating system
  131 +(if any) on which the executable work runs, or a compiler used to
  132 +produce the work, or an object code interpreter used to run it.
  133 +
  134 + The "Corresponding Source" for a work in object code form means all
  135 +the source code needed to generate, install, and (for an executable
  136 +work) run the object code and to modify the work, including scripts to
  137 +control those activities. However, it does not include the work's
  138 +System Libraries, or general-purpose tools or generally available free
  139 +programs which are used unmodified in performing those activities but
  140 +which are not part of the work. For example, Corresponding Source
  141 +includes interface definition files associated with source files for
  142 +the work, and the source code for shared libraries and dynamically
  143 +linked subprograms that the work is specifically designed to require,
  144 +such as by intimate data communication or control flow between those
  145 +subprograms and other parts of the work.
  146 +
  147 + The Corresponding Source need not include anything that users
  148 +can regenerate automatically from other parts of the Corresponding
  149 +Source.
  150 +
  151 + The Corresponding Source for a work in source code form is that
  152 +same work.
  153 +
  154 + 2. Basic Permissions.
  155 +
  156 + All rights granted under this License are granted for the term of
  157 +copyright on the Program, and are irrevocable provided the stated
  158 +conditions are met. This License explicitly affirms your unlimited
  159 +permission to run the unmodified Program. The output from running a
  160 +covered work is covered by this License only if the output, given its
  161 +content, constitutes a covered work. This License acknowledges your
  162 +rights of fair use or other equivalent, as provided by copyright law.
  163 +
  164 + You may make, run and propagate covered works that you do not
  165 +convey, without conditions so long as your license otherwise remains
  166 +in force. You may convey covered works to others for the sole purpose
  167 +of having them make modifications exclusively for you, or provide you
  168 +with facilities for running those works, provided that you comply with
  169 +the terms of this License in conveying all material for which you do
  170 +not control copyright. Those thus making or running the covered works
  171 +for you must do so exclusively on your behalf, under your direction
  172 +and control, on terms that prohibit them from making any copies of
  173 +your copyrighted material outside their relationship with you.
  174 +
  175 + Conveying under any other circumstances is permitted solely under
  176 +the conditions stated below. Sublicensing is not allowed; section 10
  177 +makes it unnecessary.
  178 +
  179 + 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
  180 +
  181 + No covered work shall be deemed part of an effective technological
  182 +measure under any applicable law fulfilling obligations under article
  183 +11 of the WIPO copyright treaty adopted on 20 December 1996, or
  184 +similar laws prohibiting or restricting circumvention of such
  185 +measures.
  186 +
  187 + When you convey a covered work, you waive any legal power to forbid
  188 +circumvention of technological measures to the extent such circumvention
  189 +is effected by exercising rights under this License with respect to
  190 +the covered work, and you disclaim any intention to limit operation or
  191 +modification of the work as a means of enforcing, against the work's
  192 +users, your or third parties' legal rights to forbid circumvention of
  193 +technological measures.
  194 +
  195 + 4. Conveying Verbatim Copies.
  196 +
  197 + You may convey verbatim copies of the Program's source code as you
  198 +receive it, in any medium, provided that you conspicuously and
  199 +appropriately publish on each copy an appropriate copyright notice;
  200 +keep intact all notices stating that this License and any
  201 +non-permissive terms added in accord with section 7 apply to the code;
  202 +keep intact all notices of the absence of any warranty; and give all
  203 +recipients a copy of this License along with the Program.
  204 +
  205 + You may charge any price or no price for each copy that you convey,
  206 +and you may offer support or warranty protection for a fee.
  207 +
  208 + 5. Conveying Modified Source Versions.
  209 +
  210 + You may convey a work based on the Program, or the modifications to
  211 +produce it from the Program, in the form of source code under the
  212 +terms of section 4, provided that you also meet all of these conditions:
  213 +
  214 + a) The work must carry prominent notices stating that you modified
  215 + it, and giving a relevant date.
  216 +
  217 + b) The work must carry prominent notices stating that it is
  218 + released under this License and any conditions added under section
  219 + 7. This requirement modifies the requirement in section 4 to
  220 + "keep intact all notices".
  221 +
  222 + c) You must license the entire work, as a whole, under this
  223 + License to anyone who comes into possession of a copy. This
  224 + License will therefore apply, along with any applicable section 7
  225 + additional terms, to the whole of the work, and all its parts,
  226 + regardless of how they are packaged. This License gives no
  227 + permission to license the work in any other way, but it does not
  228 + invalidate such permission if you have separately received it.
  229 +
  230 + d) If the work has interactive user interfaces, each must display
  231 + Appropriate Legal Notices; however, if the Program has interactive
  232 + interfaces that do not display Appropriate Legal Notices, your
  233 + work need not make them do so.
  234 +
  235 + A compilation of a covered work with other separate and independent
  236 +works, which are not by their nature extensions of the covered work,
  237 +and which are not combined with it such as to form a larger program,
  238 +in or on a volume of a storage or distribution medium, is called an
  239 +"aggregate" if the compilation and its resulting copyright are not
  240 +used to limit the access or legal rights of the compilation's users
  241 +beyond what the individual works permit. Inclusion of a covered work
  242 +in an aggregate does not cause this License to apply to the other
  243 +parts of the aggregate.
  244 +
  245 + 6. Conveying Non-Source Forms.
  246 +
  247 + You may convey a covered work in object code form under the terms
  248 +of sections 4 and 5, provided that you also convey the
  249 +machine-readable Corresponding Source under the terms of this License,
  250 +in one of these ways:
  251 +
  252 + a) Convey the object code in, or embodied in, a physical product
  253 + (including a physical distribution medium), accompanied by the
  254 + Corresponding Source fixed on a durable physical medium
  255 + customarily used for software interchange.
  256 +
  257 + b) Convey the object code in, or embodied in, a physical product
  258 + (including a physical distribution medium), accompanied by a
  259 + written offer, valid for at least three years and valid for as
  260 + long as you offer spare parts or customer support for that product
  261 + model, to give anyone who possesses the object code either (1) a
  262 + copy of the Corresponding Source for all the software in the
  263 + product that is covered by this License, on a durable physical
  264 + medium customarily used for software interchange, for a price no
  265 + more than your reasonable cost of physically performing this
  266 + conveying of source, or (2) access to copy the
  267 + Corresponding Source from a network server at no charge.
  268 +
  269 + c) Convey individual copies of the object code with a copy of the
  270 + written offer to provide the Corresponding Source. This
  271 + alternative is allowed only occasionally and noncommercially, and
  272 + only if you received the object code with such an offer, in accord
  273 + with subsection 6b.
  274 +
  275 + d) Convey the object code by offering access from a designated
  276 + place (gratis or for a charge), and offer equivalent access to the
  277 + Corresponding Source in the same way through the same place at no
  278 + further charge. You need not require recipients to copy the
  279 + Corresponding Source along with the object code. If the place to
  280 + copy the object code is a network server, the Corresponding Source
  281 + may be on a different server (operated by you or a third party)
  282 + that supports equivalent copying facilities, provided you maintain
  283 + clear directions next to the object code saying where to find the
  284 + Corresponding Source. Regardless of what server hosts the
  285 + Corresponding Source, you remain obligated to ensure that it is
  286 + available for as long as needed to satisfy these requirements.
  287 +
  288 + e) Convey the object code using peer-to-peer transmission, provided
  289 + you inform other peers where the object code and Corresponding
  290 + Source of the work are being offered to the general public at no
  291 + charge under subsection 6d.
  292 +
  293 + A separable portion of the object code, whose source code is excluded
  294 +from the Corresponding Source as a System Library, need not be
  295 +included in conveying the object code work.
  296 +
  297 + A "User Product" is either (1) a "consumer product", which means any
  298 +tangible personal property which is normally used for personal, family,
  299 +or household purposes, or (2) anything designed or sold for incorporation
  300 +into a dwelling. In determining whether a product is a consumer product,
  301 +doubtful cases shall be resolved in favor of coverage. For a particular
  302 +product received by a particular user, "normally used" refers to a
  303 +typical or common use of that class of product, regardless of the status
  304 +of the particular user or of the way in which the particular user
  305 +actually uses, or expects or is expected to use, the product. A product
  306 +is a consumer product regardless of whether the product has substantial
  307 +commercial, industrial or non-consumer uses, unless such uses represent
  308 +the only significant mode of use of the product.
  309 +
  310 + "Installation Information" for a User Product means any methods,
  311 +procedures, authorization keys, or other information required to install
  312 +and execute modified versions of a covered work in that User Product from
  313 +a modified version of its Corresponding Source. The information must
  314 +suffice to ensure that the continued functioning of the modified object
  315 +code is in no case prevented or interfered with solely because
  316 +modification has been made.
  317 +
  318 + If you convey an object code work under this section in, or with, or
  319 +specifically for use in, a User Product, and the conveying occurs as
  320 +part of a transaction in which the right of possession and use of the
  321 +User Product is transferred to the recipient in perpetuity or for a
  322 +fixed term (regardless of how the transaction is characterized), the
  323 +Corresponding Source conveyed under this section must be accompanied
  324 +by the Installation Information. But this requirement does not apply
  325 +if neither you nor any third party retains the ability to install
  326 +modified object code on the User Product (for example, the work has
  327 +been installed in ROM).
  328 +
  329 + The requirement to provide Installation Information does not include a
  330 +requirement to continue to provide support service, warranty, or updates
  331 +for a work that has been modified or installed by the recipient, or for
  332 +the User Product in which it has been modified or installed. Access to a
  333 +network may be denied when the modification itself materially and
  334 +adversely affects the operation of the network or violates the rules and
  335 +protocols for communication across the network.
  336 +
  337 + Corresponding Source conveyed, and Installation Information provided,
  338 +in accord with this section must be in a format that is publicly
  339 +documented (and with an implementation available to the public in
  340 +source code form), and must require no special password or key for
  341 +unpacking, reading or copying.
  342 +
  343 + 7. Additional Terms.
  344 +
  345 + "Additional permissions" are terms that supplement the terms of this
  346 +License by making exceptions from one or more of its conditions.
  347 +Additional permissions that are applicable to the entire Program shall
  348 +be treated as though they were included in this License, to the extent
  349 +that they are valid under applicable law. If additional permissions
  350 +apply only to part of the Program, that part may be used separately
  351 +under those permissions, but the entire Program remains governed by
  352 +this License without regard to the additional permissions.
  353 +
  354 + When you convey a copy of a covered work, you may at your option
  355 +remove any additional permissions from that copy, or from any part of
  356 +it. (Additional permissions may be written to require their own
  357 +removal in certain cases when you modify the work.) You may place
  358 +additional permissions on material, added by you to a covered work,
  359 +for which you have or can give appropriate copyright permission.
  360 +
  361 + Notwithstanding any other provision of this License, for material you
  362 +add to a covered work, you may (if authorized by the copyright holders of
  363 +that material) supplement the terms of this License with terms:
  364 +
  365 + a) Disclaiming warranty or limiting liability differently from the
  366 + terms of sections 15 and 16 of this License; or
  367 +
  368 + b) Requiring preservation of specified reasonable legal notices or
  369 + author attributions in that material or in the Appropriate Legal
  370 + Notices displayed by works containing it; or
  371 +
  372 + c) Prohibiting misrepresentation of the origin of that material, or
  373 + requiring that modified versions of such material be marked in
  374 + reasonable ways as different from the original version; or
  375 +
  376 + d) Limiting the use for publicity purposes of names of licensors or
  377 + authors of the material; or
  378 +
  379 + e) Declining to grant rights under trademark law for use of some
  380 + trade names, trademarks, or service marks; or
  381 +
  382 + f) Requiring indemnification of licensors and authors of that
  383 + material by anyone who conveys the material (or modified versions of
  384 + it) with contractual assumptions of liability to the recipient, for
  385 + any liability that these contractual assumptions directly impose on
  386 + those licensors and authors.
  387 +
  388 + All other non-permissive additional terms are considered "further
  389 +restrictions" within the meaning of section 10. If the Program as you
  390 +received it, or any part of it, contains a notice stating that it is
  391 +governed by this License along with a term that is a further
  392 +restriction, you may remove that term. If a license document contains
  393 +a further restriction but permits relicensing or conveying under this
  394 +License, you may add to a covered work material governed by the terms
  395 +of that license document, provided that the further restriction does
  396 +not survive such relicensing or conveying.
  397 +
  398 + If you add terms to a covered work in accord with this section, you
  399 +must place, in the relevant source files, a statement of the
  400 +additional terms that apply to those files, or a notice indicating
  401 +where to find the applicable terms.
  402 +
  403 + Additional terms, permissive or non-permissive, may be stated in the
  404 +form of a separately written license, or stated as exceptions;
  405 +the above requirements apply either way.
  406 +
  407 + 8. Termination.
  408 +
  409 + You may not propagate or modify a covered work except as expressly
  410 +provided under this License. Any attempt otherwise to propagate or
  411 +modify it is void, and will automatically terminate your rights under
  412 +this License (including any patent licenses granted under the third
  413 +paragraph of section 11).
  414 +
  415 + However, if you cease all violation of this License, then your
  416 +license from a particular copyright holder is reinstated (a)
  417 +provisionally, unless and until the copyright holder explicitly and
  418 +finally terminates your license, and (b) permanently, if the copyright
  419 +holder fails to notify you of the violation by some reasonable means
  420 +prior to 60 days after the cessation.
  421 +
  422 + Moreover, your license from a particular copyright holder is
  423 +reinstated permanently if the copyright holder notifies you of the
  424 +violation by some reasonable means, this is the first time you have
  425 +received notice of violation of this License (for any work) from that
  426 +copyright holder, and you cure the violation prior to 30 days after
  427 +your receipt of the notice.
  428 +
  429 + Termination of your rights under this section does not terminate the
  430 +licenses of parties who have received copies or rights from you under
  431 +this License. If your rights have been terminated and not permanently
  432 +reinstated, you do not qualify to receive new licenses for the same
  433 +material under section 10.
  434 +
  435 + 9. Acceptance Not Required for Having Copies.
  436 +
  437 + You are not required to accept this License in order to receive or
  438 +run a copy of the Program. Ancillary propagation of a covered work
  439 +occurring solely as a consequence of using peer-to-peer transmission
  440 +to receive a copy likewise does not require acceptance. However,
  441 +nothing other than this License grants you permission to propagate or
  442 +modify any covered work. These actions infringe copyright if you do
  443 +not accept this License. Therefore, by modifying or propagating a
  444 +covered work, you indicate your acceptance of this License to do so.
  445 +
  446 + 10. Automatic Licensing of Downstream Recipients.
  447 +
  448 + Each time you convey a covered work, the recipient automatically
  449 +receives a license from the original licensors, to run, modify and
  450 +propagate that work, subject to this License. You are not responsible
  451 +for enforcing compliance by third parties with this License.
  452 +
  453 + An "entity transaction" is a transaction transferring control of an
  454 +organization, or substantially all assets of one, or subdividing an
  455 +organization, or merging organizations. If propagation of a covered
  456 +work results from an entity transaction, each party to that
  457 +transaction who receives a copy of the work also receives whatever
  458 +licenses to the work the party's predecessor in interest had or could
  459 +give under the previous paragraph, plus a right to possession of the
  460 +Corresponding Source of the work from the predecessor in interest, if
  461 +the predecessor has it or can get it with reasonable efforts.
  462 +
  463 + You may not impose any further restrictions on the exercise of the
  464 +rights granted or affirmed under this License. For example, you may
  465 +not impose a license fee, royalty, or other charge for exercise of
  466 +rights granted under this License, and you may not initiate litigation
  467 +(including a cross-claim or counterclaim in a lawsuit) alleging that
  468 +any patent claim is infringed by making, using, selling, offering for
  469 +sale, or importing the Program or any portion of it.
  470 +
  471 + 11. Patents.
  472 +
  473 + A "contributor" is a copyright holder who authorizes use under this
  474 +License of the Program or a work on which the Program is based. The
  475 +work thus licensed is called the contributor's "contributor version".
  476 +
  477 + A contributor's "essential patent claims" are all patent claims
  478 +owned or controlled by the contributor, whether already acquired or
  479 +hereafter acquired, that would be infringed by some manner, permitted
  480 +by this License, of making, using, or selling its contributor version,
  481 +but do not include claims that would be infringed only as a
  482 +consequence of further modification of the contributor version. For
  483 +purposes of this definition, "control" includes the right to grant
  484 +patent sublicenses in a manner consistent with the requirements of
  485 +this License.
  486 +
  487 + Each contributor grants you a non-exclusive, worldwide, royalty-free
  488 +patent license under the contributor's essential patent claims, to
  489 +make, use, sell, offer for sale, import and otherwise run, modify and
  490 +propagate the contents of its contributor version.
  491 +
  492 + In the following three paragraphs, a "patent license" is any express
  493 +agreement or commitment, however denominated, not to enforce a patent
  494 +(such as an express permission to practice a patent or covenant not to
  495 +sue for patent infringement). To "grant" such a patent license to a
  496 +party means to make such an agreement or commitment not to enforce a
  497 +patent against the party.
  498 +
  499 + If you convey a covered work, knowingly relying on a patent license,
  500 +and the Corresponding Source of the work is not available for anyone
  501 +to copy, free of charge and under the terms of this License, through a
  502 +publicly available network server or other readily accessible means,
  503 +then you must either (1) cause the Corresponding Source to be so
  504 +available, or (2) arrange to deprive yourself of the benefit of the
  505 +patent license for this particular work, or (3) arrange, in a manner
  506 +consistent with the requirements of this License, to extend the patent
  507 +license to downstream recipients. "Knowingly relying" means you have
  508 +actual knowledge that, but for the patent license, your conveying the
  509 +covered work in a country, or your recipient's use of the covered work
  510 +in a country, would infringe one or more identifiable patents in that
  511 +country that you have reason to believe are valid.
  512 +
  513 + If, pursuant to or in connection with a single transaction or
  514 +arrangement, you convey, or propagate by procuring conveyance of, a
  515 +covered work, and grant a patent license to some of the parties
  516 +receiving the covered work authorizing them to use, propagate, modify
  517 +or convey a specific copy of the covered work, then the patent license
  518 +you grant is automatically extended to all recipients of the covered
  519 +work and works based on it.
  520 +
  521 + A patent license is "discriminatory" if it does not include within
  522 +the scope of its coverage, prohibits the exercise of, or is
  523 +conditioned on the non-exercise of one or more of the rights that are
  524 +specifically granted under this License. You may not convey a covered
  525 +work if you are a party to an arrangement with a third party that is
  526 +in the business of distributing software, under which you make payment
  527 +to the third party based on the extent of your activity of conveying
  528 +the work, and under which the third party grants, to any of the
  529 +parties who would receive the covered work from you, a discriminatory
  530 +patent license (a) in connection with copies of the covered work
  531 +conveyed by you (or copies made from those copies), or (b) primarily
  532 +for and in connection with specific products or compilations that
  533 +contain the covered work, unless you entered into that arrangement,
  534 +or that patent license was granted, prior to 28 March 2007.
  535 +
  536 + Nothing in this License shall be construed as excluding or limiting
  537 +any implied license or other defenses to infringement that may
  538 +otherwise be available to you under applicable patent law.
  539 +
  540 + 12. No Surrender of Others' Freedom.
  541 +
  542 + If conditions are imposed on you (whether by court order, agreement or
  543 +otherwise) that contradict the conditions of this License, they do not
  544 +excuse you from the conditions of this License. If you cannot convey a
  545 +covered work so as to satisfy simultaneously your obligations under this
  546 +License and any other pertinent obligations, then as a consequence you may
  547 +not convey it at all. For example, if you agree to terms that obligate you
  548 +to collect a royalty for further conveying from those to whom you convey
  549 +the Program, the only way you could satisfy both those terms and this
  550 +License would be to refrain entirely from conveying the Program.
  551 +
  552 + 13. Use with the GNU Affero General Public License.
  553 +
  554 + Notwithstanding any other provision of this License, you have
  555 +permission to link or combine any covered work with a work licensed
  556 +under version 3 of the GNU Affero General Public License into a single
  557 +combined work, and to convey the resulting work. The terms of this
  558 +License will continue to apply to the part which is the covered work,
  559 +but the special requirements of the GNU Affero General Public License,
  560 +section 13, concerning interaction through a network will apply to the
  561 +combination as such.
  562 +
  563 + 14. Revised Versions of this License.
  564 +
  565 + The Free Software Foundation may publish revised and/or new versions of
  566 +the GNU General Public License from time to time. Such new versions will
  567 +be similar in spirit to the present version, but may differ in detail to
  568 +address new problems or concerns.
  569 +
  570 + Each version is given a distinguishing version number. If the
  571 +Program specifies that a certain numbered version of the GNU General
  572 +Public License "or any later version" applies to it, you have the
  573 +option of following the terms and conditions either of that numbered
  574 +version or of any later version published by the Free Software
  575 +Foundation. If the Program does not specify a version number of the
  576 +GNU General Public License, you may choose any version ever published
  577 +by the Free Software Foundation.
  578 +
  579 + If the Program specifies that a proxy can decide which future
  580 +versions of the GNU General Public License can be used, that proxy's
  581 +public statement of acceptance of a version permanently authorizes you
  582 +to choose that version for the Program.
  583 +
  584 + Later license versions may give you additional or different
  585 +permissions. However, no additional obligations are imposed on any
  586 +author or copyright holder as a result of your choosing to follow a
  587 +later version.
  588 +
  589 + 15. Disclaimer of Warranty.
  590 +
  591 + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  592 +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  593 +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
  594 +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  595 +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  596 +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
  597 +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
  598 +ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  599 +
  600 + 16. Limitation of Liability.
  601 +
  602 + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  603 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
  604 +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
  605 +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  606 +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  607 +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
  608 +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
  609 +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
  610 +SUCH DAMAGES.
  611 +
  612 + 17. Interpretation of Sections 15 and 16.
  613 +
  614 + If the disclaimer of warranty and limitation of liability provided
  615 +above cannot be given local legal effect according to their terms,
  616 +reviewing courts shall apply local law that most closely approximates
  617 +an absolute waiver of all civil liability in connection with the
  618 +Program, unless a warranty or assumption of liability accompanies a
  619 +copy of the Program in return for a fee.
  620 +
  621 + END OF TERMS AND CONDITIONS
  622 +
  623 + How to Apply These Terms to Your New Programs
  624 +
  625 + If you develop a new program, and you want it to be of the greatest
  626 +possible use to the public, the best way to achieve this is to make it
  627 +free software which everyone can redistribute and change under these terms.
  628 +
  629 + To do so, attach the following notices to the program. It is safest
  630 +to attach them to the start of each source file to most effectively
  631 +state the exclusion of warranty; and each file should have at least
  632 +the "copyright" line and a pointer to where the full notice is found.
  633 +
  634 + <one line to give the program's name and a brief idea of what it does.>
  635 + Copyright (C) <year> <name of author>
  636 +
  637 + This program is free software: you can redistribute it and/or modify
  638 + it under the terms of the GNU General Public License as published by
  639 + the Free Software Foundation, either version 3 of the License, or
  640 + (at your option) any later version.
  641 +
  642 + This program is distributed in the hope that it will be useful,
  643 + but WITHOUT ANY WARRANTY; without even the implied warranty of
  644 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  645 + GNU General Public License for more details.
  646 +
  647 + You should have received a copy of the GNU General Public License
  648 + along with this program. If not, see <http://www.gnu.org/licenses/>.
  649 +
  650 +Also add information on how to contact you by electronic and paper mail.
  651 +
  652 + If the program does terminal interaction, make it output a short
  653 +notice like this when it starts in an interactive mode:
  654 +
  655 + <program> Copyright (C) <year> <name of author>
  656 + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  657 + This is free software, and you are welcome to redistribute it
  658 + under certain conditions; type `show c' for details.
  659 +
  660 +The hypothetical commands `show w' and `show c' should show the appropriate
  661 +parts of the General Public License. Of course, your program's commands
  662 +might be different; for a GUI interface, you would use an "about box".
  663 +
  664 + You should also get your employer (if you work as a programmer) or school,
  665 +if any, to sign a "copyright disclaimer" for the program, if necessary.
  666 +For more information on this, and how to apply and follow the GNU GPL, see
  667 +<http://www.gnu.org/licenses/>.
  668 +
  669 + The GNU General Public License does not permit incorporating your program
  670 +into proprietary programs. If your program is a subroutine library, you
  671 +may consider it more useful to permit linking proprietary applications with
  672 +the library. If this is what you want to do, use the GNU Lesser General
  673 +Public License instead of this License. But first, please read
  674 +<http://www.gnu.org/philosophy/why-not-lgpl.html>.
0 675 \ No newline at end of file
... ...
Readme.md 0 → 100644
  1 +++ a/Readme.md
... ... @@ -0,0 +1,30 @@
  1 +Modelo de Desenvolvimento
  2 +==========================
  3 +
  4 +* [Licença](LICENSE)
  5 +* [Como contribuir com este Projeto](CONTRIBUTING.md)
  6 +* [CHANGELOG](CHANGELOG.md)
  7 +
  8 +
  9 +1.0 - Objetivo e demais informações
  10 +------------
  11 +
  12 +> Objetivo Geral: Viabilizar a solicitação de carros e caronas utilizado pelo MJ por meio de aplicativo que automatize todo o processo de solicitação de veículos
  13 +
  14 +
  15 +2.0 - Responsáveis e Interessados
  16 +------------
  17 +
  18 +| Papel | Interessados | Responsável |
  19 +|-----------------------|-----------------------------------------------------|----------------------------------------|
  20 +| Patrocinador | Secretaria-Executiva do Ministério da Justiça | Marivaldo Pereira, Secretário Executivo/MJ |
  21 +| Product Owner | Secretaria-Executiva do Ministério da Justiça | [Washington Bonini](washington.bonini@mj.gov.br), Assessor |
  22 +| Stakeholder | Secretaria-Executiva do Ministério da Justiça | [Valessio Brito](valessio.brito@mj.gov.br), Assessor |
  23 +| Coordenador da Equipe | Coordenação-Geral de Tecnologia da Informação do MJ | [Vitor Reis](vitor.reis@mj.gov.br), CGTI |
  24 +| Líder Técnico | Coordenação-Geral de Tecnologia da Informação do MJ | [Eder Alves](eder.alves@mj.gov.br), Gerente |
  25 +| SCRUM Master | Escritório de Projetos da CGTI do MJ | [Leonardo Galvão](leonardo.galvao@g4f.com.br), Gerente de Projetos da G4F |
  26 +| Gerente Adjunto | Escritório de Projetos da CGTI do MJ | [Rubens Saad Júnior](rubens.saad@g4f.com.br), Gerente de Projetos da G4F |
  27 +| Analista de Requisitos | DIPROS/CGTI | [Manuella Souza](manuella.souza@capgemini.com), Capgemini |
  28 +| Teste/Qualidade | DIPROS/CGTI | [Fernando Silva](fernando.silva@rsinet.com.br), RSI |
  29 +| Analista de Negócio | DIPROS/CGTI | [Mirian da Silva Costa](mirian.costa@spread.com.br), Spread |
  30 +| Gerente de Configuração | DIPROS/CGTI | [Marcus V. Cardoso do Sacramento](marcus.sacramento@spread.com.br), Spread |
0 31 \ No newline at end of file
... ...
VERSION 0 → 100644
  1 +++ a/VERSION
... ... @@ -0,0 +1 @@
  1 +0.3.0
0 2 \ No newline at end of file
... ...
codigos_fonte/carros-parent/carros-entity/.gitignore 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/.gitignore
... ... @@ -0,0 +1 @@
  1 +/target/
... ...
codigos_fonte/carros-parent/carros-entity/pom.xml 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/pom.xml
... ... @@ -0,0 +1,45 @@
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 +
  4 + <modelVersion>4.0.0</modelVersion>
  5 +
  6 + <parent>
  7 + <groupId>br.gov.mj.carros</groupId>
  8 + <artifactId>carros-parent</artifactId>
  9 + <version>0.2.0</version>
  10 + </parent>
  11 +
  12 + <artifactId>carros-entity</artifactId>
  13 + <name>carros-entity</name>
  14 + <description>Módulo de entidades do projeto CARROS.</description>
  15 +
  16 + <dependencies>
  17 +
  18 + <dependency>
  19 + <groupId>org.hibernate</groupId>
  20 + <artifactId>hibernate-envers</artifactId>
  21 + <version>3.6.4.Final</version>
  22 + </dependency>
  23 +
  24 + <dependency>
  25 + <groupId>br.gov.mj.infra</groupId>
  26 + <artifactId>infra-negocio</artifactId>
  27 + <scope>provided</scope>
  28 + </dependency>
  29 +
  30 + <dependency>
  31 + <groupId>javax</groupId>
  32 + <artifactId>javaee-api</artifactId>
  33 + <scope>provided</scope>
  34 + </dependency>
  35 +
  36 + <dependency>
  37 + <groupId>org.hibernate</groupId>
  38 + <artifactId>hibernate-core</artifactId>
  39 + <version>4.3.7.Final</version>
  40 + <scope>provided</scope>
  41 + </dependency>
  42 +
  43 + </dependencies>
  44 +
  45 +</project>
0 46 \ No newline at end of file
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbContrato.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbContrato.java
... ... @@ -0,0 +1,166 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDate;
  4 +import java.util.Set;
  5 +
  6 +import javax.persistence.CascadeType;
  7 +import javax.persistence.Column;
  8 +import javax.persistence.Entity;
  9 +import javax.persistence.FetchType;
  10 +import javax.persistence.GeneratedValue;
  11 +import javax.persistence.GenerationType;
  12 +import javax.persistence.Id;
  13 +import javax.persistence.OneToMany;
  14 +import javax.persistence.SequenceGenerator;
  15 +import javax.persistence.Table;
  16 +import javax.persistence.Transient;
  17 +
  18 +import org.hibernate.annotations.Type;
  19 +
  20 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  21 +
  22 +@Entity
  23 +@Table(name = "tb_con_contrato")
  24 +public class TbContrato extends BaseEntity<Long> {
  25 +
  26 + private static final long serialVersionUID = 2113127550305062338L;
  27 +
  28 + @Id
  29 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_con_contrato")
  30 + @SequenceGenerator(name = "seq_tb_con_contrato", sequenceName = "seq_tb_con_contrato", allocationSize = 1)
  31 + @Column(name = "con_id_contrato")
  32 + private Long id;
  33 +
  34 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  35 + @Column(name = "con_dt_cadastro")
  36 + private LocalDate dataCadastro;
  37 +
  38 + @Column(name = "con_nu_contrato")
  39 + private String numeroContrato;
  40 +
  41 + @Column(name = "con_no_empresa")
  42 + private String nomeEmpresa;
  43 +
  44 + @Column(name = "con_nu_cnpj")
  45 + private String cnpj;
  46 +
  47 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  48 + @Column(name = "con_dt_inicio_vigencia")
  49 + private LocalDate inicioVigencia;
  50 +
  51 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  52 + @Column(name = "con_dt_fim_vigencia")
  53 + private LocalDate fimVigencia;
  54 +
  55 + @Column(name = "con_nu_processo_sei")
  56 + private String numeroProcesso;
  57 +
  58 + @OneToMany(mappedBy = "contrato", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  59 + private Set<TbHistoricoVigenciaContrato> historicoVigenciaContrato;
  60 +
  61 + @OneToMany(mappedBy = "contrato", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  62 + private Set<TbFranquiaMensal> franquiasMensais;
  63 +
  64 + @OneToMany(mappedBy = "contrato", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  65 + private Set<TbDocumentoContrato> documentos;
  66 +
  67 + @Transient
  68 + private String nomeEmpresaCnpjTemp;
  69 +
  70 + @Override
  71 + public Long getId() {
  72 + return id;
  73 + }
  74 +
  75 + public void setId(Long id) {
  76 + this.id = id;
  77 + }
  78 +
  79 + public String getNumeroContrato() {
  80 + return numeroContrato;
  81 + }
  82 +
  83 + public void setNumeroContrato(String numeroContrato) {
  84 + this.numeroContrato = numeroContrato;
  85 + }
  86 +
  87 + public String getNomeEmpresa() {
  88 + return nomeEmpresa;
  89 + }
  90 +
  91 + public void setNomeEmpresa(String nomeEmpresa) {
  92 + this.nomeEmpresa = nomeEmpresa;
  93 + }
  94 +
  95 + public String getCnpj() {
  96 + return cnpj;
  97 + }
  98 +
  99 + public void setCnpj(String cnpj) {
  100 + this.cnpj = cnpj;
  101 + }
  102 +
  103 + public LocalDate getInicioVigencia() {
  104 + return inicioVigencia;
  105 + }
  106 +
  107 + public void setInicioVigencia(LocalDate inicioVigencia) {
  108 + this.inicioVigencia = inicioVigencia;
  109 + }
  110 +
  111 + public LocalDate getDataCadastro() {
  112 + return dataCadastro;
  113 + }
  114 +
  115 + public void setDataCadastro(LocalDate dataCadastro) {
  116 + this.dataCadastro = dataCadastro;
  117 + }
  118 +
  119 + public LocalDate getFimVigencia() {
  120 + return fimVigencia;
  121 + }
  122 +
  123 + public void setFimVigencia(LocalDate fimVigencia) {
  124 + this.fimVigencia = fimVigencia;
  125 + }
  126 +
  127 + public String getNumeroProcesso() {
  128 + return numeroProcesso;
  129 + }
  130 +
  131 + public void setNumeroProcesso(String numeroProcesso) {
  132 + this.numeroProcesso = numeroProcesso;
  133 + }
  134 +
  135 + public Set<TbHistoricoVigenciaContrato> getHistoricoVigenciaContrato() {
  136 + return historicoVigenciaContrato;
  137 + }
  138 +
  139 + public void setHistoricoVigenciaContrato(Set<TbHistoricoVigenciaContrato> historicoVigenciaContrato) {
  140 + this.historicoVigenciaContrato = historicoVigenciaContrato;
  141 + }
  142 +
  143 + public Set<TbFranquiaMensal> getFranquiasMensais() {
  144 + return franquiasMensais;
  145 + }
  146 +
  147 + public void setFranquiasMensais(Set<TbFranquiaMensal> franquiasMensais) {
  148 + this.franquiasMensais = franquiasMensais;
  149 + }
  150 +
  151 + public Set<TbDocumentoContrato> getDocumentos() {
  152 + return documentos;
  153 + }
  154 +
  155 + public void setDocumentos(Set<TbDocumentoContrato> documentos) {
  156 + this.documentos = documentos;
  157 + }
  158 +
  159 + public String getNomeEmpresaCnpjTemp() {
  160 + return nomeEmpresaCnpjTemp;
  161 + }
  162 +
  163 + public void setNomeEmpresaCnpjTemp(String nomeEmpresaCnpjTemp) {
  164 + this.nomeEmpresaCnpjTemp = nomeEmpresaCnpjTemp;
  165 + }
  166 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbCustoVeiculo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbCustoVeiculo.java
... ... @@ -0,0 +1,107 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.math.BigDecimal;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.EnumType;
  8 +import javax.persistence.Enumerated;
  9 +import javax.persistence.GeneratedValue;
  10 +import javax.persistence.GenerationType;
  11 +import javax.persistence.Id;
  12 +import javax.persistence.JoinColumn;
  13 +import javax.persistence.ManyToOne;
  14 +import javax.persistence.SequenceGenerator;
  15 +import javax.persistence.Table;
  16 +import javax.persistence.Transient;
  17 +
  18 +import org.hibernate.annotations.Parameter;
  19 +import org.hibernate.annotations.Type;
  20 +
  21 +import br.gov.mj.carros.entity.util.EnumTipoCombustivel;
  22 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  23 +
  24 +@Entity
  25 +@Table(name = "tb_csv_custo_veiculo")
  26 +public class TbCustoVeiculo extends BaseEntity<Long> {
  27 +
  28 + private static final long serialVersionUID = -1870827533442818543L;
  29 +
  30 + @Id
  31 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_csv_custo_veiculo")
  32 + @SequenceGenerator(name = "seq_tb_csv_custo_veiculo", sequenceName = "seq_tb_csv_custo_veiculo", allocationSize = 1)
  33 + @Column(name = "csv_id_custo_veiculo")
  34 + private Long id;
  35 +
  36 + @ManyToOne
  37 + @JoinColumn(name = "csv_fk_tpv_id_tipo_veiculo")
  38 + private TbTipoVeiculo tipoVeiculo;
  39 +
  40 + @Enumerated(EnumType.ORDINAL)
  41 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumTipoCombustivel", name = "enumClassName") )
  42 + @Column(name = "csv_tp_combustivel")
  43 + private EnumTipoCombustivel tipoCombustivel;
  44 +
  45 + @Column(name = "csv_nu_consumo")
  46 + private BigDecimal consumo;
  47 +
  48 + @Column(name = "csv_nu_preco")
  49 + private BigDecimal preco;
  50 +
  51 + @Transient
  52 + private Long itemsPerPage;
  53 +
  54 + @Override
  55 + public Long getId() {
  56 + return id;
  57 + }
  58 +
  59 + public void setId(Long id) {
  60 + this.id = id;
  61 + }
  62 +
  63 + public TbTipoVeiculo getTipoVeiculo() {
  64 + return tipoVeiculo;
  65 + }
  66 +
  67 + public void setTipoVeiculo(TbTipoVeiculo tipoVeiculo) {
  68 + this.tipoVeiculo = tipoVeiculo;
  69 + }
  70 +
  71 + public EnumTipoCombustivel getTipoCombustivel() {
  72 + return tipoCombustivel;
  73 + }
  74 +
  75 + public void setTipoCombustivel(EnumTipoCombustivel tipoCombustivel) {
  76 + this.tipoCombustivel = tipoCombustivel;
  77 + }
  78 +
  79 + public BigDecimal getConsumo() {
  80 + return consumo;
  81 + }
  82 +
  83 + public void setConsumo(BigDecimal consumo) {
  84 + this.consumo = consumo;
  85 + }
  86 +
  87 + public BigDecimal getPreco() {
  88 + return preco;
  89 + }
  90 +
  91 + public void setPreco(BigDecimal preco) {
  92 + this.preco = preco;
  93 + }
  94 +
  95 + public Long getItemsPerPage() {
  96 + return itemsPerPage;
  97 + }
  98 +
  99 + public void setItemsPerPage(Long itemsPerPage) {
  100 + this.itemsPerPage = itemsPerPage;
  101 + }
  102 +
  103 + public String getStatus() {
  104 + // TODO Auto-generated method stub
  105 + return null;
  106 + }
  107 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbDocumentoContrato.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbDocumentoContrato.java
... ... @@ -0,0 +1,119 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDate;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.GenerationType;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.JoinColumn;
  11 +import javax.persistence.ManyToOne;
  12 +import javax.persistence.SequenceGenerator;
  13 +import javax.persistence.Table;
  14 +
  15 +import org.hibernate.annotations.Type;
  16 +
  17 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  18 +
  19 +@Entity
  20 +@Table(name = "tb_dcc_documento_contrato")
  21 +public class TbDocumentoContrato extends BaseEntity<Long> {
  22 +
  23 + private static final long serialVersionUID = 8087573504497746129L;
  24 +
  25 + @Id
  26 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_dcc_documento_contrato")
  27 + @SequenceGenerator(name = "seq_tb_dcc_documento_contrato", sequenceName = "seq_tb_dcc_documento_contrato", allocationSize = 1)
  28 + @Column(name = "dcc_id_documento_contrato")
  29 + private Long id;
  30 +
  31 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  32 + @Column(name = "dcc_dt_cadastro")
  33 + private LocalDate dataCadastro;
  34 +
  35 + @ManyToOne
  36 + @JoinColumn(name = "dcc_fk_con_id_contrato")
  37 + private TbContrato contrato;
  38 +
  39 + @Column(name = "dcc_no_identificador")
  40 + private String identificador;
  41 +
  42 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  43 + @Column(name = "dcc_dt_data_documento")
  44 + private LocalDate dataDocumento;
  45 +
  46 + @Column(name = "dcc_ds_extensao_arquivo")
  47 + private String extensaoArquivo;
  48 +
  49 + @Column(name = "dcc_nu_tamanho_arquivo")
  50 + private Integer tamanhoArquivo;
  51 +
  52 + @Column(name = "dcc_ar_arquivo")
  53 + private Byte[] arquivo;
  54 +
  55 + @Override
  56 + public Long getId() {
  57 + return id;
  58 + }
  59 +
  60 + public void setId(Long id) {
  61 + this.id = id;
  62 + }
  63 +
  64 + public LocalDate getDataCadastro() {
  65 + return dataCadastro;
  66 + }
  67 +
  68 + public void setDataCadastro(LocalDate dataCadastro) {
  69 + this.dataCadastro = dataCadastro;
  70 + }
  71 +
  72 + public TbContrato getContrato() {
  73 + return contrato;
  74 + }
  75 +
  76 + public void setContrato(TbContrato contrato) {
  77 + this.contrato = contrato;
  78 + }
  79 +
  80 + public String getIdentificador() {
  81 + return identificador;
  82 + }
  83 +
  84 + public void setIdentificador(String identificador) {
  85 + this.identificador = identificador;
  86 + }
  87 +
  88 + public LocalDate getDataDocumento() {
  89 + return dataDocumento;
  90 + }
  91 +
  92 + public void setDataDocumento(LocalDate dataDocumento) {
  93 + this.dataDocumento = dataDocumento;
  94 + }
  95 +
  96 + public String getExtensaoArquivo() {
  97 + return extensaoArquivo;
  98 + }
  99 +
  100 + public void setExtensaoArquivo(String extensaoArquivo) {
  101 + this.extensaoArquivo = extensaoArquivo;
  102 + }
  103 +
  104 + public Integer getTamanhoArquivo() {
  105 + return tamanhoArquivo;
  106 + }
  107 +
  108 + public void setTamanhoArquivo(Integer tamanhoArquivo) {
  109 + this.tamanhoArquivo = tamanhoArquivo;
  110 + }
  111 +
  112 + public Byte[] getArquivo() {
  113 + return arquivo;
  114 + }
  115 +
  116 + public void setArquivo(Byte[] arquivo) {
  117 + this.arquivo = arquivo;
  118 + }
  119 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbEndereco.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbEndereco.java
... ... @@ -0,0 +1,99 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.SequenceGenerator;
  9 +import javax.persistence.Table;
  10 +
  11 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  12 +
  13 +@Entity
  14 +@Table(name = "tb_end_endereco")
  15 +public class TbEndereco extends BaseEntity<Long> {
  16 +
  17 + private static final long serialVersionUID = 1096657945069668627L;
  18 +
  19 + @Id
  20 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_end_endereco")
  21 + @SequenceGenerator(name = "seq_tb_end_endereco", sequenceName = "seq_tb_end_endereco", allocationSize = 1)
  22 + @Column(name = "end_id_endereco")
  23 + private Long id;
  24 +
  25 + @Column(name = "end_no_endereco")
  26 + private String nome;
  27 +
  28 + @Column(name = "end_no_apelido")
  29 + private String apelido;
  30 +
  31 + @Column(name = "end_en_logradouro")
  32 + private String logradouro;
  33 +
  34 + @Column(name = "end_ds_latitude")
  35 + private String latitude;
  36 +
  37 + @Column(name = "end_ds_longitude")
  38 + private String longitude;
  39 +
  40 + @Column(name = "end_st_incompleto")
  41 + private String flagIncompleto;
  42 +
  43 + @Override
  44 + public Long getId() {
  45 + return id;
  46 + }
  47 +
  48 + public void setId(Long id) {
  49 + this.id = id;
  50 + }
  51 +
  52 + public String getNome() {
  53 + return nome;
  54 + }
  55 +
  56 + public void setNome(String nome) {
  57 + this.nome = nome;
  58 + }
  59 +
  60 + public String getApelido() {
  61 + return apelido;
  62 + }
  63 +
  64 + public void setApelido(String apelido) {
  65 + this.apelido = apelido;
  66 + }
  67 +
  68 + public String getLogradouro() {
  69 + return logradouro;
  70 + }
  71 +
  72 + public void setLogradouro(String logradouro) {
  73 + this.logradouro = logradouro;
  74 + }
  75 +
  76 + public String getLatitude() {
  77 + return latitude;
  78 + }
  79 +
  80 + public void setLatitude(String latitude) {
  81 + this.latitude = latitude;
  82 + }
  83 +
  84 + public String getLongitude() {
  85 + return longitude;
  86 + }
  87 +
  88 + public void setLongitude(String longitude) {
  89 + this.longitude = longitude;
  90 + }
  91 +
  92 + public String getFlagIncompleto() {
  93 + return flagIncompleto;
  94 + }
  95 +
  96 + public void setFlagIncompleto(String flagIncompleto) {
  97 + this.flagIncompleto = flagIncompleto;
  98 + }
  99 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbEstado.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbEstado.java
... ... @@ -0,0 +1,55 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.SequenceGenerator;
  9 +import javax.persistence.Table;
  10 +
  11 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  12 +
  13 +@Entity
  14 +@Table(name = "tb_euf_estado")
  15 +public class TbEstado extends BaseEntity<Long> {
  16 +
  17 + private static final long serialVersionUID = -3858912282939221044L;
  18 +
  19 + @Id
  20 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_euf_estado")
  21 + @SequenceGenerator(name = "seq_tb_euf_estado", sequenceName = "seq_tb_euf_estado", allocationSize = 1)
  22 + @Column(name = "euf_id_estado")
  23 + private Long id;
  24 +
  25 + @Column(name = "euf_no_nome")
  26 + private String nome;
  27 +
  28 + @Column(name = "euf_ds_sigla")
  29 + private String sigla;
  30 +
  31 + @Override
  32 + public Long getId() {
  33 + return id;
  34 + }
  35 +
  36 + public void setId(Long id) {
  37 + this.id = id;
  38 + }
  39 +
  40 + public String getNome() {
  41 + return nome;
  42 + }
  43 +
  44 + public void setNome(String nome) {
  45 + this.nome = nome;
  46 + }
  47 +
  48 + public String getSigla() {
  49 + return sigla;
  50 + }
  51 +
  52 + public void setSigla(String sigla) {
  53 + this.sigla = sigla;
  54 + }
  55 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbFranquiaMensal.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbFranquiaMensal.java
... ... @@ -0,0 +1,105 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.math.BigDecimal;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.GenerationType;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.JoinColumn;
  11 +import javax.persistence.ManyToOne;
  12 +import javax.persistence.SequenceGenerator;
  13 +import javax.persistence.Table;
  14 +
  15 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  16 +
  17 +@Entity
  18 +@Table(name = "tb_frm_franquia_mensal")
  19 +public class TbFranquiaMensal extends BaseEntity<Long> {
  20 +
  21 + private static final long serialVersionUID = -6200166867603340228L;
  22 +
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_frm_franquia_mensal")
  25 + @SequenceGenerator(name = "seq_tb_frm_franquia_mensal", sequenceName = "seq_tb_frm_franquia_mensal", allocationSize = 1)
  26 + @Column(name = "frm_id_franquia_mensal")
  27 + private Long id;
  28 +
  29 + @ManyToOne
  30 + @JoinColumn(name = "frm_fk_con_id_contrato")
  31 + private TbContrato contrato;
  32 +
  33 + @ManyToOne
  34 + @JoinColumn(name = "frm_fk_tpv_id_tipo_veiculo")
  35 + private TbTipoVeiculo tipoVeiculo;
  36 +
  37 + @Column(name = "frm_nu_quantidade_veiculos")
  38 + private Integer quantidade;
  39 +
  40 + @Column(name = "frm_nu_quilometragem_mes_veiculo")
  41 + private BigDecimal quilometragemVeiculo;
  42 +
  43 + @Column(name = "frm_nu_quilometragem_mes_franquia")
  44 + private BigDecimal quilometragemFranquia;
  45 +
  46 + @Column(name = "frm_nu_custo_franquia")
  47 + private BigDecimal custo;
  48 +
  49 + @Override
  50 + public Long getId() {
  51 + return id;
  52 + }
  53 +
  54 + public void setId(Long id) {
  55 + this.id = id;
  56 + }
  57 +
  58 + public TbContrato getContrato() {
  59 + return contrato;
  60 + }
  61 +
  62 + public void setContrato(TbContrato contrato) {
  63 + this.contrato = contrato;
  64 + }
  65 +
  66 + public TbTipoVeiculo getTipoVeiculo() {
  67 + return tipoVeiculo;
  68 + }
  69 +
  70 + public void setTipoVeiculo(TbTipoVeiculo tipoVeiculo) {
  71 + this.tipoVeiculo = tipoVeiculo;
  72 + }
  73 +
  74 + public Integer getQuantidade() {
  75 + return quantidade;
  76 + }
  77 +
  78 + public void setQuantidade(Integer quantidade) {
  79 + this.quantidade = quantidade;
  80 + }
  81 +
  82 + public BigDecimal getQuilometragemVeiculo() {
  83 + return quilometragemVeiculo;
  84 + }
  85 +
  86 + public void setQuilometragemVeiculo(BigDecimal quilometragemVeiculo) {
  87 + this.quilometragemVeiculo = quilometragemVeiculo;
  88 + }
  89 +
  90 + public BigDecimal getQuilometragemFranquia() {
  91 + return quilometragemFranquia;
  92 + }
  93 +
  94 + public void setQuilometragemFranquia(BigDecimal quilometragemFranquia) {
  95 + this.quilometragemFranquia = quilometragemFranquia;
  96 + }
  97 +
  98 + public BigDecimal getCusto() {
  99 + return custo;
  100 + }
  101 +
  102 + public void setCusto(BigDecimal custo) {
  103 + this.custo = custo;
  104 + }
  105 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbHistoricoCarona.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbHistoricoCarona.java
... ... @@ -0,0 +1,88 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDateTime;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.GenerationType;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.JoinColumn;
  11 +import javax.persistence.ManyToOne;
  12 +import javax.persistence.SequenceGenerator;
  13 +import javax.persistence.Table;
  14 +
  15 +import org.hibernate.annotations.Type;
  16 +
  17 +import br.gov.mj.carros.entity.seguranca.TbUsuario;
  18 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  19 +
  20 +
  21 +@Entity
  22 +@Table(name = "tb_car_carona")
  23 +public class TbHistoricoCarona extends BaseEntity<Long> {
  24 +
  25 + private static final long serialVersionUID = 3312475910274798699L;
  26 +
  27 + @Id
  28 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_car_carona")
  29 + @SequenceGenerator(name = "seq_tb_car_carona", sequenceName = "seq_tb_car_carona", allocationSize = 1)
  30 + @Column(name = "car_id_carona")
  31 + private Long id;
  32 +
  33 + @ManyToOne
  34 + @JoinColumn(name = "car_fk_sol_id_solicitacao")
  35 + private TbSolicitacao solicitacao;
  36 +
  37 + @ManyToOne
  38 + @JoinColumn(name = "car_fk_usr_id_usuario")
  39 + private TbUsuario usuario;
  40 +
  41 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDateTime")
  42 + @Column(name = "car_dh_carona")
  43 + private LocalDateTime dataHoraCarona;
  44 +
  45 + @Column(name = "car_nu_quantidade_passageiros")
  46 + private Integer qtdPassageiros;
  47 +
  48 + @Override
  49 + public Long getId() {
  50 + return id;
  51 + }
  52 +
  53 + public void setId(Long id) {
  54 + this.id = id;
  55 + }
  56 +
  57 + public TbSolicitacao getSolicitacao() {
  58 + return solicitacao;
  59 + }
  60 +
  61 + public void setSolicitacao(TbSolicitacao solicitacao) {
  62 + this.solicitacao = solicitacao;
  63 + }
  64 +
  65 + public TbUsuario getUsuario() {
  66 + return usuario;
  67 + }
  68 +
  69 + public void setUsuario(TbUsuario usuario) {
  70 + this.usuario = usuario;
  71 + }
  72 +
  73 + public LocalDateTime getDataHoraCarona() {
  74 + return dataHoraCarona;
  75 + }
  76 +
  77 + public void setDataHoraCarona(LocalDateTime dataHoraCarona) {
  78 + this.dataHoraCarona = dataHoraCarona;
  79 + }
  80 +
  81 + public Integer getQtdPassageiros() {
  82 + return qtdPassageiros;
  83 + }
  84 +
  85 + public void setQtdPassageiros(Integer qtdPassageiros) {
  86 + this.qtdPassageiros = qtdPassageiros;
  87 + }
  88 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbHistoricoVigenciaContrato.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbHistoricoVigenciaContrato.java
... ... @@ -0,0 +1,87 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDate;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.GenerationType;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.JoinColumn;
  11 +import javax.persistence.ManyToOne;
  12 +import javax.persistence.SequenceGenerator;
  13 +import javax.persistence.Table;
  14 +
  15 +import org.hibernate.annotations.Type;
  16 +
  17 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  18 +
  19 +@Entity
  20 +@Table(name = "tb_hvg_historico_vigencia")
  21 +public class TbHistoricoVigenciaContrato extends BaseEntity<Long> {
  22 +
  23 + private static final long serialVersionUID = -8253226461928464356L;
  24 +
  25 + @Id
  26 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_hvg_historico_vigencia")
  27 + @SequenceGenerator(name = "seq_tb_hvg_historico_vigencia", sequenceName = "seq_tb_hvg_historico_vigencia", allocationSize = 1)
  28 + @Column(name = "hvg_id_historico")
  29 + private Long id;
  30 +
  31 + @ManyToOne
  32 + @JoinColumn(name = "hvg_fk_con_id_contrato")
  33 + private TbContrato contrato;
  34 +
  35 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  36 + @Column(name = "hvg_dt_inicio_vigencia")
  37 + private LocalDate inicioVigencia;
  38 +
  39 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  40 + @Column(name = "hvg_dt_fim_vigencia")
  41 + private LocalDate fimVigencia;
  42 +
  43 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  44 + @Column(name = "hvg_dt_alteracao")
  45 + private LocalDate dataAlteracao;
  46 +
  47 + @Override
  48 + public Long getId() {
  49 + return id;
  50 + }
  51 +
  52 + public void setId(Long id) {
  53 + this.id = id;
  54 + }
  55 +
  56 + public TbContrato getContrato() {
  57 + return contrato;
  58 + }
  59 +
  60 + public void setContrato(TbContrato contrato) {
  61 + this.contrato = contrato;
  62 + }
  63 +
  64 + public LocalDate getInicioVigencia() {
  65 + return inicioVigencia;
  66 + }
  67 +
  68 + public void setInicioVigencia(LocalDate inicioVigencia) {
  69 + this.inicioVigencia = inicioVigencia;
  70 + }
  71 +
  72 + public LocalDate getFimVigencia() {
  73 + return fimVigencia;
  74 + }
  75 +
  76 + public void setFimVigencia(LocalDate fimVigencia) {
  77 + this.fimVigencia = fimVigencia;
  78 + }
  79 +
  80 + public LocalDate getDataAlteracao() {
  81 + return dataAlteracao;
  82 + }
  83 +
  84 + public void setDataAlteracao(LocalDate dataAlteracao) {
  85 + this.dataAlteracao = dataAlteracao;
  86 + }
  87 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbMunicipio.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbMunicipio.java
... ... @@ -0,0 +1,58 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.JoinColumn;
  9 +import javax.persistence.ManyToOne;
  10 +import javax.persistence.SequenceGenerator;
  11 +import javax.persistence.Table;
  12 +
  13 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  14 +
  15 +@Entity
  16 +@Table(name = "tb_mun_municipio")
  17 +public class TbMunicipio extends BaseEntity<Long> {
  18 +
  19 + private static final long serialVersionUID = 6344053075889719129L;
  20 +
  21 + @Id
  22 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_mun_municipio")
  23 + @SequenceGenerator(name = "seq_tb_mun_municipio", sequenceName = "seq_tb_mun_municipio", allocationSize = 1)
  24 + @Column(name = "mun_id_municipio")
  25 + private Long id;
  26 +
  27 + @Column(name = "mun_no_nome")
  28 + private String nome;
  29 +
  30 + @ManyToOne
  31 + @JoinColumn(name = "mun_fk_euf_id_estado")
  32 + private TbEstado estado;
  33 +
  34 + @Override
  35 + public Long getId() {
  36 + return id;
  37 + }
  38 +
  39 + public void setId(Long id) {
  40 + this.id = id;
  41 + }
  42 +
  43 + public String getNome() {
  44 + return nome;
  45 + }
  46 +
  47 + public void setNome(String nome) {
  48 + this.nome = nome;
  49 + }
  50 +
  51 + public TbEstado getEstado() {
  52 + return estado;
  53 + }
  54 +
  55 + public void setEstado(TbEstado estado) {
  56 + this.estado = estado;
  57 + }
  58 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbRelatorio.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbRelatorio.java
... ... @@ -0,0 +1,135 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDate;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.EnumType;
  8 +import javax.persistence.Enumerated;
  9 +import javax.persistence.GeneratedValue;
  10 +import javax.persistence.GenerationType;
  11 +import javax.persistence.Id;
  12 +import javax.persistence.SequenceGenerator;
  13 +import javax.persistence.Table;
  14 +import javax.persistence.Transient;
  15 +
  16 +import org.hibernate.annotations.Parameter;
  17 +import org.hibernate.annotations.Type;
  18 +
  19 +import br.gov.mj.carros.entity.util.EnumStatusRelatorio;
  20 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  21 +
  22 +@Entity
  23 +@Table(name = "tb_rel_relatorio")
  24 +public class TbRelatorio extends BaseEntity<Long> {
  25 +
  26 + private static final long serialVersionUID = 2023537540922854184L;
  27 +
  28 + @Id
  29 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_rel_relatorio")
  30 + @SequenceGenerator(name = "seq_tb_rel_relatorio", sequenceName = "seq_tb_rel_relatorio", allocationSize = 1)
  31 + @Column(name = "rel_id_relatorio")
  32 + private Long id;
  33 +
  34 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  35 + @Column(name = "rel_dt_emissao")
  36 + private LocalDate dataEmissao;
  37 +
  38 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  39 + @Column(name = "rel_dt_inicio_periodo")
  40 + private LocalDate periodoInicio;
  41 +
  42 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  43 + @Column(name = "rel_dt_final_periodo")
  44 + private LocalDate periodoFim;
  45 +
  46 + @Enumerated(EnumType.ORDINAL)
  47 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumStatusRelatorio", name = "enumClassName") )
  48 + @Column(name = "rel_tp_situacao")
  49 + private EnumStatusRelatorio situacao;
  50 +
  51 + @Column(name = "rel_no_responsavel_aprovacao")
  52 + private String nomeResponsavel;
  53 +
  54 + @Column(name = "rel_nm_arquivo")
  55 + private String nomeArquivo;
  56 +
  57 + @Column(name = "rel_ar_arquivo")
  58 + private Byte[] arquivo;
  59 +
  60 + @Transient
  61 + private Long itemsPerPage;
  62 +
  63 + @Override
  64 + public Long getId() {
  65 + return id;
  66 + }
  67 +
  68 + public void setId(Long id) {
  69 + this.id = id;
  70 + }
  71 +
  72 + public LocalDate getDataEmissao() {
  73 + return dataEmissao;
  74 + }
  75 +
  76 + public void setDataEmissao(LocalDate dataEmissao) {
  77 + this.dataEmissao = dataEmissao;
  78 + }
  79 +
  80 + public LocalDate getPeriodoInicio() {
  81 + return periodoInicio;
  82 + }
  83 +
  84 + public void setPeriodoInicio(LocalDate periodoInicio) {
  85 + this.periodoInicio = periodoInicio;
  86 + }
  87 +
  88 + public LocalDate getPeriodoFim() {
  89 + return periodoFim;
  90 + }
  91 +
  92 + public void setPeriodoFim(LocalDate periodoFim) {
  93 + this.periodoFim = periodoFim;
  94 + }
  95 +
  96 + public EnumStatusRelatorio getSituacao() {
  97 + return situacao;
  98 + }
  99 +
  100 + public void setSituacao(EnumStatusRelatorio situacao) {
  101 + this.situacao = situacao;
  102 + }
  103 +
  104 + public String getNomeResponsavel() {
  105 + return nomeResponsavel;
  106 + }
  107 +
  108 + public void setNomeResponsavel(String nomeResponsavel) {
  109 + this.nomeResponsavel = nomeResponsavel;
  110 + }
  111 +
  112 + public String getNomeArquivo() {
  113 + return nomeArquivo;
  114 + }
  115 +
  116 + public void setNomeArquivo(String nomeArquivo) {
  117 + this.nomeArquivo = nomeArquivo;
  118 + }
  119 +
  120 + public Byte[] getArquivo() {
  121 + return arquivo;
  122 + }
  123 +
  124 + public void setArquivo(Byte[] arquivo) {
  125 + this.arquivo = arquivo;
  126 + }
  127 +
  128 + public Long getItemsPerPage() {
  129 + return itemsPerPage;
  130 + }
  131 +
  132 + public void setItemsPerPage(Long itemsPerPage) {
  133 + this.itemsPerPage = itemsPerPage;
  134 + }
  135 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbRota.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbRota.java
... ... @@ -0,0 +1,105 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.JoinColumn;
  9 +import javax.persistence.ManyToOne;
  10 +import javax.persistence.OneToOne;
  11 +import javax.persistence.SequenceGenerator;
  12 +import javax.persistence.Table;
  13 +
  14 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  15 +
  16 +@Entity
  17 +@Table(name = "tb_rta_rota")
  18 +public class TbRota extends BaseEntity<Long> {
  19 +
  20 + private static final long serialVersionUID = 7362747956921761474L;
  21 +
  22 + @Id
  23 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_rta_rota")
  24 + @SequenceGenerator(name = "seq_tb_rta_rota", sequenceName = "seq_tb_rta_rota", allocationSize = 1)
  25 + @Column(name = "rta_id_rota")
  26 + private Long id;
  27 +
  28 + @OneToOne
  29 + @JoinColumn(name = "rta_fk_sol_id_solicitacao")
  30 + private TbSolicitacao solicitacao;
  31 +
  32 + @ManyToOne
  33 + @JoinColumn(name = "rta_fk_end_id_endereco_inicial")
  34 + private TbEndereco enderecoInicial;
  35 +
  36 + @ManyToOne
  37 + @JoinColumn(name = "rta_fk_end_id_endereco_final")
  38 + private TbEndereco enderecoFinal;
  39 +
  40 + @Column(name = "rta_nu_tempo_total")
  41 + private Integer tempoTotal;
  42 +
  43 + @Column(name = "rta_nu_distancia_total")
  44 + private Integer distanciaTotal;
  45 +
  46 + @Column(name = "rta_ds_itinerario")
  47 + private String itinerario;
  48 +
  49 + @Override
  50 + public Long getId() {
  51 + return id;
  52 + }
  53 +
  54 + public void setId(Long id) {
  55 + this.id = id;
  56 + }
  57 +
  58 + public TbSolicitacao getSolicitacao() {
  59 + return solicitacao;
  60 + }
  61 +
  62 + public void setSolicitacao(TbSolicitacao solicitacao) {
  63 + this.solicitacao = solicitacao;
  64 + }
  65 +
  66 + public TbEndereco getEnderecoInicial() {
  67 + return enderecoInicial;
  68 + }
  69 +
  70 + public void setEnderecoInicial(TbEndereco enderecoInicial) {
  71 + this.enderecoInicial = enderecoInicial;
  72 + }
  73 +
  74 + public TbEndereco getEnderecoFinal() {
  75 + return enderecoFinal;
  76 + }
  77 +
  78 + public void setEnderecoFinal(TbEndereco enderecoFinal) {
  79 + this.enderecoFinal = enderecoFinal;
  80 + }
  81 +
  82 + public Integer getTempoTotal() {
  83 + return tempoTotal;
  84 + }
  85 +
  86 + public void setTempoTotal(Integer tempoTotal) {
  87 + this.tempoTotal = tempoTotal;
  88 + }
  89 +
  90 + public Integer getDistanciaTotal() {
  91 + return distanciaTotal;
  92 + }
  93 +
  94 + public void setDistanciaTotal(Integer distanciaTotal) {
  95 + this.distanciaTotal = distanciaTotal;
  96 + }
  97 +
  98 + public String getItinerario() {
  99 + return itinerario;
  100 + }
  101 +
  102 + public void setItinerario(String itinerario) {
  103 + this.itinerario = itinerario;
  104 + }
  105 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbSolicitacao.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbSolicitacao.java
... ... @@ -0,0 +1,504 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.time.LocalDate;
  5 +import java.time.LocalTime;
  6 +import java.time.format.DateTimeFormatter;
  7 +import java.util.Set;
  8 +
  9 +import javax.persistence.CascadeType;
  10 +import javax.persistence.Column;
  11 +import javax.persistence.Entity;
  12 +import javax.persistence.EnumType;
  13 +import javax.persistence.Enumerated;
  14 +import javax.persistence.FetchType;
  15 +import javax.persistence.GeneratedValue;
  16 +import javax.persistence.GenerationType;
  17 +import javax.persistence.Id;
  18 +import javax.persistence.JoinColumn;
  19 +import javax.persistence.ManyToOne;
  20 +import javax.persistence.OneToMany;
  21 +import javax.persistence.OneToOne;
  22 +import javax.persistence.SequenceGenerator;
  23 +import javax.persistence.Table;
  24 +import javax.persistence.Transient;
  25 +
  26 +import org.apache.commons.lang3.StringUtils;
  27 +import org.hibernate.annotations.Parameter;
  28 +import org.hibernate.annotations.Type;
  29 +
  30 +import br.gov.mj.carros.entity.seguranca.TbUsuario;
  31 +import br.gov.mj.carros.entity.util.EnumCategoria;
  32 +import br.gov.mj.carros.entity.util.EnumMeses;
  33 +import br.gov.mj.carros.entity.util.EnumPercuso;
  34 +import br.gov.mj.carros.entity.util.EnumStatusSolicitacao;
  35 +import br.gov.mj.carros.entity.util.EnumTipoPeriodo;
  36 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  37 +
  38 +@Entity
  39 +@Table(name = "tb_sol_solicitacao")
  40 +public class TbSolicitacao extends BaseEntity<Long> {
  41 +
  42 + private static final long serialVersionUID = -6016915106116787358L;
  43 +
  44 + @Id
  45 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_sol_solicitacao")
  46 + @SequenceGenerator(name = "seq_tb_sol_solicitacao", sequenceName = "seq_tb_sol_solicitacao", allocationSize = 1)
  47 + @Column(name = "sol_id_solicitacao")
  48 + private Long id;
  49 +
  50 + @Column(name = "sol_nu_identificador")
  51 + private String codigoIdentificador;
  52 +
  53 + @Enumerated(EnumType.STRING)
  54 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumStatusSolicitacao", name = "enumClassName") )
  55 + @Column(name = "sol_tp_status")
  56 + private EnumStatusSolicitacao status;
  57 +
  58 + @Column(name = "sol_ds_motivo")
  59 + private String motivo;
  60 +
  61 + @Column(name = "sol_fk_usr_id_solicitante")
  62 + private Long usuarioSolicitante;
  63 +
  64 + @Column(name = "sol_st_ida_volta")
  65 + private String flagIdaVolta;
  66 +
  67 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  68 + @Column(name = "sol_dt_solicitacao")
  69 + private LocalDate dataSolicitacao;
  70 +
  71 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalTime")
  72 + @Column(name = "sol_hr_ida")
  73 + private LocalTime horaIda;
  74 +
  75 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalTime")
  76 + @Column(name = "sol_hr_volta")
  77 + private LocalTime horaVolta;
  78 +
  79 + @ManyToOne
  80 + @JoinColumn(name = "sol_fk_tpv_id_tipo_veiculo")
  81 + private TbTipoVeiculo tipoVeiculo;
  82 +
  83 + @Column(name = "sol_nu_quantidade_passageiros")
  84 + private Integer qtdPassageiros;
  85 +
  86 + @Column(name = "sol_ds_descricao_carga")
  87 + private String descricaoCarga;
  88 +
  89 + @Column(name = "sol_no_nome_solicitante")
  90 + private String nomeSolicitante;
  91 +
  92 + @Column(name = "sol_ds_setor")
  93 + private String setorSolicitante;
  94 +
  95 + @Column(name = "sol_ds_ramal")
  96 + private String ramalSolicitante;
  97 +
  98 + @Column(name = "sol_nu_celular")
  99 + private String celularSolicitante;
  100 +
  101 + @ManyToOne
  102 + @JoinColumn(name = "sol_fk_vei_id_veiculo")
  103 + private TbVeiculo carro;
  104 +
  105 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalTime")
  106 + @Column(name = "sol_hr_chegada")
  107 + private LocalTime horaChegada;
  108 +
  109 + @Column(name = "sol_nu_quilometragem_final")
  110 + private Integer quilometragemFinal;
  111 +
  112 + @Enumerated(EnumType.ORDINAL)
  113 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumCategoria", name = "enumClassName") )
  114 + @Column(name = "sol_tp_categoria")
  115 + private EnumCategoria categoria;
  116 +
  117 + @Column(name = "sol_ds_observacao")
  118 + private String observacao;
  119 +
  120 + @OneToOne(mappedBy = "solicitacao", cascade = CascadeType.ALL)
  121 + private TbRota rota;
  122 +
  123 + @OneToMany(mappedBy = "solicitacao", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  124 + private Set<TbHistoricoCarona> historicoCarona;
  125 +
  126 + @Transient
  127 + private TbUsuario usuarioSolicitanteTemp;
  128 +
  129 + @Transient
  130 + private String flagIdaVoltaTemp;
  131 +
  132 + @Transient
  133 + private String horaIdaTemp;
  134 +
  135 + @Transient
  136 + private String horaVoltaTemp;
  137 +
  138 + @Transient
  139 + private String horaChegadaTemp;
  140 +
  141 + @Transient
  142 + private String dataSolicitacaoTemp;
  143 +
  144 + @Transient
  145 + private String flagVincularSolicacaoTemp;
  146 +
  147 + @Transient
  148 + private String radioGrupo;
  149 +
  150 + @Transient
  151 + private EnumTipoPeriodo tipoPeriodo;
  152 +
  153 + @Transient
  154 + private LocalDate dataInicioTemp;
  155 +
  156 + @Transient
  157 + private LocalDate dataFimTemp;
  158 +
  159 + @Transient
  160 + private EnumMeses mesTemp;
  161 +
  162 + @Transient
  163 + private EnumPercuso tipoPercurso;
  164 +
  165 + @Transient
  166 + private BigDecimal custoTemp;
  167 +
  168 + @Override
  169 + public Long getId() {
  170 + return id;
  171 + }
  172 +
  173 + public void setId(Long id) {
  174 + this.id = id;
  175 + }
  176 +
  177 + public String getCodigoIdentificador() {
  178 + return codigoIdentificador;
  179 + }
  180 +
  181 + public void setCodigoIdentificador(String codigoIdentificador) {
  182 + this.codigoIdentificador = codigoIdentificador;
  183 + }
  184 +
  185 + public EnumStatusSolicitacao getStatus() {
  186 + return status;
  187 + }
  188 +
  189 + public void setStatus(EnumStatusSolicitacao status) {
  190 + this.status = status;
  191 + }
  192 +
  193 + public String getMotivo() {
  194 + return motivo;
  195 + }
  196 +
  197 + public void setMotivo(String motivo) {
  198 + this.motivo = motivo;
  199 + }
  200 +
  201 + public Long getUsuarioSolicitante() {
  202 + return usuarioSolicitante;
  203 + }
  204 +
  205 + public void setUsuarioSolicitante(Long usuarioSolicitante) {
  206 + this.usuarioSolicitante = usuarioSolicitante;
  207 + }
  208 +
  209 + public String getFlagIdaVolta() {
  210 + if (this.flagIdaVolta == null && this.flagIdaVoltaTemp != null)
  211 + this.flagIdaVolta = (this.flagIdaVoltaTemp.equals("true")) ? "1" : "0";
  212 +
  213 + return flagIdaVolta;
  214 + }
  215 +
  216 + public void setFlagIdaVolta(String flagIdaVolta) {
  217 + this.flagIdaVolta = flagIdaVolta;
  218 +
  219 + if (!StringUtils.isEmpty(flagIdaVolta))
  220 + this.flagIdaVoltaTemp = (flagIdaVolta.equals("1")) ? "true" : "false";
  221 + }
  222 +
  223 + public String getFlagIdaVoltaTemp() {
  224 + if (this.flagIdaVoltaTemp == null && this.flagIdaVolta != null)
  225 + this.flagIdaVoltaTemp = (this.flagIdaVolta.equals("1")) ? "true" : "false";
  226 +
  227 + return flagIdaVoltaTemp;
  228 + }
  229 +
  230 + public void setFlagIdaVoltaTemp(String flagIdaVoltaTemp) {
  231 + this.flagIdaVoltaTemp = flagIdaVoltaTemp;
  232 +
  233 + if (!StringUtils.isEmpty(flagIdaVoltaTemp))
  234 + this.flagIdaVolta = (flagIdaVoltaTemp.equals("true")) ? "1" : "0";
  235 + }
  236 +
  237 + public LocalDate getDataSolicitacao() {
  238 + return dataSolicitacao;
  239 + }
  240 +
  241 + public void setDataSolicitacao(LocalDate dataSolicitacao) {
  242 + this.dataSolicitacao = dataSolicitacao;
  243 + }
  244 +
  245 + public LocalTime getHoraIda() {
  246 + return horaIda;
  247 + }
  248 +
  249 + public void setHoraIda(LocalTime horaIda){
  250 + this.horaIda = horaIda;
  251 + }
  252 +
  253 + public LocalTime getHoraVolta() {
  254 + return horaVolta;
  255 + }
  256 +
  257 + public void setHoraVolta(LocalTime horaVolta) {
  258 + this.horaVolta = horaVolta;
  259 + }
  260 +
  261 + public String getHoraIdaTemp() {
  262 + if(horaIda != null)
  263 + horaIdaTemp = horaIda.toString();
  264 +
  265 + return horaIdaTemp;
  266 + }
  267 +
  268 + public void setHoraIdaTemp(String horaIdaTemp) {
  269 + this.horaIdaTemp = horaIdaTemp;
  270 +
  271 + if(horaIdaTemp != null)
  272 + this.horaIda = LocalTime.parse(horaIdaTemp);
  273 + else
  274 + this.horaIda = null;
  275 + }
  276 +
  277 + public String getHoraVoltaTemp() {
  278 + if(horaVolta != null)
  279 + horaVoltaTemp = horaVolta.toString();
  280 +
  281 + return horaVoltaTemp;
  282 + }
  283 +
  284 + public void setHoraVoltaTemp(String horaVoltaTemp) {
  285 + this.horaVoltaTemp = horaVoltaTemp;
  286 +
  287 + if (horaVoltaTemp != null)
  288 + this.horaVolta = LocalTime.parse(horaVoltaTemp);
  289 + else
  290 + this.horaVolta = null;
  291 + }
  292 +
  293 + public String getHoraChegadaTemp() {
  294 + return horaChegadaTemp;
  295 + }
  296 +
  297 + public void setHoraChegadaTemp(String horaChegadaTemp) {
  298 + this.horaChegadaTemp = horaChegadaTemp;
  299 + if (horaChegadaTemp != null)
  300 + this.horaChegada = LocalTime.parse(horaChegadaTemp);
  301 + else
  302 + this.horaChegada = null;
  303 + }
  304 +
  305 + public TbTipoVeiculo getTipoVeiculo() {
  306 + return tipoVeiculo;
  307 + }
  308 +
  309 + public void setTipoVeiculo(TbTipoVeiculo tipoVeiculo) {
  310 + this.tipoVeiculo = tipoVeiculo;
  311 + }
  312 +
  313 + public Integer getQtdPassageiros() {
  314 + return qtdPassageiros;
  315 + }
  316 +
  317 + public void setQtdPassageiros(Integer qtdPassageiros) {
  318 + this.qtdPassageiros = qtdPassageiros;
  319 + }
  320 +
  321 + public String getDescricaoCarga() {
  322 + return descricaoCarga;
  323 + }
  324 +
  325 + public void setDescricaoCarga(String descricaoCarga) {
  326 + this.descricaoCarga = descricaoCarga;
  327 + }
  328 +
  329 + public String getNomeSolicitante() {
  330 + return nomeSolicitante;
  331 + }
  332 +
  333 + public void setNomeSolicitante(String nomeSolicitante) {
  334 + this.nomeSolicitante = nomeSolicitante;
  335 + }
  336 +
  337 + public String getSetorSolicitante() {
  338 + return setorSolicitante;
  339 + }
  340 +
  341 + public void setSetorSolicitante(String setorSolicitante) {
  342 + this.setorSolicitante = setorSolicitante;
  343 + }
  344 +
  345 + public String getRamalSolicitante() {
  346 + return ramalSolicitante;
  347 + }
  348 +
  349 + public void setRamalSolicitante(String ramalSolicitante) {
  350 + this.ramalSolicitante = ramalSolicitante;
  351 + }
  352 +
  353 + public String getCelularSolicitante() {
  354 + return celularSolicitante;
  355 + }
  356 +
  357 + public void setCelularSolicitante(String celularSolicitante) {
  358 + this.celularSolicitante = celularSolicitante;
  359 + }
  360 +
  361 + public TbVeiculo getCarro() {
  362 + return carro;
  363 + }
  364 +
  365 + public void setCarro(TbVeiculo carro) {
  366 + this.carro = carro;
  367 + }
  368 +
  369 + public LocalTime getHoraChegada() {
  370 + return horaChegada;
  371 + }
  372 +
  373 + public void setHoraChegada(LocalTime horaChegada) {
  374 + this.horaChegada = horaChegada;
  375 + }
  376 +
  377 + public Integer getQuilometragemFinal() {
  378 + return quilometragemFinal;
  379 + }
  380 +
  381 + public void setQuilometragemFinal(Integer quilometragemFinal) {
  382 + this.quilometragemFinal = quilometragemFinal;
  383 + }
  384 +
  385 + public EnumCategoria getCategoria() {
  386 + return categoria;
  387 + }
  388 +
  389 + public void setCategoria(EnumCategoria categoria) {
  390 + this.categoria = categoria;
  391 + }
  392 +
  393 + public String getObservacao() {
  394 + return observacao;
  395 + }
  396 +
  397 + public void setObservacao(String observacao) {
  398 + this.observacao = observacao;
  399 + }
  400 +
  401 + public TbRota getRota() {
  402 + return rota;
  403 + }
  404 +
  405 + public void setRota(TbRota rota) {
  406 + this.rota = rota;
  407 + }
  408 +
  409 + public Set<TbHistoricoCarona> getHistoricoCarona() {
  410 + return historicoCarona;
  411 + }
  412 +
  413 + public void setHistoricoCarona(Set<TbHistoricoCarona> historicoCarona) {
  414 + this.historicoCarona = historicoCarona;
  415 + }
  416 +
  417 + public TbUsuario getUsuarioSolicitanteTemp() {
  418 + return usuarioSolicitanteTemp;
  419 + }
  420 +
  421 + public void setUsuarioSolicitanteTemp(TbUsuario usuarioSolicitanteTemp) {
  422 + this.usuarioSolicitanteTemp = usuarioSolicitanteTemp;
  423 + }
  424 +
  425 + public String getDataSolicitacaoTemp() {
  426 + if(dataSolicitacao != null)
  427 + dataSolicitacaoTemp = dataSolicitacao.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
  428 +
  429 + return dataSolicitacaoTemp;
  430 + }
  431 +
  432 + public void setDataSolicitacaoTemp(String dataSolicitacaoTemp) {
  433 + this.dataSolicitacaoTemp = dataSolicitacaoTemp;
  434 +
  435 + if(this.dataSolicitacaoTemp != null)
  436 + dataSolicitacao = LocalDate.parse(this.dataSolicitacaoTemp, DateTimeFormatter.ofPattern("dd/MM/yyyy"));
  437 + else
  438 + dataSolicitacao = null;
  439 + }
  440 +
  441 + public String getFlagVincularSolicacaoTemp() {
  442 + return flagVincularSolicacaoTemp;
  443 + }
  444 +
  445 + public void setFlagVincularSolicacaoTemp(String flagVincularSolicacaoTemp) {
  446 + this.flagVincularSolicacaoTemp = flagVincularSolicacaoTemp;
  447 + }
  448 +
  449 + public String getRadioGrupo() {
  450 + return radioGrupo;
  451 + }
  452 +
  453 + public void setRadioGrupo(String radioGrupo) {
  454 + this.radioGrupo = radioGrupo;
  455 + }
  456 +
  457 + public EnumTipoPeriodo getTipoPeriodo() {
  458 + return tipoPeriodo;
  459 + }
  460 +
  461 + public void setTipoPeriodo(EnumTipoPeriodo tipoPeriodo) {
  462 + this.tipoPeriodo = tipoPeriodo;
  463 + }
  464 +
  465 + public LocalDate getDataInicioTemp() {
  466 + return dataInicioTemp;
  467 + }
  468 +
  469 + public void setDataInicioTemp(LocalDate dataInicioTemp) {
  470 + this.dataInicioTemp = dataInicioTemp;
  471 + }
  472 +
  473 + public LocalDate getDataFimTemp() {
  474 + return dataFimTemp;
  475 + }
  476 +
  477 + public void setDataFimTemp(LocalDate dataFimTemp) {
  478 + this.dataFimTemp = dataFimTemp;
  479 + }
  480 +
  481 + public EnumMeses getMesTemp() {
  482 + return mesTemp;
  483 + }
  484 +
  485 + public void setMesTemp(EnumMeses mesTemp) {
  486 + this.mesTemp = mesTemp;
  487 + }
  488 +
  489 + public EnumPercuso getTipoPercurso() {
  490 + return tipoPercurso;
  491 + }
  492 +
  493 + public void setTipoPercurso(EnumPercuso tipoPercurso) {
  494 + this.tipoPercurso = tipoPercurso;
  495 + }
  496 +
  497 + public BigDecimal getCustoTemp() {
  498 + return custoTemp;
  499 + }
  500 +
  501 + public void setCustoTemp(BigDecimal custoTemp) {
  502 + this.custoTemp = custoTemp;
  503 + }
  504 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbTipoVeiculo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbTipoVeiculo.java
... ... @@ -0,0 +1,55 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.SequenceGenerator;
  9 +import javax.persistence.Table;
  10 +
  11 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  12 +
  13 +@Entity
  14 +@Table(name = "tb_tpv_tipo_veiculo")
  15 +public class TbTipoVeiculo extends BaseEntity<Long> {
  16 +
  17 + private static final long serialVersionUID = -8705865497450928081L;
  18 +
  19 + @Id
  20 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_tpv_tipo_veiculo")
  21 + @SequenceGenerator(name = "seq_tb_tpv_tipo_veiculo", sequenceName = "seq_tb_tpv_tipo_veiculo", allocationSize = 1)
  22 + @Column(name = "tpv_id_tipo_veiculo")
  23 + private Long id;
  24 +
  25 + @Column(name = "tpv_ds_tipo_veiculo")
  26 + private String descricao;
  27 +
  28 + @Column(name = "tpv_nu_capacidade")
  29 + private Integer capacidade;
  30 +
  31 + @Override
  32 + public Long getId() {
  33 + return id;
  34 + }
  35 +
  36 + public void setId(Long id) {
  37 + this.id = id;
  38 + }
  39 +
  40 + public String getDescricao() {
  41 + return descricao;
  42 + }
  43 +
  44 + public void setDescricao(String descricao) {
  45 + this.descricao = descricao;
  46 + }
  47 +
  48 + public Integer getCapacidade() {
  49 + return capacidade;
  50 + }
  51 +
  52 + public void setCapacidade(Integer capacidade) {
  53 + this.capacidade = capacidade;
  54 + }
  55 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbVeiculo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/TbVeiculo.java
... ... @@ -0,0 +1,326 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDate;
  4 +import java.util.List;
  5 +
  6 +import javax.persistence.Column;
  7 +import javax.persistence.Entity;
  8 +import javax.persistence.EnumType;
  9 +import javax.persistence.Enumerated;
  10 +import javax.persistence.GeneratedValue;
  11 +import javax.persistence.GenerationType;
  12 +import javax.persistence.Id;
  13 +import javax.persistence.JoinColumn;
  14 +import javax.persistence.ManyToOne;
  15 +import javax.persistence.OneToMany;
  16 +import javax.persistence.OneToOne;
  17 +import javax.persistence.SequenceGenerator;
  18 +import javax.persistence.Table;
  19 +import javax.persistence.Transient;
  20 +
  21 +import org.hibernate.annotations.Parameter;
  22 +import org.hibernate.annotations.Type;
  23 +
  24 +import br.gov.mj.carros.entity.util.EnumAtivoInativo;
  25 +import br.gov.mj.carros.entity.util.EnumCategoriaVeiculo;
  26 +import br.gov.mj.carros.entity.util.EnumTipoPropriedade;
  27 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  28 +
  29 +@Entity
  30 +@Table(name = "tb_vei_veiculo")
  31 +public class TbVeiculo extends BaseEntity<Long> {
  32 +
  33 + private static final long serialVersionUID = -2192268098155272433L;
  34 +
  35 + @Id
  36 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_vei_veiculo")
  37 + @SequenceGenerator(name = "seq_tb_vei_veiculo", sequenceName = "seq_tb_vei_veiculo", allocationSize = 1)
  38 + @Column(name = "vei_id_veiculo")
  39 + private Long id;
  40 +
  41 + @Column(name = "vei_ds_placa")
  42 + private String placa;
  43 +
  44 + @ManyToOne
  45 + @JoinColumn(name = "vei_fk_mun_id_municipio")
  46 + private TbMunicipio municipio;
  47 +
  48 + @Column(name = "vei_ds_marca")
  49 + private String marca;
  50 +
  51 + @Column(name = "vei_ds_modelo")
  52 + private String modelo;
  53 +
  54 + @Column(name = "vei_nu_renavam")
  55 + private String renavam;
  56 +
  57 + @Column(name = "vei_ds_ano_fabricacao")
  58 + private String anoFabricacao;
  59 +
  60 + @Column(name = "vei_ds_ano_modelo")
  61 + private String anoModelo;
  62 +
  63 + @Column(name = "vei_ds_cor")
  64 + private String cor;
  65 +
  66 + @ManyToOne
  67 + @JoinColumn(name = "vei_fk_tpv_id_tipo_veiculo")
  68 + private TbTipoVeiculo tipoVeiculo;
  69 +
  70 + @Enumerated(EnumType.STRING)
  71 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumTipoPropriedade", name = "enumClassName") )
  72 + @Column(name = "vei_tp_tipo_propriedade")
  73 + private EnumTipoPropriedade tipoPropriedade;
  74 +
  75 + @Column(name = "vei_nu_quilometragem_inicial")
  76 + private Integer quilometragemInicial;
  77 +
  78 + @Column(name = "vei_nu_passageiros")
  79 + private Integer numeroPassageiros;
  80 +
  81 + @Column(name = "vei_nu_capacidade_carga")
  82 + private Integer capacidadeCarga;
  83 +
  84 + @Column(name = "vei_tp_carroceria")
  85 + private String tipoCarroceria;
  86 +
  87 + @Enumerated(EnumType.STRING)
  88 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumCategoriaVeiculo", name = "enumClassName") )
  89 + @Column(name = "vei_tp_categoria")
  90 + private EnumCategoriaVeiculo categoria;
  91 +
  92 + @Enumerated(EnumType.STRING)
  93 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumAtivoInativo", name = "enumClassName") )
  94 + @Column(name = "vei_tp_situacao")
  95 + private EnumAtivoInativo situacao;
  96 +
  97 + @Column(name = "vei_ds_motivo")
  98 + private String motivo;
  99 +
  100 + @OneToOne
  101 + @JoinColumn(name = "vei_fk_vei_id_desativado")
  102 + private TbVeiculo veiculoDesativado;
  103 +
  104 + @Column(name = "vei_ds_motivo_desativado")
  105 + private String motivoVeiculoDesativado;
  106 +
  107 + @ManyToOne
  108 + @JoinColumn(name = "vei_fk_con_id_contrato")
  109 + private TbContrato contrato;
  110 +
  111 + @OneToMany(mappedBy = "carro")
  112 + private List<TbSolicitacao> solicitacoes;
  113 +
  114 + @Transient
  115 + private String modeloPlacaTemp;
  116 +
  117 + @Transient
  118 + private TbSolicitacao solicitacaoTemp;
  119 +
  120 + @Transient
  121 + private LocalDate dataSolicitacaoTemp;
  122 +
  123 + @Override
  124 + public Long getId() {
  125 + return id;
  126 + }
  127 +
  128 + public void setId(Long id) {
  129 + this.id = id;
  130 + }
  131 +
  132 + public String getPlaca() {
  133 + return placa;
  134 + }
  135 +
  136 + public void setPlaca(String placa) {
  137 + this.placa = placa;
  138 + }
  139 +
  140 + public TbMunicipio getMunicipio() {
  141 + return municipio;
  142 + }
  143 +
  144 + public void setMunicipio(TbMunicipio municipio) {
  145 + this.municipio = municipio;
  146 + }
  147 +
  148 + public String getMarca() {
  149 + return marca;
  150 + }
  151 +
  152 + public void setMarca(String marca) {
  153 + this.marca = marca;
  154 + }
  155 +
  156 + public String getModelo() {
  157 + return modelo;
  158 + }
  159 +
  160 + public void setModelo(String modelo) {
  161 + this.modelo = modelo;
  162 + }
  163 +
  164 + public String getRenavam() {
  165 + return renavam;
  166 + }
  167 +
  168 + public void setRenavam(String renavam) {
  169 + this.renavam = renavam;
  170 + }
  171 +
  172 + public String getAnoFabricacao() {
  173 + return anoFabricacao;
  174 + }
  175 +
  176 + public void setAnoFabricacao(String anoFabricacao) {
  177 + this.anoFabricacao = anoFabricacao;
  178 + }
  179 +
  180 + public String getAnoModelo() {
  181 + return anoModelo;
  182 + }
  183 +
  184 + public void setAnoModelo(String anoModelo) {
  185 + this.anoModelo = anoModelo;
  186 + }
  187 +
  188 + public String getCor() {
  189 + return cor;
  190 + }
  191 +
  192 + public void setCor(String cor) {
  193 + this.cor = cor;
  194 + }
  195 +
  196 + public TbTipoVeiculo getTipoVeiculo() {
  197 + return tipoVeiculo;
  198 + }
  199 +
  200 + public void setTipoVeiculo(TbTipoVeiculo tipoVeiculo) {
  201 + this.tipoVeiculo = tipoVeiculo;
  202 + }
  203 +
  204 + public EnumTipoPropriedade getTipoPropriedade() {
  205 + return tipoPropriedade;
  206 + }
  207 +
  208 + public void setTipoPropriedade(EnumTipoPropriedade tipoPropriedade) {
  209 + this.tipoPropriedade = tipoPropriedade;
  210 + }
  211 +
  212 + public Integer getQuilometragemInicial() {
  213 + return quilometragemInicial;
  214 + }
  215 +
  216 + public void setQuilometragemInicial(Integer quilometragemInicial) {
  217 + this.quilometragemInicial = quilometragemInicial;
  218 + }
  219 +
  220 + public Integer getNumeroPassageiros() {
  221 + return numeroPassageiros;
  222 + }
  223 +
  224 + public void setNumeroPassageiros(Integer numeroPassageiros) {
  225 + this.numeroPassageiros = numeroPassageiros;
  226 + }
  227 +
  228 + public Integer getCapacidadeCarga() {
  229 + return capacidadeCarga;
  230 + }
  231 +
  232 + public void setCapacidadeCarga(Integer capacidadeCarga) {
  233 + this.capacidadeCarga = capacidadeCarga;
  234 + }
  235 +
  236 + public String getTipoCarroceria() {
  237 + return tipoCarroceria;
  238 + }
  239 +
  240 + public void setTipoCarroceria(String tipoCarroceria) {
  241 + this.tipoCarroceria = tipoCarroceria;
  242 + }
  243 +
  244 + public EnumCategoriaVeiculo getCategoria() {
  245 + return categoria;
  246 + }
  247 +
  248 + public void setCategoria(EnumCategoriaVeiculo categoria) {
  249 + this.categoria = categoria;
  250 + }
  251 +
  252 + public EnumAtivoInativo getSituacao() {
  253 + return situacao;
  254 + }
  255 +
  256 + public void setSituacao(EnumAtivoInativo situacao) {
  257 + this.situacao = situacao;
  258 + }
  259 +
  260 + public String getMotivo() {
  261 + return motivo;
  262 + }
  263 +
  264 + public void setMotivo(String motivo) {
  265 + this.motivo = motivo;
  266 + }
  267 +
  268 + public TbVeiculo getVeiculoDesativado() {
  269 + return veiculoDesativado;
  270 + }
  271 +
  272 + public void setVeiculoDesativado(TbVeiculo veiculoDesativado) {
  273 + this.veiculoDesativado = veiculoDesativado;
  274 + }
  275 +
  276 + public String getMotivoVeiculoDesativado() {
  277 + return motivoVeiculoDesativado;
  278 + }
  279 +
  280 + public void setMotivoVeiculoDesativado(String motivoVeiculoDesativado) {
  281 + this.motivoVeiculoDesativado = motivoVeiculoDesativado;
  282 + }
  283 +
  284 + public TbContrato getContrato() {
  285 + return contrato;
  286 + }
  287 +
  288 + public void setContrato(TbContrato contrato) {
  289 + this.contrato = contrato;
  290 + }
  291 +
  292 + public List<TbSolicitacao> getSolicitacoes() {
  293 + return solicitacoes;
  294 + }
  295 +
  296 + public void setSolicitacoes(List<TbSolicitacao> solicitacoes) {
  297 + this.solicitacoes = solicitacoes;
  298 + }
  299 +
  300 + public String getModeloPlacaTemp() {
  301 + if (modelo != null && placa != null)
  302 + this.modeloPlacaTemp = modelo + " - " + placa;
  303 +
  304 + return modeloPlacaTemp;
  305 + }
  306 +
  307 + public void setModeloPlacaTemp(String modeloPlacaTemp) {
  308 + this.modeloPlacaTemp = modeloPlacaTemp;
  309 + }
  310 +
  311 + public TbSolicitacao getSolicitacaoTemp() {
  312 + return solicitacaoTemp;
  313 + }
  314 +
  315 + public void setSolicitacaoTemp(TbSolicitacao solicitacaoTemp) {
  316 + this.solicitacaoTemp = solicitacaoTemp;
  317 + }
  318 +
  319 + public LocalDate getDataSolicitacaoTemp() {
  320 + return dataSolicitacaoTemp;
  321 + }
  322 +
  323 + public void setDataSolicitacaoTemp(LocalDate dataSolicitacaoTemp) {
  324 + this.dataSolicitacaoTemp = dataSolicitacaoTemp;
  325 + }
  326 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/VwVeiculoSolicitacao.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/carros/VwVeiculoSolicitacao.java
... ... @@ -0,0 +1,141 @@
  1 +package br.gov.mj.carros.entity.carros;
  2 +
  3 +import java.time.LocalDate;
  4 +import java.time.LocalTime;
  5 +
  6 +import javax.persistence.Column;
  7 +import javax.persistence.Entity;
  8 +import javax.persistence.EnumType;
  9 +import javax.persistence.Enumerated;
  10 +import javax.persistence.Id;
  11 +import javax.persistence.Table;
  12 +
  13 +import org.hibernate.annotations.Parameter;
  14 +import org.hibernate.annotations.Type;
  15 +
  16 +import br.gov.mj.carros.entity.util.EnumStatusSolicitacao;
  17 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  18 +
  19 +@Entity
  20 +@Table(name = "vw_vsl_veiculo_solicitacao")
  21 +public class VwVeiculoSolicitacao extends BaseEntity<String> {
  22 +
  23 + private static final long serialVersionUID = -1639109017007708364L;
  24 +
  25 + @Id
  26 + @Column(name = "id")
  27 + private String id;
  28 +
  29 + @Column(name = "vei_ds_modelo")
  30 + private String modelo;
  31 +
  32 + @Column(name = "vei_ds_placa")
  33 + private String placa;
  34 +
  35 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  36 + @Column(name = "sol_dt_solicitacao")
  37 + private LocalDate dataSolicitacao;
  38 +
  39 + @Column(name = "endereco_inicial")
  40 + private String enderecoInicial;
  41 +
  42 + @Column(name = "endereco_final")
  43 + private String enderecoFinal;
  44 +
  45 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalTime")
  46 + @Column(name = "sol_hr_ida")
  47 + private LocalTime horaIda;
  48 +
  49 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalTime")
  50 + @Column(name = "sol_hr_chegada")
  51 + private LocalTime horaChegada;
  52 +
  53 + @Column(name = "sol_nu_quilometragem_final")
  54 + private Integer quilometragemFinal;
  55 +
  56 + @Enumerated(EnumType.STRING)
  57 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumStatusSolicitacao", name = "enumClassName") )
  58 + @Column(name = "sol_tp_status")
  59 + private EnumStatusSolicitacao status;
  60 +
  61 + @Override
  62 + public String getId() {
  63 + return id;
  64 + }
  65 +
  66 + public void setId(String id) {
  67 + this.id = id;
  68 + }
  69 +
  70 + public String getModelo() {
  71 + return modelo;
  72 + }
  73 +
  74 + public void setModelo(String modelo) {
  75 + this.modelo = modelo;
  76 + }
  77 +
  78 + public String getPlaca() {
  79 + return placa;
  80 + }
  81 +
  82 + public void setPlaca(String placa) {
  83 + this.placa = placa;
  84 + }
  85 +
  86 + public LocalDate getDataSolicitacao() {
  87 + return dataSolicitacao;
  88 + }
  89 +
  90 + public void setDataSolicitacao(LocalDate dataSolicitacao) {
  91 + this.dataSolicitacao = dataSolicitacao;
  92 + }
  93 +
  94 + public String getEnderecoInicial() {
  95 + return enderecoInicial;
  96 + }
  97 +
  98 + public void setEnderecoInicial(String enderecoInicial) {
  99 + this.enderecoInicial = enderecoInicial;
  100 + }
  101 +
  102 + public String getEnderecoFinal() {
  103 + return enderecoFinal;
  104 + }
  105 +
  106 + public void setEnderecoFinal(String enderecoFinal) {
  107 + this.enderecoFinal = enderecoFinal;
  108 + }
  109 +
  110 + public LocalTime getHoraIda() {
  111 + return horaIda;
  112 + }
  113 +
  114 + public void setHoraIda(LocalTime horaIda) {
  115 + this.horaIda = horaIda;
  116 + }
  117 +
  118 + public LocalTime getHoraChegada() {
  119 + return horaChegada;
  120 + }
  121 +
  122 + public void setHoraChegada(LocalTime horaChegada) {
  123 + this.horaChegada = horaChegada;
  124 + }
  125 +
  126 + public Integer getQuilometragemFinal() {
  127 + return quilometragemFinal;
  128 + }
  129 +
  130 + public void setQuilometragemFinal(Integer quilometragemFinal) {
  131 + this.quilometragemFinal = quilometragemFinal;
  132 + }
  133 +
  134 + public EnumStatusSolicitacao getStatus() {
  135 + return status;
  136 + }
  137 +
  138 + public void setStatus(EnumStatusSolicitacao status) {
  139 + this.status = status;
  140 + }
  141 +}
0 142 \ No newline at end of file
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/ldap/UsuarioLDAPDto.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/ldap/UsuarioLDAPDto.java
... ... @@ -0,0 +1,95 @@
  1 +package br.gov.mj.carros.entity.ldap;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Map;
  5 +
  6 +/**
  7 + * DTO para guardar os valores da consulta ao LDAP
  8 + *
  9 + * @author bruno.nunesmaia
  10 + * @since 21/12/2015
  11 + */
  12 +public class UsuarioLDAPDto implements Serializable {
  13 +
  14 + private static final long serialVersionUID = -2909938157449727016L;
  15 +
  16 + private String login;
  17 + private String numeroCpf;
  18 + private String nomeCompleto;
  19 + private String primeiroNome;
  20 + private String email;
  21 + private String setor;
  22 + private String ramal;
  23 +
  24 + /**
  25 + * Constrói o objeto a partir do Map de atributos.
  26 + *
  27 + * @param attributeValues Map contendo os atributos do usuário.
  28 + */
  29 + public UsuarioLDAPDto(Map<String, Object> attributeValues) {
  30 +
  31 + this.email = attributeValues.get("mail") == null ? "" : attributeValues.get("mail").toString();
  32 + this.login = attributeValues.get("sAMAccountName") == null ? "" : attributeValues.get("sAMAccountName").toString();
  33 + this.primeiroNome = attributeValues.get("givenName") == null ? "" : attributeValues.get("givenName").toString();
  34 + this.numeroCpf = attributeValues.get("CPF") == null ? "" : attributeValues.get("CPF").toString();
  35 + this.nomeCompleto = attributeValues.get("cn") == null ? "" : attributeValues.get("cn").toString();
  36 + this.setor = attributeValues.get("physicalDeliveryOfficeName") == null ? "" : attributeValues.get("physicalDeliveryOfficeName").toString();
  37 + this.ramal = attributeValues.get("telephoneNumber") == null ? "" : attributeValues.get("telephoneNumber").toString();
  38 + }
  39 +
  40 + public String getLogin() {
  41 + return login;
  42 + }
  43 +
  44 + public void setLogin(String login) {
  45 + this.login = login;
  46 + }
  47 +
  48 + public String getNumeroCpf() {
  49 + return numeroCpf;
  50 + }
  51 +
  52 + public void setNumeroCpf(String numeroCpf) {
  53 + this.numeroCpf = numeroCpf;
  54 + }
  55 +
  56 + public String getNomeCompleto() {
  57 + return nomeCompleto;
  58 + }
  59 +
  60 + public void setNomeCompleto(String nomeCompleto) {
  61 + this.nomeCompleto = nomeCompleto;
  62 + }
  63 +
  64 + public String getPrimeiroNome() {
  65 + return primeiroNome;
  66 + }
  67 +
  68 + public void setPrimeiroNome(String primeiroNome) {
  69 + this.primeiroNome = primeiroNome;
  70 + }
  71 +
  72 + public String getEmail() {
  73 + return email;
  74 + }
  75 +
  76 + public void setEmail(String email) {
  77 + this.email = email;
  78 + }
  79 +
  80 + public String getSetor() {
  81 + return setor;
  82 + }
  83 +
  84 + public void setSetor(String setor) {
  85 + this.setor = setor;
  86 + }
  87 +
  88 + public String getRamal() {
  89 + return ramal;
  90 + }
  91 +
  92 + public void setRamal(String ramal) {
  93 + this.ramal = ramal;
  94 + }
  95 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbDocumentoUsuario.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbDocumentoUsuario.java
... ... @@ -0,0 +1,135 @@
  1 +package br.gov.mj.carros.entity.seguranca;
  2 +
  3 +import java.time.LocalDate;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.EnumType;
  8 +import javax.persistence.Enumerated;
  9 +import javax.persistence.GeneratedValue;
  10 +import javax.persistence.GenerationType;
  11 +import javax.persistence.Id;
  12 +import javax.persistence.JoinColumn;
  13 +import javax.persistence.ManyToOne;
  14 +import javax.persistence.SequenceGenerator;
  15 +import javax.persistence.Table;
  16 +
  17 +import org.hibernate.annotations.Parameter;
  18 +import org.hibernate.annotations.Type;
  19 +
  20 +import br.gov.mj.carros.entity.util.EnumTipoDocumento;
  21 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  22 +
  23 +@Entity
  24 +@Table(name = "tb_dcu_documento_usuario", schema = "seguranca")
  25 +public class TbDocumentoUsuario extends BaseEntity<Long> {
  26 +
  27 + private static final long serialVersionUID = -548379515287647447L;
  28 +
  29 + @Id
  30 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_dcu_documento_usuario")
  31 + @SequenceGenerator(name = "seq_tb_dcu_documento_usuario", sequenceName = "seguranca.seq_tb_dcu_documento_usuario", allocationSize = 1)
  32 + @Column(name = "dcu_id_documento_usuario")
  33 + private Long id;
  34 +
  35 + @ManyToOne
  36 + @JoinColumn(name = "dcu_fk_usr_id_usuario")
  37 + private TbUsuario usuario;
  38 +
  39 + @Enumerated(EnumType.STRING)
  40 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumTipoDocumento", name = "enumClassName") )
  41 + @Column(name = "dcu_tp_tipo_documento")
  42 + private EnumTipoDocumento tipoDocumento;
  43 +
  44 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  45 + @Column(name = "dcu_dt_cadastro")
  46 + private LocalDate dataCadastro;
  47 +
  48 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  49 + @Column(name = "dcu_dt_documento")
  50 + private LocalDate dataDocumento;
  51 +
  52 + @Column(name = "dcu_ar_nome_arquivo")
  53 + private String nomeArquivo;
  54 +
  55 + @Column(name = "dcu_ar_tamanho_arquivo")
  56 + private String tamanhoArquivo;
  57 +
  58 + @Column(name = "dcu_ar_arquivo")
  59 + private Byte[] arquivo;
  60 +
  61 + @Override
  62 + public Long getId() {
  63 + return id;
  64 + }
  65 +
  66 + public void setId(Long id) {
  67 + this.id = id;
  68 + }
  69 +
  70 + public TbUsuario getUsuario() {
  71 + return usuario;
  72 + }
  73 +
  74 + public void setUsuario(TbUsuario usuario) {
  75 + this.usuario = usuario;
  76 + }
  77 +
  78 + public EnumTipoDocumento getTipoDocumento() {
  79 + return tipoDocumento;
  80 + }
  81 +
  82 + public void setTipoDocumento(EnumTipoDocumento tipoDocumento) {
  83 + this.tipoDocumento = tipoDocumento;
  84 + }
  85 +
  86 + public LocalDate getDataCadastro() {
  87 + return dataCadastro;
  88 + }
  89 +
  90 + public void setDataCadastro(LocalDate dataCadastro) {
  91 + this.dataCadastro = dataCadastro;
  92 + }
  93 +
  94 + public LocalDate getDataDocumento() {
  95 + return dataDocumento;
  96 + }
  97 +
  98 + public void setDataDocumento(LocalDate dataDocumento) {
  99 + this.dataDocumento = dataDocumento;
  100 + }
  101 +
  102 + public String getNomeArquivo() {
  103 + return nomeArquivo;
  104 + }
  105 +
  106 + public void setNomeArquivo(String nomeArquivo) {
  107 + this.nomeArquivo = nomeArquivo;
  108 + }
  109 +
  110 + public String getTamanhoArquivo() {
  111 + return tamanhoArquivo;
  112 + }
  113 +
  114 + public void setTamanhoArquivo(String tamanhoArquivo) {
  115 + this.tamanhoArquivo = tamanhoArquivo;
  116 + }
  117 +
  118 + public Byte[] getArquivo() {
  119 + return arquivo;
  120 + }
  121 +
  122 + public void setArquivo(Byte[] arquivo) {
  123 + this.arquivo = arquivo;
  124 + }
  125 +
  126 + public static Byte[] converterParaByte(byte[] bytesPrim) {
  127 + Byte[] bytes = new Byte[bytesPrim.length];
  128 +
  129 + int i = 0;
  130 + for (byte b : bytesPrim)
  131 + bytes[i++] = b;
  132 +
  133 + return bytes;
  134 + }
  135 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbFuncionalidade.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbFuncionalidade.java
... ... @@ -0,0 +1,69 @@
  1 +package br.gov.mj.carros.entity.seguranca;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.JoinColumn;
  9 +import javax.persistence.ManyToOne;
  10 +import javax.persistence.SequenceGenerator;
  11 +import javax.persistence.Table;
  12 +
  13 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  14 +
  15 +@Entity
  16 +@Table(name = "tb_fnc_funcionalidade", schema = "seguranca")
  17 +public class TbFuncionalidade extends BaseEntity<Long> {
  18 +
  19 + private static final long serialVersionUID = -193022071974621546L;
  20 +
  21 + @Id
  22 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_fnc_funcionalidade")
  23 + @SequenceGenerator(name = "seq_tb_fnc_funcionalidade", sequenceName = "seguranca.seq_tb_fnc_funcionalidade", allocationSize = 1)
  24 + @Column(name = "fnc_id_funcionalidade")
  25 + private Long id;
  26 +
  27 + @ManyToOne
  28 + @JoinColumn(name = "fnc_fk_sis_id_sistema")
  29 + private TbSistema sistema;
  30 +
  31 + @Column(name = "fnc_ds_descricao")
  32 + private String descricao;
  33 +
  34 + @Column(name = "fnc_to_token")
  35 + private String token;
  36 +
  37 + @Override
  38 + public Long getId() {
  39 + return id;
  40 + }
  41 +
  42 + public void setId(Long id) {
  43 + this.id = id;
  44 + }
  45 +
  46 + public TbSistema getSistema() {
  47 + return sistema;
  48 + }
  49 +
  50 + public void setSistema(TbSistema sistema) {
  51 + this.sistema = sistema;
  52 + }
  53 +
  54 + public String getDescricao() {
  55 + return descricao;
  56 + }
  57 +
  58 + public void setDescricao(String descricao) {
  59 + this.descricao = descricao;
  60 + }
  61 +
  62 + public String getToken() {
  63 + return token;
  64 + }
  65 +
  66 + public void setToken(String token) {
  67 + this.token = token;
  68 + }
  69 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbPerfil.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbPerfil.java
... ... @@ -0,0 +1,107 @@
  1 +package br.gov.mj.carros.entity.seguranca;
  2 +
  3 +import java.util.Set;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.EnumType;
  8 +import javax.persistence.Enumerated;
  9 +import javax.persistence.FetchType;
  10 +import javax.persistence.GeneratedValue;
  11 +import javax.persistence.GenerationType;
  12 +import javax.persistence.Id;
  13 +import javax.persistence.JoinColumn;
  14 +import javax.persistence.JoinTable;
  15 +import javax.persistence.ManyToMany;
  16 +import javax.persistence.ManyToOne;
  17 +import javax.persistence.SequenceGenerator;
  18 +import javax.persistence.Table;
  19 +
  20 +import org.hibernate.annotations.Parameter;
  21 +import org.hibernate.annotations.Type;
  22 +
  23 +import br.gov.mj.carros.entity.util.EnumTipoUsuario;
  24 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  25 +
  26 +@Entity
  27 +@Table(name = "tb_prf_perfil", schema = "seguranca")
  28 +public class TbPerfil extends BaseEntity<Long> {
  29 +
  30 + private static final long serialVersionUID = -7887819947740327069L;
  31 +
  32 + @Id
  33 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_prf_perfil")
  34 + @SequenceGenerator(name = "seq_tb_prf_perfil", sequenceName = "seguranca.seq_tb_prf_perfil", allocationSize = 1)
  35 + @Column(name = "prf_id_perfil")
  36 + private Long id;
  37 +
  38 + @ManyToOne
  39 + @JoinColumn(name = "prf_fk_sis_id_sistema")
  40 + private TbSistema sistema;
  41 +
  42 + @Column(name = "prf_no_nome")
  43 + private String nome;
  44 +
  45 + @Column(name = "prf_ds_descricao")
  46 + private String descricao;
  47 +
  48 + @Enumerated(EnumType.STRING)
  49 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumTipoUsuario", name = "enumClassName") )
  50 + @Column(name = "prf_tp_tipo_usuario")
  51 + private EnumTipoUsuario tipoUsuario;
  52 +
  53 + @ManyToMany(fetch = FetchType.EAGER)
  54 + @JoinTable(name = "ta_prf_fnc", schema = "seguranca",
  55 + joinColumns = { @JoinColumn(name = "prf_id_perfil", referencedColumnName = "prf_id_perfil") },
  56 + inverseJoinColumns = { @JoinColumn(name = "fnc_id_funcionalidade", referencedColumnName = "fnc_id_funcionalidade") })
  57 + private Set<TbFuncionalidade> funcionalidades;
  58 +
  59 + @Override
  60 + public Long getId() {
  61 + return id;
  62 + }
  63 +
  64 + public void setId(Long id) {
  65 + this.id = id;
  66 + }
  67 +
  68 + public TbSistema getSistema() {
  69 + return sistema;
  70 + }
  71 +
  72 + public void setSistema(TbSistema sistema) {
  73 + this.sistema = sistema;
  74 + }
  75 +
  76 + public String getNome() {
  77 + return nome;
  78 + }
  79 +
  80 + public void setNome(String nome) {
  81 + this.nome = nome;
  82 + }
  83 +
  84 + public String getDescricao() {
  85 + return descricao;
  86 + }
  87 +
  88 + public void setDescricao(String descricao) {
  89 + this.descricao = descricao;
  90 + }
  91 +
  92 + public EnumTipoUsuario getTipoUsuario() {
  93 + return tipoUsuario;
  94 + }
  95 +
  96 + public void setTipoUsuario(EnumTipoUsuario tipoUsuario) {
  97 + this.tipoUsuario = tipoUsuario;
  98 + }
  99 +
  100 + public Set<TbFuncionalidade> getFuncionalidades() {
  101 + return funcionalidades;
  102 + }
  103 +
  104 + public void setFuncionalidades(Set<TbFuncionalidade> funcionalidades) {
  105 + this.funcionalidades = funcionalidades;
  106 + }
  107 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbSistema.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbSistema.java
... ... @@ -0,0 +1,66 @@
  1 +package br.gov.mj.carros.entity.seguranca;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.SequenceGenerator;
  9 +import javax.persistence.Table;
  10 +
  11 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  12 +
  13 +@Entity
  14 +@Table(name = "tb_sis_sistema", schema = "seguranca")
  15 +public class TbSistema extends BaseEntity<Long> {
  16 +
  17 + private static final long serialVersionUID = -4869400886417468944L;
  18 +
  19 + @Id
  20 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_sis_sistema")
  21 + @SequenceGenerator(name = "seq_tb_sis_sistema", sequenceName = "seguranca.seq_tb_sis_sistema", allocationSize = 1)
  22 + @Column(name = "sis_id_sistema")
  23 + private Long id;
  24 +
  25 + @Column(name = "sis_no_nome")
  26 + private String nome;
  27 +
  28 + @Column(name = "sis_ds_sigla")
  29 + private String sigla;
  30 +
  31 + @Column(name = "sis_ds_descricao")
  32 + private String descricao;
  33 +
  34 + @Override
  35 + public Long getId() {
  36 + return id;
  37 + }
  38 +
  39 + public void setId(Long id) {
  40 + this.id = id;
  41 + }
  42 +
  43 + public String getNome() {
  44 + return nome;
  45 + }
  46 +
  47 + public void setNome(String nome) {
  48 + this.nome = nome;
  49 + }
  50 +
  51 + public String getSigla() {
  52 + return sigla;
  53 + }
  54 +
  55 + public void setSigla(String sigla) {
  56 + this.sigla = sigla;
  57 + }
  58 +
  59 + public String getDescricao() {
  60 + return descricao;
  61 + }
  62 +
  63 + public void setDescricao(String descricao) {
  64 + this.descricao = descricao;
  65 + }
  66 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbUsuario.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/seguranca/TbUsuario.java
... ... @@ -0,0 +1,325 @@
  1 +package br.gov.mj.carros.entity.seguranca;
  2 +
  3 +import java.time.LocalDate;
  4 +import java.util.List;
  5 +import java.util.Set;
  6 +
  7 +import javax.persistence.CascadeType;
  8 +import javax.persistence.Column;
  9 +import javax.persistence.Entity;
  10 +import javax.persistence.EnumType;
  11 +import javax.persistence.Enumerated;
  12 +import javax.persistence.FetchType;
  13 +import javax.persistence.GeneratedValue;
  14 +import javax.persistence.GenerationType;
  15 +import javax.persistence.Id;
  16 +import javax.persistence.JoinColumn;
  17 +import javax.persistence.JoinTable;
  18 +import javax.persistence.ManyToMany;
  19 +import javax.persistence.OneToMany;
  20 +import javax.persistence.SequenceGenerator;
  21 +import javax.persistence.Table;
  22 +import javax.persistence.Transient;
  23 +
  24 +import org.apache.commons.lang3.StringUtils;
  25 +import org.hibernate.annotations.Parameter;
  26 +import org.hibernate.annotations.Type;
  27 +
  28 +import br.gov.mj.carros.entity.util.EnumAtivoInativo;
  29 +import br.gov.mj.carros.entity.util.EnumTipoUsuario;
  30 +import br.gov.mj.infra.negocio.persistencia.BaseEntity;
  31 +
  32 +@Entity
  33 +@Table(name = "tb_usr_usuario", schema = "seguranca")
  34 +public class TbUsuario extends BaseEntity<Long> {
  35 +
  36 + private static final long serialVersionUID = -4869400886417468944L;
  37 +
  38 + @Id
  39 + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq_tb_usr_usuario")
  40 + @SequenceGenerator(name = "seq_tb_usr_usuario", sequenceName = "seguranca.seq_tb_usr_usuario", allocationSize = 1)
  41 + @Column(name = "usr_id_usuario")
  42 + private Long id;
  43 +
  44 + @Enumerated(EnumType.STRING)
  45 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumTipoUsuario", name = "enumClassName") )
  46 + @Column(name = "usr_tp_tipo_usuario")
  47 + private EnumTipoUsuario tipoUsuario;
  48 +
  49 + @Column(name = "usr_nu_cpf")
  50 + private String cpf;
  51 +
  52 + @Column(name = "usr_no_nome_completo")
  53 + private String nomeCompleto;
  54 +
  55 + @Column(name = "usr_ds_telefone")
  56 + private String telefone;
  57 +
  58 + @Column(name = "usr_ds_telefone_celular")
  59 + private String telefoneCelular;
  60 +
  61 + @Column(name = "usr_ds_email")
  62 + private String email;
  63 +
  64 + @Enumerated(EnumType.STRING)
  65 + @Type(type = "br.gov.mj.infra.negocio.persistencia.BaseEnumType", parameters = @Parameter(value = "br.gov.mj.carros.entity.util.EnumAtivoInativo", name = "enumClassName") )
  66 + @Column(name = "usr_tp_situacao")
  67 + private EnumAtivoInativo situacao;
  68 +
  69 + @Column(name = "usr_ds_motivo")
  70 + private String motivo;
  71 +
  72 + @Column(name = "usr_lg_login")
  73 + private String login;
  74 +
  75 + @Column(name = "usr_sn_senha")
  76 + private String senha;
  77 +
  78 + @Column(name = "usr_st_primeiro_acesso")
  79 + private String flagPrimeiroAcesso;
  80 +
  81 + @Column(name = "usr_ds_token_troca_senha")
  82 + private String tokenTrocaSenha;
  83 +
  84 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  85 + @Column(name = "usr_dt_validade_senha")
  86 + private LocalDate dataValidadeSenha;
  87 +
  88 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  89 + @Column(name = "usr_dt_validade_troca_senha")
  90 + private LocalDate dataValidadeTrocaSenha;
  91 +
  92 + @Column(name = "usr_no_usuario_cadastro")
  93 + private String nomeUsuarioCadastro;
  94 +
  95 + @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentLocalDate")
  96 + @Column(name = "usr_dt_cadastro")
  97 + private LocalDate dataCadastro;
  98 +
  99 + @Column(name = "usr_ds_setor")
  100 + private String setor;
  101 +
  102 + @Column(name = "usr_nu_ramal")
  103 + private String ramal;
  104 +
  105 + @OneToMany(mappedBy = "usuario", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  106 + private List<TbDocumentoUsuario> documentos;
  107 +
  108 + @ManyToMany(fetch = FetchType.EAGER)
  109 + @JoinTable(name = "ta_prf_usr", schema = "seguranca",
  110 + joinColumns = { @JoinColumn(name = "usr_id_usuario", referencedColumnName = "usr_id_usuario") },
  111 + inverseJoinColumns = { @JoinColumn(name = "prf_id_perfil", referencedColumnName = "prf_id_perfil") })
  112 + private Set<TbPerfil> perfis;
  113 +
  114 + @Transient
  115 + private Long itemsPerPage;
  116 +
  117 + @Override
  118 + public Long getId() {
  119 + return id;
  120 + }
  121 +
  122 + public void setId(Long id) {
  123 + this.id = id;
  124 + }
  125 +
  126 + public EnumTipoUsuario getTipoUsuario() {
  127 + return tipoUsuario;
  128 + }
  129 +
  130 + public void setTipoUsuario(EnumTipoUsuario tipoUsuario) {
  131 + this.tipoUsuario = tipoUsuario;
  132 + }
  133 +
  134 + public String getCpf() {
  135 + return cpf;
  136 + }
  137 +
  138 + public String getCpfSemMascara() {
  139 + String cpfunmasked = null;
  140 +
  141 + if (this.cpf != null)
  142 + cpfunmasked = this.cpf.replace(".", "").replace("-", "");
  143 +
  144 + return cpfunmasked;
  145 + }
  146 +
  147 + public String getCpfComMascara() {
  148 +
  149 + StringBuilder cpfmasked = new StringBuilder();
  150 +
  151 + if (!StringUtils.isEmpty(this.getCpfSemMascara()))
  152 + {
  153 + cpfmasked.append(this.getCpfSemMascara().substring(0, 3));
  154 + cpfmasked.append(".");
  155 + cpfmasked.append(this.getCpfSemMascara().substring(3, 6));
  156 + cpfmasked.append(".");
  157 + cpfmasked.append(this.getCpfSemMascara().substring(6, 9));
  158 + cpfmasked.append("-");
  159 + cpfmasked.append(this.getCpfSemMascara().substring(9, 11));
  160 + }
  161 + else
  162 + return null;
  163 +
  164 + return cpfmasked.toString();
  165 + }
  166 +
  167 + public void setCpf(String cpf) {
  168 + if(cpf != null)
  169 + this.cpf = cpf.replace(".", "").replace("-", "");
  170 + else
  171 + this.cpf = null;
  172 + }
  173 +
  174 + public String getNomeCompleto() {
  175 + return nomeCompleto;
  176 + }
  177 +
  178 + public void setNomeCompleto(String nomeCompleto) {
  179 + this.nomeCompleto = nomeCompleto;
  180 + }
  181 +
  182 + public String getTelefone() {
  183 + return telefone;
  184 + }
  185 +
  186 + public void setTelefone(String telefone) {
  187 + this.telefone = telefone;
  188 + }
  189 +
  190 + public String getTelefoneCelular() {
  191 + return telefoneCelular;
  192 + }
  193 +
  194 + public void setTelefoneCelular(String telefoneCelular) {
  195 + this.telefoneCelular = telefoneCelular;
  196 + }
  197 +
  198 + public String getEmail() {
  199 + return email;
  200 + }
  201 +
  202 + public void setEmail(String email) {
  203 + this.email = email;
  204 + }
  205 +
  206 + public EnumAtivoInativo getSituacao() {
  207 + return situacao;
  208 + }
  209 +
  210 + public void setSituacao(EnumAtivoInativo situacao) {
  211 + this.situacao = situacao;
  212 + }
  213 +
  214 + public String getMotivo() {
  215 + return motivo;
  216 + }
  217 +
  218 + public void setMotivo(String motivo) {
  219 + this.motivo = motivo;
  220 + }
  221 +
  222 + public String getLogin() {
  223 + return login;
  224 + }
  225 +
  226 + public void setLogin(String login) {
  227 + this.login = login;
  228 + }
  229 +
  230 + public String getSenha() {
  231 + return senha;
  232 + }
  233 +
  234 + public void setSenha(String senha) {
  235 + this.senha = senha;
  236 + }
  237 +
  238 + public String getFlagPrimeiroAcesso() {
  239 + return flagPrimeiroAcesso;
  240 + }
  241 +
  242 + public void setFlagPrimeiroAcesso(String flagPrimeiroAcesso) {
  243 + this.flagPrimeiroAcesso = flagPrimeiroAcesso;
  244 + }
  245 +
  246 + public String getTokenTrocaSenha() {
  247 + return tokenTrocaSenha;
  248 + }
  249 +
  250 + public void setTokenTrocaSenha(String tokenTrocaSenha) {
  251 + this.tokenTrocaSenha = tokenTrocaSenha;
  252 + }
  253 +
  254 + public LocalDate getDataValidadeSenha() {
  255 + return dataValidadeSenha;
  256 + }
  257 +
  258 + public void setDataValidadeSenha(LocalDate dataValidadeSenha) {
  259 + this.dataValidadeSenha = dataValidadeSenha;
  260 + }
  261 +
  262 + public LocalDate getDataValidadeTrocaSenha() {
  263 + return dataValidadeTrocaSenha;
  264 + }
  265 +
  266 + public void setDataValidadeTrocaSenha(LocalDate dataValidadeTrocaSenha) {
  267 + this.dataValidadeTrocaSenha = dataValidadeTrocaSenha;
  268 + }
  269 +
  270 + public String getNomeUsuarioCadastro() {
  271 + return nomeUsuarioCadastro;
  272 + }
  273 +
  274 + public void setNomeUsuarioCadastro(String nomeUsuarioCadastro) {
  275 + this.nomeUsuarioCadastro = nomeUsuarioCadastro;
  276 + }
  277 +
  278 + public LocalDate getDataCadastro() {
  279 + return dataCadastro;
  280 + }
  281 +
  282 + public void setDataCadastro(LocalDate dataCadastro) {
  283 + this.dataCadastro = dataCadastro;
  284 + }
  285 +
  286 + public String getSetor() {
  287 + return setor;
  288 + }
  289 +
  290 + public void setSetor(String setor) {
  291 + this.setor = setor;
  292 + }
  293 +
  294 + public String getRamal() {
  295 + return ramal;
  296 + }
  297 +
  298 + public void setRamal(String ramal) {
  299 + this.ramal = ramal;
  300 + }
  301 +
  302 + public List<TbDocumentoUsuario> getDocumentos() {
  303 + return documentos;
  304 + }
  305 +
  306 + public void setDocumentos(List<TbDocumentoUsuario> documentos) {
  307 + this.documentos = documentos;
  308 + }
  309 +
  310 + public Set<TbPerfil> getPerfis() {
  311 + return perfis;
  312 + }
  313 +
  314 + public void setPerfis(Set<TbPerfil> perfis) {
  315 + this.perfis = perfis;
  316 + }
  317 +
  318 + public Long getItemsPerPage() {
  319 + return itemsPerPage;
  320 + }
  321 +
  322 + public void setItemsPerPage(Long itemsPerPage) {
  323 + this.itemsPerPage = itemsPerPage;
  324 + }
  325 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumAtivoInativo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumAtivoInativo.java
... ... @@ -0,0 +1,25 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumAtivoInativo implements BaseEnum<String> {
  6 + ATIVO("A", "Ativo"),
  7 + INATIVO("I", "Inativo");
  8 +
  9 + private String valor;
  10 + private String descricao;
  11 +
  12 + private EnumAtivoInativo(String valor, String descricao) {
  13 + this.valor = valor;
  14 + this.descricao = descricao;
  15 + }
  16 +
  17 + @Override
  18 + public String getValor() {
  19 + return this.valor;
  20 + }
  21 +
  22 + public String getDescricao() {
  23 + return this.descricao;
  24 + }
  25 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumCategoria.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumCategoria.java
... ... @@ -0,0 +1,25 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumCategoria implements BaseEnum<Integer> {
  6 +
  7 + REUNIAO(new Integer(1), "Reunião");
  8 +
  9 + private Integer valor;
  10 + private String descricao;
  11 +
  12 + private EnumCategoria(Integer valor, String descricao) {
  13 + this.valor = valor;
  14 + this.descricao = descricao;
  15 + }
  16 +
  17 + @Override
  18 + public Integer getValor() {
  19 + return this.valor;
  20 + }
  21 +
  22 + public String getDescricao() {
  23 + return this.descricao;
  24 + }
  25 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumCategoriaVeiculo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumCategoriaVeiculo.java
... ... @@ -0,0 +1,26 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumCategoriaVeiculo implements BaseEnum<String> {
  6 + NOVO("N", "Novo"),
  7 + RESERVA("R", "Reserva"),
  8 + SUBSTITUTO("S", "Substituto");
  9 +
  10 + private String valor;
  11 + private String descricao;
  12 +
  13 + private EnumCategoriaVeiculo(String valor, String descricao) {
  14 + this.valor = valor;
  15 + this.descricao = descricao;
  16 + }
  17 +
  18 + @Override
  19 + public String getValor() {
  20 + return this.valor;
  21 + }
  22 +
  23 + public String getDescricao() {
  24 + return this.descricao;
  25 + }
  26 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumMeses.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumMeses.java
... ... @@ -0,0 +1,35 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumMeses implements BaseEnum<Integer>{
  6 + JANEIRO(new Integer(1), "Janeiro"),
  7 + FEVEREIRO(new Integer(2), "Fevereiro"),
  8 + MARCO(new Integer(3), "Março"),
  9 + ABRIL(new Integer(4), "Abril"),
  10 + MAIO(new Integer(5), "Maio"),
  11 + JUNHO(new Integer(6), "Junho"),
  12 + JULHO(new Integer(7), "Julho"),
  13 + AGOSTO(new Integer(8), "Agosto"),
  14 + SETEMBRO(new Integer(9), "Setembro"),
  15 + OUTUBRO(new Integer(10), "Outubro"),
  16 + NOVEMBRO(new Integer(11), "Novembro"),
  17 + DEZEMBRO(new Integer(12), "Dezembro");
  18 +
  19 + private Integer Valor;
  20 + private String descricao;
  21 +
  22 + private EnumMeses(Integer valor, String descricao){
  23 + this.Valor = valor;
  24 + this.descricao = descricao;
  25 + }
  26 +
  27 + @Override
  28 + public Integer getValor() {
  29 + return this.Valor;
  30 + }
  31 +
  32 + public String getDescricao() {
  33 + return descricao;
  34 + }
  35 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumPagination.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumPagination.java
... ... @@ -0,0 +1,29 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumPagination implements BaseEnum<Integer> {
  6 +
  7 + ITEMS_PER_PAGE_PAGINATION_10(new Integer(1), 10L),
  8 + ITEMS_PER_PAGE_PAGINATION_15(new Integer(2), 15L),
  9 + ITEMS_PER_PAGE_PAGINATION_20(new Integer(3), 20L),
  10 + ITEMS_PER_PAGE_PAGINATION_25(new Integer(4), 25L),
  11 + ITEMS_PER_PAGE_PAGINATION_30(new Integer(5), 30L);
  12 +
  13 + private Integer valor;
  14 + private Long descricao;
  15 +
  16 + private EnumPagination(Integer valor, Long descricao) {
  17 + this.valor = valor;
  18 + this.descricao = descricao;
  19 + }
  20 +
  21 + @Override
  22 + public Integer getValor() {
  23 + return this.valor;
  24 + }
  25 +
  26 + public Long getDescricao() {
  27 + return descricao;
  28 + }
  29 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumPercuso.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumPercuso.java
... ... @@ -0,0 +1,27 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumPercuso implements BaseEnum<String> {
  6 + IDA("I", "Ida"),
  7 + VOLTA("V", "Volta"),
  8 + IDAVOLTA("IV","Ida e Volta");
  9 +
  10 + private String valor;
  11 + private String descricao;
  12 +
  13 + private EnumPercuso(String valor, String descricao) {
  14 + this.valor = valor;
  15 + this.descricao = descricao;
  16 + }
  17 +
  18 + @Override
  19 + public String getValor() {
  20 + return this.valor;
  21 + }
  22 +
  23 + public String getDescricao() {
  24 + return this.descricao;
  25 + }
  26 +}
  27 +
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumStatusRelatorio.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumStatusRelatorio.java
... ... @@ -0,0 +1,26 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumStatusRelatorio implements BaseEnum<Integer> {
  6 + EM_ANALISE(new Integer(1), "Em Análise"),
  7 + APROVADO(new Integer(2), "Aprovado"),
  8 + REPROVADO(new Integer(3), "Reprovado");
  9 +
  10 + private Integer Valor;
  11 + private String descricao;
  12 +
  13 + private EnumStatusRelatorio(Integer valor, String descricao) {
  14 + this.Valor = valor;
  15 + this.descricao = descricao;
  16 + }
  17 +
  18 + @Override
  19 + public Integer getValor() {
  20 + return this.Valor;
  21 + }
  22 +
  23 + public String getDescricao() {
  24 + return descricao;
  25 + }
  26 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumStatusSolicitacao.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumStatusSolicitacao.java
... ... @@ -0,0 +1,27 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumStatusSolicitacao implements BaseEnum<String>{
  6 + CRIADO("CR","Criado"),
  7 + VINCULADO("VI","Em Andamento"),
  8 + CANCELADO("CA","Cancelado"),
  9 + REALIZADO("RE","Concluído");
  10 +
  11 + private String Valor;
  12 + private String descricao;
  13 +
  14 + private EnumStatusSolicitacao(String valor, String descricao){
  15 + this.Valor = valor;
  16 + this.descricao = descricao;
  17 + }
  18 +
  19 + @Override
  20 + public String getValor() {
  21 + return this.Valor;
  22 + }
  23 +
  24 + public String getDescricao() {
  25 + return descricao;
  26 + }
  27 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoCombustivel.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoCombustivel.java
... ... @@ -0,0 +1,27 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumTipoCombustivel implements BaseEnum<Integer> {
  6 + ALCOOL(new Integer(1), "Álcool"),
  7 + DIESEL(new Integer(2), "Diesel"),
  8 + GAS(new Integer(3), "Gás"),
  9 + GASOLINA(new Integer(4), "Gasolina");
  10 +
  11 + private Integer valor;
  12 + private String descricao;
  13 +
  14 + private EnumTipoCombustivel(Integer valor, String descricao) {
  15 + this.valor = valor;
  16 + this.descricao = descricao;
  17 + }
  18 +
  19 + @Override
  20 + public Integer getValor() {
  21 + return this.valor;
  22 + }
  23 +
  24 + public String getDescricao() {
  25 + return this.descricao;
  26 + }
  27 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoDocumento.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoDocumento.java
... ... @@ -0,0 +1,25 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumTipoDocumento implements BaseEnum<String> {
  6 + PESSOAL("P", "Documentação Pessoal"),
  7 + EMPRESA("E", "Documentação da Empresa");
  8 +
  9 + private String valor;
  10 + private String descricao;
  11 +
  12 + private EnumTipoDocumento(String valor, String descricao) {
  13 + this.valor = valor;
  14 + this.descricao = descricao;
  15 + }
  16 +
  17 + @Override
  18 + public String getValor() {
  19 + return this.valor;
  20 + }
  21 +
  22 + public String getDescricao() {
  23 + return this.descricao;
  24 + }
  25 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoPeriodo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoPeriodo.java
... ... @@ -0,0 +1,26 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumTipoPeriodo implements BaseEnum<String>{
  6 + PERIODO("P","Período"),
  7 + MENSAL("M","Mensal"),
  8 + DIARIO("D","Diário");
  9 +
  10 + private String Valor;
  11 + private String descricao;
  12 +
  13 + private EnumTipoPeriodo(String valor, String descricao){
  14 + this.Valor = valor;
  15 + this.descricao = descricao;
  16 + }
  17 +
  18 + @Override
  19 + public String getValor() {
  20 + return this.Valor;
  21 + }
  22 +
  23 + public String getDescricao() {
  24 + return descricao;
  25 + }
  26 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoPropriedade.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoPropriedade.java
... ... @@ -0,0 +1,25 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumTipoPropriedade implements BaseEnum<String> {
  6 + ALUGUEL("A", "Aluguel"),
  7 + PROPRIO("P", "Próprio");
  8 +
  9 + private String valor;
  10 + private String descricao;
  11 +
  12 + private EnumTipoPropriedade(String valor, String descricao) {
  13 + this.valor = valor;
  14 + this.descricao = descricao;
  15 + }
  16 +
  17 + @Override
  18 + public String getValor() {
  19 + return this.valor;
  20 + }
  21 +
  22 + public String getDescricao() {
  23 + return this.descricao;
  24 + }
  25 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoUsuario.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoUsuario.java
... ... @@ -0,0 +1,25 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumTipoUsuario implements BaseEnum<String> {
  6 + INTERNO("I", "Interno"),
  7 + EXTERNO("E", "Externo");
  8 +
  9 + private String valor;
  10 + private String descricao;
  11 +
  12 + private EnumTipoUsuario(String valor, String descricao) {
  13 + this.valor = valor;
  14 + this.descricao = descricao;
  15 + }
  16 +
  17 + @Override
  18 + public String getValor() {
  19 + return this.valor;
  20 + }
  21 +
  22 + public String getDescricao() {
  23 + return this.descricao;
  24 + }
  25 +}
... ...
codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoVeiculo.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-entity/src/main/java/br/gov/mj/carros/entity/util/EnumTipoVeiculo.java
... ... @@ -0,0 +1,34 @@
  1 +package br.gov.mj.carros.entity.util;
  2 +
  3 +import br.gov.mj.infra.negocio.persistencia.BaseEnum;
  4 +
  5 +public enum EnumTipoVeiculo implements BaseEnum<Integer> {
  6 + CARGA(new Integer(1), "Carga", new Integer(1)),
  7 + EXECUTIVO(new Integer(2), "Executivo", new Integer(0)),
  8 + PARTICULAR(new Integer(3), "Particular", new Integer(0)),
  9 + POPULAR(new Integer(4), "Popular", new Integer(4)),
  10 + VAN(new Integer(5), "Van", new Integer(16));
  11 +
  12 + private Integer valor;
  13 + private String descricao;
  14 + private Integer capacidade;
  15 +
  16 + private EnumTipoVeiculo(Integer valor, String descricao, Integer capacidade) {
  17 + this.valor = valor;
  18 + this.descricao = descricao;
  19 + this.capacidade = capacidade;
  20 + }
  21 +
  22 + @Override
  23 + public Integer getValor() {
  24 + return this.valor;
  25 + }
  26 +
  27 + public String getDescricao() {
  28 + return this.descricao;
  29 + }
  30 +
  31 + public Integer getCapacidade() {
  32 + return this.capacidade;
  33 + }
  34 +}
... ...
codigos_fonte/carros-parent/carros-web/.gitignore 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-web/.gitignore
... ... @@ -0,0 +1 @@
  1 +/target/
... ...
codigos_fonte/carros-parent/carros-web/pom.xml 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-web/pom.xml
... ... @@ -0,0 +1,326 @@
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 +
  4 + <modelVersion>4.0.0</modelVersion>
  5 +
  6 + <parent>
  7 + <groupId>br.gov.mj.carros</groupId>
  8 + <artifactId>carros-parent</artifactId>
  9 + <version>0.2.0</version>
  10 + </parent>
  11 +
  12 + <artifactId>carros-web</artifactId>
  13 + <name>carros-web</name>
  14 + <packaging>war</packaging>
  15 + <description>CARROS - Sistema de Transporte do Ministério da Justiça</description>
  16 +
  17 + <dependencyManagement>
  18 + <dependencies>
  19 + <dependency>
  20 + <groupId>org.jboss.arquillian</groupId>
  21 + <artifactId>arquillian-bom</artifactId>
  22 + <version>1.1.8.Final</version>
  23 + <scope>import</scope>
  24 + <type>pom</type>
  25 + </dependency>
  26 + </dependencies>
  27 + </dependencyManagement>
  28 +
  29 + <dependencies>
  30 +
  31 + <!-- Infra -->
  32 +
  33 + <dependency>
  34 + <groupId>br.gov.mj.carros</groupId>
  35 + <artifactId>carros-entity</artifactId>
  36 + <version>${project.version}</version>
  37 + </dependency>
  38 +
  39 + <dependency>
  40 + <groupId>br.gov.mj.infra</groupId>
  41 + <artifactId>infra-security-api</artifactId>
  42 + <version>${infra.security.api.version}</version>
  43 + <scope>provided</scope>
  44 + </dependency>
  45 +
  46 + <dependency>
  47 + <groupId>br.gov.mj.infra</groupId>
  48 + <artifactId>infra-negocio</artifactId>
  49 + </dependency>
  50 +
  51 + <dependency>
  52 + <groupId>br.gov.mj.infra</groupId>
  53 + <artifactId>infra-wicket</artifactId>
  54 + </dependency>
  55 +
  56 + <dependency>
  57 + <groupId>commons-io</groupId>
  58 + <artifactId>commons-io</artifactId>
  59 + </dependency>
  60 +
  61 + <dependency>
  62 + <groupId>javax</groupId>
  63 + <artifactId>javaee-api</artifactId>
  64 + <scope>provided</scope>
  65 + </dependency>
  66 +
  67 + <!-- Wicket -->
  68 +
  69 + <dependency>
  70 + <groupId>org.apache.wicket</groupId>
  71 + <artifactId>wicket-core</artifactId>
  72 + </dependency>
  73 +
  74 + <dependency>
  75 + <groupId>org.apache.wicket</groupId>
  76 + <artifactId>wicket-cdi-1.1</artifactId>
  77 + </dependency>
  78 +
  79 + <dependency>
  80 + <groupId>org.apache.wicket</groupId>
  81 + <artifactId>wicket-auth-roles</artifactId>
  82 + </dependency>
  83 +
  84 + <dependency>
  85 + <groupId>com.googlecode.wicket-jquery-ui</groupId>
  86 + <artifactId>jquery-ui-core</artifactId>
  87 + <version>6.2.2</version>
  88 + </dependency>
  89 +
  90 + <!-- JasperReports -->
  91 +
  92 + <dependency>
  93 + <groupId>net.sf.jasperreports</groupId>
  94 + <artifactId>jasperreports</artifactId>
  95 + <version>5.6.1</version>
  96 + </dependency>
  97 + <dependency>
  98 + <groupId>org.wicketstuff</groupId>
  99 + <artifactId>wicketstuff-jasperreports</artifactId>
  100 + <version>6.17.0</version>
  101 + </dependency>
  102 +
  103 + <dependency>
  104 + <groupId>org.wicketstuff</groupId>
  105 + <artifactId>wicketstuff-editable-grid</artifactId>
  106 + <version>6.17.0</version>
  107 + </dependency>
  108 + <dependency>
  109 + <groupId>org.wicketstuff</groupId>
  110 + <artifactId>wicketstuff-inmethod-grid</artifactId>
  111 + <version>6.17.0</version>
  112 + </dependency>
  113 +
  114 + <dependency>
  115 + <groupId>org.apache.poi</groupId>
  116 + <artifactId>poi</artifactId>
  117 + <version>3.5-FINAL</version>
  118 + </dependency>
  119 +
  120 + <!-- Log4j -->
  121 +
  122 + <dependency>
  123 + <groupId>org.slf4j</groupId>
  124 + <artifactId>slf4j-api</artifactId>
  125 + <version>1.7.5</version>
  126 + <type>jar</type>
  127 + <scope>test</scope>
  128 + </dependency>
  129 +
  130 + <dependency>
  131 + <groupId>org.slf4j</groupId>
  132 + <artifactId>slf4j-log4j12</artifactId>
  133 + </dependency>
  134 +
  135 + <dependency>
  136 + <groupId>log4j</groupId>
  137 + <artifactId>log4j</artifactId>
  138 + </dependency>
  139 +
  140 + <!-- JUnit -->
  141 +
  142 + <dependency>
  143 + <groupId>junit</groupId>
  144 + <artifactId>junit</artifactId>
  145 + <scope>test</scope>
  146 + </dependency>
  147 +
  148 + <dependency>
  149 + <groupId>commons-logging</groupId>
  150 + <artifactId>commons-logging</artifactId>
  151 + </dependency>
  152 +
  153 + <!-- Arquillian -->
  154 +
  155 + <dependency>
  156 + <groupId>org.jboss.arquillian.junit</groupId>
  157 + <artifactId>arquillian-junit-container</artifactId>
  158 + <scope>test</scope>
  159 + </dependency>
  160 +
  161 + <dependency>
  162 + <groupId>org.jboss.shrinkwrap.resolver</groupId>
  163 + <artifactId>shrinkwrap-resolver-depchain</artifactId>
  164 + <scope>test</scope>
  165 + <type>pom</type>
  166 + </dependency>
  167 +
  168 + <!-- Database -->
  169 +
  170 + <dependency>
  171 + <groupId>postgresql</groupId>
  172 + <artifactId>postgresql</artifactId>
  173 + <version>9.0-801.jdbc4</version>
  174 + </dependency>
  175 +
  176 + <dependency>
  177 + <groupId>com.h2database</groupId>
  178 + <artifactId>h2</artifactId>
  179 + <version>1.4.187</version>
  180 + <scope>test</scope>
  181 + </dependency>
  182 +
  183 + <dependency>
  184 + <groupId>org.hibernate</groupId>
  185 + <artifactId>hibernate-entitymanager</artifactId>
  186 + <version>4.3.7.Final</version>
  187 + <scope>test</scope>
  188 + </dependency>
  189 +
  190 + <dependency>
  191 + <groupId>org.hibernate.javax.persistence</groupId>
  192 + <artifactId>hibernate-jpa-2.1-api</artifactId>
  193 + <version>1.0.0.Final</version>
  194 + <scope>test</scope>
  195 + </dependency>
  196 +
  197 + <!-- Dependência para atender aos tipos LocalDate, LocalTime e LocalDateTime -->
  198 +
  199 + <dependency>
  200 + <groupId>org.jadira.usertype</groupId>
  201 + <artifactId>usertype.extended</artifactId>
  202 + <version>3.2.0.GA</version>
  203 + </dependency>
  204 +
  205 + </dependencies>
  206 +
  207 + <build>
  208 + <plugins>
  209 + <plugin>
  210 + <groupId>org.apache.maven.plugins</groupId>
  211 + <artifactId>maven-war-plugin</artifactId>
  212 + <version>2.6</version>
  213 + <configuration>
  214 + <webResources>
  215 + <resource>
  216 + <filtering>true</filtering>
  217 + <directory>src/main/webapp</directory>
  218 + <includes>
  219 + <include>**/web.xml</include>
  220 + <include>**/jboss-web.xml</include>
  221 + </includes>
  222 + </resource>
  223 + </webResources>
  224 + <archive>
  225 + <manifest>
  226 + <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  227 + </manifest>
  228 + </archive>
  229 + </configuration>
  230 + </plugin>
  231 + </plugins>
  232 + </build>
  233 +
  234 + <profiles>
  235 +
  236 + <!-- Profile default de desenvolvimento -->
  237 + <profile>
  238 + <id>desenv</id>
  239 + <activation>
  240 + <activeByDefault>true</activeByDefault>
  241 + </activation>
  242 + <properties>
  243 + <enable.security.desenv.end>--&gt;</enable.security.desenv.end>
  244 + <enable.security.desenv.start>&lt;!--</enable.security.desenv.start>
  245 + <enable.security.prod.end></enable.security.prod.end>
  246 + <enable.security.prod.start></enable.security.prod.start>
  247 + <security.domain.name>carros-sec-domain-desenv</security.domain.name>
  248 + </properties>
  249 + </profile>
  250 +
  251 + <!-- Profile a ser ativado ao gerar pacote para produção. -->
  252 + <profile>
  253 + <id>prod</id>
  254 + <properties>
  255 + <enable.security.desenv.end></enable.security.desenv.end>
  256 + <enable.security.desenv.start></enable.security.desenv.start>
  257 + <enable.security.prod.end>--&gt;</enable.security.prod.end>
  258 + <enable.security.prod.start>&lt;!--</enable.security.prod.start>
  259 + <security.domain.name>carros-sec-domain-prod</security.domain.name>
  260 + </properties>
  261 + </profile>
  262 +
  263 + <profile>
  264 + <id>corpmj-arquillian-remote</id>
  265 + <activation>
  266 + <activeByDefault>true</activeByDefault>
  267 + </activation>
  268 + <dependencies>
  269 + <dependency>
  270 + <groupId>org.wildfly.arquillian</groupId>
  271 + <artifactId>wildfly-arquillian-container-remote</artifactId>
  272 + <version>1.0.0.Alpha5</version>
  273 + <scope>test</scope>
  274 + </dependency>
  275 + </dependencies>
  276 + </profile>
  277 +
  278 + <!-- Esse profile foi adicionada para permitir automatização do deploy
  279 + via maven, sem usar o WTP do eclipse. Os parâmetros ${wildfly-hostname},
  280 + ${wildfly-port}, e etc devem ser configurados no settings.xml local da máquina,
  281 + dentro da definição de profile "wildfly": <profile> <id>wildfly</id> <properties>
  282 + <wildfly-hostname>localhost</wildfly-hostname> <wildfly-port>9990</wildfly-port>
  283 + <wildfly-username>rodrigo.uchoa</wildfly-username> <wildfly-password>123456</wildfly-password>
  284 + </properties> </profile> O username/password são os mesmos usados para acessar
  285 + o console de administração do Wildfly. Caso não tenha criado ainda, é só
  286 + usar o script "add-user" dentro do diretório "bin" do Wildfly. Para fazer
  287 + o deploy, primeiro é necessário start o Wildfly manualmente e depois rodar
  288 + o seguinte comando no diretório do "conare-parent": mvn package -Pdesenv,wildfly
  289 + -DskipTests O profile "desenv" ou "prod" precisa ser informado junto com
  290 + o profile "wildfly". São eles que fazem o filtering dos arquivos de configuração.
  291 + Para fazer o undeploy, entrar no diretório "conare-web" e rodar o comando:
  292 + mvn wildfly:undeploy -Pwildfly Observar que o comando de deploy é feito no
  293 + diretório do projeto parent, enquanto o de undeploy é feito no diretório
  294 + do próprio módulo web. -->
  295 + <profile>
  296 + <id>wildfly</id>
  297 + <build>
  298 + <plugins>
  299 + <plugin>
  300 + <groupId>org.wildfly.plugins</groupId>
  301 + <artifactId>wildfly-maven-plugin</artifactId>
  302 + <version>1.1.0.Alpha2</version>
  303 + <configuration>
  304 + <hostname>${wildfly-hostname}</hostname>
  305 + <port>${wildfly-port}</port>
  306 + <username>${wildfly-username}</username>
  307 + <password>${wildfly-password}</password>
  308 + <filename>${project.build.finalName}.war</filename>
  309 + </configuration>
  310 + <executions>
  311 + <execution>
  312 + <id>wildfly-deploy</id>
  313 + <phase>package</phase>
  314 + <goals>
  315 + <goal>deploy</goal>
  316 + </goals>
  317 + </execution>
  318 + </executions>
  319 + </plugin>
  320 + </plugins>
  321 + </build>
  322 + </profile>
  323 +
  324 + </profiles>
  325 +
  326 +</project>
0 327 \ No newline at end of file
... ...
codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/CarrosApplication.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/CarrosApplication.java
... ... @@ -0,0 +1,42 @@
  1 +package br.gov.mj.carros.web;
  2 +
  3 +import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
  4 +import org.apache.wicket.markup.html.WebPage;
  5 +
  6 +import br.gov.mj.carros.web.util.CarrosSession;
  7 +import br.gov.mj.carros.web.util.Constants;
  8 +import br.gov.mj.carros.web.view.HomePage;
  9 +import br.gov.mj.carros.web.view.LoginPage;
  10 +import br.gov.mj.carros.web.view.seguranca.AlterarSenhaPage;
  11 +import br.gov.mj.infra.wicket.application.BaseWicketApplication;
  12 +import de.agilecoders.wicket.core.Bootstrap;
  13 +
  14 +public class CarrosApplication extends BaseWicketApplication {
  15 +
  16 + @Override
  17 + public void init() {
  18 +
  19 + super.init();
  20 +
  21 + Bootstrap.install(get());
  22 + getMarkupSettings().setDefaultMarkupEncoding("UTF-8");
  23 +
  24 + // mapeamento de paths alternativos
  25 + mountPage(Constants.PAGINA_ALTERACAO_SENHA, AlterarSenhaPage.class);
  26 + }
  27 +
  28 + @Override
  29 + public Class<? extends WebPage> getHomePage() {
  30 + return HomePage.class;
  31 + }
  32 +
  33 + @Override
  34 + protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass() {
  35 + return CarrosSession.class;
  36 + }
  37 +
  38 + @Override
  39 + protected Class<? extends WebPage> getSignInPageClass() {
  40 + return LoginPage.class;
  41 + }
  42 +}
... ...
codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/CarrosApplication.properties 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/CarrosApplication.properties
... ... @@ -0,0 +1,105 @@
  1 +TITULO_SISTEMA=CARROS - Sistema de Transporte do Ministério da Justiça
  2 +
  3 +# Labels padrão do sistema
  4 +
  5 +menuInicio=Início
  6 +menuVeiculos=Veículos
  7 +menuUsuarios=Usuários
  8 +menuVincularUsuario=Vincular Usuários
  9 +menuSolicitarCarros=Solicitar Carros
  10 +menuAlterarSenha=Alterar Senha
  11 +menuGerenciarCadastros=Menu Exemplo
  12 +menuExemplo=Exemplo
  13 +menuAgendamento=Solicitações do Dia
  14 +menuMapa=Mapa
  15 +menuMeuPainel=Meu Painel
  16 +menuSolicitacoesEmAndamento = Em Atendimento
  17 +menuConferirSolicitacao = Conferir Solicitações
  18 +menuCustos=Custos
  19 +menuContratos=Contratos
  20 +menuRelatorio=Relatórios
  21 +menuManterEndereco=Endereços
  22 +
  23 +
  24 +lnkEsqueciSenha=Esqueci minha senha
  25 +linkLogoff=Efetuar logoff
  26 +
  27 +btnLimpar=Limpar
  28 +btnConfirmar=Pesquisar
  29 +btnGravar=Salvar
  30 +btnCancelar=Voltar
  31 +btnVisualizar=Visualizar Registro
  32 +btnEditar=Editar Registro
  33 +btnExcluir=Excluir Registro
  34 +btnAnexar=Anexar
  35 +
  36 +# Mensagens padrão para as regras do sistema
  37 +
  38 +MP001=Inclusão realizada com sucesso.
  39 +MP002=Alteração realizada com sucesso.
  40 +MP003=Exclusão realizada com sucesso.
  41 +MP004=Exclusão não permitida.
  42 +MP005=Carona cadastrada com sucesso. Favor comparecer a garagem no horário agendado
  43 +
  44 +MN004=Deseja realmente excluir esse registro?
  45 +
  46 +ERRO001=Erro ao gravar!
  47 +ERRO002=Usuário inativo. Contate o Administrador do Sistema.
  48 +ERRO003=Sua senha expirou. Favor efetuar a alteração da senha através do link "Esqueci minha senha".
  49 +ERRO004=Usuario e/ou senha inválidos.
  50 +
  51 +# Mensagens padrão para os componentes personalizados
  52 +
  53 +IConverter='${label}' não é um valor válido.
  54 +IConverter.LocalDate='${label}' não é uma data válida.
  55 +CpfValidator=Número de CPF inválido.
  56 +CnpjValidator=Número de CNPJ inválido.
  57 +FieldValidator=Valor inválido no campo ${label}.
  58 +Required=O campo '${label}' é de preenchimento obrigatório.
  59 +
  60 +formProcesso.uploadTooLarge=Arquivo ultrapassou o tamanho permitido.
  61 +formProcesso.uploadFailed=O upload do arquivo falhou.
  62 +
  63 +noData=Não foram encontrados dados para a pesquisa realizada.
  64 +lblObrigatorio=Os campos marcados com <rowspan class="asterisk" /> são de preenchimento obrigatório.
  65 +lbItemsPerPage=Itens por página
  66 +
  67 +# Mensagens padrão dos componentes do Wicket
  68 +
  69 +null=- Selecione -
  70 +nullValid=- Selecione -
  71 +
  72 +msgSIM=Sim
  73 +MsgNAO=Não
  74 +
  75 +#Required=Campo '${label}' \u00e9 obrigat\u00f3rio.
  76 +#IConverter='${label}' n\u00e3o \u00e9 um ${type} v\u00e1lido.
  77 +
  78 +#RangeValidator.range=${label} deve estar entre ${minimum} e ${maximum}.
  79 +#RangeValidator.minimum='${label}' deve ser maior ou igual a ${minimum}.
  80 +#RangeValidator.maximum='${label}' deve ser menor ou igual a ${maximum}.
  81 +
  82 +#StringValidator.range='${label}' deve ter entre ${minimum} e ${maximum} caracteres.
  83 +#StringValidator.minimum='${label}' deve ter no m\u00ednimo ${minimum} caracteres.
  84 +#StringValidator.maximum='${label}' deve ter no m\u00e1ximo ${maximum} caracteres.
  85 +#StringValidator.exact='${label}' deve ter exatamente ${exact} caracteres.
  86 +
  87 +#DateValidator.range='${label}' deve estar entre ${minimum} e ${maximum}.
  88 +#DateValidator.minimum='${label}' deve ser posterior a ${minimum}.
  89 +#DateValidator.maximum='${label}' deve ser anterior a ${maximum}.
  90 +
  91 +#CreditCardValidator=Cart\u00e3o de cr\u00e9dito n\u00e3o \u00e9 v\u00e1lido.
  92 +
  93 +#UrlValidator='${label}' n\u00e3o \u00e9 uma URL v\u00e1lida.
  94 +
  95 +#PatternValidator='${label}' n\u00e3o obedece ao padr\u00e3o '${pattern}'
  96 +#EmailAddressValidator='${label}' n\u00e3o \u00e9 um endere\u00e7o de email v\u00e1lido.
  97 +
  98 +#EqualInputValidator='${input0}' de ${label0} e '${input1}' de ${label1} devem ser iguais.
  99 +#EqualPasswordInputValidator=${label0} e ${label1} devem ser iguais.
  100 +
  101 +#PagingNavigator.first=Voltar \u00e0 primeira p\u00e1gina
  102 +#PagingNavigator.previous=Voltar \u00e0 p\u00e1gina anterior
  103 +#PagingNavigator.next=Avan\u00e7ar \u00e0 pr\u00f3xima p\u00e1gina
  104 +#PagingNavigator.last=Avan\u00e7ar \u00e0 \u00faltima p\u00e1gina
  105 +#PagingNavigation.page=Ir \u00e0 p\u00e1gina ${page}
0 106 \ No newline at end of file
... ...
codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/dao/ContratoDAO.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/dao/ContratoDAO.java
... ... @@ -0,0 +1,166 @@
  1 +package br.gov.mj.carros.web.dao;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +import javax.ejb.Stateless;
  7 +import javax.ejb.TransactionAttribute;
  8 +import javax.ejb.TransactionAttributeType;
  9 +import javax.inject.Inject;
  10 +import javax.persistence.EntityManager;
  11 +import javax.persistence.TypedQuery;
  12 +import javax.persistence.criteria.CriteriaBuilder;
  13 +import javax.persistence.criteria.CriteriaQuery;
  14 +import javax.persistence.criteria.JoinType;
  15 +import javax.persistence.criteria.Predicate;
  16 +import javax.persistence.criteria.Root;
  17 +import javax.persistence.criteria.SetJoin;
  18 +
  19 +import org.apache.commons.lang3.StringUtils;
  20 +
  21 +import br.gov.mj.carros.entity.carros.TbContrato;
  22 +import br.gov.mj.carros.entity.carros.TbFranquiaMensal;
  23 +import br.gov.mj.carros.entity.carros.TbTipoVeiculo;
  24 +
  25 +
  26 +/**
  27 + * Classe de persistência para manter contratos.
  28 + *
  29 + * @author vsandes
  30 + * @since 10/02/2016
  31 + */
  32 +@Stateless
  33 +@TransactionAttribute(TransactionAttributeType.MANDATORY)
  34 +public class ContratoDAO {
  35 +
  36 + @Inject
  37 + private EntityManager em;
  38 +
  39 +
  40 + /**
  41 + * Efetua a consulta paginada de contratos no banco de dados de acordo com os filtros.
  42 + *
  43 + * @param contrato Objeto contrato com os parâmetros a serem filtrados.
  44 + * @param first Índice do primeiro objeto da página.
  45 + * @param size Quantidade de objetos por página.
  46 + * @return Lista de contratos.
  47 + */
  48 + public List<TbContrato> findPaginated(TbContrato contrato, int first, int size) {
  49 +
  50 + CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
  51 + CriteriaQuery<TbContrato> criteriaQuery = criteriaBuilder.createQuery(TbContrato.class);
  52 + Root<TbContrato> root = criteriaQuery.from(TbContrato.class);
  53 +
  54 + Predicate[] predicates = extractPredicates(contrato, criteriaBuilder, root);
  55 +
  56 + criteriaQuery.select(criteriaQuery.getSelection()).where(predicates);
  57 + criteriaQuery.orderBy(criteriaBuilder.asc(root.get("numeroContrato")));
  58 +
  59 + TypedQuery<TbContrato> query = em.createQuery(criteriaQuery);
  60 +
  61 + query.setFirstResult(first);
  62 + query.setMaxResults(size);
  63 +
  64 + return query.getResultList();
  65 + }
  66 +
  67 + /**
  68 + * Efetua a consulta de contratos no banco de dados de acordo com o tipo do veículo.
  69 + *
  70 + * @param contrato Objeto contrato com os parâmetros a serem filtrados.
  71 + * @return Lista de contratos.
  72 + */
  73 + public List<TbContrato> findByTipoVeiculo(TbTipoVeiculo tipoVeiculo) {
  74 +
  75 + CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
  76 + CriteriaQuery<TbContrato> criteriaQuery = criteriaBuilder.createQuery(TbContrato.class);
  77 + Root<TbContrato> root = criteriaQuery.from(TbContrato.class);
  78 +
  79 + Predicate[] predicates = extractPredicatesTipoVeiculo(tipoVeiculo, criteriaBuilder, root);
  80 +
  81 + criteriaQuery.select(criteriaQuery.getSelection()).where(predicates);
  82 + criteriaQuery.orderBy(criteriaBuilder.asc(root.get("numeroContrato")));
  83 +
  84 + TypedQuery<TbContrato> query = em.createQuery(criteriaQuery);
  85 +
  86 + return query.getResultList();
  87 + }
  88 +
  89 + /**
  90 + * Calcula a quantidade de registros de contratos no banco de dados de acordo com os filtros.
  91 + *
  92 + * @param contrato Objeto contrato com os parâmetros a serem filtrados.
  93 + * @return Quantidade de objetos encontrados.
  94 + */
  95 + public Long countPaginated(TbContrato contrato) {
  96 +
  97 + CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
  98 + CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
  99 + Root<TbContrato> root = criteriaQuery.from(TbContrato.class);
  100 +
  101 + Predicate[] predicates = extractPredicates(contrato, criteriaBuilder, root);
  102 +
  103 + criteriaQuery.select(criteriaBuilder.count(root));
  104 + criteriaQuery.where(predicates);
  105 +
  106 + return em.createQuery(criteriaQuery).getSingleResult();
  107 + }
  108 +
  109 + /**
  110 + * Efetua a consulta por contratos.
  111 + * A consulta efetuada é case insensitive.
  112 + *
  113 + * @param contrato Objeto contrato com a descrição a ser consultada.
  114 + * @return Lista de contratos.
  115 + */
  116 + public List<TbContrato> findDuplicated(TbContrato contrato) {
  117 +
  118 + CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
  119 + CriteriaQuery<TbContrato> criteriaQuery = criteriaBuilder.createQuery(TbContrato.class);
  120 + Root<TbContrato> root = criteriaQuery.from(TbContrato.class);
  121 +
  122 + List<Predicate> predicates = new ArrayList<>();
  123 +
  124 + if (contrato.getNumeroContrato() != null)
  125 + predicates.add(criteriaBuilder.equal(root.get("numeroContrato"), contrato.getNumeroContrato()));
  126 +
  127 + criteriaQuery.select(criteriaQuery.getSelection()).where(predicates.toArray(new Predicate[] {}));
  128 +
  129 + TypedQuery<TbContrato> query = em.createQuery(criteriaQuery);
  130 +
  131 + return query.getResultList();
  132 + }
  133 +
  134 + private Predicate[] extractPredicates(TbContrato contrato, CriteriaBuilder criteriaBuilder, Root<?> root) {
  135 +
  136 + List<Predicate> predicates = new ArrayList<>();
  137 +
  138 + if (contrato != null)
  139 + { // filtros veículo
  140 +
  141 + if (contrato.getNumeroContrato() != null)
  142 + predicates.add(criteriaBuilder.like(root.get("numeroContrato"), "%" + contrato.getNumeroContrato() + "%"));
  143 +
  144 + if (!StringUtils.isEmpty(contrato.getNomeEmpresa()))
  145 + {
  146 + predicates.add(criteriaBuilder.like(criteriaBuilder.lower(root.get("nomeEmpresa")), "%" + contrato.getNomeEmpresa().toLowerCase() + "%"));
  147 + }
  148 + }
  149 +
  150 + return predicates.toArray(new Predicate[] {});
  151 + }
  152 +
  153 + private Predicate[] extractPredicatesTipoVeiculo(TbTipoVeiculo tipoVeiculo, CriteriaBuilder criteriaBuilder, Root<?> root) {
  154 +
  155 + List<Predicate> predicates = new ArrayList<>();
  156 +
  157 + if (tipoVeiculo != null)
  158 + {
  159 + SetJoin<TbContrato, TbFranquiaMensal> joinList = root.joinSet("franquiasMensais", JoinType.LEFT);
  160 +
  161 + predicates.add(criteriaBuilder.equal(joinList.get("tipoVeiculo"), tipoVeiculo));
  162 + }
  163 +
  164 + return predicates.toArray(new Predicate[] {});
  165 + }
  166 +}
... ...
codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/dao/CustoDAO.java 0 → 100644
  1 +++ a/codigos_fonte/carros-parent/carros-web/src/main/java/br/gov/mj/carros/web/dao/CustoDAO.java
... ... @@ -0,0 +1,158 @@
  1 +package br.gov.mj.carros.web.dao;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +import javax.ejb.Stateless;
  7 +import javax.ejb.TransactionAttribute;
  8 +import javax.ejb.TransactionAttributeType;
  9 +import javax.inject.Inject;
  10 +import javax.persistence.EntityManager;
  11 +import javax.persistence.TypedQuery;
  12 +import javax.persistence.criteria.CriteriaBuilder;
  13 +import javax.persistence.criteria.CriteriaQuery;
  14 +import javax.persistence.criteria.Predicate;
  15 +import javax.persistence.criteria.Root;
  16 +
  17 +import br.gov.mj.carros.entity.carros.TbCustoVeiculo;
  18 +
  19 +/**
  20 + * Classe de persistência para manter custos.
  21 + *
  22 + * @author vsandes
  23 + * @since 16/12/2015
  24 + */
  25 +@Stateless
  26 +@TransactionAttribute(TransactionAttributeType.MANDATORY)
  27 +public class CustoDAO {
  28 +
  29 + @Inject
  30 + private EntityManager em;
  31 +
  32 + /**
  33 + * Efetua a consulta paginada de custo no banco de dados de acordo com os filtros.
  34 + *
  35 + * @param custoVeiculo
  36 + * Objeto custo com os parâmetros a serem filtrados.
  37 + * @param first
  38 + * Índice do primeiro objeto da página.
  39 + * @param size
  40 + * Quantidade de objetos por página.
  41 + * @return Lista de custos.
  42 + */
  43 + public List<TbCustoVeiculo> findPaginated(TbCustoVeiculo custoVeiculo, int first, int size) {
  44 +
  45 + CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
  46 + CriteriaQuery<TbCustoVeiculo> criteriaQuery = criteriaBuilder.createQuery(TbCustoVeiculo.class);
  47 + Root<TbCustoVeiculo> root = criteriaQuery.from(TbCustoVeiculo.class);
  48 +
  49 + Predicate[] predicates = extractPredicates(custoVeiculo, criteriaBuilder, root);
  50 +
  51 + criteriaQuery.select(criteriaQuery.getSelection()).where(predicates);
  52 + criteriaQuery.orderBy(criteriaBuilder.asc(root.get("tipoVeiculo")));
  53 +