2 #1

Closed
pxf8gw7s3 wants to merge 0 commits from main into master

57
.gitignore vendored

@ -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,271 +1,2 @@
### 日志
# human-resource-management-system
#### v1.0-221229
1. 解决了第一次点击导航栏,页面出现空白的问题
2. 取消使用自定义的封装组件CommonForm、CommonTable
3. 优化了一些对话框布局
4. 增加修改头像功能,员工未设置头像时,显示默认头像
5. 删除了att_leave_type、sal_deduct_type、att_work_time、att_overtime_type等数据库表具体原因见项目文档的总结部分
6. token过期直接退出登录
7. 实现了当访问不存在的路由时出现404页面的功能
#### v1.1-240323
1. 解决了一些关于路由warning的问题 2023/2/3
2. 优化了界面,增强了搜索功能 2023/2/15
3. 解决了添加子部门时,出现异常的问题 2023/2/17
4. 解决了不能修改密码的问题 2023/3/10
5. 解决了不能添加参保城市的问题 2023/4/6
#### v1.2-240402
1. 完成了项目的加班模块 2024/3/23
2. 解决了当数据表格的列fixed时行未对齐的问题 2024/3/26
#### v2.0-240428
1. 整合了spring security实现了基于jwt的认证以及授权 2024/4/3
2. 解决了文件上传、下载,数据导入、导出的跨域问题 2024/4/5
3. 实现了自定义的认证、授权失败处理器,认证失败直接退出登录 2024/4/7
4. 结合自定义指令,实现了功能点的权限控制 2024/4/11
5. 修复了一些小bug完善了权限控制 2024/4/13
6. 整合了redis实现了验证码登录功能 2024/4/18
#### master
1. 整合了activiti实现了基于工作流的请假审批 2024/5/1
2. 指明技术栈版本 2025/8/17
### 项目介绍
#### 项目概述
本项目是一款基于Spring
Boot+Vue+ElementUI的人力资源管理系统有权限管理、财务管理、系统管理、考勤管理等功能模块。
#### 技术栈
1. 前端
| 技术 | 版本 |
|:----------:|:-------:|
| Vue | 2.6.14 |
| Axios | 0.25.0 |
| ElementUI | 2.15.7 |
| Vue-Router | 3.5.3 |
| Vuex | 3.6.2 |
| ECharts | 5.3.0 |
| node | 22.14.0 |
| npm | 11.3.0 |
2. 后端
| 技术 | 版本 |
|:---------------:|:--------:|
| Spring Boot | 2.5.6 |
| jdk | 17.0.12 |
| Jwt | 0.11.5 |
| MyBatis-Plus | 3.5.1 |
| Hutool | 5.8.25 |
| Spring Security | 5.5.3 |
| Activiti | 7.0.0.GA |
| Swagger | 2.9.2 |
| MySQL | 8.1.0 |
| Redis | 5.0.14.1 |
### 系统设计
#### 功能模块
![功能模块.png](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711450961011.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
本系统主要分四个模块,分别是权限管理、财务管理、系统管理、考勤管理。
### 系统展示
#### 首页
![首页](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451220221.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
首页主要展示了员工以及系统的一些基本信息。
#### 请假
![请假](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451261849.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
在请假面板中,员工可以进行请假。在右侧的请假记录中可以查看以往的请假申请,或对当前未被审核的申请进行撤销。
![审批](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240428-1714314768552.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
对员工的请假进行审批,比如通过或驳回。员工申请请假之后,等待相关人员进行审批。如果审批通过,则将员工休假时间段的考勤状态设置为休假(但当请假类型是调休时,考勤状态要设为调休)。
#### 五险一金
![五险一金](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451370245.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
![明细](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451410947.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
实现了对员工的五险一金进行管理,以及员工五险一金报表的导出。
#### 薪资管理
![薪资管理](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451455146.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
![明细](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451550417.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
实现了对员工的薪资进行管理,以及员工月薪资报表的导出。
#### 考勤表现
![考勤状态](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451623975.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
实现了考勤数据的导入,以及月考勤报表的导出,员工考勤状态的查看与修改。
![考勤数据导入模板](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451829770.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
通过导入员工的考勤记录表,系统就会将员工的上下班时间与员工所在部门规定的上班时间进行比对,判断员工是否迟到、早退、旷工。
(这是数据导入的模板,需要按照此格式填写数据。系统只会读取上下班时间的时间部分,并以考勤日期作为打卡日期)
另外,介绍一下考勤规则:
* 若考勤日期对应的是周末,则不判读员工考勤状态,默认为休假。
* 若考勤日期对应的是员工请假的日期,则员工考勤状态设为休假。
* 若考勤日期对应的是员工调休的日期,则员工考勤状态设为调休。
* 若员工的四个打卡时间,只要有一个为空,则员工考勤状态设为旷工。
* 若员工既迟到又早退,则员工考勤状态设为旷工。
* 若员工迟到,则员工考勤状态设为迟到。
* 若员工早退,则员工考勤状态设为早退。
* 若不是以上任何情况,则员工考勤状态设为正常。
#### 加班详情
![加班详情](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451716398.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
实现了加班数据的导入,以及月加班报表的导出,员工加班状态的查看与加班信息的修改。
![加班数据导入模板](https://image-qiu.oss-cn-hangzhou.aliyuncs.com/project/hrm/README-20240326-1711451890484.png?x-oss-process=image/auto-orient,1/interlace,1/quality,q_50/format,jpg)
通过导入员工的加班记录表(导入数据时,数据项有缺失的加班记录会被直接丢弃),系统会首先计算员工当天的加班总时长,然后再根据员工所在部门的加班规则等信息,对员工的加班状态进行判断。
加班类型:
* 节假日加班:根据国家的节假日安排来判断当天是否是节假日。
* 休息日加班将周末视为休息日如果是休息日加班部门可以选择不调休或者调休当选择调休时只有当员工当天的总加班时长不少于8个小时时才可以获得一天的调休否则没有调休。
* 工作日加班:工作日就是周一到周五。
加班费计算方式:
* 以小时为单位员工当天的总加班时长不能少于2小时否则没有加班费加班费 = 时薪 x 时长 x 倍数 + 奖金
* 以日为单位员工当天的总加班时长不能少于8个小时否则没有加班费加班费 = 日薪 x 倍数 + 奖金
加班状态:
* 若当天是休息日加班部门选择了调休并且员工当天的加班总时长不少于8个小时则员工获得一天的调休当天的加班状态设置为调休。
* 其他情况下若员工当天的加班时长大于0当天的加班状态设置为加班。
* 若不是以上任何情况,则员工加班状态设置为正常。
### 项目搭建
#### 项目配置
1. 前端
在`.env`文件中
```xml
# 修改端口号此端口号与在application.yml中配置的端口号相同
VUE_APP_PORT = 8888
```
2. 后端
在`application.yml`中进行相关的配置
```xml
# 这是后端项目的运行端口,可自行修改
server:
port: 8888
# 配置多数据源hrm是主数据库保存系统业务信息hrm_activiti是从数据库保存工作流信息
datasource:
master:
jdbc-url: jdbc:mysql://127.0.0.1:3306/hrm?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2b8
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
activiti:
jdbc-url: jdbc:mysql://127.0.0.1:3306/hrm_activiti?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2b8
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
# redis配置
redis:
host: localhost
port: 6379
password: 123456
database: 0
lettuce:
pool:
max-idle: 16
max-active: 32
min-idle: 8
# 因为此项目涉及到了文件上传与下载,此路径用来存储上传的文件。
file-path: E:/project/idea/hrm/file/ # 修改为自己的路径
# 因为每年的法定节假日是不确定的这里我只列举了2024年的节假日其他年份的可根据个人需要添加即可
holidays:
- 2024-01-01
- 2024-02-10
- 2024-02-11
- 2024-02-12
- 2024-02-13
- 2024-02-14
- 2024-02-15
- 2024-02-16
- 2024-02-17
- 2024-04-04
- 2024-04-05
- 2024-04-06
- 2024-05-01
- 2024-05-02
- 2024-05-03
- 2024-05-04
- 2024-05-05
- 2024-06-08
- 2024-06-09
- 2024-06-10
- 2024-09-15
- 2024-09-16
- 2024-09-17
- 2024-10-01
- 2024-10-02
- 2024-10-03
- 2024-10-04
- 2024-10-05
- 2024-10-06
- 2024-10-07
```
#### 项目启动
1. 新建数据库执行数据库文件启动mysql
2. 配置redis启动redis
3. 在/hrm/vue-elementui-hrm目录下
```bash
# 下载依赖
npm install
# 启动
npm run serve
```
4. 启动后端项目
5. 项目启动成功之后,访问<http://localhost:8080/login>
账号admin
密码123 (其他账号的密码也为123)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 786 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 KiB

1266
hrm.sql

File diff suppressed because it is too large Load Diff

@ -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,31 +0,0 @@
package com.qiujie.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @Author qiujie
* @Date 2022/3/29
* @Version 1.0
*/
/**
*
* RUNTIME
*/
@Retention(RetentionPolicy.RUNTIME)
// 定义注解作用的元素类型
@Target(ElementType.FIELD)
public @interface ExcelColumn {
/**
*
*
* @return
*/
String value() default "";
}

@ -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,60 +0,0 @@
package com.qiujie.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* Api
*
* @Author : qiujie
* @Date : 2022/1/30
*/
@Configuration // 标明配置类
@EnableSwagger2 // 开启Swagger功能
public class SwaggerConfig {
@Bean
public Docket createRestApi(Environment environment) {
// 设置要显示的swagger环境
// Profiles profiles = Profiles.of("dev");
// 判断是否处在自己设定的环境当中
// boolean flag = environment.acceptsProfiles(profiles);
return new Docket(DocumentationType.SWAGGER_2) // DocumentationType.SWAGGER_2 固定的代表swagger2
// .groupName("分布式任务系统") // 如果配置多个文档的时候那么需要配置groupName来分组标识
.apiInfo(apiInfo()) // 用于生成API信息
.enable(true) // 如果为false,则不启动swagger
.select() // select()函数返回一个ApiSelectorBuilder实例,用来控制接口被swagger做成文档
.apis(RequestHandlerSelectors.basePackage("com.qiujie.controller")) // 用于指定扫描哪个包下的接口
/**
* RequestHandlerSelectors:
* any():
* none():
*/
.paths(PathSelectors.any()) // 选择所有的API,如果你想只为部分API生成文档可以配置这里
.build();
}
/**
* APIAPI
*
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("人力资源管理系统API") // 可以用来自定义API的主标题
.description("人力资源管理系统API管理") // 可以用来描述整体的API
.termsOfServiceUrl("") // 用于定义服务的域名
.version("1.0") // 可以用来定义版本。
.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,96 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.annotation.ExcelColumn;
import com.qiujie.enums.AttendanceStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.sql.Timestamp;
import java.sql.Date;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-29
*/
@Data
@Accessors(chain = true)
@TableName("att_attendance")
@ApiModel(value = "Attendance对象", description = "")
public class Attendance implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ExcelColumn("员工id")
@ApiModelProperty("员工id")
@TableField("staff_id")
private Integer staffId;
@ExcelColumn("上午上班时间")
@ApiModelProperty("上午上班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("mor_start_time")
private Timestamp morStartTime;
@ExcelColumn("上午下班时间")
@ApiModelProperty("上午下班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("mor_end_time")
private Timestamp morEndTime;
@ExcelColumn("下午上班时间")
@ApiModelProperty("下午上班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("aft_start_time")
private Timestamp aftStartTime;
@ExcelColumn("下午下班时间")
@ApiModelProperty("下午下班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("aft_end_time")
private Timestamp aftEndTime;
@ExcelColumn("考勤日期")
@ApiModelProperty("考勤日期")
@TableField("attendance_date")
private Date attendanceDate;
@ApiModelProperty("0正常1迟到2早退3旷工4休假")
@TableField("status")
private AttendanceStatusEnum status;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,124 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.annotation.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-23
*/
@Getter
@Setter
@TableName("soc_city")
@ApiModel(value = "City对象", description = "参保城市")
public class City implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ExcelColumn("城市")
@ApiModelProperty("参保城市")
@TableField("name")
private String name;
@ApiModelProperty("职工上年度平均月工资")
@TableField("average_salary")
private BigDecimal averageSalary;
@ApiModelProperty("职工上年度最低月工资")
@TableField("lower_salary")
private BigDecimal lowerSalary;
@ExcelColumn("职工社保缴纳基数上限")
@ApiModelProperty("职工社保缴纳基数上限")
@TableField("soc_upper_limit")
private BigDecimal socUpperLimit;
@ExcelColumn("职工社保缴纳基数下限")
@ApiModelProperty("职工社保缴纳基数下限")
@TableField("soc_lower_limit")
private BigDecimal socLowerLimit;
@ExcelColumn("公积金缴纳基数上限")
@ApiModelProperty("公积金缴纳基数上限")
@TableField("hou_upper_limit")
private BigDecimal houUpperLimit;
@ExcelColumn("公积金缴纳基数下限")
@ApiModelProperty("公积金缴纳基数下限")
@TableField("hou_lower_limit")
private BigDecimal houLowerLimit;
@ExcelColumn("养老保险个人缴费比例")
@ApiModelProperty("养老保险个人缴费比例")
@TableField("per_pension_rate")
private BigDecimal perPensionRate;
@ExcelColumn("养老保险企业缴费比例")
@ApiModelProperty("养老保险企业缴费比例")
@TableField("com_pension_rate")
private BigDecimal comPensionRate;
@ExcelColumn("医疗保险个人缴费比例")
@ApiModelProperty("医疗保险个人缴费比例")
@TableField("per_medical_rate")
private BigDecimal perMedicalRate;
@ExcelColumn("医疗保险企业缴费比例")
@ApiModelProperty("医疗保险企业缴费比例")
@TableField("com_medical_rate")
private BigDecimal comMedicalRate;
@ExcelColumn("失业保险个人缴费比例")
@ApiModelProperty("失业保险个人缴费比例")
@TableField("per_unemployment_rate")
private BigDecimal perUnemploymentRate;
@ExcelColumn("失业保险企业缴费比例")
@ApiModelProperty("失业保险企业缴费比例")
@TableField("com_unemployment_rate")
private BigDecimal comUnemploymentRate;
@ExcelColumn("生育保险企业缴费比例")
@ApiModelProperty("生育保险企业缴费比例")
@TableField("com_maternity_rate")
private BigDecimal comMaternityRate;
@ExcelColumn("备注")
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,101 +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.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-07
*/
@Getter
@Setter
@TableName("sys_dept")
@ApiModel(value = "Dept对象", description = "部门")
public class Dept 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;
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@ApiModelProperty("上午上班时间")
@TableField("mor_start_time")
private Timestamp morStartTime;
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@ApiModelProperty("上午下班时间")
@TableField("mor_end_time")
private Timestamp morEndTime;
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@ApiModelProperty("下午上班时间")
@TableField("aft_start_time")
private Timestamp aftStartTime;
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@ApiModelProperty("下午下班时间")
@TableField("aft_end_time")
private Timestamp aftEndTime;
@ApiModelProperty("员工的总工作时长")
@TableField("total_work_time")
private BigDecimal totalWorkTime;
@ApiModelProperty("部门备注")
@TableField("remark")
private String remark;
@ApiModelProperty("父级部门id0根部门")
@TableField("parent_id")
private Integer parentId;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
@ApiModelProperty("子部门")
@TableField(exist = false)
private List<Dept> children;
}

@ -1,76 +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 lombok.experimental.Accessors;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-02-24
*/
@Data
@Accessors(chain = true)
@TableName("sys_docs")
@ApiModel(value = "Docs对象", description = "文件管理")
public class Docs implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("文件名称")
@TableField("name")
private String name;
@ApiModelProperty("文件类型")
@TableField("type")
private String type;
@ApiModelProperty("文件原名称")
@TableField("old_name")
private String oldName;
@ApiModelProperty("文件md5信息")
@TableField("md5")
private String md5;
@ApiModelProperty("文件大小kB")
@TableField("size")
private Long size;
@ApiModelProperty("文件上传者id")
@TableField("staff_id")
private Integer staffId;
@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;
@ApiModelProperty("0未删除1已删除默认为0")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,99 +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.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-24
*/
@Getter
@Setter
@TableName("soc_insurance")
@ApiModel(value = "Insurance对象", description = "员工社保")
public class Insurance implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("城市id")
@TableField("city_id")
private Integer cityId;
@ApiModelProperty("员工id")
@TableField("staff_id")
private Integer staffId;
@ApiModelProperty("公积金基数")
@TableField("house_base")
private BigDecimal houseBase;
@ApiModelProperty("公积金个人缴纳比例")
@TableField("per_house_rate")
private BigDecimal perHouseRate;
@ApiModelProperty("公积金个人缴纳费用")
@TableField("per_house_pay")
private BigDecimal perHousePay;
@ApiModelProperty("公积金企业缴纳比例")
@TableField("com_house_rate")
private BigDecimal comHouseRate;
@ApiModelProperty("公积金企业缴纳费用")
@TableField("com_house_pay")
private BigDecimal comHousePay;
@ApiModelProperty("公积金备注")
@TableField("house_remark")
private String houseRemark;
@ApiModelProperty("社保基数")
@TableField("social_base")
private BigDecimal socialBase;
@ApiModelProperty("社保企业缴纳费用")
@TableField("com_social_pay")
private BigDecimal comSocialPay;
@ApiModelProperty("社保个人缴纳费用")
@TableField("per_social_pay")
private BigDecimal perSocialPay;
@ApiModelProperty("工伤保险企业缴纳比例")
@TableField("com_injury_rate")
private BigDecimal comInjuryRate;
@ApiModelProperty("社保备注")
@TableField("social_remark")
private String socialRemark;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,68 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.enums.LeaveEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-27
*/
@Getter
@Setter
@TableName("att_leave")
@ApiModel(value = "Leave对象", description = "请假表")
public class Leave implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("休假类型")
@TableField("type_num")
private LeaveEnum typeNum;
@ApiModelProperty("部门id")
@TableField("dept_id")
private Integer deptId;
@ApiModelProperty("休假天数")
@TableField("days")
private Integer days;
@ApiModelProperty("0禁用1正常默认1")
@TableField("status")
private Integer status;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,87 +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 java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-02-28
*/
@Data
@TableName("per_menu")
@ApiModel(value = "Menu对象", description = "")
public class Menu implements Serializable {
@Serial
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;
@TableField("icon")
private String icon;
@ApiModelProperty("权限标识")
@TableField("permission")
private String permission;
@ApiModelProperty("父菜单id0代表根菜单")
@TableField("parent_id")
private Integer parentId;
@ApiModelProperty("0一级菜单1二级菜单2权限点")
@TableField("level")
private Integer level;
@ApiModelProperty("权限点是否启用0禁用、1正常默认1")
@TableField("status")
private Integer status;
@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;
@TableField(exist = false)
private List<Menu> children;
}

@ -1,78 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.enums.OvertimeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-28
*/
@Getter
@Setter
@TableName("att_overtime")
@ApiModel(value = "Overtime对象", description = "加班表")
public class Overtime implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("工资倍数,如按照小时计算,就是员工平均小时工资乘以倍数")
@TableField("salary_multiple")
private BigDecimal salaryMultiple;
@ApiModelProperty("加班奖金")
@TableField("bonus")
private BigDecimal bonus;
@ApiModelProperty("加班类型")
@TableField("type_num")
private OvertimeEnum typeNum;
@ApiModelProperty("部门id")
@TableField("dept_id")
private Integer deptId;
@ApiModelProperty("0小时1天默认0计数加班工资的类型")
@TableField("count_type")
private Integer countType;
@TableField("remark")
private String remark;
@ApiModelProperty("0不调休1调休默认0")
@TableField("is_time_off")
private Integer timeOffFlag;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -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,105 +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.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-04-06
*/
@Getter
@Setter
@TableName("sal_salary")
@ApiModel(value = "Salary对象", description = "")
public class Salary implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("员工id")
@TableField("staff_id")
private Integer staffId;
@ApiModelProperty("基础工资")
@TableField("base_salary")
private BigDecimal baseSalary;
@ApiModelProperty("平均日薪")
@TableField("day_salary")
private BigDecimal daySalary;
@ApiModelProperty("平均时薪资")
@TableField("hour_salary")
private BigDecimal hourSalary;
@ApiModelProperty("加班费")
@TableField("overtime_salary")
private BigDecimal overtimeSalary;
@ApiModelProperty("生活补贴")
@TableField("subsidy")
private BigDecimal subsidy;
@ApiModelProperty("奖金")
@TableField("bonus")
private BigDecimal bonus;
@ApiModelProperty("月份")
@TableField("month")
private String month;
@ApiModelProperty("早退扣款")
@TableField("late_deduct")
private BigDecimal lateDeduct;
@ApiModelProperty("休假扣款")
@TableField("leave_deduct")
private BigDecimal leaveDeduct;
@ApiModelProperty("早退扣款")
@TableField("leave_early_deduct")
private BigDecimal leaveEarlyDeduct;
@ApiModelProperty("旷工扣款")
@TableField("absenteeism_deduct")
private BigDecimal absenteeismDeduct;
@ApiModelProperty("总工资")
@TableField("total_salary")
private BigDecimal totalSalary;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,65 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.enums.DeductEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-27
*/
@Getter
@Setter
@TableName("sal_salary_deduct")
@ApiModel(value = "SalaryDeduct对象", description = "工资扣除表")
public class SalaryDeduct implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("部门id")
@TableField("dept_id")
private Integer deptId;
@ApiModelProperty("扣款类型0迟到1早退2旷工3休假")
@TableField("type_num")
private DeductEnum typeNum;
@ApiModelProperty("每次扣款金额")
@TableField("deduct")
private Integer deduct;
@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;
@ApiModelProperty("0未删除1已删除默认为0")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,103 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.annotation.ExcelColumn;
import com.qiujie.enums.GenderEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-01-27
*/
@Data
@Accessors(chain = true)
@TableName("sys_staff")
@ApiModel(value = "Staff对象", description = "")
public class Staff implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("员工id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ExcelColumn("工号")
@ApiModelProperty("员工编码")
@TableField("code")
private String code;
@ExcelColumn("姓名")
@ApiModelProperty("员工姓名")
@TableField("name")
private String name;
@ApiModelProperty("性别0男1女默认男")
@TableField("gender")
private GenderEnum gender;
@ExcelColumn("地址")
@ApiModelProperty("员工家庭住址")
@TableField("address")
private String address;
@ApiModelProperty("员工密码")
@TableField("pwd")
private String password;
@ApiModelProperty("员工头像")
@TableField("avatar")
private String avatar;
@ExcelColumn("生日")
@ApiModelProperty("员工生日")
@TableField("birthday")
private Date birthday;
@ExcelColumn("电话")
@ApiModelProperty("员工电话")
@TableField("phone")
private String phone;
@ExcelColumn("备注")
@ApiModelProperty("员工备注")
@TableField("remark")
private String remark;
@ExcelColumn("部门id")
@ApiModelProperty("部门id")
@TableField("dept_id")
private Integer deptId;
@ApiModelProperty("员工状态0离职1在职2禁用")
@TableField("status")
private Integer status;
@ExcelColumn("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty("创建时间")
@TableField("create_time")
private Timestamp createTime;
@ExcelColumn("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty("更新时间")
@TableField("update_time")
private Timestamp updateTime;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -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,77 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.enums.AuditStatusEnum;
import com.qiujie.enums.LeaveEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-04-05
*/
@Getter
@Setter
@TableName("att_staff_leave")
@ApiModel(value = "StaffLeave对象", description = "")
public class StaffLeave implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("员工id")
@TableField("staff_id")
private Integer staffId;
@ApiModelProperty("请假的天数")
@TableField("days")
private Integer days;
@TableField("type_num")
private LeaveEnum typeNum;
@ApiModelProperty("请假的起始日期")
@TableField("start_date")
private Date startDate;
@ApiModelProperty("0待审核1审核通过2驳回3撤销4审核中")
@TableField("status")
private AuditStatusEnum status;
@ApiModelProperty("审批意见")
@TableField("audit_remark")
private String auditRemark;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@TableField("is_deleted")
@TableLogic
private Integer deleteFlag;
}

@ -1,113 +0,0 @@
package com.qiujie.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qiujie.annotation.ExcelColumn;
import com.qiujie.enums.OvertimeEnum;
import com.qiujie.enums.OvertimeStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.sql.Date;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2024-03-20
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("att_staff_overtime")
@ApiModel(value = "StaffOvertime对象", description = "员工加班表")
public class StaffOvertime implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ExcelColumn("员工id")
@ApiModelProperty("员工id")
@TableField("staff_id")
private Integer staffId;
@ExcelColumn("上午上班时间")
@ApiModelProperty("上午上班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("mor_start_time")
private Timestamp morStartTime;
@ExcelColumn("上午下班时间")
@ApiModelProperty("上午下班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("mor_end_time")
private Timestamp morEndTime;
@ExcelColumn("下午上班时间")
@ApiModelProperty("下午上班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("aft_start_time")
private Timestamp aftStartTime;
@ExcelColumn("下午下班时间")
@ApiModelProperty("下午下班时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
@TableField("aft_end_time")
private Timestamp aftEndTime;
@ExcelColumn("加班日期")
@ApiModelProperty("加班日期")
@TableField("overtime_date")
private Date overtimeDate;
@ApiModelProperty("加班时长")
@TableField("total_overtime")
private BigDecimal totalOvertime;
@ApiModelProperty("加班工资")
@TableField("overtime_salary")
private BigDecimal overtimeSalary;
@ApiModelProperty("加班类型")
@TableField("type_num")
private OvertimeEnum typeNum;
@ApiModelProperty("0正常1加班2调休")
@TableField("status")
private OvertimeStatusEnum status;
@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;
@ApiModelProperty("逻辑删除0未删除1删除")
@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_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,323 +0,0 @@
package com.qiujie.service;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Date;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.qiujie.util.EnumUtil;
import org.springframework.beans.factory.annotation.Autowired;
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.Attendance;
import com.qiujie.entity.Dept;
import com.qiujie.enums.AttendanceStatusEnum;
import com.qiujie.enums.BusinessStatusEnum;
import com.qiujie.exception.ServiceException;
import com.qiujie.mapper.AttendanceMapper;
import com.qiujie.mapper.DeptMapper;
import com.qiujie.mapper.StaffMapper;
import com.qiujie.util.DatetimeUtil;
import com.qiujie.util.HutoolExcelUtil;
import com.qiujie.vo.AttendanceMonthVO;
import com.qiujie.vo.StaffAttendanceVO;
import cn.hutool.core.date.DateUtil;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-29
*/
@Service
public class AttendanceService extends ServiceImpl<AttendanceMapper, Attendance> {
@Autowired
private AttendanceMapper attendanceMapper;
@Autowired
private DeptMapper deptMapper;
@Autowired
private StaffMapper staffMapper;
@Autowired
private DatetimeUtil datetimeUtil;
public ResponseDTO add(Attendance attendance) {
if (save(attendance)) {
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(Attendance attendance) {
if (updateById(attendance)) {
return Response.success();
}
return Response.error();
}
public ResponseDTO query(Integer id) {
Attendance attendance = getById(id);
if (attendance != null) {
return Response.success(attendance);
}
return Response.error();
}
public ResponseDTO list(Integer current, Integer size, String name, Integer deptId, String month) {
IPage<StaffAttendanceVO> config = new Page<>(current, size);
// 解决当搜索条件为空时,默认查询所有数据
if (name == null) {
name = "";
}
IPage<StaffAttendanceVO> page;
if (deptId == null) {
page = this.staffMapper.listStaffAttendanceVO(config, name);
} else {
page = this.staffMapper.listStaffDeptAttendanceVO(config, name, deptId);
}
// 每页展示的数据
List<StaffAttendanceVO> staffDeptVOList = page.getRecords();
// 如果没有指明月份,就默认显示当前月份的考勤数据
if (month == null) {
month = DateUtil.format(new java.util.Date(), "yyyyMM");
}
String[] monthDayList = this.datetimeUtil.getMonthDayList(month);
for (StaffAttendanceVO staffDeptVO : staffDeptVOList) {
// 获取当前月的日期格式为yyyyMMdd
List<HashMap<String, Object>> list = new ArrayList<>();
for (String day : monthDayList) {
HashMap<String, Object> map = new HashMap<>();
Attendance attendance = this.attendanceMapper.queryByStaffIdAndDate(staffDeptVO.getStaffId(), day);
// 如果考勤数据不存在,就重新设置数据
if (attendance == null) {
Date date = DateUtil.parse(day, "yyyyMMdd").toSqlDate();
// 如果是周末或法定假期就休假
if (DateUtil.isWeekend(date) || this.datetimeUtil.isHoliday(date)) {
map.put("message", AttendanceStatusEnum.LEAVE.getMessage());
map.put("tagType", AttendanceStatusEnum.LEAVE.getTagType());
} else {
map.put("message", AttendanceStatusEnum.NORMAL.getMessage());
map.put("tagType", AttendanceStatusEnum.NORMAL.getTagType());
}
map.put("attendanceDate", date);
} else {
map.put("message", attendance.getStatus().getMessage());
map.put("tagType", attendance.getStatus().getTagType());
map.put("attendanceDate", attendance.getAttendanceDate());
}
list.add(map);
}
staffDeptVO.setAttendanceList(list);
}
// 将响应数据填充到map中
Map map = new HashMap();
map.put("pages", page.getPages());
map.put("total", page.getTotal());
map.put("list", staffDeptVOList);
map.put("dayNum", monthDayList.length);
map.put("month", month);
return Response.success(map);
}
/**
*
*
* @param response
* @param month
* @param filename
* @return
*/
public void export(HttpServletResponse response, String month, String filename) throws IOException {
List<AttendanceMonthVO> list = this.staffMapper.queryAttendanceMonthVO();
for (AttendanceMonthVO attendanceMonthVO : list) {
// 设置迟到次数
attendanceMonthVO.setLateTimes(this.attendanceMapper.countTimes(attendanceMonthVO.getStaffId(),
AttendanceStatusEnum.LATE.getCode(), month));
// 设置早退次数
attendanceMonthVO.setLeaveEarlyTimes(this.attendanceMapper.countTimes(attendanceMonthVO.getStaffId(),
AttendanceStatusEnum.LEAVE_EARLY.getCode(), month));
// 设置旷工次数
attendanceMonthVO.setAbsenteeismTimes(this.attendanceMapper.countTimes(attendanceMonthVO.getStaffId(),
AttendanceStatusEnum.ABSENTEEISM.getCode(), month));
// 设置调休的天数
attendanceMonthVO.setTimeOffDays(this.attendanceMapper.countTimes(attendanceMonthVO.getStaffId(),
AttendanceStatusEnum.TIME_OFF.getCode(), month));
// 设置休假天数
List<Date> leaveDateList = this.attendanceMapper.queryLeaveDate(attendanceMonthVO.getStaffId(),
AttendanceStatusEnum.LEAVE.getCode(), month);
int count = 0;
for (Date date : leaveDateList) {
// 不包括周末
if (!DateUtil.isWeekend(date)) {
count++;
}
}
attendanceMonthVO.setLeaveDays(count);
}
HutoolExcelUtil.writeExcel(response, list, filename, AttendanceMonthVO.class);
}
/**
*
*
* @param file
* @return
*/
@Transactional(rollbackFor = Exception.class)
public ResponseDTO imp(MultipartFile file) throws IOException {
InputStream inputStream = file.getInputStream();
List<Attendance> list = HutoolExcelUtil.readExcel(inputStream, 1, Attendance.class);
for (Attendance attendance : list) {
// 判断是否是周末,如果是周末就不用记录考勤情况,如果不是周末就判断员工是否请假
if (attendance.getStaffId() == null || attendance.getAttendanceDate() == null ||
DateUtil.isWeekend(attendance.getAttendanceDate()) || isLeave(attendance)) {
continue;
}
Dept dept = this.deptMapper.queryByStaffId(attendance.getStaffId());
if (isAbsenteeism(attendance, dept)) {
attendance.setStatus(AttendanceStatusEnum.ABSENTEEISM);
} else if (isLate(attendance, dept)) {
attendance.setStatus(AttendanceStatusEnum.LATE);
} else if (isLeaveEarly(attendance, dept)) {
attendance.setStatus(AttendanceStatusEnum.LEAVE_EARLY);
} else {
attendance.setStatus(AttendanceStatusEnum.NORMAL);
}
QueryWrapper<Attendance> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("staff_id", attendance.getStaffId()).eq("attendance_date",
attendance.getAttendanceDate());
if (!saveOrUpdate(attendance, queryWrapper)) {
return Response.error(BusinessStatusEnum.DATA_IMPORT_ERROR);
}
}
return Response.success();
}
public ResponseDTO setAttendance(Attendance attendance) {
QueryWrapper<Attendance> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("staff_id", attendance.getStaffId()).eq("attendance_date", attendance.getAttendanceDate());
if (saveOrUpdate(attendance)) {
return Response.success();
}
return Response.error();
}
/**
*
*
* @param attendance
* @param dept
* @return
*/
private boolean isLate(Attendance attendance, Dept dept) {
if (DateUtil.compare(attendance.getMorStartTime(), dept.getMorStartTime(), "HH:mm:ss") > 0) {
return true;
} else if (DateUtil.compare(attendance.getAftStartTime(), dept.getAftStartTime(), "HH:mm:ss") > 0) {
return true;
}
return false;
}
/**
* 退
*
* @param attendance
* @param dept
* @return
*/
private boolean isLeaveEarly(Attendance attendance, Dept dept) {
if (DateUtil.compare(attendance.getMorEndTime(), dept.getMorEndTime(), "HH:mm:ss") < 0) {
return true;
} else if (DateUtil.compare(attendance.getAftEndTime(), dept.getAftEndTime(), "HH:mm:ss") < 0) {
return true;
}
return false;
}
/**
* 4退使
*
* @param attendance
* @param dept
* @return
*/
private boolean isAbsenteeism(Attendance attendance, Dept dept) {
if (attendance.getMorStartTime() == null || attendance.getMorEndTime() == null
|| attendance.getAftStartTime() == null || attendance.getAftEndTime() == null) {
return true;
}
return isLate(attendance, dept) && isLeaveEarly(attendance, dept);
}
/**
*
*
* @param attendance
* @return
*/
private boolean isLeave(Attendance attendance) {
QueryWrapper<Attendance> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("staff_id", attendance.getStaffId()).eq("attendance_date", attendance.getAttendanceDate());
Attendance one = getOne(queryWrapper);
if (one != null) {
return one.getStatus() == AttendanceStatusEnum.LEAVE || one.getStatus() == AttendanceStatusEnum.TIME_OFF;
}
return false;
}
public ResponseDTO queryAll() {
List<Map<String, Object>> enumList = EnumUtil.getEnumList(AttendanceStatusEnum.class);
for (Map<String, Object> map : enumList) {
for (AttendanceStatusEnum attendanceStatusEnum : AttendanceStatusEnum.values()) {
if (map.get("code") == attendanceStatusEnum.getCode()) {
map.put("tagType", attendanceStatusEnum.getTagType());
}
}
}
return Response.success(enumList);
}
public ResponseDTO queryByStaffIdAndDate(Integer id, String date) {
Attendance attendance = this.attendanceMapper.queryByStaffIdAndDate(id, date.replace("-", ""));
if (attendance != null) {
return Response.success(attendance);
}
return Response.error();
}
}

@ -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();
}
}

@ -1,181 +0,0 @@
package com.qiujie.service;
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.Dept;
import com.qiujie.mapper.DeptMapper;
import com.qiujie.util.HutoolExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.math.BigDecimal;
import com.qiujie.enums.BusinessStatusEnum;
import com.qiujie.exception.ServiceException;
/**
* <p>
*
* </p>
*
* @author qiujie
* @since 2022-03-07
*/
@Service
public class DeptService extends ServiceImpl<DeptMapper, Dept> {
@Autowired
private DeptMapper deptMapper;
public ResponseDTO add(Dept dept) {
// 父级部门不需要计算上班时间
if(dept.getParentId() != 0){
dept.setTotalWorkTime(calculateTotalWorkTime(dept));
}
if (save(dept)) {
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(Dept dept) {
// 子部门才计算上班事件
if(dept.getParentId() != 0) {
dept.setTotalWorkTime(calculateTotalWorkTime(dept));
}
QueryWrapper<Dept> queryWrapper = new QueryWrapper();
queryWrapper.eq("id", dept.getId());
if (saveOrUpdate(dept, queryWrapper)) {
return Response.success();
}
return Response.error();
}
/**
*
*
* @return
*/
public ResponseDTO queryAll() {
List<Dept> list = list();
// 为父级部门设置子部门
return Response.success(setSubDept(list));
}
public ResponseDTO query(Integer id) {
Dept dept = getById(id);
if (dept != null) {
return Response.success(dept);
}
return Response.error();
}
public ResponseDTO list(Integer current, Integer size, String name) {
IPage<Dept> config = new Page<>(current, size);
if (name == null) {
name = "";
}
IPage<Dept> page = this.deptMapper.listParentDept(config, name);
// 查询所有菜单
List<Dept> list = this.deptMapper.queryAllSub();
// 父级部门
List<Dept> parentList = page.getRecords();
for (Dept parentDept : parentList) {
// 设置子部门
List<Dept> subList = list.stream().filter(dept -> dept.getParentId() == parentDept.getId())
.collect(Collectors.toList());
parentDept.setChildren(subList);
}
// 将响应数据填充到map中
Map map = new HashMap();
map.put("pages", page.getPages());
map.put("total", page.getTotal());
map.put("list", parentList);
return Response.success(map);
}
/**
*
*
* @param response
* @return
*/
public void export(HttpServletResponse response,String filename) throws Exception {
List<Dept> list = this.deptMapper.queryAllSub();
HutoolExcelUtil.writeExcel(response, list, filename, Dept.class);
}
/**
*
*
* @param file
* @return
*/
@Transactional(rollbackFor = Exception.class)
public ResponseDTO imp(MultipartFile file) throws IOException {
InputStream inputStream = file.getInputStream();
List<Dept> list = HutoolExcelUtil.readExcel(inputStream, 1, Dept.class);
// IService接口中的方法.批量插入数据
if (saveBatch(list)) {
return Response.success();
}
return Response.error();
}
/**
* 使
*
* @param list
* @return
*/
public List<Dept> setSubDept(List<Dept> list) {
// 父级菜单
List<Dept> parentList = list.stream().parallel()
.filter(dept -> dept.getParentId() == 0).collect(Collectors.toList());
for (Dept parentDept : parentList) {
// 子菜单
List<Dept> subList = list.stream().parallel()
.filter(dept -> dept.getParentId() == parentDept.getId()).collect(Collectors.toList());
parentDept.setChildren(subList);
}
return parentList;
}
// 计算员工每天的上班时间
public BigDecimal calculateTotalWorkTime(Dept dept) {
long morDiff = dept.getMorEndTime().getTime() - dept.getMorStartTime().getTime();
long aftDiff = dept.getAftEndTime().getTime() - dept.getAftStartTime().getTime();
BigDecimal totalWorkTime = BigDecimal.valueOf((morDiff + aftDiff) / (1000 * 60 * 60.0)); // 此处除数一定要是浮点数类型
return totalWorkTime;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save