Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for working hour statistics, which are used for improving the accuracy of working hour statistics, improving the statistics efficiency and reducing the labor cost.
The invention provides a working hour statistical method, which comprises the following steps:
acquiring the starting time and the ending time of a time period to be counted, which are input by a user;
obtaining pre-stored user information, wherein the user information comprises working day working time, working time of each day and a rest date;
and acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and the user information.
Further, the acquiring the pre-stored user information includes:
receiving an interaction credential input by a user;
and acquiring user information corresponding to the interaction credential from a storage unit according to the interaction credential.
Further, the acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and the user information includes:
judging whether the starting time and the ending time are on the same date or not;
if yes, acquiring the working hours of the time period to be counted according to the starting time, the ending time, the working time and the working-out time;
if not, acquiring the actual working days in the time period to be counted according to the starting time, the ending time and the rest date; acquiring the working hours of the starting time on the day and the working hours of the ending time on the day according to the starting time, the ending time, the working time and the working time;
and acquiring the working hours of the time period to be counted according to the actual working days, the working hours of each day, the working hours of the starting time on the same day and the working hours of the ending time on the same day.
Further, the rest date comprises a date of weekday and a date of weekday;
the obtaining of the actual working days in the time period to be counted according to the starting time, the ending time and the rest date comprises:
and counting the days of the working day, the days of the rest day and the days of the rest day between the starting time and the ending time so as to obtain the actual working days in the time period to be counted.
Further, the method further comprises:
receiving estimated starting time and estimated task processing time input by a user;
and acquiring the estimated completion time according to the estimated starting time, the estimated task processing time and the user information.
Further, the obtaining the estimated completion time according to the estimated start time, the estimated task processing time, and the user information includes:
acquiring integral days and remaining hours according to the estimated task processing time and the daily working time;
acquiring an estimated completion date according to the date corresponding to the estimated starting time, the rest date and the integer number of days;
acquiring an estimated completion time point according to a time point corresponding to the estimated starting time and the remaining hours;
and acquiring the estimated completion time according to the estimated completion date and the estimated completion time point.
A second aspect of the present invention provides a man-hour counting apparatus, including:
the input module is used for acquiring the starting time and the ending time of the time period to be counted input by the user;
the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for acquiring prestored user information, and the user information comprises working day on-duty time, working day off-duty time, working time per day and rest date;
and the processing module is used for acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and the user information.
Further, the obtaining module is configured to:
receiving an interaction credential input by a user;
and acquiring user information corresponding to the interaction credential from a storage unit according to the interaction credential.
Further, the processing module is configured to:
judging whether the starting time and the ending time are on the same date or not;
if yes, acquiring the working hours of the time period to be counted according to the starting time, the ending time, the working time and the working-out time;
if not, acquiring the actual working days in the time period to be counted according to the starting time, the ending time and the rest date; acquiring the working hours of the starting time on the day and the working hours of the ending time on the day according to the starting time, the ending time, the working time and the working time;
and acquiring the working hours of the time period to be counted according to the actual working days, the working hours of each day, the working hours of the starting time on the same day and the working hours of the ending time on the same day.
Further, the rest date comprises a date of weekday and a date of weekday;
the processing module is used for:
and counting the days of the working day, the days of the rest day and the days of the rest day between the starting time and the ending time so as to obtain the actual working days in the time period to be counted.
Further, the input module is further configured to receive an estimated start time and an estimated task processing time input by a user;
the processing module is further used for acquiring the estimated completion time according to the estimated starting time, the estimated task processing time and the user information.
Further, the processing module is configured to:
acquiring integral days and remaining hours according to the estimated task processing time and the daily working time;
acquiring an estimated completion date according to the date corresponding to the estimated starting time, the rest date and the integer number of days;
acquiring an estimated completion time point according to a time point corresponding to the estimated starting time and the remaining hours;
and acquiring the estimated completion time according to the estimated completion date and the estimated completion time point.
A third aspect of the present invention is to provide a man-hour counting apparatus, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
A fourth aspect of the present invention is to provide a computer-readable storage medium having stored thereon a computer program;
which when executed by a processor implements the method according to the first aspect.
The working hour counting method, the working hour counting device, the working hour counting equipment and the storage medium provided by the invention have the advantages that the starting time and the ending time of the time period to be counted, which are input by a user, are obtained; obtaining pre-stored user information, wherein the user information comprises working day working time, working time of each day and a rest date; and acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and the user information. The method of the invention considers the influence of the user's rest on the working hours, can improve the accuracy of working hour statistics, does not need manual statistics, improves the statistical efficiency, reduces the labor cost, and provides a basis for accurately and efficiently performing performance assessment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The man-hour counting method provided by the invention can be suitable for a system with a multi-tenant architecture, can be convenient for multiple users to count the man hours of the users respectively, and ensures the data isolation among the users. Each user can generate a unique identity ID after registering in the system, and an interactive proof for identity verification when the user interacts with the system is generated according to the ID, wherein the ID is encrypted by adopting a DES encryption algorithm to generate an encrypted character string in the process of generating the interactive proof, the character string obtained by transcoding is used as the interactive proof after transcoding by using Base 64. Each user can upload user information to the system, specifically, the user information may include information such as working day working hours, working hours (e.g., 9:00-12:00,13:00-18:00), daily working hours (8 hours), and holiday date, and the system may store the user information in a Map object, where key is an interactive credential of the user, value is the user information, and holiday date may be stored in a table form, for example, the table list1 stores the date of weekday, list2 stores the date of weekday. Of course, the storage method is not limited to the above-described storage method, and other methods may be used for storage. Of course, the present invention is not limited to the multi-tenant architecture system described above, and other architectures are also possible. The man-hour statistic process is described in detail below with reference to specific embodiments.
Fig. 1 is a flowchart of a method for counting man-hours according to an embodiment of the present invention. The embodiment provides a man-hour statistical method, which comprises the following specific steps:
s101, acquiring the starting time and the ending time of the time period to be counted input by the user.
In this embodiment, when a user needs to count the valid working hours in a certain period to be counted, the user inputs a start time and an end time of the period to be counted, where the start time and the end time specifically include dates and time points, for example, 2018, 1, 9:00 to 2018, 1, 10, 17: 00.
S102, pre-stored user information is obtained, wherein the user information comprises working day working time, working time and working time of each day, and a rest date.
In the embodiment, by obtaining the pre-stored user information from the storage unit of the system, the working day on-duty time, off-duty time (e.g. 9:00-12:00,13:00-18:00) and daily working time (8 hours) of the user, and the rest date can be obtained, wherein the rest date can include the date of the working day on-duty day and the date of the rest day on-duty day. Of course, the user information may not include the daily work duration, and the daily work duration may be calculated by the work time and the work time.
The acquiring of the pre-stored user information may specifically include:
receiving an interaction credential input by a user; and acquiring user information corresponding to the interaction credential from a storage unit according to the interaction credential.
In this embodiment, since the system may store the user information into a Map object, where key is the interactive credential of the user and value is the user information, after the user inputs the interactive credential, the corresponding value is queried by using the interactive credential as a key value, so as to obtain the user information corresponding to the interactive credential. Of course, the user may also query by inputting the ID, or query by other query methods.
S103, acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and user information.
In this embodiment, the working hours in the time period to be counted may be counted according to the start time and the end time of the time period to be counted and the user information, and the specific steps may be as follows:
s1031, judging whether the starting time and the ending time are on the same date or not;
if so, S1032 is performed, otherwise, S1033 is performed.
S1032, acquiring the working hours of the time period to be counted according to the starting time, the ending time, the working time and the working-out time;
in this embodiment, considering that the start time and the end time of the time period to be counted are within the same day, it is only necessary to count how many man-hours are included between the two time points of the start time and the end time. Specifically, for example, for working days, the working hours and the working hours are 9:00 to 12:00,13:00 to 18:00, that is, the working hours in the morning are 9:00, the working hours in the afternoon are 12:00, the working hours in the afternoon are 13:00, and the working hours in the afternoon are 18:00, if the time period to be counted is 10:00 to 17:00 in the same date, 2 hours between the first time period 10:00 and 12:00 and 4 hours between the second time period 13:00 and 17:00 are obtained, so that the time period to be counted, 10:00 to 17:00, is 2+4 to 6 hours.
More specifically, the start time is the upper shift time as the start time when the start time is earlier than the on-shift time, and the lower shift time is the lower shift time as the receiving time when the end time is later than the off-shift time.
S1033, acquiring actual working days in the time period to be counted according to the starting time, the ending time and the rest date; acquiring the working hours of the starting time on the day and the working hours of the ending time on the day according to the starting time, the ending time, the working time and the working time; and acquiring the working hours of the time period to be counted according to the actual working days, the working hours of each day, the working hours of the starting time on the same day and the working hours of the ending time on the same day.
In the present embodiment, the man-hours of the time period to be counted can be acquired by counting the actual number of working days in the time period to be counted, and calculating the man-hours of the start time on the day and the man-hours of the end time on the day. Specifically, for example, the date of the starting time of the time period to be counted is d1, and the time point is t 1; the date of the end time is d2, and the time point is t 2; firstly, counting the number of days n1 of a working day (such as Monday to Friday) between d1 and d2, then counting the number of days n2 of a working day with a weekday adjustment between d1 and d2 and the number of days n3 of a working day with a weekday adjustment, and then obtaining that the actual working days in the time period to be counted are n1-n2+ n 3.
Since the start time and end time may not be the entire day of work hours counted, e.g., 8:00 hours on duty, but t1 is 10:00, the time hours on day are not equal to the daily work hours, if counted from the start time, and the time hours between t1 and the time on duty need to be subtracted. Therefore, the starting time h1 and the finishing time and day man-hour h2 need to be counted separately. Note that, if t1 is earlier than the on-duty time, the on-duty time is t1, and if t1 is later than the off-duty time, the off-duty time is t1, and h1 is denoted as 0; similarly, if t2 is earlier than the on-duty time, the on-duty time is t1 and h2 is 0, and if t2 is later than the off-duty time, the off-duty time is t 2.
After the actual working days in the statistical time period, the working hours of the starting time day and the working hours of the ending time day are obtained, the working hours of the time period to be counted are (n1-n2+ n 3-2). times.h + h1+ h2, wherein h is the working time length per day.
According to the man-hour counting method provided by the embodiment, the starting time and the ending time of the time period to be counted input by a user are obtained; obtaining pre-stored user information, wherein the user information comprises working day working time, working time of each day and a rest date; and acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and the user information. The method of the embodiment considers the influence of the user's call on the working hours, can improve the accuracy of working hour statistics, does not need manual statistics, improves the statistical efficiency, reduces the labor cost, and provides a basis for accurately and efficiently performing performance assessment.
On the basis of the above embodiment, the number of days of the weekday rest-rest day and the number of days of the weekday rest-rest day between the starting time and the ending time are counted, and a dichotomy can be adopted.
Specifically, the dates of the rest are stored in a table form, for example, a table list1 stores dates of weekday and weekday, a list2 stores dates of weekday and weekday, data in the list are sorted in ascending order of date, and when judging whether the dates in the list are within the time period to be counted, the data are divided into two parts. For example, the number of days of the weekday rest day in the time period to be counted is obtained recursively by taking a value with an index position of half the size of the list1 capacity.
Fig. 2 is a flowchart of a method for counting man-hours according to an embodiment of the present invention. The embodiment also provides a man-hour statistical method for estimating the construction period, which comprises the following specific steps:
s201, receiving estimated starting time and estimated task processing time input by a user.
In this embodiment, when the user needs to estimate the time limit of the work period, the estimated start time and the estimated task processing time are input, that is, a certain task is executed from the estimated start time, and the required work time is the estimated task processing time, and the time required for estimating the work period to the end, that is, the estimated completion time needs to be obtained.
S202, pre-stored user information is obtained, wherein the user information comprises working day working time, working time and working time of each day, and a rest date.
This step is the same as that described in the above embodiments, and is not described herein again. It should be noted that if the pre-stored user information is already obtained, this step does not need to be performed again.
S203, acquiring the estimated completion time according to the estimated starting time, the estimated task processing time and the user information.
In this embodiment, the estimated completion time may be obtained according to the estimated start time, the estimated task processing time, and the user information, and the specific steps may be as follows:
acquiring integral days and remaining hours according to the estimated task processing time and the daily working time;
acquiring an estimated completion date according to the date corresponding to the estimated starting time, the rest date and the integer number of days;
acquiring an estimated completion time point according to a time point corresponding to the estimated starting time and the remaining hours;
and acquiring the estimated completion time according to the estimated completion date and the estimated completion time point.
In this embodiment, it is assumed that the estimated start time date is d4, the time point is t4, the estimated task processing time t5, and the daily working duration is h, then t5 is divided by h to obtain an integer number of days n4 and a remaining number of hours t6, a date list3 is established with d4 as a starting point, the dates of n4 working days are added, the date of the working day is removed, the date of the working day after the working day is changed is added, and the estimated completion date d5 is adjusted according to the removed and added dates. Since the estimated completion date is only the case of considering the integer number of days n4, the number of remaining hours t6 is not considered, and the time point t4 of the estimated start time may not reach the off-duty time after adding t6, the estimated completion date is d5, and the time point is t4+ t 6; if the off-duty time is exceeded, it is necessary to increase by one day on the basis of the estimated completion date d5 and calculate the number of hours exceeding the off-duty time to the next day to obtain the estimated completion time.
The working hour statistical method provided by the embodiment is used for the construction period estimation, can accurately acquire the estimated completion time, and provides constructive guidance for work arrangement.
Fig. 3 is a structural diagram of a man-hour counting apparatus according to an embodiment of the present invention. The man-hour counting device provided in this embodiment may execute the processing procedure provided in the embodiment of the man-hour counting method, as shown in fig. 3, and the man-hour counting device includes an input module 31, an obtaining module 32, and a processing module 33.
The input module 31 is configured to obtain a start time and an end time of a time period to be counted, which are input by a user;
the acquiring module 32 is configured to acquire prestored user information, where the user information includes working day on-duty time, off-duty time, working time per day, and a rest date;
and the processing module 33 is configured to obtain the working hours of the user in the time period to be counted according to the start time and the end time of the time period to be counted and the user information.
Further, the obtaining module 32 is configured to:
receiving an interaction credential input by a user;
and acquiring user information corresponding to the interaction credential from a storage unit according to the interaction credential.
Further, the processing module 33 is configured to:
judging whether the starting time and the ending time are on the same date or not;
if yes, acquiring the working hours of the time period to be counted according to the starting time, the ending time, the working time and the working-out time;
if not, acquiring the actual working days in the time period to be counted according to the starting time, the ending time and the rest date; acquiring the working hours of the starting time on the day and the working hours of the ending time on the day according to the starting time, the ending time, the working time and the working time;
and acquiring the working hours of the time period to be counted according to the actual working days, the working hours of each day, the working hours of the starting time on the same day and the working hours of the ending time on the same day.
Further, the rest date comprises a date of weekday and a date of weekday;
the processing module 33 is configured to:
and counting the days of the working day, the days of the rest day and the days of the rest day between the starting time and the ending time so as to obtain the actual working days in the time period to be counted.
Further, the input module 31 is further configured to receive an estimated start time and an estimated task processing time input by a user;
the processing module 33 is further configured to obtain the estimated completion time according to the estimated start time, the estimated task processing time, and the user information.
Further, the processing module 33 is configured to:
acquiring integral days and remaining hours according to the estimated task processing time and the daily working time;
acquiring an estimated completion date according to the date corresponding to the estimated starting time, the rest date and the integer number of days;
acquiring an estimated completion time point according to a time point corresponding to the estimated starting time and the remaining hours;
and acquiring the estimated completion time according to the estimated completion date and the estimated completion time point.
The man-hour counting apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in fig. 1, and specific functions are not described herein again.
The man-hour counting device provided by the embodiment of the invention obtains the starting time and the ending time of the time period to be counted, which are input by a user; obtaining pre-stored user information, wherein the user information comprises working day working time, working time of each day and a rest date; and acquiring the working hours of the user in the time period to be counted according to the starting time and the ending time of the time period to be counted and the user information. The embodiment considers the influence of the user on the working hours, can improve the accuracy of working hour statistics, does not need manual statistics, improves the statistical efficiency, reduces the labor cost, and provides a basis for accurately and efficiently performing performance assessment.
Fig. 4 is a schematic structural diagram of a man-hour counting device according to an embodiment of the present invention. The man-hour counting device provided by the embodiment of the present invention may execute the processing flow provided by the embodiment of the man-hour counting method, as shown in fig. 4, the man-hour counting device 40 includes a memory 41, a processor 42, a computer program, and a communication interface 43; wherein a computer program is stored in the memory 41 and configured to execute the man-hour counting method described in the above embodiments by the processor 42.
The man-hour counting device in the embodiment shown in fig. 4 may be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
In addition, the present embodiment also provides a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the man-hour counting method described in the above embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.