@ -1,57 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
test/
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
*.rdb
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@ -1 +0,0 @@
|
||||
你好✌
|
||||
|
Before Width: | Height: | Size: 875 KiB |
|
Before Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 180 KiB |
|
Before Width: | Height: | Size: 854 KiB |
|
Before Width: | Height: | Size: 558 KiB |
|
Before Width: | Height: | Size: 786 KiB |
|
Before Width: | Height: | Size: 269 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 3.1 MiB |
|
Before Width: | Height: | Size: 537 KiB |
@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<groupId>com.qiujie</groupId>
|
||||
<artifactId>hrm</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>hrm</name>
|
||||
<description>人力资源管理系统</description>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>2.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-starter-security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
<version>2.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>2.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.22</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!--代码生成器模板-->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 开启热部署-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<version>2.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 跨域认证jwt-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>0.11.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>0.11.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>0.11.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 数据导入与导出 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>5.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>xmlbeans</artifactId>
|
||||
<groupId>org.apache.xmlbeans</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.22</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.activiti/activiti-spring-boot-starter -->
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-spring-boot-starter</artifactId>
|
||||
<version>7.0.0.GA</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<groupId>org.mybatis</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<groupId>commons-io</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- 打包 -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.6</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -1,16 +0,0 @@
|
||||
package com.qiujie;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
|
||||
@MapperScan("com.qiujie.mapper")
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement // 事务
|
||||
public class HrmApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HrmApplication.class, args);
|
||||
}
|
||||
}
|
||||
@ -1,148 +0,0 @@
|
||||
package com.qiujie.config;
|
||||
|
||||
import org.activiti.api.runtime.shared.identity.UserGroupManager;
|
||||
import org.activiti.engine.cfg.ProcessEngineConfigurator;
|
||||
import org.activiti.engine.impl.persistence.StrongUuidGenerator;
|
||||
import org.activiti.spring.SpringAsyncExecutor;
|
||||
import org.activiti.spring.SpringProcessEngineConfiguration;
|
||||
import org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration;
|
||||
import org.activiti.spring.boot.ActivitiProperties;
|
||||
import org.activiti.spring.boot.ProcessDefinitionResourceFinder;
|
||||
import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer;
|
||||
import org.activiti.spring.boot.process.validation.AsyncPropertyValidator;
|
||||
import org.activiti.spring.bpmn.parser.CloudActivityBehaviorFactory;
|
||||
import org.activiti.validation.ProcessValidatorImpl;
|
||||
import org.activiti.validation.validator.ValidatorSet;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class DataSourceConfig extends AbstractProcessEngineAutoConfiguration {
|
||||
|
||||
@Primary
|
||||
@Bean
|
||||
@ConfigurationProperties(prefix = "spring.datasource.master")
|
||||
public DataSource masterDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties(prefix = "spring.datasource.activiti")
|
||||
public DataSource activitiDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
/**
|
||||
* activiti7的数据源配置
|
||||
* @param transactionManager
|
||||
* @param springAsyncExecutor
|
||||
* @param activitiProperties
|
||||
* @param processDefinitionResourceFinder
|
||||
* @param processEngineConfigurationConfigurer
|
||||
* @param processEngineConfigurators
|
||||
* @param userGroupManager
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@Bean
|
||||
public SpringProcessEngineConfiguration springProcessEngineConfiguration(
|
||||
PlatformTransactionManager transactionManager,
|
||||
SpringAsyncExecutor springAsyncExecutor,
|
||||
ActivitiProperties activitiProperties,
|
||||
ProcessDefinitionResourceFinder processDefinitionResourceFinder,
|
||||
@Autowired(required = false) ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer,
|
||||
@Autowired(required = false) List<ProcessEngineConfigurator> processEngineConfigurators,
|
||||
UserGroupManager userGroupManager) throws IOException {
|
||||
|
||||
SpringProcessEngineConfiguration conf = new SpringProcessEngineConfiguration();
|
||||
conf.setConfigurators(processEngineConfigurators);
|
||||
configureProcessDefinitionResources(processDefinitionResourceFinder,
|
||||
conf);
|
||||
conf.setDataSource(activitiDataSource());
|
||||
conf.setTransactionManager(transactionManager);
|
||||
|
||||
if (springAsyncExecutor != null) {
|
||||
conf.setAsyncExecutor(springAsyncExecutor);
|
||||
}
|
||||
conf.setDeploymentName(activitiProperties.getDeploymentName());
|
||||
conf.setDatabaseSchema(activitiProperties.getDatabaseSchema());
|
||||
conf.setDatabaseSchemaUpdate(activitiProperties.getDatabaseSchemaUpdate());
|
||||
conf.setDbHistoryUsed(activitiProperties.isDbHistoryUsed());
|
||||
conf.setAsyncExecutorActivate(activitiProperties.isAsyncExecutorActivate());
|
||||
if (!activitiProperties.isAsyncExecutorActivate()) {
|
||||
ValidatorSet springBootStarterValidatorSet = new ValidatorSet("activiti-spring-boot-starter");
|
||||
springBootStarterValidatorSet.addValidator(new AsyncPropertyValidator());
|
||||
if (conf.getProcessValidator() == null) {
|
||||
ProcessValidatorImpl processValidator = new ProcessValidatorImpl();
|
||||
processValidator.addValidatorSet(springBootStarterValidatorSet);
|
||||
conf.setProcessValidator(processValidator);
|
||||
} else {
|
||||
conf.getProcessValidator().getValidatorSets().add(springBootStarterValidatorSet);
|
||||
}
|
||||
}
|
||||
conf.setMailServerHost(activitiProperties.getMailServerHost());
|
||||
conf.setMailServerPort(activitiProperties.getMailServerPort());
|
||||
conf.setMailServerUsername(activitiProperties.getMailServerUserName());
|
||||
conf.setMailServerPassword(activitiProperties.getMailServerPassword());
|
||||
conf.setMailServerDefaultFrom(activitiProperties.getMailServerDefaultFrom());
|
||||
conf.setMailServerUseSSL(activitiProperties.isMailServerUseSsl());
|
||||
conf.setMailServerUseTLS(activitiProperties.isMailServerUseTls());
|
||||
|
||||
if (userGroupManager != null) {
|
||||
conf.setUserGroupManager(userGroupManager);
|
||||
}
|
||||
|
||||
conf.setHistoryLevel(activitiProperties.getHistoryLevel());
|
||||
conf.setCopyVariablesToLocalForTasks(activitiProperties.isCopyVariablesToLocalForTasks());
|
||||
conf.setSerializePOJOsInVariablesToJson(activitiProperties.isSerializePOJOsInVariablesToJson());
|
||||
conf.setJavaClassFieldForJackson(activitiProperties.getJavaClassFieldForJackson());
|
||||
|
||||
if (activitiProperties.getCustomMybatisMappers() != null) {
|
||||
conf.setCustomMybatisMappers(getCustomMybatisMapperClasses(activitiProperties.getCustomMybatisMappers()));
|
||||
}
|
||||
|
||||
if (activitiProperties.getCustomMybatisXMLMappers() != null) {
|
||||
conf.setCustomMybatisXMLMappers(new HashSet<>(activitiProperties.getCustomMybatisXMLMappers()));
|
||||
}
|
||||
|
||||
if (activitiProperties.getCustomMybatisXMLMappers() != null) {
|
||||
conf.setCustomMybatisXMLMappers(new HashSet<>(activitiProperties.getCustomMybatisXMLMappers()));
|
||||
}
|
||||
|
||||
if (activitiProperties.isUseStrongUuids()) {
|
||||
conf.setIdGenerator(new StrongUuidGenerator());
|
||||
}
|
||||
|
||||
if (activitiProperties.getDeploymentMode() != null) {
|
||||
conf.setDeploymentMode(activitiProperties.getDeploymentMode());
|
||||
}
|
||||
|
||||
conf.setActivityBehaviorFactory(new CloudActivityBehaviorFactory());
|
||||
|
||||
if (processEngineConfigurationConfigurer != null) {
|
||||
processEngineConfigurationConfigurer.configure(conf);
|
||||
}
|
||||
|
||||
return conf;
|
||||
}
|
||||
|
||||
private void configureProcessDefinitionResources(ProcessDefinitionResourceFinder processDefinitionResourceFinder,
|
||||
SpringProcessEngineConfiguration conf) throws IOException {
|
||||
List<Resource> procDefResources = processDefinitionResourceFinder.discoverProcessDefinitionResources();
|
||||
if (!procDefResources.isEmpty()) {
|
||||
conf.setDeploymentResources(procDefResources.toArray(new Resource[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.qiujie.config;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties // 指明前缀,因为没有前缀,所以不用指明,默认为”“即可
|
||||
public class HolidayConfig {
|
||||
private List<String> holidays;
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.qiujie.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 分页插件
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan("com.qiujie.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
// 最新版
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package com.qiujie.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
redisTemplate.setConnectionFactory(factory);
|
||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
||||
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||
objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance , ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
|
||||
jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
|
||||
redisTemplate.setKeySerializer(stringRedisSerializer); // key的序列化类型
|
||||
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); // value的序列化类型
|
||||
redisTemplate.setHashKeySerializer(stringRedisSerializer); // hash key的序列化类型
|
||||
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer); // hash value的序列化类型
|
||||
redisTemplate.afterPropertiesSet();
|
||||
return redisTemplate;
|
||||
}
|
||||
}
|
||||
@ -1,86 +0,0 @@
|
||||
package com.qiujie.config;
|
||||
|
||||
import com.qiujie.filter.JwtAuthenticationFilter;
|
||||
import com.qiujie.handler.AccessDeniedExceptionHandler;
|
||||
import com.qiujie.handler.AuthenticationEntryPointHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
public class SecurityConfig {
|
||||
|
||||
@Autowired
|
||||
private AuthenticationEntryPointHandler authenticationEntryPointHandler;
|
||||
|
||||
@Autowired
|
||||
private AccessDeniedExceptionHandler accessDeniedExceptionHandler;
|
||||
|
||||
@Autowired
|
||||
private JwtAuthenticationFilter jwtAuthenticationFilter;
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationManager authenticationManager(AuthenticationConfiguration configuration) throws Exception {
|
||||
return configuration.getAuthenticationManager();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
CorsConfigurationSource corsConfigurationSource() {
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
corsConfiguration.setAllowedOrigins(List.of("*"));
|
||||
corsConfiguration.setAllowedHeaders(List.of("*"));
|
||||
corsConfiguration.setAllowedMethods(List.of("*"));
|
||||
corsConfiguration.setMaxAge(Duration.ofHours(5));
|
||||
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
return urlBasedCorsConfigurationSource;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
return http.authorizeRequests()
|
||||
.antMatchers("/login/**","/validate/code").permitAll() // 登录接口,验证码接口放行
|
||||
//放行swagger
|
||||
.antMatchers("/swagger-ui.html/**", "/swagger-resources/**", "/webjars/**", "/v2/**").permitAll()
|
||||
.anyRequest().authenticated() // 任意请求认证之后才能访问
|
||||
.and()
|
||||
.cors().configurationSource(corsConfigurationSource()) // 跨域
|
||||
.and()
|
||||
.csrf().disable()
|
||||
//不通过Session获取SecurityContext
|
||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
.and()
|
||||
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class) // 添加过滤器
|
||||
.exceptionHandling()
|
||||
.authenticationEntryPoint(authenticationEntryPointHandler) // 认证失败处理器
|
||||
.accessDeniedHandler(accessDeniedExceptionHandler) // 授权失败处理器
|
||||
.and()
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,105 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.service.AttendanceService;
|
||||
import com.qiujie.entity.Attendance;
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance")
|
||||
public class AttendanceController {
|
||||
|
||||
@Autowired
|
||||
private AttendanceService attendanceService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody Attendance attendance) {
|
||||
return this.attendanceService.add(attendance);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.attendanceService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.attendanceService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody Attendance attendance) {
|
||||
return this.attendanceService.edit(attendance);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.attendanceService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('performance:attendance:list','performance:attendance:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId, String month) {
|
||||
return this.attendanceService.list(current, size, name, deptId, month);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{month}/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('performance:attendance:export')")
|
||||
public void export(HttpServletResponse response, @PathVariable String month,@PathVariable String filename) throws IOException {
|
||||
this.attendanceService.export(response, month,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('performance:attendance:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.attendanceService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}/{date}")
|
||||
public ResponseDTO queryByStaffIdAndDate(@PathVariable Integer id, @PathVariable String date) {
|
||||
return this.attendanceService.queryByStaffIdAndDate(id, date);
|
||||
}
|
||||
|
||||
@ApiOperation("保存或更新")
|
||||
@PutMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('performance:attendance:set')")
|
||||
public ResponseDTO setAttendance(@RequestBody Attendance attendance) {
|
||||
return this.attendanceService.setAttendance(attendance);
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll() {
|
||||
return this.attendanceService.queryAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,96 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.City;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.CityService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/city")
|
||||
public class CityController {
|
||||
@Autowired
|
||||
private CityService cityService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAnyAuthority('money:city:add')")
|
||||
public ResponseDTO add(@RequestBody City city) {
|
||||
return this.cityService.add(city);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('money:city:delete')")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.cityService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@PreAuthorize("hasAnyAuthority('money:city:delete')")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.cityService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAnyAuthority('money:city:edit')")
|
||||
public ResponseDTO edit(@RequestBody City city) {
|
||||
return this.cityService.edit(city);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.cityService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll() {
|
||||
return this.cityService.queryAll();
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('money:city:list','money:city:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name) {
|
||||
return this.cityService.list(current, size, name);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('money:city:export')")
|
||||
public void export(HttpServletResponse response, @PathVariable String filename) throws IOException {
|
||||
this.cityService.export(response, filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('money:city:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.cityService.imp(file);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,94 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Dept;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.DeptService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
public class DeptController {
|
||||
@Autowired
|
||||
private DeptService deptService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:department:add')")
|
||||
public ResponseDTO add(@RequestBody Dept dept) {
|
||||
return this.deptService.add(dept);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:delete')")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.deptService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:delete')")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.deptService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:department:edit')")
|
||||
public ResponseDTO edit(@RequestBody Dept dept) {
|
||||
return this.deptService.edit(dept);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.deptService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll(){
|
||||
return this.deptService.queryAll();
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:department:list','system:department:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name) {
|
||||
return this.deptService.list(current, size, name);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:export')")
|
||||
public void export(HttpServletResponse response,@PathVariable String filename) throws Exception {
|
||||
this.deptService.export(response,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.deptService.imp(file);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,107 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Docs;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.DocsService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @Author qiujie
|
||||
* @Date 2022/2/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/docs")
|
||||
public class DocsController {
|
||||
|
||||
@Autowired
|
||||
private DocsService docsService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody Docs docs) {
|
||||
return this.docsService.add(docs);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:delete')")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.docsService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:delete')")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.docsService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:edit')")
|
||||
public ResponseDTO edit(@RequestBody Docs docs) {
|
||||
return this.docsService.edit(docs);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.docsService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("分页条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:list','system:docs:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String oldName, String staffName) {
|
||||
return this.docsService.list(current, size, oldName, staffName);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:export')")
|
||||
public void export(HttpServletResponse response,@PathVariable String filename) throws IOException {
|
||||
this.docsService.export(response,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.docsService.imp(file);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("文件上传")
|
||||
@PostMapping("/upload/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:upload')")
|
||||
public ResponseDTO upload(MultipartFile file, @PathVariable Integer id) throws IOException {
|
||||
return this.docsService.upload(file, id);
|
||||
}
|
||||
|
||||
@ApiOperation("文件下载")
|
||||
@GetMapping("/download/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('system:docs:download')")
|
||||
public void download(@PathVariable String filename, HttpServletResponse response) throws IOException {
|
||||
this.docsService.download(filename, response);
|
||||
}
|
||||
|
||||
@ApiOperation("文件下载")
|
||||
@GetMapping("/avatar/{filename}")
|
||||
public void getAvatar(@PathVariable String filename, HttpServletResponse response) throws IOException {
|
||||
this.docsService.download(filename, response);
|
||||
}
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.HomeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author qiujie
|
||||
* @Date 2022/2/27
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/home")
|
||||
public class HomeController {
|
||||
|
||||
@Autowired
|
||||
private HomeService homeService;
|
||||
|
||||
@GetMapping("/staff")
|
||||
public ResponseDTO queryStaff() {
|
||||
return this.homeService.queryStaff();
|
||||
}
|
||||
|
||||
@GetMapping("/count")
|
||||
public ResponseDTO queryCount() {
|
||||
return this.homeService.queryCount();
|
||||
}
|
||||
|
||||
@GetMapping("/city")
|
||||
public ResponseDTO queryCity() {
|
||||
return this.homeService.queryCity();
|
||||
}
|
||||
|
||||
@GetMapping("/attendance")
|
||||
public ResponseDTO queryAttendance(@RequestParam Integer id, String month) {
|
||||
return this.homeService.queryAttendance(id, month);
|
||||
}
|
||||
@GetMapping("/department")
|
||||
public ResponseDTO queryDepartment() {
|
||||
return this.homeService.queryDepartment();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,98 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Staff;
|
||||
import com.qiujie.service.InsuranceService;
|
||||
import com.qiujie.entity.Insurance;
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/insurance")
|
||||
public class InsuranceController {
|
||||
@Autowired
|
||||
private InsuranceService insuranceService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody Insurance insurance) {
|
||||
return this.insuranceService.add(insurance);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.insuranceService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.insuranceService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody Insurance insurance) {
|
||||
return this.insuranceService.edit(insurance);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.insuranceService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/staff/{id}")
|
||||
public ResponseDTO queryByStaffId(@PathVariable Integer id) {
|
||||
return this.insuranceService.queryByStaffId(id);
|
||||
}
|
||||
|
||||
@ApiOperation("多条件分页查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('money:insurance:list','money:insurance:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId){
|
||||
return this.insuranceService.list(current, size, name,deptId);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('money:insurance:export')")
|
||||
public void export(HttpServletResponse response,@PathVariable String filename) throws IOException {
|
||||
this.insuranceService.export(response,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('money:insurance:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.insuranceService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("为员工设置社保")
|
||||
@PostMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('money:insurance:set')")
|
||||
public ResponseDTO setInsurance(@RequestBody Insurance insurance) {
|
||||
return this.insuranceService.setInsurance(insurance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Leave;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.LeaveService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 请假表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/leave")
|
||||
public class LeaveController {
|
||||
@Autowired
|
||||
private LeaveService leaveService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody Leave leave) {
|
||||
return this.leaveService.add(leave);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.leaveService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.leaveService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody Leave leave) {
|
||||
return this.leaveService.edit(leave);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.leaveService.query(id);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/{deptId}/{typeNum}")
|
||||
public ResponseDTO queryByDeptIdAndTypeNum(@PathVariable Integer deptId, @PathVariable Integer typeNum) {
|
||||
return this.leaveService.queryByDeptIdAndTypeNum(deptId, typeNum);
|
||||
}
|
||||
|
||||
@ApiOperation("设置假期")
|
||||
@PostMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:setting')")
|
||||
public ResponseDTO setLeave(@RequestBody Leave leave) {
|
||||
return this.leaveService.setLeave(leave);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/dept/{id}")
|
||||
public ResponseDTO queryByDeptId(@PathVariable Integer id) {
|
||||
return this.leaveService.queryByDeptId(id);
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll() {
|
||||
return this.leaveService.queryAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.dto.Response;
|
||||
import com.qiujie.entity.Staff;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.LoginService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 登录注册接口
|
||||
*
|
||||
* @Author : qiujie
|
||||
* @Date : 2022/1/30
|
||||
*/
|
||||
@RestController
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private LoginService loginService;
|
||||
|
||||
@PostMapping("/login/{validateCode}")
|
||||
public ResponseDTO login(@RequestBody Staff staff, @PathVariable String validateCode) {
|
||||
return this.loginService.login(staff, validateCode);
|
||||
}
|
||||
|
||||
@GetMapping("/validate/code")
|
||||
public void getValidateCode(HttpServletResponse response) throws IOException {
|
||||
this.loginService.getValidateCode(response);
|
||||
}
|
||||
}
|
||||
@ -1,108 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.entity.Menu;
|
||||
import com.qiujie.service.MenuService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/menu")
|
||||
public class MenuController {
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:add')")
|
||||
public ResponseDTO add(@RequestBody Menu menu) {
|
||||
return this.menuService.add(menu);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:delete')")
|
||||
public ResponseDTO deleteById(@PathVariable Integer id) {
|
||||
return this.menuService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:delete')")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.menuService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:edit','permission:menu:enable')")
|
||||
public ResponseDTO edit(@RequestBody Menu menu) {
|
||||
return this.menuService.edit(menu);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.menuService.query(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("分页条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:list','permission:menu:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name) {
|
||||
return this.menuService.list(current, size, name);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:export')")
|
||||
public void export(HttpServletResponse response,@PathVariable String filename) throws IOException {
|
||||
this.menuService.export(response,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('permission:menu:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.menuService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll(){
|
||||
return this.menuService.queryAll();
|
||||
}
|
||||
|
||||
@ApiOperation("获取员工的菜单")
|
||||
@GetMapping("/staff/{id}")
|
||||
public ResponseDTO queryByStaffId(@PathVariable Integer id){
|
||||
return this.menuService.queryByStaffId(id);
|
||||
}
|
||||
|
||||
@ApiOperation("查询权限")
|
||||
@GetMapping("/permission/{id}")
|
||||
public ResponseDTO queryPermission(@PathVariable Integer id){
|
||||
return this.menuService.queryPermission(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Overtime;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.enums.OvertimeEnum;
|
||||
import com.qiujie.service.OvertimeService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 加班表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/overtime")
|
||||
public class OvertimeController {
|
||||
@Autowired
|
||||
private OvertimeService overtimeService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody Overtime overtime) {
|
||||
return this.overtimeService.add(overtime);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.overtimeService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.overtimeService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody Overtime overtime) {
|
||||
return this.overtimeService.edit(overtime);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.overtimeService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/{deptId}/{typeNum}")
|
||||
public ResponseDTO queryByDeptIdAndTypeNum(@PathVariable Integer deptId, @PathVariable String typeNum) {
|
||||
return this.overtimeService.queryByDeptIdAndTypeNum(deptId,typeNum);
|
||||
}
|
||||
|
||||
@ApiOperation("设置加班")
|
||||
@PostMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:setting')")
|
||||
public ResponseDTO setOvertime(@RequestBody Overtime overtime) {
|
||||
return this.overtimeService.setOvertime(overtime);
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll() {
|
||||
return this.overtimeService.queryAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,110 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Role;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.RoleMenuService;
|
||||
import com.qiujie.service.RoleService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class RoleController {
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private RoleMenuService roleMenuService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:add')")
|
||||
public ResponseDTO add(@RequestBody Role role) {
|
||||
return this.roleService.add(role);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:delete')")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.roleService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:delete')")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.roleService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:edit')")
|
||||
public ResponseDTO edit(@RequestBody Role role) {
|
||||
return this.roleService.edit(role);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.roleService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll(){
|
||||
return this.roleService.queryAll();
|
||||
}
|
||||
|
||||
@ApiOperation("分页条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:list','permission:role:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name) {
|
||||
return this.roleService.list(current, size, name);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:export')")
|
||||
public void export(HttpServletResponse response,@PathVariable String filename) throws IOException {
|
||||
this.roleService.export(response,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.roleService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("为角色设置菜单")
|
||||
@PostMapping("/set/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('permission:role:set_menu')")
|
||||
public ResponseDTO setMenu(@PathVariable Integer id, @RequestBody List<Integer> menuIds){
|
||||
return this.roleMenuService.setMenu(id, menuIds);
|
||||
}
|
||||
|
||||
@ApiOperation("得到角色所属的菜单")
|
||||
@GetMapping("/role/{id}")
|
||||
public ResponseDTO queryByRoleId(@PathVariable Integer id){
|
||||
return this.roleMenuService.queryByRoleId(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,93 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.Salary;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.SalaryService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-04-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/salary")
|
||||
public class SalaryController {
|
||||
|
||||
@Autowired
|
||||
private SalaryService salaryService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody Salary salary) {
|
||||
return this.salaryService.add(salary);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.salaryService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.salaryService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody Salary salary) {
|
||||
return this.salaryService.edit(salary);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.salaryService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("分页条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('money:salary:list','money:salary:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId, String month) {
|
||||
return this.salaryService.list(current, size, name, deptId, month);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{month}/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('money:salary:export')")
|
||||
public void export(HttpServletResponse response, @PathVariable String month,@PathVariable String filename) throws IOException {
|
||||
this.salaryService.export(response, month,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('money:salary:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.salaryService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("设置工资")
|
||||
@PostMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('money:salary:set')")
|
||||
public ResponseDTO setSalary(@RequestBody Salary salary) {
|
||||
return this.salaryService.setSalary(salary);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,79 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.entity.SalaryDeduct;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.service.SalaryDeductService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工资扣除表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/salary-deduct")
|
||||
public class SalaryDeductController {
|
||||
@Autowired
|
||||
private SalaryDeductService salaryDeductService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody SalaryDeduct salaryDeduct) {
|
||||
return this.salaryDeductService.add(salaryDeduct);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.salaryDeductService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.salaryDeductService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody SalaryDeduct salaryDeduct) {
|
||||
return this.salaryDeductService.edit(salaryDeduct);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.salaryDeductService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/{deptId}/{typeNum}")
|
||||
public ResponseDTO queryByDeptIdAndTypeNum(@PathVariable Integer deptId, @PathVariable Integer typeNum) {
|
||||
return this.salaryDeductService.queryByDeptIdAndTypeNum(deptId, typeNum);
|
||||
}
|
||||
|
||||
@ApiOperation("设置罚款")
|
||||
@PostMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('system:department:setting')")
|
||||
public ResponseDTO setSalaryDeduct(@RequestBody SalaryDeduct salaryDeduct) {
|
||||
return this.salaryDeductService.setSalaryDeduct(salaryDeduct);
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll() {
|
||||
return this.salaryDeductService.queryAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,123 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.entity.Staff;
|
||||
import com.qiujie.service.StaffRoleService;
|
||||
import com.qiujie.service.StaffService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-01-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/staff")
|
||||
public class StaffController {
|
||||
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleService staffRoleService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:add')")
|
||||
public ResponseDTO add(@RequestBody Staff staff) {
|
||||
return this.staffService.add(staff);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:delete')")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.staffService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:delete')")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.staffService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:edit','system:staff:enable')")
|
||||
public ResponseDTO edit(@RequestBody Staff staff) {
|
||||
return this.staffService.edit(staff);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.staffService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("查询员工信息")
|
||||
@GetMapping("/info/{id}")
|
||||
public ResponseDTO queryInfo(@PathVariable Integer id) {
|
||||
return this.staffService.queryInfo(id);
|
||||
}
|
||||
|
||||
@ApiOperation("多条件分页查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:list','system:staff:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, String birthday, Integer deptId, Integer status) {
|
||||
return this.staffService.list(current, size, name, birthday, deptId, status);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:export')")
|
||||
public void export(HttpServletResponse response, @PathVariable String filename) throws IOException {
|
||||
this.staffService.export(response, filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.staffService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("为员工设置角色")
|
||||
@PostMapping("/set/{id}")
|
||||
@PreAuthorize("hasAnyAuthority('system:staff:set_role')")
|
||||
public ResponseDTO setRole(@PathVariable Integer id, @RequestBody List<Integer> roleIds) {
|
||||
return this.staffRoleService.setRole(id, roleIds);
|
||||
}
|
||||
|
||||
@ApiOperation("得到员工的角色")
|
||||
@GetMapping("/staff/{id}")
|
||||
public ResponseDTO queryByStaffId(@PathVariable Integer id) {
|
||||
return this.staffRoleService.queryByStaffId(id);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("检查员工的密码")
|
||||
@GetMapping("/{pwd}/{id}")
|
||||
public ResponseDTO validate(@PathVariable String pwd, @PathVariable Integer id) {
|
||||
return this.staffService.validate(pwd, id);
|
||||
}
|
||||
|
||||
@ApiOperation("更新密码")
|
||||
@PutMapping("/reset")
|
||||
public ResponseDTO reset(@RequestBody Staff staff) {
|
||||
return this.staffService.reset(staff);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,139 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
import com.qiujie.service.StaffLeaveService;
|
||||
import com.qiujie.entity.StaffLeave;
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-04-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/staff-leave")
|
||||
public class StaffLeaveController {
|
||||
|
||||
@Autowired
|
||||
private StaffLeaveService staffLeaveService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody StaffLeave staffLeave) {
|
||||
return this.staffLeaveService.add(staffLeave);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.staffLeaveService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.staffLeaveService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody StaffLeave staffLeave) {
|
||||
return this.staffLeaveService.edit(staffLeave);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.staffLeaveService.query(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
* @param size
|
||||
* @param name
|
||||
* @param deptId
|
||||
* @param code 用户工号
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("分页条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('performance:leave:list','performance:leave:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId,String code) {
|
||||
return this.staffLeaveService.list(current, size, name,deptId,code);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('performance:leave:export')")
|
||||
public void export(HttpServletResponse response,@PathVariable String filename) throws IOException {
|
||||
this.staffLeaveService.export(response,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('performance:leave:import')")
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.staffLeaveService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@GetMapping("/staff")
|
||||
public ResponseDTO queryByStaffId(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, Integer id) {
|
||||
return this.staffLeaveService.queryByStaffId(current, size, id);
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有")
|
||||
@GetMapping("/all")
|
||||
public ResponseDTO queryAll() {
|
||||
return this.staffLeaveService.queryAll();
|
||||
}
|
||||
|
||||
@ApiOperation("申请请假")
|
||||
@PostMapping("/apply/{code}")
|
||||
public ResponseDTO apply(@RequestBody StaffLeave staffLeave,@PathVariable String code) {
|
||||
return this.staffLeaveService.apply(staffLeave,code);
|
||||
}
|
||||
|
||||
@ApiOperation("拾取请假任务")
|
||||
@PostMapping("/claim/{code}")
|
||||
@PreAuthorize("hasAnyAuthority('performance:leave:claim')")
|
||||
public ResponseDTO claim(@RequestBody StaffLeave staffLeave,@PathVariable String code) {
|
||||
return this.staffLeaveService.claim(staffLeave,code);
|
||||
}
|
||||
|
||||
@ApiOperation("归还请假任务")
|
||||
@PostMapping("/revert/{code}")
|
||||
public ResponseDTO revert(@RequestBody StaffLeave staffLeave,@PathVariable String code) {
|
||||
return this.staffLeaveService.revert(staffLeave,code);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("完成任务")
|
||||
@PostMapping("/complete/{code}")
|
||||
public ResponseDTO complete(@RequestBody StaffLeave staffLeave, @PathVariable String code) {
|
||||
return this.staffLeaveService.complete(staffLeave,code);
|
||||
}
|
||||
|
||||
@ApiOperation("撤销请假")
|
||||
@PostMapping("/cancel")
|
||||
public ResponseDTO cancel(@RequestBody StaffLeave staffLeave){
|
||||
return this.staffLeaveService.cancel(staffLeave);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,103 +0,0 @@
|
||||
package com.qiujie.controller;
|
||||
|
||||
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.entity.StaffOvertime;
|
||||
import com.qiujie.service.StaffOvertimeService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/staff-overtime")
|
||||
public class StaffOvertimeController {
|
||||
@Autowired
|
||||
private StaffOvertimeService staffOvertimeService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping
|
||||
public ResponseDTO add(@RequestBody StaffOvertime staffOvertime) {
|
||||
return this.staffOvertimeService.add(staffOvertime);
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseDTO delete(@PathVariable Integer id) {
|
||||
return this.staffOvertimeService.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("批量逻辑删除")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
|
||||
return this.staffOvertimeService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑更新")
|
||||
@PutMapping
|
||||
public ResponseDTO edit(@RequestBody StaffOvertime staffOvertime) {
|
||||
return this.staffOvertimeService.edit(staffOvertime);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}")
|
||||
public ResponseDTO query(@PathVariable Integer id) {
|
||||
return this.staffOvertimeService.query(id);
|
||||
}
|
||||
|
||||
@ApiOperation("分页条件查询")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('performance:overtime:list','performance:overtime:search')")
|
||||
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId,String month) {
|
||||
return this.staffOvertimeService.list(current, size, name,deptId ,month);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导出接口")
|
||||
@GetMapping("/export/{month}/{filename}")
|
||||
@PreAuthorize("hasAnyAuthority('performance:overtime:export')")
|
||||
public void export(HttpServletResponse response, @PathVariable String month,@PathVariable String filename) throws IOException {
|
||||
this.staffOvertimeService.export(response, month,filename);
|
||||
}
|
||||
|
||||
@ApiOperation("数据导入接口")
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("hasAnyAuthority('performance:overtime:import')")
|
||||
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
return this.staffOvertimeService.imp(file);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/{id}/{date}")
|
||||
public ResponseDTO queryByStaffIdAndDate(@PathVariable Integer id,@PathVariable String date) {
|
||||
return this.staffOvertimeService.queryByStaffIdAndDate(id,date);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("设置加班")
|
||||
@PostMapping("/set")
|
||||
@PreAuthorize("hasAnyAuthority('performance:overtime:set')")
|
||||
public ResponseDTO setOvertime(@RequestBody StaffOvertime staffOvertime) {
|
||||
return this.staffOvertimeService.setOvertime(staffOvertime);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@GetMapping("/time/off/{id}")
|
||||
public ResponseDTO queryTimeOffDaysByStaffId(@PathVariable Integer id) {
|
||||
return this.staffOvertimeService.queryTimeOffDaysByStaffId(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
package com.qiujie.dto;
|
||||
|
||||
import com.qiujie.enums.BaseEnum;
|
||||
import com.qiujie.enums.BusinessStatusEnum;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* 请求响应数据
|
||||
*/
|
||||
public class Response {
|
||||
|
||||
public static ResponseDTO success(){
|
||||
return new ResponseDTO(BusinessStatusEnum.SUCCESS);
|
||||
}
|
||||
|
||||
public static ResponseDTO success(String message){
|
||||
return new ResponseDTO(BusinessStatusEnum.SUCCESS.getCode(), message);
|
||||
}
|
||||
|
||||
public static ResponseDTO success(Object data){
|
||||
return new ResponseDTO(BusinessStatusEnum.SUCCESS,data);
|
||||
}
|
||||
|
||||
public static ResponseDTO success(Object data,String token){
|
||||
return new ResponseDTO(BusinessStatusEnum.SUCCESS,data,token);
|
||||
}
|
||||
|
||||
public static ResponseDTO success(String message, Object data){
|
||||
return new ResponseDTO(BusinessStatusEnum.SUCCESS.getCode(),message,data);
|
||||
}
|
||||
|
||||
public static ResponseDTO error(String message){
|
||||
return new ResponseDTO(BusinessStatusEnum.ERROR.getCode(), message);
|
||||
}
|
||||
|
||||
public static ResponseDTO error(){
|
||||
return new ResponseDTO(BusinessStatusEnum.ERROR);
|
||||
}
|
||||
|
||||
public static ResponseDTO error(Integer code, String message){
|
||||
return new ResponseDTO(code,message);
|
||||
}
|
||||
|
||||
public static ResponseDTO error(BaseEnum<T> e) {
|
||||
return new ResponseDTO(e);
|
||||
}
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
package com.qiujie.dto;
|
||||
|
||||
import com.qiujie.enums.BaseEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "数据传输对象", description = "")
|
||||
public class ResponseDTO {
|
||||
@ApiModelProperty("状态码")
|
||||
private int code;
|
||||
|
||||
@ApiModelProperty("响应消息")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty("响应数据")
|
||||
private Object data;
|
||||
|
||||
@ApiModelProperty("token")
|
||||
private String token;
|
||||
|
||||
public ResponseDTO(int code, String message){
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ResponseDTO(int code,String message,Object data){
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ResponseDTO(BaseEnum<T> e){
|
||||
this.code = e.getCode();
|
||||
this.message = e.getMessage();
|
||||
}
|
||||
|
||||
public ResponseDTO(BaseEnum<T> e, Object data){
|
||||
this.code = e.getCode();
|
||||
this.message = e.getMessage();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ResponseDTO(BaseEnum<T> e, Object data, String token){
|
||||
this.code = e.getCode();
|
||||
this.message = e.getMessage();
|
||||
this.data = data;
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
package com.qiujie.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-01-27
|
||||
*/
|
||||
@Data
|
||||
@TableName("per_role")
|
||||
@ApiModel(value = "Role对象", description = "")
|
||||
public class Role implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("角色编码")
|
||||
@TableField("code")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("角色名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("角色备注")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField("create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField("update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@TableField("is_deleted")
|
||||
@TableLogic
|
||||
private Integer deleteFlag;
|
||||
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package com.qiujie.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("per_role_menu")
|
||||
@ApiModel(value = "RoleMenu对象", description = "")
|
||||
public class RoleMenu implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
@TableField("role_id")
|
||||
private Integer roleId;
|
||||
|
||||
@ApiModelProperty("菜单id")
|
||||
@TableField("menu_id")
|
||||
private Integer menuId;
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.qiujie.entity;
|
||||
|
||||
import com.qiujie.vo.StaffDeptVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StaffDetails implements UserDetails, Serializable {
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String username;
|
||||
private String password;
|
||||
private Collection<? extends GrantedAuthority> authorities;
|
||||
private boolean accountNonExpired;
|
||||
private boolean accountNonLocked;
|
||||
private boolean credentialsNonExpired;
|
||||
private boolean enabled;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package com.qiujie.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("per_staff_role")
|
||||
@ApiModel(value = "StaffRole对象", description = "")
|
||||
public class StaffRole implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("员工id")
|
||||
@TableField("staff_id")
|
||||
private Integer staffId;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
@TableField("role_id")
|
||||
private Integer roleId;
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package com.qiujie.entity;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ValidateCode {
|
||||
|
||||
private BufferedImage image;
|
||||
|
||||
private String code;
|
||||
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
public ValidateCode(BufferedImage image, String code, int expireIn) {
|
||||
this.image = image;
|
||||
this.code = code;
|
||||
this.expireTime = LocalDateTime.now().plusSeconds(expireIn);
|
||||
}
|
||||
|
||||
public ValidateCode(BufferedImage image, String code) {
|
||||
this.image = image;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ValidateCode(BufferedImage image, String code, LocalDateTime expireTime) {
|
||||
this.image = image;
|
||||
this.code = code;
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
boolean isExpire() {
|
||||
return LocalDateTime.now().isAfter(expireTime);
|
||||
}
|
||||
|
||||
public BufferedImage getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(BufferedImage image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public LocalDateTime getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(LocalDateTime expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* @Author qiujie
|
||||
* @Date 2022/3/31
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AttendanceStatusEnum implements BaseEnum<T> {
|
||||
|
||||
NORMAL(0, "正常","success"),
|
||||
LATE(1, "迟到",""),
|
||||
LEAVE_EARLY(2, "早退","warning"),
|
||||
ABSENTEEISM(3, "旷工","danger"),
|
||||
LEAVE(4, "休假","info"),
|
||||
TIME_OFF(5,"调休","info");
|
||||
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
@JsonValue
|
||||
private final String message;
|
||||
|
||||
private final String tagType;
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* @Author qiujie
|
||||
* @Date 2022/4/7
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AuditStatusEnum implements BaseEnum<T> {
|
||||
|
||||
UNAUDITED(0, "待审核","info"),
|
||||
APPROVE(1, "审核通过","success"),
|
||||
REJECT(2, "驳回","danger"),
|
||||
CANCEL(3, "撤销",""),
|
||||
AUDITING(4,"审核中","warning");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
@JsonValue
|
||||
private final String message;
|
||||
|
||||
private final String tagType;
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 通用枚举接口
|
||||
*
|
||||
* @Author qiujie
|
||||
* @Date 2022/3/21
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface BaseEnum<T> extends Serializable {
|
||||
/**
|
||||
* 获取编码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
Integer getCode();
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getMessage();
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BusinessStatusEnum implements BaseEnum<T> {
|
||||
|
||||
SUCCESS(200, "成功"),
|
||||
ERROR(300, "失败"),
|
||||
STAFF_NOT_EXIST(400,"没有此员工,请重新登录"),
|
||||
STAFF_STATUS_ERROR(500, "状态异常,请联系管理员"),
|
||||
FILE_NOT_EXIST(600, "文件不存在"),
|
||||
FILE_READ_ERROR(700, "文件读取失败"),
|
||||
FILE_WRITE_ERROR(800, "文件写入失败"),
|
||||
FILE_UPLOAD_ERROR(900, "文件上传失败"),
|
||||
DATA_IMPORT_ERROR(1000, "数据导入失败"),
|
||||
BATCH_DELETE_ERROR(1100, "批量删除失败"),
|
||||
UNAUTHORIZED(1200,"认证失败,请重新登录"),
|
||||
FORBIDDEN(1300,"不好意思,你没有此权限");
|
||||
|
||||
private final Integer code;
|
||||
private final String message;
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeductEnum implements BaseEnum<T>{
|
||||
LATE_DEDUCT(0, "迟到扣款",50),
|
||||
LEAVE_EARLY_DEDUCT(1, "早退扣款",50),
|
||||
ABSENTEEISM_DEDUCT(2, "旷工扣款",100),
|
||||
LEAVE_DEDUCT(3, "休假扣款",80);
|
||||
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
@JsonValue
|
||||
private final String message;
|
||||
|
||||
// 默认的扣款金额
|
||||
private final Integer defaultValue;
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum GenderEnum implements BaseEnum<T>{
|
||||
|
||||
MALE(0,"男"),
|
||||
FEMALE(1,"女");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
@JsonValue
|
||||
private final String message;
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* 休假枚举类
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum LeaveEnum implements BaseEnum<T> {
|
||||
PERSONAL_LEAVE(0, "事假"),
|
||||
MATERNITY_LEAVE(1, "产假"),
|
||||
SICK_LEAVE(2, "病假"),
|
||||
MARRIAGE_LEAVE(3, "婚假"),
|
||||
HOME_LEAVE(4, "探亲假"),
|
||||
PATERNITY_LEAVE(5, "陪产假"),
|
||||
TIME_OFF(6, "调休");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
@JsonValue
|
||||
private final String message;
|
||||
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OvertimeEnum implements BaseEnum<T> {
|
||||
|
||||
WORKDAY_OVERTIME(0, "工作日加班",1.5),
|
||||
HOLIDAY_OVERTIME(1, "节假日加班",3.0),
|
||||
DAY_OFF_OVERTIME(2, "休息日加班",2.0);
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
@JsonValue
|
||||
private final String message;
|
||||
|
||||
// 基本工资倍数下限
|
||||
private final Double lowerLimit;
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.qiujie.enums;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* @Author qiujie
|
||||
* @Date 2022/3/31
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OvertimeStatusEnum implements BaseEnum<T> {
|
||||
|
||||
NORMAL(0, "正常","success"),
|
||||
OVERTIME(1, "加班",""),
|
||||
TIME_OFF(2, "调休","info");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
@JsonValue
|
||||
private final String message;
|
||||
|
||||
private final String tagType;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.qiujie.exception;
|
||||
|
||||
import com.qiujie.dto.Response;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ControllerAdvice
|
||||
public class BaseExceptionHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BaseExceptionHandler.class);
|
||||
|
||||
@ExceptionHandler(ServiceException.class)
|
||||
@ResponseBody
|
||||
public ResponseDTO handle(ServiceException exception){
|
||||
logger.info(exception.getMessage());
|
||||
return Response.error(exception.getCode(),exception.getMessage());
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package com.qiujie.exception;
|
||||
|
||||
import com.qiujie.enums.BaseEnum;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* 自定义异常
|
||||
* @author
|
||||
* @date
|
||||
*/
|
||||
@Getter
|
||||
public class ServiceException extends RuntimeException {
|
||||
private final int code;
|
||||
|
||||
public ServiceException(int code,String message){
|
||||
super(message);
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ServiceException(BaseEnum<T> e){
|
||||
super(e.getMessage());
|
||||
this.code = e.getCode();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
package com.qiujie.filter;
|
||||
|
||||
import com.qiujie.service.StaffDetailsService;
|
||||
import com.qiujie.util.JwtUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@Component
|
||||
public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
@Autowired
|
||||
private StaffDetailsService staffDetailsService;
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
||||
// 获取认证信息
|
||||
String authorization = request.getHeader("Authorization");
|
||||
String username = "";
|
||||
if (StringUtils.hasText(authorization) && authorization.startsWith("Bearer ")) {
|
||||
String token = authorization.substring(7).trim(); // 截取token
|
||||
if (StringUtils.hasText(token)) {
|
||||
// 解析username
|
||||
try {
|
||||
username = JwtUtil.extractUsername(token);
|
||||
} catch (Exception e) {
|
||||
this.logger.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.hasText(username)) {
|
||||
// 获取信息
|
||||
UserDetails userDetails = this.staffDetailsService.loadUserByUsername(username);
|
||||
if (userDetails != null) {
|
||||
// 存入SecurityContextHolder中
|
||||
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken =
|
||||
new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
|
||||
usernamePasswordAuthenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
|
||||
SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken);
|
||||
}
|
||||
}
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.qiujie.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.enums.BusinessStatusEnum;
|
||||
import com.qiujie.util.WebUtil;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.web.access.AccessDeniedHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@Component
|
||||
public class AccessDeniedExceptionHandler implements AccessDeniedHandler {
|
||||
@Override
|
||||
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) {
|
||||
String str = JSON.toJSONString(new ResponseDTO(BusinessStatusEnum.FORBIDDEN));
|
||||
// 给出异常提示信息
|
||||
WebUtil.renderString(response, str);
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.qiujie.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.enums.BusinessStatusEnum;
|
||||
import com.qiujie.util.WebUtil;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@Component
|
||||
public class AuthenticationEntryPointHandler implements AuthenticationEntryPoint {
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) {
|
||||
String str = JSON.toJSONString(new ResponseDTO(BusinessStatusEnum.UNAUTHORIZED));
|
||||
// 给出异常提示信息
|
||||
WebUtil.renderString(response, str);
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package com.qiujie.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.qiujie.entity.Staff;
|
||||
import com.qiujie.entity.StaffLeave;
|
||||
import com.qiujie.enums.AuditStatusEnum;
|
||||
import com.qiujie.enums.BusinessStatusEnum;
|
||||
import com.qiujie.exception.ServiceException;
|
||||
import com.qiujie.mapper.StaffMapper;
|
||||
import com.qiujie.service.StaffLeaveService;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class HrApproveListener implements ExecutionListener {
|
||||
|
||||
@Autowired
|
||||
private StaffLeaveService staffLeaveService;
|
||||
|
||||
@Autowired
|
||||
private StaffMapper staffMapper;
|
||||
|
||||
@Autowired
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void notify(DelegateExecution execution) {
|
||||
UpdateWrapper<StaffLeave> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("status", AuditStatusEnum.UNAUDITED).eq("id", Integer.valueOf(execution.getProcessInstanceBusinessKey()));
|
||||
if (!this.staffLeaveService.update(updateWrapper)) {
|
||||
throw new ServiceException(BusinessStatusEnum.ERROR);
|
||||
}
|
||||
List<Staff> staffList = this.staffMapper.queryByRole("manager");
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("manager", staffList.stream().map(Staff::getCode).collect(Collectors.joining(",")));
|
||||
runtimeService.setVariables(execution.getId(), variables);
|
||||
}
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.qiujie.listener;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.qiujie.dto.Response;
|
||||
import com.qiujie.entity.Attendance;
|
||||
import com.qiujie.entity.StaffLeave;
|
||||
import com.qiujie.entity.StaffOvertime;
|
||||
import com.qiujie.enums.AttendanceStatusEnum;
|
||||
import com.qiujie.enums.BusinessStatusEnum;
|
||||
import com.qiujie.enums.LeaveEnum;
|
||||
import com.qiujie.enums.OvertimeStatusEnum;
|
||||
import com.qiujie.exception.ServiceException;
|
||||
import com.qiujie.mapper.StaffOvertimeMapper;
|
||||
import com.qiujie.service.AttendanceService;
|
||||
import com.qiujie.service.StaffLeaveService;
|
||||
import com.qiujie.util.DatetimeUtil;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
@Component
|
||||
public class ManagerApproveListener implements ExecutionListener {
|
||||
|
||||
@Autowired
|
||||
private StaffLeaveService staffLeaveService;
|
||||
|
||||
@Autowired
|
||||
private StaffOvertimeMapper staffOvertimeMapper;
|
||||
|
||||
@Autowired
|
||||
private AttendanceService attendanceService;
|
||||
|
||||
@Autowired
|
||||
private DatetimeUtil datetimeUtil;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void notify(DelegateExecution execution) {
|
||||
StaffLeave staffLeave = this.staffLeaveService.getOne(new QueryWrapper<StaffLeave>().eq("id", Integer.valueOf(execution.getProcessInstanceBusinessKey())));
|
||||
for (int i = 0; i < staffLeave.getDays(); i++) {
|
||||
Date attendanceDate = DateUtil.offsetDay(staffLeave.getStartDate(), i).toSqlDate();
|
||||
// 因为周末本就要休息,所以只需记录在休假期间包括的工作日的考勤状态到数据库
|
||||
if (DateUtil.isWeekend(attendanceDate) || this.datetimeUtil.isHoliday(attendanceDate)) {
|
||||
continue;
|
||||
}
|
||||
Attendance attendance = new Attendance().setAttendanceDate(attendanceDate).setStaffId(staffLeave.getStaffId());
|
||||
// 如果请假类型是调休,考勤状态设为调休;其他类型的假期都设为休假
|
||||
if (staffLeave.getTypeNum() == LeaveEnum.TIME_OFF) {
|
||||
attendance.setStatus(AttendanceStatusEnum.TIME_OFF);
|
||||
// 删除员工的一条调休记录
|
||||
this.staffOvertimeMapper.delete(new QueryWrapper<StaffOvertime>()
|
||||
.eq("staff_id", staffLeave.getStaffId())
|
||||
.eq("status", OvertimeStatusEnum.TIME_OFF).orderByAsc("overtime_date").last("limit 1"));
|
||||
} else {
|
||||
attendance.setStatus(AttendanceStatusEnum.LEAVE);
|
||||
}
|
||||
QueryWrapper<Attendance> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("staff_id", attendance.getStaffId()).eq("attendance_date", attendance.getAttendanceDate());
|
||||
if (!this.attendanceService.saveOrUpdate(attendance, queryWrapper)) {
|
||||
throw new ServiceException(BusinessStatusEnum.ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.Attendance;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-29
|
||||
*/
|
||||
|
||||
public interface AttendanceMapper extends BaseMapper<Attendance> {
|
||||
|
||||
|
||||
@Select("select * from att_attendance where is_deleted = 0 and staff_id = #{id} and date_format(attendance_date,'%Y%m%d') = #{day}")
|
||||
Attendance queryByStaffIdAndDate(@Param("id") Integer id, @Param("day") String day);
|
||||
|
||||
/**
|
||||
* 统计员工迟到、早退、旷工的次数
|
||||
*
|
||||
* @param id 员工id
|
||||
* @param status
|
||||
* @param month 月份
|
||||
* @return
|
||||
*/
|
||||
@Select("select count(*) from att_attendance where is_deleted = 0 and staff_id = #{id} and status = #{status} and date_format(attendance_date,'%Y%m') = #{month} ")
|
||||
Integer countTimes(@Param("id") Integer id, @Param("status") Integer status, @Param("month") String month);
|
||||
|
||||
|
||||
/**
|
||||
* 查找员工休假的日期
|
||||
*
|
||||
* @param id
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
@Select("select attendance_date from att_attendance where is_deleted = 0 and staff_id = #{id} and status=#{status} and date_format(attendance_date,'%Y%m') = #{month} ")
|
||||
List<Date> queryLeaveDate(@Param("id") Integer id, @Param("status") Integer status, @Param("month") String month);
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.City;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-23
|
||||
*/
|
||||
public interface CityMapper extends BaseMapper<City> {
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.Dept;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-07
|
||||
*/
|
||||
public interface DeptMapper extends BaseMapper<Dept> {
|
||||
|
||||
@Select("select * from sys_dept where is_deleted = 0 and parent_id = 0 and name like concat('%',#{name},'%')")
|
||||
IPage<Dept> listParentDept(IPage<Dept> config, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查找所有子部门
|
||||
*
|
||||
*/
|
||||
@Select("select * from sys_dept where is_deleted = 0 and parent_id != 0")
|
||||
List<Dept> queryAllSub();
|
||||
|
||||
/**
|
||||
* 查找员工所在的部门
|
||||
*/
|
||||
@Select("select sd.* from sys_dept sd right join sys_staff ss on sd.id = ss.dept_id where ss.is_deleted = 0 and ss.id = #{id} ")
|
||||
Dept queryByStaffId(@Param("id") Integer id);
|
||||
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.Docs;
|
||||
import com.qiujie.vo.StaffDocsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-24
|
||||
*/
|
||||
public interface DocsMapper extends BaseMapper<Docs> {
|
||||
|
||||
@Select("select sd.*,ss.name staff_name from sys_staff ss left join sys_docs sd on ss.id = sd.staff_id " +
|
||||
"where sd.is_deleted = 0 and sd.old_name like concat('%',#{oldName},'%') and ss.name like concat('%',#{staffName},'%')")
|
||||
IPage<StaffDocsVO> listStaffDocsVO(IPage<StaffDocsVO> config, @Param("oldName") String oldName, @Param("staffName") String staffName);
|
||||
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.Insurance;
|
||||
import com.qiujie.vo.StaffInsuranceVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-23
|
||||
*/
|
||||
public interface InsuranceMapper extends BaseMapper<Insurance> {
|
||||
|
||||
|
||||
@Select("select ss.id staff_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name," +
|
||||
"si.id insurance_id,si.city_id,si.social_base,si.per_social_pay,si.com_injury_rate,si.com_social_pay,si.social_remark,si.house_base,si.per_house_rate," +
|
||||
"si.per_house_pay,si.com_house_rate,si.com_house_pay,si.house_remark from " +
|
||||
"(sys_staff ss left join sys_dept sd on ss.dept_id = sd.id) left join soc_insurance si on si.staff_id = ss.id " +
|
||||
"where ss.is_deleted = 0 and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffInsuranceVO> listStaffInsuranceVO(IPage<StaffInsuranceVO> config, @Param("name") String name);
|
||||
|
||||
@Select("select ss.id staff_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name," +
|
||||
"si.id insurance_id,si.city_id,si.social_base,si.per_social_pay,si.com_injury_rate,si.com_social_pay,si.social_remark,si.house_base,si.per_house_rate," +
|
||||
"si.per_house_pay,si.com_house_rate,si.com_house_pay,si.house_remark from " +
|
||||
"(sys_staff ss left join sys_dept sd on ss.dept_id = sd.id) left join soc_insurance si on si.staff_id = ss.id " +
|
||||
"where ss.is_deleted = 0 and ss.dept_id = #{deptId} and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffInsuranceVO> listStaffDeptInsuranceVO(IPage<StaffInsuranceVO> config, @Param("name") String name,@Param("deptId") Integer deptId);
|
||||
|
||||
@Select("select ss.id staff_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name," +
|
||||
"si.id insurance_id,si.city_id,si.social_base,si.per_social_pay,si.com_injury_rate,si.com_social_pay,si.social_remark,si.house_base,si.per_house_rate," +
|
||||
"si.per_house_pay,si.com_house_rate,si.com_house_pay,si.house_remark from " +
|
||||
"(sys_staff ss left join sys_dept sd on ss.dept_id = sd.id) left join soc_insurance si on si.staff_id = ss.id " +
|
||||
"where ss.is_deleted = 0")
|
||||
List<StaffInsuranceVO> queryStaffInsuranceVO();
|
||||
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.Leave;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 请假表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-27
|
||||
*/
|
||||
|
||||
public interface LeaveMapper extends BaseMapper<Leave> {
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.Menu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
public interface MenuMapper extends BaseMapper<Menu> {
|
||||
|
||||
@Select("""
|
||||
select distinct pm.* from per_menu pm\s
|
||||
left join per_role_menu prm on pm.id = prm.menu_id\s
|
||||
left join per_role pr on prm.role_id = pr.id\s
|
||||
left join per_staff_role psr on pr.id = psr.role_id where psr.staff_id = #{id} and pm.status = 1 and pm.level < 2 and pm.is_deleted = 0""")
|
||||
List<Menu> queryByStaffId(@Param("id") Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前员工的权限
|
||||
* @param id 员工id
|
||||
*/
|
||||
@Select("""
|
||||
select distinct pm.* from per_menu pm\s
|
||||
left join per_role_menu prm on pm.id = prm.menu_id\s
|
||||
left join per_role pr on prm.role_id = pr.id\s
|
||||
left join per_staff_role psr on pr.id = psr.role_id where psr.staff_id = #{id} and pm.status = 1 and pm.level > 0 and pm.is_deleted = 0""")
|
||||
List<Menu> queryPermission(@Param("id") Integer id);
|
||||
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.Overtime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 加班表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-28
|
||||
*/
|
||||
|
||||
public interface OvertimeMapper extends BaseMapper<Overtime> {
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.Role;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-01-27
|
||||
*/
|
||||
public interface RoleMapper extends BaseMapper<Role> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.RoleMenu;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
public interface RoleMenuMapper extends BaseMapper<RoleMenu> {
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.SalaryDeduct;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工资扣除表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-27
|
||||
*/
|
||||
|
||||
|
||||
public interface SalaryDeductMapper extends BaseMapper<SalaryDeduct> {
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.Salary;
|
||||
import com.qiujie.vo.StaffSalaryVO;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-04-06
|
||||
*/
|
||||
public interface SalaryMapper extends BaseMapper<Salary> {
|
||||
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name,si.per_social_pay social_pay,si.per_house_pay house_pay " +
|
||||
"from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id left join soc_insurance si on ss.id = si.staff_id where ss.is_deleted = 0")
|
||||
List<StaffSalaryVO> queryStaffSalaryVO();
|
||||
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name,si.per_social_pay social_pay,si.per_house_pay house_pay " +
|
||||
"from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id left join soc_insurance si on ss.id = si.staff_id where ss.is_deleted = 0 and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffSalaryVO> listStaffSalaryVO(IPage<StaffSalaryVO> config, @Param("name") String name);
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name,si.per_social_pay social_pay,si.per_house_pay house_pay " +
|
||||
"from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id left join soc_insurance si on ss.id = si.staff_id where ss.is_deleted = 0 and ss.dept_id = #{deptId} and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffSalaryVO> listStaffDeptSalaryVO(IPage<StaffSalaryVO> config, @Param("name") String name, @Param("deptId")Integer deptId);
|
||||
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.StaffLeave;
|
||||
import com.qiujie.vo.StaffLeaveVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-04-05
|
||||
*/
|
||||
public interface StaffLeaveMapper extends BaseMapper<StaffLeave> {
|
||||
|
||||
|
||||
@Select("select * from att_staff_leave where is_deleted = 0 and staff_id = #{id}")
|
||||
IPage<StaffLeave> listStaffLeaveByStaffId(IPage<StaffLeave> config, @Param("id") Integer id);
|
||||
|
||||
/**
|
||||
* 查询组任务以及个人任务
|
||||
*
|
||||
* @param config
|
||||
* @param name
|
||||
* @param deptId
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Select("<script> " +
|
||||
"select asl.*,ss.code,ss.name ,ss.phone,sd.name dept_name from att_staff_leave asl inner join sys_staff ss on asl.staff_id = ss.id " +
|
||||
"inner join sys_dept sd on ss.dept_id = sd.id " +
|
||||
"where asl.is_deleted = 0 and asl.status in (0,4) " +
|
||||
"<if test= 'name != null'>" +
|
||||
"and ss.name like concat('%',#{name},'%')" +
|
||||
"</if>" +
|
||||
"<if test= 'deptId != null'>" +
|
||||
"and ss.dept_id = #{deptId}" +
|
||||
"</if>" +
|
||||
"<choose>" +
|
||||
"<when test='ids != null and ids.size > 0' >" +
|
||||
"and asl.id in <foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach> " +
|
||||
"</when> " +
|
||||
"<otherwise>" +
|
||||
"and 1 != 1" +
|
||||
"</otherwise>" +
|
||||
"</choose>" +
|
||||
"</script>")
|
||||
IPage<StaffLeaveVO> listStaffLeaveVO(IPage<StaffLeaveVO> config, @Param("name") String name, @Param("deptId") Integer deptId, @Param("ids") List<Integer> ids);
|
||||
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.qiujie.entity.Staff;
|
||||
import com.qiujie.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-01-27
|
||||
*/
|
||||
|
||||
|
||||
public interface StaffMapper extends BaseMapper<Staff> {
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id " +
|
||||
"where ss.is_deleted = 0 and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffAttendanceVO> listStaffAttendanceVO(IPage<StaffAttendanceVO> config, @Param("name") String name);
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id " +
|
||||
"where ss.is_deleted = 0 and ss.dept_id = #{deptId} and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffAttendanceVO> listStaffDeptAttendanceVO(IPage<StaffAttendanceVO> config, @Param("name") String name,@Param("deptId") Integer deptId);
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id where ss.is_deleted = 0")
|
||||
List<AttendanceMonthVO> queryAttendanceMonthVO();
|
||||
|
||||
@Select("select ss.id , ss.code, ss.name, ss.gender, ss.pwd password, ss.avatar, ss.birthday, ss.phone, ss.address, ss.remark,ss.status, ss.dept_id,sd.name dept_name from sys_staff ss left join sys_dept sd on ss.dept_id = sd.id where ss.is_deleted = 0 and ss.code = #{code}")
|
||||
StaffDeptVO queryByCode(@Param("code") String code);
|
||||
|
||||
@Select("select ss.id , ss.code, ss.name, ss.gender, ss.avatar, ss.birthday, ss.phone, ss.address, ss.remark,ss.status, ss.dept_id,sd.name dept_name from sys_staff ss left join sys_dept sd on ss.dept_id = sd.id where ss.is_deleted = 0 and ss.id = #{id}")
|
||||
StaffDeptVO queryInfo(@Param("id") Integer id);
|
||||
|
||||
@Select("select ss.id , ss.code, ss.name, ss.gender, ss.pwd password, ss.avatar, ss.birthday, ss.phone, ss.address, ss.remark,ss.status, ss.dept_id,sd.name dept_name from sys_staff ss left join sys_dept sd on ss.dept_id = sd.id where ss.is_deleted = 0")
|
||||
List<StaffDeptVO> queryStaffDeptVO();
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id " +
|
||||
"where ss.is_deleted = 0 and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffOvertimeVO> listStaffOvertimeVO(IPage<StaffOvertimeVO> config, @Param("name") String name);
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id " +
|
||||
"where ss.is_deleted = 0 and ss.dept_id = #{deptId} and ss.name like concat('%',#{name},'%')")
|
||||
IPage<StaffOvertimeVO> listStaffDeptOvertimeVO(IPage<StaffOvertimeVO> config, @Param("name") String name,@Param("deptId") Integer deptId);
|
||||
|
||||
@Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id where ss.is_deleted = 0")
|
||||
List<OvertimeMonthVO> queryOvertimeMonthVO();
|
||||
|
||||
@Select("select ss.* from sys_staff ss inner join per_staff_role psr on ss.id = psr.staff_id inner join per_role pr on psr.role_id = pr.id where ss.is_deleted = 0 and pr.code = #{code}")
|
||||
List<Staff> queryByRole(@Param("code") String code);
|
||||
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.qiujie.entity.Attendance;
|
||||
import com.qiujie.entity.StaffOvertime;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 员工加班表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
public interface StaffOvertimeMapper extends BaseMapper<StaffOvertime> {
|
||||
|
||||
@Select("select * from att_staff_overtime where is_deleted = 0 and staff_id = #{id} and date_format(overtime_date,'%Y%m%d') = #{day}")
|
||||
StaffOvertime queryByStaffIdAndDate(@Param("id") Integer id, @Param("day") String day);
|
||||
|
||||
|
||||
/**
|
||||
* 统计员工加班次数、获得的调休天数
|
||||
*
|
||||
* @param id 员工id
|
||||
* @param status 状态
|
||||
* @param month 月份
|
||||
*/
|
||||
@Select("select count(*) from att_staff_overtime where is_deleted = 0 and staff_id = #{id} and status = #{status} and date_format(overtime_date,'%Y%m') = #{month} ")
|
||||
Integer countTimes(@Param("id") Integer id, @Param("status") Integer status, @Param("month") String month);
|
||||
|
||||
|
||||
/**
|
||||
* 合计员工当前月的加班工资
|
||||
*/
|
||||
@Select("select sum(overtime_salary) from att_staff_overtime WHERE is_deleted = 0 and staff_id = #{id} and date_format(overtime_date,'%Y%m') = #{month}")
|
||||
BigDecimal sumMonthOvertimeSalary(@Param("id") Integer id, @Param("month") String month);
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.qiujie.mapper;
|
||||
|
||||
import com.qiujie.entity.StaffRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-02-28
|
||||
*/
|
||||
|
||||
|
||||
public interface StaffRoleMapper extends BaseMapper<StaffRole> {
|
||||
|
||||
}
|
||||
@ -1,134 +0,0 @@
|
||||
package com.qiujie.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qiujie.dto.Response;
|
||||
import com.qiujie.dto.ResponseDTO;
|
||||
import com.qiujie.entity.City;
|
||||
import com.qiujie.mapper.CityMapper;
|
||||
import com.qiujie.util.HutoolExcelUtil;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author qiujie
|
||||
* @since 2022-03-23
|
||||
*/
|
||||
@Service
|
||||
public class CityService extends ServiceImpl<CityMapper, City> {
|
||||
|
||||
|
||||
public ResponseDTO add(City city) {
|
||||
if (save(city)) {
|
||||
return Response.success();
|
||||
}
|
||||
return Response.error();
|
||||
}
|
||||
|
||||
public ResponseDTO delete(Integer id) {
|
||||
if (removeById(id)) {
|
||||
return Response.success();
|
||||
}
|
||||
return Response.error();
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseDTO deleteBatch(List<Integer> ids) {
|
||||
if (removeBatchByIds(ids)) {
|
||||
return Response.success();
|
||||
}
|
||||
return Response.error();
|
||||
}
|
||||
|
||||
|
||||
public ResponseDTO edit(City city) {
|
||||
if (updateById(city)) {
|
||||
return Response.success();
|
||||
}
|
||||
return Response.error();
|
||||
}
|
||||
|
||||
|
||||
public ResponseDTO query(Integer id) {
|
||||
City city = getById(id);
|
||||
if (city != null) {
|
||||
return Response.success(city);
|
||||
}
|
||||
return Response.error();
|
||||
}
|
||||
|
||||
public ResponseDTO queryAll() {
|
||||
List<City> list = list();
|
||||
return Response.success(list);
|
||||
}
|
||||
|
||||
|
||||
public ResponseDTO list(Integer current, Integer size, String name) {
|
||||
IPage<City> config = new Page<>(current, size);
|
||||
QueryWrapper<City> wrapper = null;
|
||||
if (name != "" && name != null) {
|
||||
wrapper = new QueryWrapper<>();
|
||||
wrapper.like("name", name);
|
||||
}
|
||||
IPage<City> page = page(config, wrapper);
|
||||
// 将响应数据填充到map中
|
||||
Map map = new HashMap();
|
||||
map.put("pages", page.getPages());
|
||||
map.put("total", page.getTotal());
|
||||
map.put("list", page.getRecords());
|
||||
return Response.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据导出
|
||||
*
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
public void export(HttpServletResponse response,String filename) throws IOException {
|
||||
List<City> list = list();
|
||||
HutoolExcelUtil.writeExcel(response, list,filename , City.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据导入
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseDTO imp(MultipartFile file) throws IOException {
|
||||
InputStream inputStream = file.getInputStream();
|
||||
List<City> list = HutoolExcelUtil.readExcel(inputStream, 1, City.class);
|
||||
// IService接口中的方法.批量插入数据
|
||||
if (saveBatch(list)) {
|
||||
return Response.success();
|
||||
}
|
||||
return Response.error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||