CN-116308085-B - Inventory determination method, apparatus, computer device and storage medium
Abstract
The application relates to an inventory determination method, an inventory determination device, a computer device and a storage medium. The method comprises the steps of determining inventory parameters corresponding to target receipts, converting the target receipts into inventory model objects comprising a plurality of information fields when inventory update is started by inventory parameter characterization, and obtaining a target master table by determining an initial master table and an initial slave table corresponding to the inventory model objects and further performing inventory update on the initial master table according to the inventory parameters, so that the initial slave table can be subjected to inventory update through the target master table and the plurality of information fields to obtain the target slave table. By adopting the method, the efficiency of inventory determination can be improved.
Inventors
- SHEN JIANLEI
- LIU YUANJUN
- LIU GUANGHUA
- HU LING
- ZHANG WEN
Assignees
- 金蝶蝶金云计算有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230302
Claims (13)
- 1. A method of inventory determination, the method comprising: acquiring a target bill and determining inventory parameters corresponding to the target bill; converting the target document into an inventory model object comprising a plurality of information fields when the inventory parameter characterization initiates an inventory update; determining an initial master table and an initial slave table corresponding to the inventory model object, wherein the initial master table characterizes an inventory table corresponding to the instant inventory; performing inventory updating on the initial master table according to the inventory parameters to obtain a target master table; and updating the initial slave table in stock through the target master table and the information fields to obtain a target slave table.
- 2. The method of claim 1, wherein prior to the obtaining the target document, the method further comprises: Acquiring a bill template, and creating an initial bill according to the bill template, wherein the initial bill comprises a preset database table name and recorded bill information; Configuring the inventory parameters of the initial bill according to the bill service requirement to obtain candidate bills, wherein the bill service requirement comprises any one of the steps of storing the bill, checking the bill reversely and deleting the bill; And associating the inventory parameters in the candidate bill with corresponding program files to obtain a target bill, wherein the program files are used for carrying out logic calculation on the inventory of the target bill.
- 3. The method of claim 1, wherein after the determining the inventory parameter corresponding to the target document, the method further comprises: Determining whether an inventory collation operation of a plurality of history documents is being performed; if yes, obtaining a checking prompt message, and stopping inventory calculation on the target bill; If not, judging whether the inventory parameters characterize opening inventory updating, and stopping inventory calculation on the target bill when the inventory parameters characterize unopened inventory updating.
- 4. The method of claim 1, wherein the converting the target document into an inventory model object comprising a plurality of information fields comprises: Determining a reference bill corresponding to the target bill, wherein the reference bill represents a bill which provides a reference basis for bill information input for the target bill; Performing preliminary calculation on the target bill according to the reference bill to obtain a calculated target bill; and converting the calculated target bill containing a plurality of bill information into an inventory model object comprising a plurality of information fields.
- 5. The method of claim 4, wherein the performing a preliminary calculation on the target document according to the reference document to obtain a calculated target document includes: Determining a reference field in the reference document, and determining a modification field corresponding to the reference field from the target document; determining a difference between a field value of the reference field and a field value of the modified field; And updating the field value of the modified field in the target bill to the difference value to obtain the calculated target bill.
- 6. The method of claim 1, wherein the inventory model object comprises a database table name, wherein the initial master table comprises a plurality of master table fields, wherein the determining the initial master table and the initial slave table corresponding to the inventory model object comprises: Determining an initial main table corresponding to the database of the instant inventory according to the database table name; Determining a target main table field in a plurality of main table fields, wherein the target main table field comprises a target main key internal code; And acquiring a plurality of slave tables, and screening an initial slave table from the plurality of slave tables according to the target master table field.
- 7. The method of claim 1, wherein the information field includes a commodity value, wherein the updating the initial master table to obtain a target master table based on the inventory parameters includes: determining a first field value corresponding to an instant stock basic quantity field in the initial main table; determining a first calculation result of the first field value and the commodity value according to the inventory parameter; and updating a first field value in the initial main table to the first calculation result to obtain a target main table.
- 8. The method of claim 7, wherein after said updating the first field value in the initial master table to the first calculation result to obtain a target master table, the method further comprises: when the instant stock basic quantity field in the target main table corresponds to a negative value, carrying out inverse processing on the commodity value to obtain a new commodity value; returning to the step of determining the first field value and the first calculation result of the commodity value according to the inventory parameter.
- 9. The method of claim 1, wherein said updating the initial slave table by inventory through the target master table and the plurality of information fields to obtain a target slave table comprises: Determining a plurality of dimension master table fields in the target master table, and determining whether the field value of each dimension master table field is the same as the field value of any slave table field in the initial slave table; if the field values of the target primary key inner codes in the target primary table are the same, updating the field values of the target primary key inner codes in the target primary table into the field values of the associated primary key inner codes in the initial secondary table to obtain a candidate secondary table; And according to the information fields, updating the stock of the candidate slave table to obtain a target slave table.
- 10. The method of claim 9, wherein the information field includes a commodity value, wherein the inventory updating the candidate slave table based on the plurality of information fields results in a target slave table, comprising: Determining a second field value corresponding to the in-transit inventory basic quantity field in the candidate slave table; Determining a second calculation result of the second field value and the commodity value according to the inventory parameter; and updating a second field value in the candidate master table to the second calculation result to obtain a target slave table.
- 11. An inventory determination device, the device comprising: the bill conversion module is used for acquiring a target bill and determining an inventory parameter corresponding to the target bill, and converting the target bill into an inventory model object comprising a plurality of information fields when the inventory parameter characterizes to start inventory update; The target master table determining module is used for determining an initial master table and an initial slave table corresponding to the inventory model object, wherein the initial master table represents an inventory table corresponding to the instant inventory; And the target slave table determining module is used for updating the initial slave table through the target master table and the information fields to obtain a target slave table.
- 12. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 10 when the computer program is executed.
- 13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 10.
Description
Inventory determination method, apparatus, computer device and storage medium Technical Field The present application relates to the field of enterprise management software, and in particular, to a method, an apparatus, a computer device, and a storage medium for inventory determination. Background Inventory management is one of the cores of an enterprise resource planning system, is the most important input and output information of production management and supply chain management, is the information foundation of business such as enterprise material demand planning, material input and output and input, and the like, and the design of inventory management restricts the performance and experience of the whole information system. At present, when the inventory balance is required to be inquired, all the ex-warehouse and in-warehouse receipts are counted, so that the inventory balance of the instant inventory is calculated, and then receipts of different receipts types are respectively encoded, so that the in-transit inventory of receipts of the uniform receipts type is calculated. However, each time a new document type is added, it needs to be recoded and a new encoding field is added, which clearly increases the computational efficiency of the inventory. Therefore, how to perform the inventory calculation of the on-line inventory and the in-transit inventory simultaneously, and improving the efficiency of the inventory determination are problems to be solved by the present application. Disclosure of Invention In view of the foregoing, it is desirable to provide an inventory determination method, apparatus, computer device, and computer-readable storage medium that can improve inventory calculation efficiency. In a first aspect, the present application provides a method of inventory determination. The method comprises the following steps: acquiring a target bill and determining inventory parameters corresponding to the target bill; converting the target document into an inventory model object comprising a plurality of information fields when the inventory parameter characterization initiates an inventory update; determining an initial master table and an initial slave table corresponding to the inventory model object, wherein the initial master table characterizes an inventory table corresponding to the instant inventory; performing inventory updating on the initial master table according to the inventory parameters to obtain a target master table; and updating the initial slave table in stock through the target master table and the information fields to obtain a target slave table. In one embodiment, before the target bill is acquired, the method further comprises the steps of acquiring a bill template, creating an initial bill according to the bill template, configuring inventory parameters of the initial bill according to bill service requirements to obtain candidate bills, wherein the bill service requirements comprise any one of storing the bill, checking the bill and deleting the bill, associating the inventory parameters in the candidate bill with corresponding program files to obtain the target bill, and the program files are used for carrying out logic calculation on the inventory of the target bill. In one embodiment, after the inventory parameters corresponding to the target bill are determined, the method further comprises the steps of determining whether inventory checking operation of a plurality of historical bills is performed, if so, obtaining checking prompt information and stopping inventory calculation of the target bill, if not, judging whether the inventory parameters represent opening inventory update, and if not, stopping inventory calculation of the target bill. In one embodiment, the method for converting the target document into the inventory model object comprising a plurality of information fields comprises the steps of determining a reference document corresponding to the target document, characterizing the reference document to a document providing a reference basis for document information input for the target document, performing preliminary calculation on the target document according to the reference document to obtain a calculated target document, and converting the calculated target document comprising a plurality of document information into the inventory model object comprising a plurality of information fields. In one embodiment, the preliminary calculation is performed on the target document according to the reference document to obtain a calculated target document, and the method comprises the steps of determining a reference field in the reference document, determining a modification field corresponding to the reference field from the target document, determining a difference value between a field value of the reference field and a field value of the modification field, and updating the field value of the modification field in the target document to the difference