A metadata-driven application software dynamic construction method
Patent Information
- Application Number
- CN202611534361.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-30
- Publication Date
- 2026-11-03
AI Technical Summary
When the fields in the procurement business of the existing application software change, the data table and page field structure need to be adjusted synchronously, which makes it easy for the field relationships of the created procurement projects to change and makes it difficult to maintain consistency.
By adopting a metadata-driven approach, we receive procurement plan requests, merge fields to form a project field set, save metadata, and build quotation pages for buyers and suppliers. We also check and save field values, reducing the need to rebuild data tables and page structures.
This reduces the impact of field changes on created procurement projects, maintains the correspondence between historical page field structures and instance fields, and reduces the frequency of data table column structure adjustments.
Smart Images

Figure CN123030607A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer data processing technology, and in particular to a method for dynamically constructing application software based on metadata. Background Technology
[0002] Existing procurement applications typically establish procurement plans, procurement projects, and quotation pages according to pre-configured field structures. The field names, types, order, and input requirements vary across different procurement business scenarios. When fields are added, field attributes are adjusted, or multiple procurement plans combine to form a procurement project, it is usually necessary to simultaneously handle the correspondence between project fields, quotation fields, and page fields.
[0003] When existing fixed-field processing methods change, it is often necessary to adjust the data column structure of the data table, the page field structure, and the field mapping relationship synchronously. If the procurement plan template is subsequently updated with added, deleted, or adjusted fields, and the already created procurement projects continue to form page or query structures based on the changed template, the correspondence between page fields and saved instance fields is likely to change, causing the original field values to be unable to be read and restored according to the field structure when the procurement project was created. Summary of the Invention
[0004] This invention provides a metadata-driven method for dynamically building application software, comprising:
[0005] S1 receives a request from one or more procurement plans to create a procurement project, merges the fields of each procurement plan according to the field identifier to form a project field set, determines the project-level sorting order, and saves the field identifier and field attributes, including the sorting order, as field metadata to the project field template.
[0006] S2, create a purchaser quotation for the purchase object, create a purchaser instance field record according to the project field template and write the corresponding field attributes, and read the field value according to the field identifier and write the corresponding record according to the input type based on the relationship between the purchase object and the source purchase plan. Project fields that do not have corresponding data columns set in the purchase project master data table or purchaser quotation master data table are saved through purchaser instance field records.
[0007] S3 reads the enabled attributes of the project field template and the field attributes of the purchaser instance field record to form the supplier quotation field rules, organizes the page fields in the order of project level, reads the field value of the current purchase object according to the field identifier of the purchaser-provided field, and forms the input position of the supplier input field according to the input type when the edit attribute is allowed, constructs the supplier quotation page, and creates or reads the supplier quotation sheet corresponding to the current supplier and the purchase object.
[0008] S4: Receive data submitted by suppliers, check the range of submitted fields according to the supplier quotation field rules, and check the field values according to required attributes and input types. After all checks pass, create or update supplier instance field records according to the supplier quotation association identifier and field identifier, and save the field values.
[0009] S5. After the procurement plan template is modified, the created procurement projects can continue to use the saved project field template and instance field records. When accessed again, the page field structure and field values are restored according to the field identifier and project-level sorting order.
[0010] As a preferred embodiment of the metadata-driven application software dynamic construction method described in this invention, in S2, the purchaser instance field record includes purchaser quotation association identifier, field identifier, field name, field category, input type, required attribute, sorting order, input length, system field attribute, editing attribute, text storage field and numeric storage field. The text type field value and the option value of the drop-down radio type field are written to the text storage field, and the numeric type field value is written to the numeric storage field.
[0011] When the project field template contains fields in the procurement project master data table or the procurement quotation master data table that do not have corresponding data columns set, the field attributes and field values are saved through the corresponding procurement instance field record, and the procurement project master data table and the procurement quotation master data table maintain their original column structure.
[0012] As a preferred embodiment of the metadata-driven application software dynamic construction method of the present invention, in S2, when the same procurement project contains multiple procurement objects, a procurement quotation and a procurement instance field record corresponding to each procurement object are established respectively, and each procurement quotation has a sorting number; in S3, the procurement quotation at the top is determined according to the sorting number, and the procurement instance field record associated with the procurement quotation is read, and the supplier quotation field rule shared by each procurement object is formed by combining the enabled attribute in the project field template;
[0013] When constructing a supplier quotation page for any procurement object, the procurement field value is read from the procurement object instance field record according to the field identifier. When the field category is a procurement-provided field, the field value is loaded into the corresponding page position and kept read-only. When the field category is a supplier-entered field and the edit attribute allows the supplier to enter, the corresponding entry position is formed according to the input type.
[0014] As a preferred embodiment of the metadata-driven application software dynamic construction method of the present invention, in S1, when multiple procurement plans jointly create a procurement project, the number of fields of each procurement plan is counted, and the procurement plan with the most fields is taken as the benchmark plan.
[0015] When two or more procurement plans have the same maximum number of fields, the procurement plan with the largest number of fields that appears first in the creation request shall be selected as the baseline plan.
[0016] A basic project field set is established based on the baseline plan field. Other procurement plans are then read according to the order of the procurement plans in the creation request. Fields not included in the basic project field set are added according to the order of the fields in each procurement plan. The quotation unit price, quotation quantity, and quotation total price fields are added after the procurement plan fields. After all fields are merged, the project-level arrangement order is determined according to the position of each field in the project field set.
[0017] As a preferred embodiment of the metadata-driven application software dynamic construction method described in this invention, in step S4, the field identifier of the field submitted by the supplier is read and the corresponding field is searched in the supplier quotation field rules. If the corresponding field is not found, or the field category of the corresponding field is not a supplier entry field, or the editing attribute does not allow the supplier to enter, the field range check failure result is recorded.
[0018] Next, check the fields in the supplier quotation field rules that are classified as supplier input fields and whose edit attributes allow supplier input according to the field identifier. If a required field does not have a non-empty field value, record the missing result. For text type fields, check according to the input length. For numeric type fields, check according to the numeric parsing result. For drop-down radio button type fields, compare with the candidate options saved in the project field template. If any check fails, terminate the current save. After all checks pass, create or update the corresponding supplier instance field record.
[0019] As a preferred embodiment of the metadata-driven application software dynamic construction method described in this invention, in S4, the supplier instance field record includes supplier quotation association identifier, field identifier, field name, field category, input type, required attributes, sorting order, input length, system field attributes, editing attributes, text storage field and numeric storage field;
[0020] The server matches the fields submitted by the supplier with the fields in the supplier quotation field rules according to the field identifier. The field values of text type or drop-down radio selection type are written to the text storage field of the corresponding supplier instance field record, and the field values of numeric type are written to the numeric storage field of the corresponding supplier instance field record.
[0021] As a preferred embodiment of the metadata-driven application software dynamic construction method of the present invention, in S5, when accessing the supplier quotation page of the created procurement project, the page fields are determined according to the enabled attributes in the project field template saved by the procurement project, and the purchaser instance field record corresponding to the current procurement object and the supplier instance field record corresponding to the current supplier are read according to the field identifier.
[0022] When querying or outputting saved quotation data, the purchaser field value or supplier field value is not read from the later modified purchase plan template. Instead, the purchaser field value or supplier field value is read according to the field category, field identifier and project-level sorting order. The drop-down radio button type field uses the candidate options saved by the project field template. If no corresponding supplier instance field record is found, the corresponding supplier entry field remains empty.
[0023] The beneficial effects of this invention are as follows: This invention can reduce the adjustment of data table column structure and reconstruction of page structure caused by field changes, so that different field combinations can use the existing master data table structure to complete instance field saving and page construction; at the same time, it can reduce the impact of subsequent changes in the source template on the created procurement project, and maintain the correspondence between the historical page field structure and the saved instance fields. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart of the metadata-driven application software dynamic construction method in Example 1.
[0026] Figure 2 This is a schematic diagram illustrating the relationship between metadata and instance fields in Example 1. Detailed Implementation
[0027] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0028] The technical problem this invention aims to solve is that when the business fields of application software change, the fixed data columns, page field structure, and field mapping relationships need to be adjusted synchronously, and the correspondence between the page fields of the created procurement project and the saved instance fields is prone to change after subsequent changes to the source template.
[0029] Example 1, referring to Figure 1 and Figure 2 ;
[0030] This embodiment uses the example of multiple procurement plans jointly creating a price inquiry procurement project to illustrate the process of establishing project field templates, forming procurement instance field records, constructing supplier quotation pages, saving supplier quotation data, and restoring historical procurement project fields.
[0031] The method in this embodiment is executed by a server running the procurement application software.
[0032] In this embodiment, field name, field category, input type, required attributes, sorting order, input length, enabled attributes, system field attributes, edit attributes, and candidate options corresponding to drop-down radio fields together constitute field metadata used to describe field structure and processing methods. The project field template saves the field metadata corresponding to the current procurement project. The procuring entity instance field record and the supplier instance field record retain the field attributes corresponding to the field values while saving the field values.
[0033] In this embodiment, the dynamic construction of application software refers to the process by which the procurement application software, during operation, forms a quotation page field structure, field arrangement, input method, field value storage relationship, and query output structure corresponding to the current procurement project based on the field metadata and instance field records saved in the current procurement project. When the procurement plan or quotation field changes, it is not necessary to reset the data columns of the business master data table for the newly added fields, nor is it necessary to establish a fixed page field structure for different field combinations.
[0034] The project field template records the fields and project field attributes included in the current procurement project. Project field attributes include field name, field category, input type, required attributes, sorting order, input length, enabled attributes, system field attributes, and edit attributes. When the input type is a drop-down radio button, the project field template also saves the candidate options corresponding to that field when the current procurement project was created.
[0035] The purchaser instance field record stores the purchaser quotation association identifier, field identifier, instance field attributes, and purchaser field values. Instance field attributes include field name, field category, input type, required attributes, sorting order, input length, system field attributes, and edit attributes.
[0036] The supplier instance field record stores the supplier quotation association identifier, field identifier, instance field attributes, and field values submitted by the supplier. Instance field attributes include field name, field category, input type, required attributes, sorting order, input length, system field attributes, and edit attributes.
[0037] The purchaser instance field record and the supplier instance field record are set to text storage field and numeric storage field respectively. The text type field value and the option value of the drop-down radio type field are written to the text storage field, and the numeric type field value is written to the numeric storage field.
[0038] Both the purchaser instance field record and the supplier instance field record are created item by item according to the field. Each instance field record is identified by the corresponding quotation association identifier and field identifier, and the instance field attribute and field value of the field are stored in the same record.
[0039] When the project field template contains fields in the procurement project master data table or the procurement quotation master data table that do not have corresponding data columns set, the server saves the field attributes and field values of the field through the corresponding procurement instance field record, and the procurement project master data table and the procurement quotation master data table maintain the original column structure.
[0040] Field categories are used to distinguish between fields provided by the purchaser and fields entered by the supplier. Field values for fields provided by the purchaser are derived from the purchaser's instance field records and remain read-only on the supplier quotation page. Field values entered by the supplier are received by the supplier when the edit attribute allows the supplier to enter them. Field categories and edit attributes together limit the range of data that the supplier can submit.
[0041] System field attributes are used to distinguish between system-preconfigured fields and non-system-preset fields. Quoted unit price, quoted quantity, and quoted total price are system-preconfigured fields and have their own field identifiers.
[0042] The procurement plan source field reads the field value according to the field identifier based on the correspondence between the procurement object and the source procurement plan. The quotation field, which is pre-configured by the system, enters the project field set according to the corresponding field definition and does not read the field value from the source procurement plan.
[0043] Field identifiers are used to identify the same field in different records. Fields with the same field identifier in different procurement plans use the same field name, field category, input type, required attributes, input length, and edit attributes. Drop-down radio button type fields also use the same candidate options. Fields that need to be configured with different field attributes or different candidate options use different field identifiers.
[0044] For fields originating from the procurement plan, the same field identifier remains consistent across procurement plan fields, project fields, and corresponding instance field records. Pre-configured quotation fields maintain the same field identifier across project field templates, purchaser instance field records, and supplier instance field records.
[0045] S1, Create the project field template corresponding to the current procurement project.
[0046] The server receives a request to create a procurement project from one or more procurement plans. The creation request includes the association identifiers of the procurement plans involved in the creation of the current procurement project and the order in which the procurement plans are arranged.
[0047] The server reads the corresponding field records of the procurement plan based on the procurement plan association identifier;
[0048] When a request contains only one procurement plan, that procurement plan is used as the baseline plan.
[0049] When a request contains multiple procurement plans, the number of field records in each procurement plan is counted, and the procurement plan with the most field records is determined as the baseline plan.
[0050] When two or more procurement plans have the same maximum number of field records, the server determines the procurement plan with the largest number of field records as the baseline plan according to the order of the procurement plans in the creation request.
[0051] After the baseline plan is determined, the server reads the field records one by one according to the field arrangement order in the baseline plan, and writes the field identifier and field attributes other than the arrangement order of each field into the base project field set.
[0052] After the basic project field set is established, the server reads other procurement plans according to the order of the procurement plans in the creation request, and obtains the field identifiers in the order of the fields in each procurement plan.
[0053] If the basic project field set already contains the same field identifier, the corresponding field will not be added again, and the already saved field attributes will be retained.
[0054] If no identical field identifier is found, the field identifier of the current field and field attributes other than the source order will be added to the basic project field set. The added fields will maintain their relative order in the source procurement plan.
[0055] After all the procurement plan fields are organized, the server reads the pre-saved field definitions of the three quotation fields: unit price, quantity, and total price.
[0056] The field definitions for the three quotation fields respectively store the field identifier, field name, field category, input type, required attributes, input length, enabled attributes, system field attributes, and edit attributes. The three quotation fields belong to the pre-configured system fields.
[0057] The server adds the three quotation fields sequentially after the procurement plan field, according to the pre-defined relative order of quotation unit price, quotation quantity, and quotation total price.
[0058] After the project field set is formed, the server redetermines the project-level arrangement order according to the current position of each field in the project field set.
[0059] The baseline plan source field maintains its relative order within the baseline plan, while other procurement plan supplement fields maintain their respective relative order within the source procurement plans and are arranged after the existing procurement plan fields. The three quotation fields are arranged after the procurement plan fields in a predetermined relative order.
[0060] The server writes the redefined project-level sort order into the field records of each project.
[0061] The project field template will save the project-level sorting order and will not continue to use the original sorting order of the source procurement plan field or the pre-configured quotation field.
[0062] The server creates a project field template corresponding to the current procurement project based on the project field set, and saves the field identifier and project field attributes of each field.
[0063] After the project field template is created, the server reads the fields whose input type is drop-down radio button and retrieves the corresponding candidate options when the current project was created according to the field identifier;
[0064] Fields derived from the procurement plan obtain candidate options from the corresponding procurement plan field configuration, while pre-configured fields obtain candidate options from the corresponding preset option configuration, and the obtained candidate options are associated with and saved with the corresponding project fields;
[0065] The candidate options saved in association with the project field will continue to be used in the future for the current procurement project. When the source field configuration or preset option configuration is added, deleted or adjusted in the future, the candidate options saved in the existing procurement project will not be changed.
[0066] When a procurement project is created, the server also establishes a correspondence between each procurement object and the source procurement plan, and saves the source procurement plan association identifier for each procurement object.
[0067] In this embodiment, the first procurement plan includes material name, specifications, quantity, unit of measurement, and delivery location, while the second procurement plan adds brand requirements to the above fields.
[0068] The second procurement plan has a large number of field records. The server determines the second procurement plan as the baseline plan and builds a basic project field set according to the field order in the second procurement plan.
[0069] The server then reads the field identifiers from the first procurement plan. Since all the fields in the first procurement plan already exist in the basic project field set, this embodiment does not add a procurement plan source field, but adds three quotation fields and redetermines the project-level sorting order.
[0070] When a procurement plan with a large number of field records is used as the baseline plan, the basic project field set can pre-include more procurement plan fields. When the server processes other procurement plans, it only adds fields that are not yet included in the basic project field set, thereby reducing the number of new project field records that need to be added during the formation of the project field set.
[0071] S2, Create records for the buyer's quotation and buyer instance fields.
[0072] In this embodiment, the procurement object is the procurement materials or procurement details that require separate quotations in the current procurement project.
[0073] The server creates a quotation sheet for each procurement object in the current procurement project, and saves the association identifier and sequence number of the current procurement object in each quotation sheet.
[0074] The server creates purchaser instance field records for each field according to the project field template. It writes the purchaser quotation association identifier and field identifier into each record, and writes the field name, field category, input type, required attributes, project-level sorting order, input length, system field attributes, and edit attributes from the project field template into the corresponding records, so that the current purchaser quotation has purchaser instance field records corresponding to each field of the project field template.
[0075] After the purchaser instance field record is established, the server reads the source purchase plan association identifier saved by the current purchase object, and reads the field record and field value in the corresponding purchase plan based on the association identifier.
[0076] The server reads each field record of the current purchaser's quotation associated with the purchaser instance one by one and obtains the field identifiers in the current record.
[0077] The server uses the field identifier to search for the same field in the source procurement plan field record.
[0078] When a matching field is found and the source procurement plan has already saved the field value, the server reads that field value.
[0079] When the input type of the current instance field is text, the server writes the field value to the text storage field.
[0080] When the input type is numeric, the server writes the field value to the numeric storage field. When the input type is a drop-down radio button and the source procurement plan has already saved the option value, the server writes the option value to the text storage field.
[0081] If the same field identifier is not found in the source procurement plan, or if the same field identifier exists but the field value is not saved, the server retains the corresponding purchaser instance field record and keeps the field value empty.
[0082] After the current purchaser's quotation is processed, the server processes the next purchaser using the same process.
[0083] When the project field template contains fields in the procurement project master data table or the procurement quotation master data table that do not have corresponding data columns set, the server will still create the corresponding procurement instance field record according to the project field template, and save the field attributes and field values through the procurement instance field record. The procurement project master data table and the procurement quotation master data table will continue to maintain the column structure before the procurement project was created.
[0084] S3, Based on the project field template and the purchaser instance field record, generate the supplier quotation field rules and the supplier quotation page.
[0085] The server reads the project field template saved for the current procurement project, determines the first procurement quotation according to the order number of the procurement quotation, reads the procurement instance field record associated with the procurement quotation, and then matches the procurement instance field record with the fields in the project field template according to the field identifier.
[0086] When the enabled attribute in the project field template is enabled, the field identifier and instance field attribute of the corresponding purchaser instance field record will be included in the supplier quotation field rule. When the enabled attribute is disabled, the corresponding field will not be included in the supplier quotation field rule. The supplier quotation field rule organizes the fields according to the project-level arrangement order.
[0087] The supplier quotation field rules are used to determine the scope and attributes of fields shared by all procurement objects in the current procurement project, and do not save the purchaser field values of other procurement objects;
[0088] When constructing supplier quotation pages for different procurement objects, the server determines the field structure according to the same supplier quotation field rules, and reads the procurement field value from the procurement object instance field record corresponding to the current procurement object according to the field identifier.
[0089] When constructing a supplier quotation page for a specific procurement object, the server reads the purchaser quotation corresponding to the current procurement object and obtains the purchaser instance field record associated with the purchaser quotation.
[0090] The server reads the supplier quotation field rules one by one, and searches for the corresponding record in the purchaser instance field record of the current purchase object according to the field identifier of the current rule field.
[0091] When the field category is provided by the purchaser, the server reads the field value from the text storage field or the numerical storage field from the purchaser instance field record corresponding to the current purchase object according to the field identifier, and loads the field value into the corresponding page position. This type of field remains read-only on the supplier quotation page.
[0092] When the field category is a supplier entry field, the server continues to read the edit attributes and input type. For fields that the supplier is allowed to enter in the edit attributes, corresponding entry positions are established according to the input type. Text type corresponds to text entry position, numeric type corresponds to numeric entry position, and drop-down radio selection type reads the corresponding candidate options from the project field template saved in the current procurement project and forms a drop-down selection position. Fields that the supplier is not allowed to enter in the edit attributes do not form entry positions and are not included in the data range allowed to be submitted in this quotation.
[0093] For fields that suppliers are allowed to enter, the server reads both the required attributes and the input length. The required attributes are used to check whether the field value has been obtained when the supplier submits the data, and the input length is used to check the submitted content of text-type fields. The candidate options saved in the project field template are used to check the submitted content of drop-down radio-type fields.
[0094] When a supplier accesses the supplier quotation page of the current procurement object, the server looks up the corresponding supplier quotation based on the current supplier association identifier and the current procurement object association identifier. If a supplier quotation has already been created, the server continues to read its supplier quotation association identifier. If it has not yet been created, the server creates a supplier quotation for the current supplier and the current procurement object, and saves the supplier association identifier, the procurement object association identifier, and the procurement party quotation association identifier corresponding to the current procurement object in the supplier quotation.
[0095] When a supplier visits the quotation page for the same procurement object again, the server continues to read the established supplier quotation and its associated supplier instance field records, and loads the saved supplier entry field values into the corresponding page positions according to the field identifiers.
[0096] The enable attribute in the project field template controls whether a field can be included in the supplier quotation field rules and the current supplier quotation page. If a field is deactivated, the saved purchaser instance field record and supplier instance field record will not be deleted, and the corresponding field data will continue to be retained in historical quotation queries and existing data output.
[0097] S4, Review supplier-submitted data and create or update supplier instance field records.
[0098] The data submitted by suppliers includes the fields that suppliers are allowed to enter on the supplier quotation page and their corresponding values.
[0099] After receiving this quote submission, the server retrieves all submitted fields, with each field containing at least a field identifier and a field value.
[0100] The server first checks whether the submitted data contains fields outside the supplier quotation field rules or fields that suppliers are not allowed to enter.
[0101] The server reads the field identifiers of each submitted field and searches for the same field identifiers in the supplier quotation field rules.
[0102] If there is no matching field identifier in the supplier quotation field rule, the server will record the currently submitted field as an outside field of the rule.
[0103] After finding the same field identifier in the supplier quotation field rules, the server reads the field category and edit attribute of the field. If the field category is not a supplier entry field or the edit attribute does not allow the supplier to enter, the currently submitted field is recorded as an abnormal submission field, and the submission field value is not used to modify the purchaser instance field record or the supplier instance field record.
[0104] After completing the field range check, the server continues to read fields in the supplier quotation field rules that are classified as supplier input fields and whose edit attributes allow suppliers to input fields, and searches for the corresponding submitted fields in the submitted data according to the field identifier.
[0105] When no corresponding submission field is found, the server reads the required attributes of the current rule field. If the required attribute is mandatory, the current field is recorded as a missing field. If the required attribute is not mandatory, no missing result is recorded, and the value of the supplier instance field that has already been saved for this field remains unchanged.
[0106] After finding the corresponding submitted field, the server reads the value of the submitted field. If the submitted field value is empty and the required attribute is required, the current field is recorded as a missing field.
[0107] If a submitted field value is empty and a required attribute is not required, the missing result will not be recorded. If a supplier instance field record already exists for the current field, the original field value of the corresponding field will be cleared after all checks of this submission have passed. If a corresponding supplier instance field record has not yet been created, the record will not be created and the corresponding field will remain empty.
[0108] After obtaining the non-empty field value, the server performs data checks according to the input type of the current rule field.
[0109] When the input type is text, the server obtains the character length of the submitted field value and compares it with the current field's input length. If the character length does not exceed the input length, the text length check passes; if the character length exceeds the input length, the length check fails.
[0110] When the input type is numeric, the server parses the submitted field value according to the numeric data format. If a numeric result can be obtained, the data type check passes; otherwise, if a numeric result cannot be obtained, the data type check fails.
[0111] When the input type is a drop-down radio button, the server reads the corresponding candidate option from the project field template saved in the current procurement project according to the field identifier, and compares the submitted field value with the candidate option. If the submitted field value can obtain the corresponding option in the candidate options, it passes the option check.
[0112] When the submitted field value cannot be found in the candidate options saved in the project field template, the server records the option check failure result.
[0113] If there are fields outside the rules, fields submitted abnormally, missing fields, fields that fail the length check, fields that fail the data type check, or fields that fail the option check, the server will terminate the saving of the current quotation data and return the corresponding field identifier and check results. This submission will not add new supplier instance field records, nor will it update the already saved supplier instance field records.
[0114] The above field checks are based on the supplier quotation field rules and the field attributes saved in the current procurement project. If the check fails, the existing supplier instance field records will remain unchanged to avoid writing submitted values that do not correspond to the current page field structure or field input type into the supplier instance field records.
[0115] After all submitted fields pass the check, the server processes the supplier entry fields that have obtained non-empty field values in this submission, and finds the corresponding supplier instance field record based on the current supplier quotation association identifier and field identifier. If the field has not been saved, the supplier instance field record is created and the supplier quotation association identifier, field identifier and corresponding instance field attribute are written to it. If the field has been saved, the corresponding supplier instance field record is updated.
[0116] Text-type or dropdown list-type field values are written to the text storage field of the corresponding supplier instance field record, and numeric-type field values are written to the numeric storage field of the corresponding supplier instance field record. The same supplier quotation association identifier and the same field identifier correspond to one supplier instance field record.
[0117] Once the supplier instance field record is created or updated, the server will associate the corresponding record with the current supplier quotation, and the supplier quotation will be associated with the purchaser quotation corresponding to the current purchase object.
[0118] S5, Restoring Historical Projects After Template Changes
[0119] After a procurement project is created, the project field template and the corresponding procurement instance field records for each procurement party's quotation are saved. After a supplier completes its quotation, the corresponding supplier instance field record for the supplier's quotation is saved.
[0120] When fields are added, deleted, or their attributes are adjusted in the procurement plan template, the modified field definitions will apply to procurement plans created afterward.
[0121] For procurement projects that have already been created, the server does not rebuild the project field structure based on the later modified procurement plan template, nor does it directly write the newly added procurement plan template fields into the corresponding procurement party instance field record or supplier instance field record of the original procurement project.
[0122] When a procurement project has already been created and contains drop-down radio button type fields, the server continues to use the candidate options saved in the project field template of the procurement project. When the procurement plan template or pre-configured candidate options are added, deleted or adjusted later, the candidate options saved in the already created procurement project will not be replaced.
[0123] After receiving an access request for a created procurement project, the server reads the project field template, the procurement party instance field record corresponding to the current procurement object, and the supplier instance field record corresponding to the current supplier, based on the procurement project association identifier, and restores the current page field structure according to the enabled attributes and project-level sorting order in the project field template.
[0124] The purchaser provides fields by reading the purchaser instance field value according to the field identifier. The supplier enters fields by reading the corresponding supplier instance field value according to the field identifier. If no supplier instance field record is found, the corresponding field remains empty. The drop-down radio button type field continues to use the candidate options saved in the current procurement project.
[0125] When querying or outputting a procurement project that has already been created, the server continues to read the field values of the procuring entity instance and the supplier instance according to the field identifier, field category and project-level sorting order saved for that procurement project, without reconstructing the field structure based on the later modified procurement plan template.
Claims
1. A method for dynamically constructing application software based on metadata-driven methods, characterized in that, Executed by the server, including: S1 receives a request from one or more procurement plans to create a procurement project, merges the fields of each procurement plan according to the field identifier to form a project field set, determines the project-level sorting order, and saves the field identifier and field attributes, including the sorting order, as field metadata to the project field template. S2, create a purchaser quotation for the purchase object, create a purchaser instance field record according to the project field template and write the corresponding field attributes, and read the field value according to the field identifier and write the corresponding record according to the input type based on the relationship between the purchase object and the source purchase plan. Project fields that do not have corresponding data columns set in the purchase project master data table or purchaser quotation master data table are saved through purchaser instance field records. S3 reads the enabled attributes of the project field template and the field attributes of the purchaser instance field record to form the supplier quotation field rules, organizes the page fields in the order of project level, reads the field value of the current purchase object according to the field identifier of the purchaser-provided field, and forms the input position of the supplier input field according to the input type when the edit attribute is allowed, constructs the supplier quotation page, and creates or reads the supplier quotation sheet corresponding to the current supplier and the purchase object. S4: Receive data submitted by suppliers, check the range of submitted fields according to the supplier quotation field rules, and check the field values according to required attributes and input types. After all checks pass, create or update supplier instance field records according to the supplier quotation association identifier and field identifier, and save the field values. S5. After the procurement plan template is modified, the created procurement projects can continue to use the saved project field template and instance field records. When accessed again, the page field structure and field values are restored according to the field identifier and project-level sorting order.
2. The method for dynamically constructing application software based on metadata as described in claim 1, characterized in that: In S2, the purchaser instance field records include purchaser quotation association identifier, field identifier, field name, field category, input type, required attributes, sorting order, input length, system field attributes, edit attributes, text storage field and numeric storage field. The values of text type fields and the option values of drop-down radio type fields are written to the text storage field, and the values of numeric type fields are written to the numeric storage field. When the project field template contains fields in the procurement project master data table or the procurement quotation master data table that do not have corresponding data columns set, the field attributes and field values are saved through the corresponding procurement instance field record, and the procurement project master data table and the procurement quotation master data table maintain their original column structure.
3. The metadata-driven application software dynamic construction method as described in claim 1, characterized in that: In S2, when the same procurement project contains multiple procurement objects, the procurement quotation and procurement instance field records corresponding to each procurement object are established separately, and each procurement quotation has a sorting number; in S3, the procurement quotation at the top is determined according to the sorting number, and the procurement instance field record associated with the procurement quotation is read, and the supplier quotation field rule shared by each procurement object is formed by combining the enabled attribute in the project field template. When constructing a supplier quotation page for any procurement object, the procurement field value is read from the procurement object instance field record according to the field identifier. When the field category is a procurement-provided field, the field value is loaded into the corresponding page position and kept read-only. When the field category is a supplier-entered field and the edit attribute allows the supplier to enter, the corresponding entry position is formed according to the input type.
4. The metadata-driven application software dynamic construction method as described in claim 1, characterized in that: In S1, when multiple procurement plans jointly create a procurement project, the number of fields in each procurement plan is counted, and the procurement plan with the most fields is used as the baseline plan. When two or more procurement plans have the same maximum number of fields, the procurement plan with the largest number of fields that appears first in the creation request shall be selected as the baseline plan. A basic project field set is established based on the baseline plan field. Other procurement plans are then read according to the order of the procurement plans in the creation request. Fields not included in the basic project field set are added according to the order of the fields in each procurement plan. The quotation unit price, quotation quantity, and quotation total price fields are added after the procurement plan fields. After all fields are merged, the project-level arrangement order is determined according to the position of each field in the project field set.
5. The method for dynamically constructing application software based on metadata as described in claim 1, characterized in that: In S4, the field identifier of the field submitted by the supplier is read and the corresponding field is searched in the supplier quotation field rules. If the corresponding field is not found, or the field category of the corresponding field is not a supplier entry field, or the edit attribute does not allow the supplier to enter, the field range check result is recorded as not passing. Next, check the fields in the supplier quotation field rules that are classified as supplier input fields and whose edit attributes allow supplier input according to the field identifier. If a required field does not have a non-empty field value, record the missing result. For text type fields, check according to the input length. For numeric type fields, check according to the numeric parsing result. For drop-down radio button type fields, compare with the candidate options saved in the project field template. If any check fails, terminate the current save. After all checks pass, create or update the corresponding supplier instance field record.
6. The method for dynamically constructing application software based on metadata as described in claim 1, characterized in that: In S4, the supplier instance field record includes supplier quotation association identifier, field identifier, field name, field category, input type, required attributes, sorting order, input length, system field attributes, edit attributes, text storage field and numeric storage field; The server matches the fields submitted by the supplier with the fields in the supplier quotation field rules according to the field identifier. The field values of text type or drop-down radio selection type are written to the text storage field of the corresponding supplier instance field record, and the field values of numeric type are written to the numeric storage field of the corresponding supplier instance field record.
7. The method for dynamically constructing application software based on metadata as described in claim 1, characterized in that: In S5, when accessing the supplier quotation page of a created procurement project, the page fields are determined according to the enabled attributes in the project field template saved for the procurement project, and the purchaser instance field record corresponding to the current procurement object and the supplier instance field record corresponding to the current supplier are read according to the field identifier. When querying or outputting saved quotation data, the purchaser field value or supplier field value is not read from the later modified purchase plan template. Instead, the purchaser field value or supplier field value is read according to the field category, field identifier and project-level sorting order. The drop-down radio button type field uses the candidate options saved by the project field template. If no corresponding supplier instance field record is found, the corresponding supplier entry field remains empty.
