A medicine sales business management system
Patent Information
- Application Number
- CN202611146311.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-16
AI Technical Summary
然而,现有系统大多针对普通商品流通场景设计,各功能模块相对独立,客户管理、商品销售、订单处理和人员绩效等环节之间缺乏统一的数据衔接和规则联动
[0016]This invention discloses a pharmaceutical sales business management system. Through the collaborative operation of a mobile business mini-program module, a mobile customer mini-program module, a backend management module, a backend service layer module, a data storage layer module, and an external system interface module, it constructs a closed-loop management architecture covering the entire pharmaceutical distribution business chain, helping to eliminate data barriers between various business links. The mobile business mini-program module and the mobile customer mini-program module provide differentiated order entry points and product display logic for business personnel and customers, respectively. The backend management module uniformly maintains regional authorization, product authorization, job level, and task rules, ensuring that mobile order verification, customer list presentation, and product visibility are all based on the same authorization criteria, helping to reduce business disputes caused by duplicate regional authorization, unclear product attribution, and incorrect sales attribution. The order verification unit in the backend service layer module centrally handles multiple verifications upon order submission, including customer qualifications, customer type, additional authorization, regional authorization, special product rules, first-order promotions, bundled products, inventory, and minimum price payment. The amount calculation unit recalculates the order amount according to the activity rules, ensuring the consistency and accuracy of order data even in scenarios with multiple rules overlapping. The payment callback processor unit triggers commission snapshot generation, referral reward calculation, gift record saving, customer message push, and ERP push sequentially after successful payment. Unique constraints prevent duplicate processing, helping to avoid data omissions or duplications caused by excessively long payment callback chains. The bundled product splitter unit generates sub-product snapshots when an order is placed and executes them on a sub-product basis during inventory verification and ERP push, helping to ensure data traceability for bundled products across various business stages. The visit record unit dynamically selects coordinate sources for distance verification based on customer information status and generates visit photos and route data with watermarks. The backend can use this to review the visit process, improving the authenticity and verifiability of visit records. The invitation code binding unit locks the invitation code and establishes the invitation relationship only after registration approval and account creation. Invitation codes are not deducted during the registration submission stage, helping to avoid invalid applications occupying invitation codes and reducing the waste of invitation code resources. After return approval, the order return management unit synchronously updates the order status, processes refunds, restores inventory, and archives and deletes the corresponding commission snapshot and referral reward, helping to maintain final consistency between revenue data and order status. This invention enables unified processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management, thereby improving data consistency and system traceability in all aspects of pharmaceutical distribution business.
Smart Images

Figure CN122927751A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of business management technology, and in particular to a pharmaceutical sales business management system. Background Technology
[0002] With the digital transformation of the pharmaceutical distribution industry, drug sales management is gradually evolving from traditional offline models to online and mobile approaches. Currently, some companies in the industry have adopted solutions combining mobile mini-programs with back-end management systems to support daily operations such as customer visits, product inquiries, and order placement on behalf of customers, while also providing online services such as self-ordering, order tracking, and logistics monitoring for customers. However, most existing systems are designed for general commodity distribution scenarios, with relatively independent functional modules, lacking unified data integration and rule-based linkage between customer management, product sales, order processing, and personnel performance.
[0003] The pharmaceutical distribution business has its own unique characteristics: customer qualifications vary depending on the type of business, and the initial business registration review standards are strict; different customer types correspond to different ranges of salable goods, and the sales authority and commission rules for the same product vary in different regions and under different business positions; product promotion activities take many forms, including first-order discounts, gifts with purchase, bundled sales, and minimum payment options, and these rules often overlap when an order is submitted, making it difficult to ensure the consistency and accuracy of order data with a single page or module verification. Furthermore, the post-payment processing chain is lengthy, requiring simultaneous updates to order status, generation of commission snapshots, calculation of referral rewards, saving of gift records, and data push to the ERP system. Existing systems are prone to data inconsistencies or omissions when handling this chain; when sales personnel visit customers, there is a lack of effective technical means to track the authenticity of the visit, verify location, and preserve photographic evidence. Regarding the referral business, existing systems typically use a registration-based binding method for invitation codes and relationship binding, which can easily lead to wasted invitation codes and relationship confusion due to invalid registration applications.
[0004] To address the aforementioned issues, there is an urgent need for a pharmaceutical sales business management system to unify the processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management, thereby improving data consistency and system traceability across all aspects of the pharmaceutical distribution business. Summary of the Invention
[0005] The purpose of this invention is to provide a pharmaceutical sales business management system that can achieve unified processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management, so as to improve data consistency and system traceability in all aspects of pharmaceutical distribution business.
[0006] To achieve the above objectives, the present invention provides a pharmaceutical sales business management system, including a mobile terminal business mini-program module, a mobile terminal customer mini-program module, a back-end management terminal module, a back-end service layer module, a data storage layer module, and an external system interface module; The mobile terminal business mini-program module and the mobile terminal customer mini-program module are respectively connected to the backend service layer module through the network. The backend management terminal module is connected to the backend service layer module through the network. The backend service layer module is respectively connected to the data storage layer module and the external system interface module. The mobile business mini-program module is used for business accounts to perform registration applications, invitation code generation and use, customer query and addition, first-time business information submission, product query, order placement on behalf of customers, base price payment calculation, order query, visit photo taking, visit route viewing, sales data query and invitation reward query; The mobile customer mini-program module is used for customer accounts to log in, view and edit customer information, manage shipping addresses, browse product lists, add products to favorites, manage shopping carts, place orders independently, make payments, apply for returns, apply for invoices, track logistics, and receive message notifications. The back-end management module is used by platform operators to perform business account management, business position management, customer file management, customer account management, product management, order management, payment transaction management, return management, invoicing management, commission snapshot management, visit record management, invitation configuration management, delivery configuration management, basic data management, and system permission management. The backend service layer module is used to provide a unified service interface to complete business rule verification, data conversion, order status flow, external system calls and transaction processing. The data storage layer module is used to store customer profiles, business accounts, business positions, product master data, order master data, order product details, payment records, commission snapshots, invitation relationships, invitation rewards, visit records, activity configurations, bundled products, delivery configurations, and system permission data. The external system interface module is used to interface with communication software mini-program interfaces, B2B payment interfaces, ERP system interfaces, map parsing interfaces, logistics query interfaces, object storage interfaces, OCR recognition interfaces, and communication software message interfaces.
[0007] The mobile business mini-program module includes a registration application unit, a customer management unit, a product query unit, a customer order placement unit, a visit record unit, and a sales data unit. The registration application unit is connected to the customer management unit and the backend service layer module respectively. The customer management unit is connected to the product query unit, the order placement unit, the visit record unit and the backend service layer module respectively. The product query unit is connected to the order placement unit and the backend service layer module respectively. The order placement unit is connected to the backend service layer module. The visit record unit is connected to the backend service layer module. The sales data unit is connected to the backend service layer module. The registration application unit is used to collect applicant information and submit registration for review, and bind an invitation code after the review is approved; The customer management unit is used to query the list of customers within the visible range based on the regional and product authorization of the business position, and to add new customers or submit initial business information; The product query unit is used to dynamically calculate and display available products for purchase based on customer identity, customer type, first-time customer status, activity rules, and additional sales authorization; The order placement unit is used to select customers and products, submit orders, and verify the business unit's regional permissions, product permissions, customer qualifications, inventory, first-order promotions, bundled products, and minimum price payment rules. The visit record unit is used to select a customer and submit the current location, visit photos, visit purpose and remarks, and select the target coordinate source for distance verification based on the customer information status, and generate a watermarked visit record and route data; The sales data unit is used to display sales data, task completion status, and leaderboards for different business positions.
[0008] The mobile client mini-program module includes a login account unit, a shipping address management unit, a product display unit, a shopping cart order placement unit, an order service unit, and a message notification unit. The login account unit is connected to the shipping address management unit, the product display unit, and the backend service layer module, respectively. The shipping address management unit is connected to the shopping cart ordering unit and the backend service layer module, respectively. The product display unit is connected to the shopping cart ordering unit and the backend service layer module, respectively. The shopping cart ordering unit is connected to the order service unit and the backend service layer module, respectively. The order service unit is connected to the message notification unit and the backend service layer module, respectively. The message notification unit is connected to the backend service layer module. The login account unit is used to support account and password login and quick login, and is associated with customer profiles and store information; The delivery address management unit is used to save and manage multiple delivery addresses and synchronize the enterprise's registered address as the default delivery address; The product display unit is used to filter and display purchasable products based on the customer's first-time customer status, customer type, and additional sales authorization, and hides the commission rate field from the client. The shopping cart ordering unit is used to temporarily store product selections and quantities, and to execute customer self-ordering and payment; The order service unit is used to query the order list and details, submit return requests and invoice requests, and view the logistics track; The message notification unit is used to display messages categorized by order, data, and platform notification, and supports marking messages as read individually or in batches.
[0009] The back-end management module includes a business account management unit, a business position authorization management unit, a customer file management unit, a product activity management unit, an order return management unit, a commission snapshot management unit, an invitation management unit, and a visit correction management unit. The business account management unit is connected to the business position authorization management unit. The business position authorization management unit is connected to the customer file management unit, the product activity management unit, and the backend service layer module. The customer file management unit is connected to the order return management unit and the backend service layer module. The product activity management unit is connected to the order return management unit and the backend service layer module. The order return management unit is connected to the commission snapshot management unit, the invitation management unit, and the backend service layer module. The commission snapshot management unit is connected to the backend service layer module. The invitation management unit is connected to the backend service layer module. The visit correction management unit is connected to the backend service layer module. The business account management unit is used to add, edit, and delete business accounts, bind or transfer business positions, and synchronize account information to position data; The business position authorization management unit is used to configure position levels, regional authorizations and product authorizations, perform authorization conflict checks, and set sales targets, customer targets and product sales targets. The customer file management unit is used to maintain customer unit information, licenses and certificates, initial business information, registered address, detailed address and coordinates, parse address coordinates through map interface, and push information status change messages to customer accounts; The product activity management unit is used to maintain product master data, listing status, specifications, commission rate, and to configure first-order activities, gift-with-purchase activities, bundled products, and additional sales authorizations. The order return management unit is used to query and edit orders, submit ERP push notifications, update logistics information, review return applications, and execute refunds, inventory restoration, and reverse processing of commission snapshots and referral rewards. The commission snapshot management unit is used to automatically generate commission snapshots based on customer region, product authorization, business position level and order amount, and provides query, statistics and export functions; The invitation management unit is used to maintain invitation code configuration, invitation code records, invitation relationships, usage logs and reward details, terminate invitation relationships and export data; The visit correction management unit is used to query visit records and route data, review location correction applications, and update customer coordinates.
[0010] The backend service layer module includes an order verification unit, an amount calculation unit, a payment callback processor unit, a combined product splitter unit, an invitation code binder unit, and a visitor verification unit. The order verification unit is connected to the amount calculation unit, the amount calculation unit is connected to the payment callback processor unit, the payment callback processor unit is connected to the combined product splitter unit, the invitation code binder unit and the data storage layer module respectively, the combined product splitter unit is connected to the data storage layer module, the invitation code binder unit is connected to the data storage layer module, and the visitor verification unit is connected to the data storage layer module; The order verification unit is used to uniformly perform customer qualification verification, customer type verification, regional authorization verification, product authorization verification, special product rule verification, first order activity verification, inventory verification, and base price payment verification when an order is submitted. The amount calculation unit is used to recalculate the total order price and the amount payable based on first-order promotions, gift-with-purchase promotions, bundled products, and minimum price payment rules. The payment callback processor unit is used to verify the payment signature, update the payment transaction and order status, and trigger the generation of commission snapshot, referral reward, gift record, customer message and ERP push after successful payment. The unique constraint prevents duplicate processing. The combined product splitter unit is used to split combined product orders into sub-product snapshots, and execute them by sub-product during inventory verification and ERP push. The invitation code binding unit is used to lock the invitation code and establish an invitation relationship after the registration review is approved and the business account is created, without deducting the invitation code during the registration submission stage; The visit verification unit is used to select target coordinates based on customer information status, calculate the spherical distance between the mobile terminal location and the target coordinates, and determine whether to allow the generation of visit records based on the configured threshold.
[0011] The data storage layer module includes a business master table unit, a product activity unit, an order flow unit, a snapshot reward unit, and a configuration log unit. The business main table unit is connected to the backend service layer module, the product activity unit is connected to the backend service layer module, the order flow unit is connected to the product activity unit and the snapshot reward unit respectively, the snapshot reward unit is connected to the backend service layer module, and the configuration log unit is connected to the backend service layer module; The main business table unit is used to store customer accounts, customer files, delivery addresses, business accounts, and business position data; The product activity unit is used to store product master data, product specifications, activity configuration, combined products and sub-product association data; The order log unit is used to store the order master record, order product details, gift records, payment records, and logistics information; The snapshot reward unit is used to save commission snapshots, invitation relationships, invitation rewards, combined product snapshots, and visit records; The configuration log unit is used to store delivery configuration, invitation configuration, system permission configuration, invitation code usage logs, and operation logs.
[0012] The external system interface module includes a payment interface unit, an ERP interface unit, a map interface unit, a logistics interface unit, a storage interface unit, and a message interface unit. The payment interface unit is connected to the backend service layer module, the communication software mini-program interface, and the B2B payment interface, respectively. The ERP interface unit is connected to the backend service layer module and the ERP system interface, respectively. The map interface unit is connected to the backend service layer module and the map parsing interface, respectively. The logistics interface unit is connected to the backend service layer module and the logistics query interface, respectively. The storage interface unit is connected to the backend service layer module and the object storage interface, respectively. The message interface unit is connected to the backend service layer module, the communication software message interface, and the communication software mini-program interface, respectively. The payment interface unit is used to select the corresponding mini-program appid, merchant number and callback address according to the order entry type, initiate B2B payment and process payment callback; The ERP interface unit is used to push customer information, order items, gifts and bundled product items to the ERP system, and receive outbound and shipment information returned by the ERP. The map interface unit is used to parse the province, city, district, street, and latitude and longitude of the enterprise's registered address and generate the points of the visit route; The logistics interface unit is used to obtain logistics trajectory through the express delivery interface and display it on the mobile terminal and the backend. The storage interface unit is used to upload and store product images, certificate images, and visit photos; The message interface unit is used to send notifications to operations personnel via WeChat and push messages to customers via mini-programs.
[0013] The visit record unit includes a coordinate correction subunit, a watermark generation subunit, and a route calculation subunit. The coordinate correction subunit is connected to the customer management unit and the backend service layer module respectively; the watermark generation subunit is connected to the coordinate correction subunit and the backend service layer module respectively; and the route calculation subunit is connected to the watermark generation subunit and the backend service layer module respectively. The coordinate correction subunit is used to submit a correction record by the business account when the customer's coordinates are incorrect. After the background review and approval, the coordinate and address fields in the customer's file are updated. The watermark generation subunit is used to overlay the date, serial number, customer name, address and remarks on the visit photos, and save the watermarked photos to the visit record; The route calculation subunit is used to calculate the route distance between adjacent visit records according to business account and date range, and generate map points and connection data for backend display.
[0014] The commission snapshot management unit includes a job matching subunit, a hierarchical parsing subunit, a snapshot generation subunit, and an idempotent control subunit. The job matching subunit is connected to the hierarchical parsing subunit, the hierarchical parsing subunit is connected to the snapshot generation subunit, the snapshot generation subunit is connected to the idempotency control subunit, and the idempotency control subunit is connected to the backend service layer module. The job matching subunit is used to find business positions with matching regional and product authorizations based on the province, city, district / county where the order customer is located and the order product ID. The hierarchical parsing subunit is used to parse the upper-level links starting from the hit business position, including regional manager, provincial manager, regional manager, business unit head and academic promotion manager; The snapshot generation subunit is used to generate commission data for each level based on each order's product, order amount, quantity, product commission rate, and business position commission rate. It is associated with the base price deduction in the base price payment scenario and adds the promotion manager commission field when the academic promotion scope is hit. The idempotent control subunit is used to prevent duplicate commission snapshots from being generated during duplicate payment callbacks, using the order ID, product ID, and job ID as unique keys.
[0015] The invitation management unit includes a reward calculation subunit, a relationship termination subunit, and a unique constraint subunit. The reward calculation subunit is connected to the commission snapshot management unit and the unique constraint subunit, respectively; the relationship termination subunit is connected to the reward calculation subunit; and the unique constraint subunit is connected to the backend service layer module. The reward calculation subunit is used to read the commission snapshot sales amount of the invited business account after the order is paid, generate the invitation sales reward according to the ordinary reward ratio, and generate the regional reward according to the regional reward ratio after promotion. The relationship termination subunit is used to terminate the invitation relationship when the business account status changes to "left", the invitee becomes a subordinate, or the configured number of days without valid orders is exceeded, while retaining historical reward data. The unique constraint subunit is used to prevent the same order from generating duplicate invitation rewards by using the invitation relationship ID, order ID, and reward type as a joint unique constraint, and to archive and delete the corresponding reward when the return is approved.
[0016] This invention discloses a pharmaceutical sales business management system. Through the collaborative operation of a mobile business mini-program module, a mobile customer mini-program module, a backend management module, a backend service layer module, a data storage layer module, and an external system interface module, it constructs a closed-loop management architecture covering the entire pharmaceutical distribution business chain, helping to eliminate data barriers between various business links. The mobile business mini-program module and the mobile customer mini-program module provide differentiated order entry points and product display logic for business personnel and customers, respectively. The backend management module uniformly maintains regional authorization, product authorization, job level, and task rules, ensuring that mobile order verification, customer list presentation, and product visibility are all based on the same authorization criteria, helping to reduce business disputes caused by duplicate regional authorization, unclear product attribution, and incorrect sales attribution. The order verification unit in the backend service layer module centrally handles multiple verifications upon order submission, including customer qualifications, customer type, additional authorization, regional authorization, special product rules, first-order promotions, bundled products, inventory, and minimum price payment. The amount calculation unit recalculates the order amount according to the activity rules, ensuring the consistency and accuracy of order data even in scenarios with multiple rules overlapping. The payment callback processor unit triggers commission snapshot generation, referral reward calculation, gift record saving, customer message push, and ERP push sequentially after successful payment. Unique constraints prevent duplicate processing, helping to avoid data omissions or duplications caused by excessively long payment callback chains. The bundled product splitter unit generates sub-product snapshots when an order is placed and executes them on a sub-product basis during inventory verification and ERP push, helping to ensure data traceability for bundled products across various business stages. The visit record unit dynamically selects coordinate sources for distance verification based on customer information status and generates visit photos and route data with watermarks. The backend can use this to review the visit process, improving the authenticity and verifiability of visit records. The invitation code binding unit locks the invitation code and establishes the invitation relationship only after registration approval and account creation. Invitation codes are not deducted during the registration submission stage, helping to avoid invalid applications occupying invitation codes and reducing the waste of invitation code resources. After return approval, the order return management unit synchronously updates the order status, processes refunds, restores inventory, and archives and deletes the corresponding commission snapshot and referral reward, helping to maintain final consistency between revenue data and order status. This invention enables unified processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management, thereby improving data consistency and system traceability in all aspects of pharmaceutical distribution business. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0018] Figure 1This is a schematic diagram of the structure of the drug sales business management system of the present invention.
[0019] Figure 2 This is a schematic diagram of the visitor record unit of the present invention.
[0020] Figure 3 This is a schematic diagram of the snapshot management unit of the present invention.
[0021] Figure 4 This is a schematic diagram of the invitation management unit of the present invention.
[0022] Figure 5 This is a business closed-loop flowchart of the present invention.
[0023] Figure 6 This is a flowchart of the client account to payment completion process of the present invention.
[0024] 1-Mobile Business Mini Program Module, 2-Mobile Customer Mini Program Module, 3-Backend Management Module, 4-Backend Service Layer Module, 5-Data Storage Layer Module, 6-External System Interface Module, 11-Registration Application Unit, 12-Customer Management Unit, 13-Product Inquiry Unit, 14-Customer Order Placement Unit, 15-Visit Record Unit, 16-Sales Data Unit, 21-Login Account Unit, 22-Shipping Address Management Unit, 23-Product Display Unit, 24-Shopping Cart Order Placement Unit, 25-Order Service Unit, 26-Message Notification Unit, 31-Business Account Management Unit, 32-Business Position Authorization Management Unit, 33-Customer File Management Unit, 34-Product Activity Management Unit, 35-Order Return Management Unit, 36-Commission Snapshot Management Unit, 37-Invitation Management Unit, 38-Visit Correction Management Unit, 41-Order Verification Units: 42-Amount Calculation Unit, 43-Payment Callback Processor Unit, 44-Combined Product Splitter Unit, 45-Invitation Code Binder Unit, 46-Visit Verifier Unit, 51-Business Master Table Unit, 52-Product Activity Unit, 53-Order Transaction Unit, 54-Snapshot Reward Unit, 55-Configuration Log Unit, 61-Payment Interface Unit, 62-ERP Interface Unit, 63-Map Interface Unit, 64-Logistics Interface Unit, 65-Storage Interface Unit, 66-Message Interface Unit, 151-Coordinate Correction Subunit, 152-Watermark Generation Subunit, 153-Route Calculation Subunit, 361-Job Matching Subunit, 362-Hierarchical Resolution Subunit, 363-Snapshot Generation Subunit, 364-Idempotent Control Subunit, 371-Reward Calculation Subunit, 372-Relationship Termination Subunit, 373-Unique Constraint Subunit. Detailed Implementation
[0025] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, but should not be construed as limiting the present invention.
[0026] Please see Figures 1-6 ,in, Figure 1 This is a schematic diagram of the structure of the drug sales business management system of the present invention; Figure 2 This is a schematic diagram of the visitor record unit of the present invention; Figure 3 This is a schematic diagram of the structure of the snapshot management unit of the present invention; Figure 4 This is a schematic diagram of the invitation management unit of the present invention; Figure 5 This is a business closed-loop flowchart of the present invention; Figure 6 This is a flowchart of the client account to payment completion process of the present invention.
[0027] This invention provides a pharmaceutical sales business management system, comprising a mobile business mini-program module 1, a mobile customer mini-program module 2, a backend management module 3, a backend service layer module 4, a data storage layer module 5, and an external system interface module 6. The mobile business mini-program module 1 includes a registration application unit 11, a customer management unit 12, a product query unit 13, a customer order placement unit 14, a visit record unit 15, and a sales data unit 16. The mobile customer mini-program module 2 includes a login account unit 21, a shipping address management unit 22, a product display unit 23, a shopping cart order placement unit 24, an order service unit 25, and a message notification unit 26. The backend management module 3 includes a business account management unit 31, a business position authorization management unit 32, a customer file management unit 33, a product activity management unit 34, an order return management unit 35, a commission snapshot management unit 36, an invitation management unit 37, and a visit correction management unit 38. The backend service layer module 4 includes an order verification unit 41, an amount calculation unit 42, a payment callback processor unit 43, a combined product splitter unit 44, and an invitation... The request code binding unit 45 and the visit verification unit 46; the data storage layer module 5 includes a business master table unit 51, a product activity unit 52, an order flow unit 53, a snapshot reward unit 54, and a configuration log unit 55; the external system interface module 6 includes a payment interface unit 61, an ERP interface unit 62, a map interface unit 63, a logistics interface unit 64, a storage interface unit 65, and a message interface unit 66; the visit record unit 15 includes a coordinate correction subunit 151, a watermark generation subunit 152, and a route calculation subunit 153. The commission snapshot management unit 36 includes a job matching subunit 361, a hierarchical parsing subunit 362, a snapshot generation subunit 363, and an idempotent control subunit 364; the invitation management unit 37 includes a reward calculation subunit 371, a relationship termination subunit 372, and a unique constraint subunit 373; the aforementioned scheme can achieve unified processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management, so as to improve the data consistency and system traceability of each link of the pharmaceutical distribution business.
[0028] In this specific embodiment, the mobile terminal business mini-program module 1 and the mobile terminal customer mini-program module 2 are respectively connected to the backend service layer module 4 via the network, the backend management terminal module 3 is connected to the backend service layer module 4 via the network, and the backend service layer module 4 is respectively connected to the data storage layer module 5 and the external system interface module 6; The mobile business mini-program module 1 is used for business accounts to perform registration applications, invitation code generation and use, customer query and addition, first-time business information submission, product query, order placement on behalf of customers, base price payment calculation, order query, visit photo taking, visit route viewing, sales data query and invitation reward query; The mobile customer mini-program module 2 is used for customer accounts to perform functions such as login, viewing and editing customer information, managing delivery addresses, browsing product lists, adding products to favorites, managing shopping carts, placing orders independently, making payments, applying for returns, applying for invoices, tracking logistics, and receiving message notifications. The back-end management module 3 is used by platform operators to perform business account management, business position management, customer file management, customer account management, product management, order management, payment transaction management, return management, invoicing management, commission snapshot management, visit record management, invitation configuration management, delivery configuration management, basic data management, and system permission management. The backend service layer module 4 is used to provide a unified service interface to complete business rule verification, data conversion, order status flow, external system calls and transaction processing; The data storage layer module 5 is used to store customer profiles, business accounts, business positions, product master data, order master data, order product details, payment records, commission snapshots, invitation relationships, invitation rewards, visit records, activity configurations, bundled products, delivery configurations, and system permission data. The external system interface module 6 is used to interface with communication software mini-program interfaces, B2B payment interfaces, ERP system interfaces, map parsing interfaces, logistics query interfaces, object storage interfaces, OCR recognition interfaces, and communication software message interfaces.
[0029] In this implementation, the mobile business mini-program module 1 is used by business accounts to perform functions such as registration application, invitation code generation and use, customer query and addition, submission of initial business information, product query, order placement on behalf of customers, calculation of minimum payment, order query, visit photo taking, visit route viewing, sales data query, and referral reward query. The mobile customer mini-program module 2 is used by customer accounts to perform functions such as login, viewing and editing customer information, managing shipping addresses, browsing product lists, adding products to favorites, managing shopping carts, customer self-ordering, payment, return application, invoicing application, logistics query, and message notification. The backend management module 3 is used by platform operators to perform functions such as business account management, business position management, customer file management, customer account management, product management, order management, payment transaction management, return management, invoicing management, commission snapshot management, visit record management, invitation configuration management, delivery configuration management, basic data management, and system permission management. The backend service layer module 4 provides a unified service interface to complete business rule verification, data conversion, order status transition, external system calls, and transaction processing. The data storage layer module 5 is compatible with historical business tables and saves newly added capabilities such as invitations, delivery, product combinations, first-order activities, visit assistance configurations, and task configurations through newly added business extension tables. Specifically, it stores customer profiles, business accounts, business positions, product master data, order master data, order product details, payment records, commission snapshots, invitation relationships, invitation rewards, visit records, activity configurations, product combinations, delivery configurations, and system permission data. The external system interface module 6 interfaces with WeChat Mini Program, B2B payment, ERP system, map parsing, logistics query, object storage, OCR recognition, and WeChat Work messaging interfaces. This system can achieve unified processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management to improve data consistency and system traceability across all aspects of the pharmaceutical distribution business.
[0030] The registration application unit 11 is connected to the customer management unit 12 and the backend service layer module 4. The customer management unit 12 is connected to the product query unit 13, the order placement unit 14, the visit record unit 15 and the backend service layer module 4. The product query unit 13 is connected to the order placement unit 14 and the backend service layer module 4. The order placement unit 14 is connected to the backend service layer module 4. The visit record unit 15 is connected to the backend service layer module 4. The sales data unit 16 is connected to the backend service layer module 4. The registration application unit 11 is used to collect applicant information and submit registration for review, and bind an invitation code after the review is passed; The customer management unit 12 is used to query the list of customers within the visible range based on the regional authorization and product authorization of the business position, and to add new customers or submit initial business information; The product query unit 13 is used to dynamically calculate and display available products based on customer identity, customer type, first-time customer status, activity rules, and additional sales authorization; The order placement unit 14 is used to select customers and products, submit orders, and verify the business position's regional permissions, product permissions, customer qualifications, inventory, first order promotions, bundled products, and minimum price payment rules. The visit record unit 15 is used to select a customer and submit the current location, visit photos, visit purpose and remarks, and select the target coordinate source for distance verification according to the customer information status, and generate a watermarked visit record and route data. The sales data unit 16 is used to display sales data, task completion status, and rankings for different ranges according to the business position level.
[0031] In this embodiment, the registration application unit 11 collects applicant information and submits it for registration review, and binds an invitation code after the review is passed. The specific processing logic is as follows: the applicant enters their name, mobile phone number, password, intended region, bank, account holder name, bank card number, bank name, and verification code. The server verifies the mobile phone number format, whether the account already exists, whether there are any unfinished registration applications, and whether the SMS verification code is valid. The invitation code is optional. During the submission stage, it can be verified that the invitation code exists and is not used, but the number of attempts is not deducted. After the registration application is written into the review data, the status is pending. After the background review is passed, a business account is created and an invitation code is attempted to be bound in the same transaction. Each business account can generate a limited number of invitation codes according to the configuration. The invitation code is used only once and supports idempotent keys to prevent duplicate generation. The technical feature of this logic is that the invitation code is not deducted during the registration submission stage, but is deducted and bound after the account is created after the review is passed, thereby avoiding invalid applications occupying invitation codes. The customer management unit 12 queries the customer list within the visible range according to the regional authorization and product authorization of the business position, and adds customers or submits initial business information. The specific processing logic is as follows: A customer list is obtained based on the business position's regional authorization, account level, and query conditions. When adding a new customer, information such as company name, business type, contact person, telephone number, detailed address, and customer type is collected. The server uses field aliases to ensure compatibility with mobile and historical business fields, writing customer information into the customer profile. Address information is divided into detailed address, company registered address, and delivery address. The server stores province, city, district / county, street, latitude and longitude, and address object respectively. The company registered address can automatically synchronize the warehouse address and default delivery address. When initial business data is submitted, the server updates the review fields such as business license, permit, purchase authorization, and delivery authorization according to the data scope. The date field performs validity period verification to prevent the submission of expired data. After customer data changes, a customer message reminder can be triggered to remind the customer account to check the data status. The product query unit 13 dynamically calculates and displays purchasable products based on customer identity, customer type, initial business status, activity rules, and additional sales authorization. The specific processing logic is as follows: The product list is filtered by category, keywords, activity status, purchased status, customer store, etc. The system determines whether a product is purchasable based on the customer's initial business status, customer type, and additional sales authorization. The product details section analyzes the main image, detail images, purchase specifications, product categories, business-side gifts with purchase, client-side gifts with purchase, first-order promotions, and bundled product details. It hides backend fields such as commission rates that are unsuitable for direct display on the client side. The favorites function links customer stores with products, and the favorites list returns favorite records and product summaries. The order placement unit 14 selects the customer and product, submits the order, and verifies the business unit's regional permissions, product permissions, customer qualifications, inventory, first-order promotions, bundled products, and minimum price payment rules.The specific processing logic is as follows: The server parses the store, product, quantity, shipping address, payment method, business position, payment amount, and activity fields from the order request. It verifies whether the store exists, whether the customer's first-time customer status allows ordering, whether the retail pharmacy has maintained the contract image, whether the product exists, whether the customer type can purchase it, whether additional sales authorization is allowed, and whether the business position has regional and product permissions. For orders placed on behalf of customers, it verifies whether the business position's mobile phone number matches the position ID and restricts orders from outside the region. Additional rule verification is performed for special products (e.g., products with specific control attributes are restricted from being ordered on behalf of customers). First-order activity verification (first-order bundled products can only be purchased once) and inventory verification (ordinary products are judged according to ERP inventory or local inventory; bundled products are first split into sub-products and then verified). If the base price payment is enabled, only business-side orders placed on behalf of customers are allowed, and the base price deduction amount is calculated according to the business position's commission ratio. If there is a first-order activity or bundled products, the server recalculates the total order price and the amount payable. An order master record and order product record are created to generate an order number. For bundled products, a snapshot of the sub-products at the time of ordering is generated for subsequent ERP splitting and amount tracking. After selecting a customer, the visit record unit 15 submits the current location, visit photo, visit purpose, and remarks. Based on the customer's profile status, it selects the target coordinate source for distance verification, generating a watermarked visit record and route data. The specific processing logic is as follows: After selecting a customer, the business account submits the current location, customer, photo, visit purpose, and remarks. The server reads the customer information and selects verification coordinates based on the customer's initial visit status (using the customer's detailed address coordinates when the information is incomplete, and using the company's registered address coordinates when the information is complete). The server reads the distance threshold configuration and calculates the spherical distance between the current location and the customer's target coordinates. If the current location or customer coordinates are missing, a clear prompt is returned; if the distance exceeds the threshold, the distance and allowed range are returned. Once the distance meets the rules, a visit photo record is generated, saving the business account, customer, location, address, visit purpose, photo, remarks, and time. The system calculates the visit sequence number for the same business account on the same day, the visit sequence number for the same customer, and the route distance between two adjacent visits, and adds watermark information to the photos (including date, sequence number, customer, address, and remarks). The system supports querying visit records by date range and generating map points and route data. If the customer's address coordinates are incorrect, the business side can submit a correction record, which will be updated after approval by the backend. Sales data unit 16 displays sales data, task completion status, and rankings for different ranges based on business position levels. The specific processing logic is as follows: salespersons can view their own customers, orders, sales revenue, task completion, number of visits, and product data; regional management positions can view business accounts, organizational structure, number of customers, sales ranking, and product sales within their visible range.The system calculates sales data by month, quarter, year, or custom time range. Data sources are based on orders, order items, commission snapshots, customer profiles, and visit records. The leaderboard supports regional display and drill-down to business positions. Product tasks are generated based on the key products and business position authorization relationships configured in the backend.
[0032] Secondly, the login account unit 21 is connected to the delivery address management unit 22, the product display unit 23, and the backend service layer module 4, respectively. The delivery address management unit 22 is connected to the shopping cart order unit 24 and the backend service layer module 4, respectively. The product display unit 23 is connected to the shopping cart order unit 24 and the backend service layer module 4, respectively. The shopping cart order unit 24 is connected to the order service unit 25 and the backend service layer module 4, respectively. The order service unit 25 is connected to the message notification unit 26 and the backend service layer module 4, respectively. The message notification unit 26 is connected to the backend service layer module 4. The login account unit 21 is used to support account and password login and quick login, and is associated with customer profiles and store information; The delivery address management unit 22 is used to save and manage multiple delivery addresses and synchronize the enterprise registration address as the default delivery address; The product display unit 23 is used to filter and display purchasable products based on the customer's first-time business status, customer type, and additional sales authorization, and hides the commission rate field from the client. The shopping cart ordering unit 24 is used to temporarily store the product selection and quantity, and to execute customer self-ordering and payment; The order service unit 25 is used to query the order list and details, submit return requests and invoice requests, and view the logistics trajectory; The message notification unit 26 is used to display messages categorized by order, data, and platform notification, and supports marking messages as read individually or in batches.
[0033] In this embodiment, the login account unit 21 supports account and password login and quick login, and is associated with customer profiles and store information. After logging in, the system reads the list of stores associated with the customer account and the customer profile. The customer can query service phone numbers, message lists, number of unread messages, invoicing information, and details of initial business information. The delivery address management unit 22 saves and manages multiple delivery addresses and synchronizes the enterprise registration address as the default delivery address. The delivery address saves the recipient, phone number, province, city, district / county, street, detailed address, latitude and longitude, and default marker. When the default delivery address is consistent with the enterprise registration address, the coordinates of the enterprise registration address can be synchronized. The product display unit 23 filters and displays purchasable products based on the customer's initial business status, customer type, and additional sales authorization, and hides the commission rate field from the client. The product display does not simply read the main product table, but dynamically calculates the purchasable status of products based on customer identity, store qualifications, activity rules, and authorization relationships. The shopping cart order unit 24 temporarily saves the product selection and quantity, and executes the customer's self-service order and payment. The temporary shopping cart synchronizes products, quantities, and specifications by account or store, supporting querying, synchronization, and clearing. The customer self-service order payment process is as follows: After logging in, the system first confirms the associated store, customer profile, data status, and shipping address. Then, based on customer type, product rules, inventory, promotions, and address information, it generates a pending payment order. Finally, payment is completed through the customer portal, and the order status and payment transaction history are updated. Order service unit 25 allows querying of order lists and details, submitting return and invoicing requests, and viewing logistics tracking. The order list is filtered by account, store, order status, time range, and order type. Order details return the order master information, product details, gifts, a snapshot of bundled products, payment history, shipping address, logistics, and return information. Customer return requests generate return details and return transaction numbers based on the order products. Invoicing requests generate invoicing records and invoicing numbers based on the order and customer invoicing information. Logistics tracking obtains the trajectory through the courier interface and displays it in the backend or on the mobile app. The message notification unit 26 displays messages categorized by order, data, and platform notification, and supports marking individual messages or batches as read. When an order status changes, a customer message can be generated and the mobile app's unread notification can be updated.
[0034] Meanwhile, the business account management unit 31 is connected to the business position authorization management unit 32, the business position authorization management unit 32 is connected to the customer file management unit 33, the product activity management unit 34 and the backend service layer module 4 respectively, the customer file management unit 33 is connected to the order return management unit 35 and the backend service layer module 4 respectively, the product activity management unit 34 is connected to the order return management unit 35 and the backend service layer module 4 respectively, the order return management unit 35 is connected to the commission snapshot management unit 36, the invitation management unit 37 and the backend service layer module 4 respectively, the commission snapshot management unit 36 is connected to the backend service layer module 4, the invitation management unit 37 is connected to the backend service layer module 4, and the visit correction management unit 38 is connected to the backend service layer module 4; The business account management unit 31 is used to add, edit, and delete business accounts, bind or transfer business positions, and synchronize account information to position data; The business position authorization management unit 32 is used to configure position levels, regional authorizations and product authorizations, perform authorization conflict checks, and set sales targets, customer targets and product sales targets. The customer file management unit 33 is used to maintain customer unit information, licenses and certificates, initial business information, registered address, detailed address and coordinates, parse address coordinates through map interface, and push information status change messages to customer accounts; The product activity management unit 34 is used to maintain product master data, listing status, specifications, commission rate, and to configure first order activities, gift-with-purchase activities, bundled products and additional sales authorizations; The order return management unit 35 is used to query and edit orders, submit ERP pushes, update logistics information, review return applications and execute refunds, inventory restoration and reverse processing of commission snapshots and referral rewards; The commission snapshot management unit 36 is used to automatically generate commission snapshots based on customer region, product authorization, business position level and order amount, and provides query, statistics and export functions; The invitation management unit 37 is used to maintain invitation code configuration, invitation code records, invitation relationships, usage logs and reward details, terminate invitation relationships and export data; The visit correction management unit 38 is used to query visit records and route data, review location correction applications, and update customer coordinates.
[0035] In this implementation, the business account management unit 31 adds, edits, and deletes business accounts, binds or transfers business positions, and synchronizes account information to position data. When adding an account, the name, mobile phone number, account status, review status, and entry date are verified, and the password is saved using a unified encryption method on the server side. Accounts can be bound to business positions, and when binding, the name, mobile phone number, avatar, ID, bank, and login information are synchronized to the position data. When an account is transferred to a position, the original position binding is cleared and the new position is synchronized. When the account status changes to "left," the end snapshot position is recorded, the position binding is cleared, and the relevant invitation relationship is terminated. When an account is deleted, the position binding relationship is cleared simultaneously. The business position authorization management unit 32 configures position levels, regional authorizations, and product authorizations, performs authorization conflict checks, and sets sales targets, customer targets, and product sales targets. When adding a business position, a business account is created simultaneously, and the account ID is written back to the position. Positions can be configured with type, superior, organization, business unit, business type, mobile phone number, avatar, and extended information. Regional authorizations are saved by province, city, district / county, and street, while product authorizations are saved by position and product. When adding new regions or product authorizations, the system checks whether there are already authorization conflicts for similar positions in the same region and product. Salesperson positions require regions to be accurate to the province, city, and district level; province-level positions can be configured by province or city. Academic promotion managers do not directly maintain ordinary region and product authorizations but use specified promotion scope configurations. The backend allows batch setting of sales targets, customer targets, and product sales targets. Preset tasks support automatic refresh to eligible sales positions based on basic targets, role multipliers, and key products. The technical feature of this logic is that regions, products, position levels, and task rules are maintained uniformly in the backend, and mobile orders, customer lists, product visibility, and commission snapshots all use the same authorization criteria.
[0036] Customer Profile Management Unit 33 maintains customer unit information, licenses, initial business information, registered address, detailed address, and coordinates. It parses address coordinates via a map interface and pushes information status change messages to customer accounts. Customer profiles store unit name, business type, ERP business type, customer type, contact person, licenses, authorization documents, registered address, detailed address, and customer account. Backend forms uniformly set default approval status and support conversion of data images, dates, and multi-value fields. The registered address can be parsed using a map interface to obtain province, city, district, street, and coordinates. During address correction, the system updates the customer's registered province, city, district, street, and coordinates based on the address parsing results. A default password is generated and bound to the store when a customer account is activated. Before submitting initial business information to the ERP, the server converts image fields to a structure recognizable by the old interface and maintains the submission range as a comma string. When the ERP returns a failure, the system transmits or explains the reason for the failure. After customer information changes, a message can be pushed to remind the customer to check the information status. Product Activity Management Unit 34 maintains product master data, listing status, specifications, commission rates, and configures first-order promotions, gift-with-purchase promotions, bundled products, and additional sales authorizations. The main product table maintains product name, specifications, manufacturer, ERP code, batch number, inventory, supply price, suggested retail price, customer type, image, and category. The percentage field is entered as a percentage in the backend and converted to a decimal for storage on the server. Product details load purchase specifications, business-side gifts with purchase, client-side gifts with purchase, first-order promotions, and bundled product details. First-order promotions are configured with activation time, status, and purchase limits for each product. Bundled products maintain fields for main product and sub-products, sub-product quantity, sub-product unit price, sorting, and activity snapshot. After a bundled product is ordered, it is split into sub-product snapshots for inventory, ERP, and cost tracking. Product listing status directly affects the mobile product list. Additional sales product configuration allows authorization of additional products for specific customers or the entire store, addressing supplementary sales scenarios when customer type and product type do not match. The order return management unit 35 queries and edits orders, submits ERP pushes, updates logistics information, reviews return applications, and executes refunds, inventory restoration, and reverse processing of commission snapshots and referral rewards. The order list supports filtering by status, order type, payment method, logistics type, ERP push status, and time range. Order details aggregate the main order table, customer, business position, product details, gifts, bundled product snapshots, return requests, and logistics tracking. When submitting to the ERP system in the backend, the system automatically completes the customer's ERP unit code, shipping address, and product details. Bundled products are split into sub-products when pushed to the ERP system, and gifts are added according to gift rules. After the ERP system returns outbound or shipment information, the system updates the ERP outbound tracking number, courier tracking number, shipment time, and order status. When returning an entire order in the backend, a return serial number and returned product details are generated. After the return is approved, the system updates the order to "returned," processes the refund, restores special price inventory, archives, and deletes the relevant commission snapshots and referral rewards for that order.Online refunds are processed through the B2B refund interface, while offline payment orders can be marked as refund completed. The commission snapshot management unit 36 automatically generates commission snapshots based on customer region, product authorization, business position level, and order amount, providing query, statistics, and export functions. The system searches for the corresponding business position based on the order customer's province, city, district / county, product ID, and business position authorization. Starting from the matched business position, it analyzes the upstream link (including roles such as region, province, region, business unit, and manager). For each product, a snapshot is generated based on the order amount, quantity, product commission rate, and business position commission rate. In the case of base price payment, the commission portion of the corresponding business position is associated with the base price deduction. If an academic promotion manager specifies a range, the corresponding promotion manager and promotion rate are recorded in the snapshot. Idempotent writes are used for the same order and product to prevent duplicate payment callbacks from being generated repeatedly. The backend can query, statistically analyze, and export commission snapshots by business account, product, month, region, order, and status. After a return is approved, the system archives and deletes the corresponding commission snapshot, retaining the deletion source for traceability. The technical feature of this logic is that the commission snapshot is not simply generated per person, but is calculated jointly by the customer region, product authorization, business position level, academic promotion scope, and order product amount. The invitation management unit 37 maintains invitation code configuration, invitation code records, invitation relationships, usage logs, and reward details, as well as terminating invitation relationships and exporting data. Invitation configuration includes the maximum number of invitation codes per person, the ordinary reward ratio, the regional reward ratio after promotion, the number of days to terminate a relationship with no valid orders for an extended period, and the activation status. Invitation code records save the invitation code, inviter, status, user, review application, and usage time. Invitation relationships are established after registration approval (recording the inviter, invitee, source review application, relationship status, and termination reason). Usage logs record reasons for success, skipping, and failure (including invitation code not existing, already used, inviter unavailable, invitee already having a relationship, etc.). After order payment, the system calculates the invitation reward based on the commission snapshot. Ordinary invitation rewards are calculated based on the commission snapshot sales amount of the invited business account, while regional rewards after promotion are calculated based on the commission snapshot sales amount of the invited business account within its superior region. Once a return is approved, the referral reward is archived and deleted. Referral relationships are terminated in scenarios such as the business account status ending, the invitee becoming a subordinate, or a prolonged period without valid orders, but historical rewards are retained. The backend can record the promotion status of invited business accounts and export the referral code, relationship, logs, and reward details. The Visit Correction Management Unit 38 queries visit records and route data, approves location correction applications, and updates customer coordinates. The visit record list can be filtered by business account, customer, date, region, and keywords. Visit details display the customer, business account, visit time, visit purpose, photos, address, latitude and longitude, and remarks. Route queries return map points and connecting data by business account and date range. Exporting generates detailed records by visit date and business account (including address, time, and photos for each visit).Location correction requests are submitted via mobile devices. Once approved in the backend, the customer's coordinates and address fields are updated, and the review results can be sent to the relevant accounts via message.
[0037] Additionally, the order verification unit 41 is connected to the amount calculation unit 42, the amount calculation unit 42 is connected to the payment callback processor unit 43, the payment callback processor unit 43 is connected to the combined product splitter unit 44, the invitation code binder unit 45 and the data storage layer module 5 respectively, the combined product splitter unit 44 is connected to the data storage layer module 5, the invitation code binder unit 45 is connected to the data storage layer module 5, and the visitor verification unit 46 is connected to the data storage layer module 5; The order verification unit 41 is used to uniformly perform customer qualification verification, customer type verification, regional authorization verification, product authorization verification, special product rule verification, first order activity verification, inventory verification, and base price payment verification when an order is submitted. The amount calculation unit 42 is used to recalculate the total order price and the amount payable based on the first order promotion, the gift-with-purchase promotion, the bundled products and the base price payment rules; The payment callback processor unit 43 is used to verify the payment signature, update the payment transaction and order status, and trigger the generation of commission snapshot, invitation reward, gift record, customer message and ERP push after successful payment, and prevent duplicate processing through unique constraints; The combined product splitter unit 44 is used to split the combined product order into sub-product snapshots and execute them by sub-product during inventory verification and ERP push. The invitation code binding unit 45 is used to lock the invitation code and establish an invitation relationship after the registration review is approved and the business account is created, and the invitation code is not deducted during the registration submission stage; The visit verification unit 46 is used to select target coordinates according to customer information status, calculate the spherical distance between the mobile terminal location and the target coordinates, and determine whether to allow the generation of visit records according to the configured threshold.
[0038] In this embodiment, the order verification unit 41 uniformly performs customer qualification verification, customer type verification, regional authorization verification, product authorization verification, special product rule verification, first-order activity verification, inventory verification, and minimum price payment verification when an order is submitted. The specific processing steps for determining if a customer can place an order are as follows: obtain the customer file and customer account; determine if the first-time customer status allows ordering through the current entry point; determine if the customer type is within the product's salable customer types; if the customer type does not match, query additional sales authorization; determine if the retail pharmacy has maintained the contract image; and return the reason for allowing or rejecting the order. The processing steps for determining regional and product authorization are as follows: read the business position type and authorized region; determine the regional matching precision according to the position type; match the customer's province, city, and district / county with the authorized region; read the authorized products for the business position; determine if the order's products fall within the authorized products; and check if other positions have duplicate authorizations for the same product and in the same region. The amount calculation unit 42 recalculates the total order price and payable amount based on the first-order activity, full-gift activity, bundled products, and minimum price payment rules. The specific processing steps are as follows: Parse the order's products and quantities; if a first-order promotion is found, mark it and verify if it has been used; if a combination of products is found, load the sub-products and their unit prices, recalculate the product line amount, select eligible gifts for "full-price promotions" based on thresholds, calculate deductions based on the commission ratio for business roles when paying the base price, and summarize the total order price, deductions, and payable amount. The payment callback processor unit 43 verifies the payment signature, updates the payment transaction history and order status, and triggers commission snapshot generation, referral reward generation, gift record generation, customer message generation, and ERP push notifications after successful payment, using unique constraints to prevent duplicate processing. The system reads different mini-program appids, merchant numbers, keys, and callback addresses based on the entry point, verifying that the order must be in a pending payment state before creating payment parameters. Self-ordered orders can only be paid through the customer entry point, while orders placed on behalf of customers can only be paid through the business entry point. The payment transaction number is generated based on the mobile phone number, date, and daily sequence number; the payment callback performs signature verification and status parsing. After successful payment, the system updates the payment transaction details, order amount, payment time, and WeChat order number. It then retrieves the order, customer, business role, product, and shipping address context, automatically generating commission snapshots, referral rewards, and customer messages, and automatically pushes them to the ERP system (recording results in case of failure and allowing background or scheduled task compensation). For duplicate payments, the system returns the processed result and does not generate duplicate commission snapshots or referral rewards. The combined product splitter unit 44 splits combined product orders into sub-product snapshots and executes them by sub-product during inventory verification and ERP push. The inventory verification and combined product splitting process is as follows: It identifies ordinary products and combined products; combined products are split by multiplying the quantity of sub-products by the purchase quantity; products with ERP codes and batch numbers are read from the ERP inventory; products without valid ERP codes are read from the local inventory; the purchase quantity of similar products is aggregated by product and batch number; the purchase quantity and inventory quantity are compared; and the system returns the product with sufficient inventory or a specific product with insufficient inventory.When pushing products to the ERP system, bundled products are split into sub-products, and gifts are added according to the gift rules. Invitation code binding unit 45 locks the invitation code and establishes an invitation relationship after the business account is created following registration approval. The invitation code is not deducted during the registration submission stage. This logic prevents invalid applications from occupying invitation codes, ensuring that the invitation code is only consumed after the business account is actually created. Visit verification unit 46 selects the target coordinates based on the customer's information status, calculates the spherical distance between the mobile device's location and the target coordinates, and determines whether to allow the generation of a visit record based on the configured threshold. The specific processing steps are: obtaining a snapshot of the business account, obtaining the customer profile and customer coordinates, selecting detailed address coordinates or enterprise registered address coordinates based on the customer's information status, reading the allowed distance threshold from the configuration, and calculating the distance between the current location and the customer's target coordinates using latitude and longitude. If the distance does not match, a distance explanation is returned; if the distance matches, the visit photo record is saved, a watermark is generated on the photo and the record is written back, and route points are calculated for display on the backend map.
[0039] Furthermore, the business main table unit 51 is connected to the backend service layer module 4, the product activity unit 52 is connected to the backend service layer module 4, the order flow unit 53 is connected to the product activity unit 52 and the snapshot reward unit 54 respectively, the snapshot reward unit 54 is connected to the backend service layer module 4, and the configuration log unit 55 is connected to the backend service layer module 4. The main business table unit 51 is used to store customer accounts, customer files, delivery addresses, business accounts, and business position data; The product activity unit 52 is used to store product master data, product specifications, activity configuration, combined products and sub-product association data; The order log unit 53 is used to store the order master record, order product details, gift records, payment records, and logistics information; The snapshot reward unit 54 is used to save commission snapshots, invitation relationships, invitation rewards, combined product snapshots, and visit records; The configuration log unit 55 is used to store delivery configuration, invitation configuration, system permission configuration, invitation code usage log, and operation log.
[0040] In this implementation, the business master table unit 51 stores customer accounts, customer profiles, shipping addresses, business accounts, and business position data. Customer accounts store login mobile phone number, password, openid, store association, and account status. Customer profiles store company name, business type, customer type, initial business information, registered address, detailed address, coordinates, and ERP code. Shipping addresses store the recipient, phone number, address, latitude and longitude, and default flags under the customer account. Business accounts store name, mobile phone number, password, avatar, ID, bank, account status, and approval status. Business positions store position type, superior, region, product, organization, mobile phone number, and business information. The product activity unit 52 stores product master data, product specifications, activity configuration, combined products, and sub-product association data. Product master data stores product name, specifications, price, ERP code, inventory, image, category, customer type, and commission rate. Activity configuration stores first-order activities, gift-with-purchase activities, customer gift-with-purchase activities, and additional sales authorization. Combined products store main product, sub-product, sub-product quantity, sub-product unit price, and sorting. Order Flow Unit 53 stores the master order record, order product details, gift records, payment flow, and logistics information. The master order record stores the order number, customer, amount, payment method, status, shipping address, logistics, and ERP push status. The order product details store the product, quantity, unit price, total price, activity tag, and return tag. The payment flow stores the payment transaction number, order, amount, status, WeChat order number, and payment time. Snapshot Rewards Unit 54 stores commission snapshots, invitation relationships, invitation rewards, bundled product snapshots, and visit records. The commission snapshot stores the order, product, customer region, business role link, sales amount, sales quantity, and commission data for each level. The invitation relationship stores the invitation code, inviter, invitee, relationship status, promotion status, and termination reason. The invitation reward stores the order, relationship, reward type, sales amount, percentage, reward amount, and status. The visit record stores the business account, customer, visit time, purpose, photo, address, latitude and longitude, route data, and remarks. Configuration log unit 55 stores delivery configuration, invitation configuration, system permission configuration, invitation code usage logs, and operation logs. Delivery configuration stores carriers, packaging materials, packaging rules, billing templates, deduction rules, and old version of freight savings.
[0041] Furthermore, the payment interface unit 61 is connected to the backend service layer module 4, the communication software applet interface, and the B2B payment interface, respectively; the ERP interface unit 62 is connected to the backend service layer module 4 and the ERP system interface, respectively; the map interface unit 63 is connected to the backend service layer module 4 and the map parsing interface, respectively; the logistics interface unit 64 is connected to the backend service layer module 4 and the logistics query interface, respectively; the storage interface unit 65 is connected to the backend service layer module 4 and the object storage interface, respectively; and the message interface unit 66 is connected to the backend service layer module 4, the communication software message interface, and the communication software applet interface, respectively. The payment interface unit 61 is used to select the corresponding mini-program appid, merchant number and callback address according to the order entry type, initiate B2B payment and process payment callback; The ERP interface unit 62 is used to push customer information, order items, gifts and bundled product items to the ERP system, and receive outbound and shipment information returned by the ERP. The map interface unit 63 is used to parse the province, city, district, street, and latitude and longitude of the enterprise's registered address and generate the points of the visit route; The logistics interface unit 64 is used to obtain the logistics trajectory through the express interface and display it on the mobile terminal and the backend. The storage interface unit 65 is used to upload and store product images, certificate images, and visit photos; The message interface unit 66 is used to send notifications to operations personnel via WeChat and push messages to customers via mini-programs.
[0042] In this embodiment, the payment interface unit 61 selects the corresponding mini-program appid, merchant number, and callback address based on the order entry type, initiates B2B payment, and processes the payment callback. The system distinguishes between customer entry and business entry to prevent different order types from using the wrong payment entry. The ERP interface unit 62 pushes customer information, order items, gifts, and bundled product sub-items to the ERP system and receives outbound and shipping information returned by the ERP. When the ERP push fails, the result is recorded and background or scheduled task compensation processing is allowed. Bundled products are split into sub-products when pushed to the ERP system, and gifts are added according to the gift rules. The map interface unit 63 parses the province, city, district, street, and latitude and longitude of the enterprise's registered address and generates the points of the visit route. The enterprise's registered address can be parsed using the map interface to obtain the province, city, district, street, and coordinates. When correcting the address, the system updates the customer's registered province, city, district, street, and coordinates based on the address reverse parsing result. The logistics interface unit 64 obtains the logistics trajectory through the express delivery interface and displays it on the mobile terminal and the backend. The storage interface unit 65 uploads and stores product images, certificate images, and visit photos. The message interface unit 66 sends notifications to operations staff via WeChat Work and pushes messages to customers via mini-programs. Customer messages are categorized into orders, data, and platform notifications, and support single-read and batch-read status.
[0043] Furthermore, the coordinate correction subunit 151 is connected to the customer management unit 12 and the backend service layer module 4 respectively, the watermark generation subunit 152 is connected to the coordinate correction subunit 151 and the backend service layer module 4 respectively, and the route calculation subunit 153 is connected to the watermark generation subunit 152 and the backend service layer module 4 respectively. The coordinate correction subunit 151 is used to submit a correction record by the business account when the customer's coordinates are incorrect. After the background review and approval, the coordinate and address fields in the customer's file are updated. The watermark generation subunit 152 is used to overlay the date, serial number, customer name, address and remarks on the visit photos, and save the watermarked photos to the visit record; The route calculation subunit 153 is used to calculate the route distance between adjacent visit records according to business account and date range, and generate map points and connection data for backend display.
[0044] In this embodiment, the coordinate correction subunit 151 submits a correction record from the business account when the customer's coordinates are incorrect. After the background review and approval, the coordinate and address fields in the customer's file are updated. Specifically, the business side can submit a correction record, and the background visit correction management unit 38 reviews the location correction application. After approval, the customer's coordinate and address fields are updated, and the review result can be notified to the relevant account via message. The watermark generation subunit 152 overlays the date, serial number, customer name, address, and remarks on the visit photo and saves the watermarked photo to the visit record. Specifically, the system adds watermark information to the photo. The watermark content includes the date, serial number, customer, address, and remarks. The visit record details display the customer, business account, visit time, visit purpose, photo, address, latitude and longitude, and remarks. The route calculation subunit 153 calculates the route distance between adjacent visit records according to the business account and date range, and generates map points and connection data for the background display. Specifically, the system calculates the visit sequence number of the same business account, the visit sequence number of the same customer, and the route distance between two adjacent visits on the same day. The background route query returns map points and connection data according to the business account and date range.
[0045] Wherein, the job matching subunit 361 is connected to the hierarchical parsing subunit 362, the hierarchical parsing subunit 362 is connected to the snapshot generation subunit 363, the snapshot generation subunit 363 is connected to the idempotency control subunit 364, and the idempotency control subunit 364 is connected to the backend service layer module 4; The job matching subunit 361 is used to find business positions with matching regional authorization and product authorization based on the province, city, district / county where the order customer is located and the order product ID; The hierarchical parsing subunit 362 is used to parse the upper-level links starting from the hit business positions, including regional managers, provincial managers, regional managers, business unit heads, and academic promotion managers. The snapshot generation subunit 363 is used to generate commission data for each level based on each order's product, order amount, quantity, product commission rate, and business position commission rate. In the case of base price payment, it is associated with base price deduction, and when the academic promotion scope is hit, the promotion manager commission field is added. The idempotent control subunit 364 is used to prevent duplicate commission snapshots from being generated during duplicate payment callbacks by using the order ID, product ID, and job ID as unique keys.
[0046] In this implementation, the job matching subunit 361 searches for business positions with matching regional and product authorizations based on the province, city, district / county where the order customer is located and the order product ID. Specifically, the system searches for matching business positions based on the province, city, district / county where the order customer is located, the product ID, and the business position authorization. The matching rules are based on the matching of the customer's region with the business position's regional authorization and the matching of product authorizations. The hierarchical parsing subunit 362 starts with the matching business position and parses its superior links, including regional managers, provincial managers, regional managers, business unit heads, and academic promotion managers. If there is a specified range for academic promotion managers, the corresponding promotion manager and promotion ratio are recorded in the snapshot. The snapshot generation subunit 363 generates commission data for each level based on each order product, order amount, quantity, product commission ratio, and business position commission ratio. In the case of base price payment, the base price is deducted, and when the academic promotion range is matched, the promotion manager commission field is added. A snapshot is generated for each product based on the order amount, quantity, product commission ratio, and business position commission ratio. In scenarios involving base price payments, the commission portion for the corresponding business role is associated with the base price deduction. The idempotent control subunit 364 uses the order ID, product ID, and job ID as unique keys to prevent duplicate commission snapshots from being generated during duplicate payment callbacks. Idempotent writes are used for the same order and product to prevent duplicate payment callbacks from being generated repeatedly. After successful payment, the system obtains the order, customer, business role, product, and shipping address context, automatically generates a commission snapshot, and returns a processed result to duplicate payment callbacks.
[0047] Finally, the reward calculation subunit 371 is connected to the commission snapshot management unit 36 and the unique constraint subunit 373 respectively, the relationship termination subunit 372 is connected to the reward calculation subunit 371, and the unique constraint subunit 373 is connected to the backend service layer module 4. The reward calculation subunit 371 is used to read the commission snapshot sales amount of the invited business account after the order payment, generate the invitation sales reward according to the ordinary reward ratio, and generate the regional reward according to the regional reward ratio after promotion. The relationship termination subunit 372 is used to terminate the invitation relationship when the business account status changes to "left", the invitee becomes a subordinate, or the configured number of days without valid orders is exceeded, and retains historical reward data. The unique constraint subunit 373 is used to use the invitation relationship ID, order ID and reward type as a joint unique constraint to prevent the same order from generating invitation rewards repeatedly, and to archive and delete the corresponding rewards when the return is approved.
[0048] In this embodiment, the reward calculation subunit 371 reads the commission snapshot sales amount of the invited business account after order payment, generates an invitation sales reward according to the normal reward ratio, and generates a regional reward according to the post-promotion regional reward ratio. The specific processing steps for generating invitation rewards are as follows: query whether the order has been paid and the status allows for reward generation, query the commission snapshot sales amount of the invited business account, generate an invitation sales reward according to the normal reward ratio, query the recorded promotion invitation relationship, and generate a post-promotion regional reward according to the commission snapshot sales amount of the region affiliation. The relationship termination subunit 372 terminates the invitation relationship when the business account status changes to "left," the invitee becomes a subordinate, or the configured number of days without valid orders is exceeded, and retains historical reward data. Scenarios such as the business account status ending, the invitee becoming a subordinate, and long-term absence of valid orders will terminate the invitation relationship, but historical rewards will be retained. The invitation configuration includes the number of days for relationship termination due to long-term absence of valid orders and the activation status. The unique constraint subunit 373 uses the invitation relationship ID, order ID, and reward type as a combined unique constraint to prevent the same order from generating duplicate invitation rewards. The reward is archived and deleted upon successful return approval. Using the relationship ID, order ID, and reward type as unique constraints prevents duplicate generation, and invitation rewards are simultaneously archived and deleted upon successful return approval.
[0049] To better understand the present invention, specific embodiments are listed below to illustrate the usage process of the system of the present invention.
[0050] Example 1: The business side places orders on behalf of customers and generates commission snapshots. Specifically, in this example, the business account selects customers and products on the mobile device. The server verifies the customer's initial business information, customer type, business position area, product authorization, and inventory through the order verification unit 41. If the product is a bundled product, the bundled product splitter unit 44 splits it into sub-products and verifies the inventory. If the product is part of a first-order promotion or a gift-with-purchase promotion, an promotion tag and gift data are generated. The business account selects a payment method and submits the order. After successful payment, the payment callback processor unit 43 updates the order status and generates commission snapshots, referral rewards, and customer messages. The server pushes the order products, gifts, and bundled product sub-items to the ERP system. The backend can view order details, commission snapshots, payment records, and ERP push results. The specific process for generating commission snapshots is as follows: The job matching subunit 361 searches for business positions with matching regional and product authorizations based on the order customer's province, city, district / county, and order product ID. The hierarchical parsing subunit 362 parses the upstream links (including regional managers, provincial managers, regional managers, business unit heads, and academic promotion managers) starting from the matched business position. The snapshot generation subunit 363 generates commission data for each level based on each order's product, order amount, quantity, product commission rate, and business position commission rate. In the case of base price payment, the base price is deducted. When the academic promotion scope is matched, the promotion manager commission field is added. The idempotency control subunit 364 uses the order ID, product ID, and job ID as unique keys to prevent duplicate generation.
[0051] Example 2: Customers place orders and apply for returns independently. Specifically, in this example, after logging into the mini-program, the customer selects a store. The system displays available products according to the store's customer type and first-time customer status. The customer submits the order, and the server verifies the inventory, promotions, shipping address, and payment information. After successful payment, the system generates a commission snapshot and a message notification. The customer submits a return request in the order details. After the backend approves the request, the system updates the order to "returned," processes the refund, inventory, commission snapshot, and referral rewards. The client receives the order status message. The reverse processing after the return is approved includes: updating the order to "returned," processing the refund, restoring special-price inventory, archiving and deleting the relevant commission snapshot and referral rewards for the order, and retaining the source of the deletion for traceability.
[0052] Example 3: Business Visit Photo Taking and Backend Route Verification. Specifically, in this example, the business account selects a customer on the mobile device and submits the current location and a visit photo. The visit verification unit 46 selects the target coordinates based on the customer's information status (using the customer's detailed address coordinates when the information is incomplete, and using the company's registered address coordinates when the information is complete). The visit verification unit 46 calculates the spherical distance between the mobile device's location and the target coordinates, and saves the visit photo record if it meets the rules. The watermark generation subunit 152 overlays the date, serial number, customer name, address, and remarks information onto the visit photo, and saves the watermarked photo to the visit record. The route calculation subunit 153 generates route points according to the visit time. The backend views the visit record, photos, and map route by business account and date. If the customer coordinates are incorrect, the business account submits a correction record, and the backend updates the customer coordinates after approval.
[0053] Example 4: Invitation Registration and Reward Generation. Specifically, in this example, the business account generates an invitation code on the mobile device. The applicant fills in the invitation code and submits a verification code during registration. The system writes the registration review application without deducting the invitation code. After the backend review is approved, a business account is created, and the invitation code binding unit 45 locks the invitation code and establishes an invitation relationship. After the invited business account completes a valid order, the reward calculation subunit 371 calculates the invitation reward based on the commission snapshot (generating an invitation sales reward according to the normal reward ratio and a regional reward according to the post-promotion regional reward ratio). If the invited business account is subsequently recorded as promoted, subsequent orders can generate post-promotion regional rewards. The unique constraint subunit 373 uses the invitation relationship ID, order ID, and reward type as a combined unique constraint to prevent the same order from generating duplicate invitation rewards. The backend can query the invitation code, invitation relationship, usage log, and reward details. The relationship termination subunit 372 terminates the invitation relationship and retains historical reward data when the business account status changes to "left," the invitee becomes a subordinate, or the configured number of days without valid orders is exceeded.
[0054] The pharmaceutical sales business management system of this invention constructs a closed-loop management architecture covering the entire pharmaceutical distribution business chain through the collaborative cooperation of a mobile business mini-program module 1, a mobile customer mini-program module 2, a backend management module 3, a backend service layer module 4, a data storage layer module 5, and an external system interface module 6. This helps to eliminate data barriers between various business links. The mobile business mini-program module 1 and the mobile customer mini-program module 2 provide differentiated order entry points and product display logic for business personnel and customers, respectively. The backend management module 3 uniformly maintains regional authorization, product authorization, job level, and task rules, ensuring that mobile order verification, customer list presentation, and product visibility are all based on the same authorization criteria. This helps reduce business disputes caused by duplicate regional authorization, unclear product attribution, and incorrect sales attribution. The order verification unit 41 in the backend service layer module 4 centrally handles multiple verifications upon order submission, including customer qualifications, customer type, additional authorization, regional authorization, special product rules, first-order promotions, bundled products, inventory, and minimum price payment. The amount calculation unit 42 recalculates the order amount according to the activity rules, ensuring the consistency and accuracy of order data even in scenarios with multiple rules overlapping. The payment callback processor unit 43 triggers commission snapshot generation, referral reward calculation, gift record saving, customer message push, and ERP push sequentially after successful payment. Unique constraints prevent duplicate processing, helping to avoid data omissions or duplications caused by excessively long payment callback chains. The bundled product splitter unit 44 generates sub-product snapshots when an order is placed and executes them by sub-product during inventory verification and ERP push, helping to ensure data traceability for bundled products across various business stages. The visit record unit 15 dynamically selects coordinate sources for distance verification based on customer information status and generates visit photos and route data with watermarks. The backend can use this to review the visit process, improving the authenticity and verifiability of visit records. The invitation code binding unit 45 locks the invitation code and establishes the invitation relationship only after registration approval and account creation. Invitation codes are not deducted during the registration submission stage, helping to avoid invalid applications occupying invitation codes and reducing the waste of invitation code resources. After return approval, the order return management unit 35 synchronously updates the order status, processes refunds, restores inventory, and archives and deletes the corresponding commission snapshot and referral reward, helping to maintain final consistency between revenue data and order status. This invention enables unified processing of customer qualification verification, regional and product authorization, multi-rule order verification, commission snapshot generation, visit process tracking, and invitation relationship management, thereby improving data consistency and system traceability in all aspects of pharmaceutical distribution business.
[0055] The above-disclosed embodiments are merely one or more preferred embodiments of this application and should not be construed as limiting the scope of this application. Those skilled in the art can understand that all or part of the processes for implementing the above embodiments and equivalent changes made in accordance with the claims of this application still fall within the scope of this application.
Claims
1. A pharmaceutical sales business management system, characterized in that, It includes a mobile business mini-program module, a mobile customer mini-program module, a backend management module, a backend service layer module, a data storage layer module, and an external system interface module; The mobile terminal business mini-program module and the mobile terminal customer mini-program module are respectively connected to the backend service layer module through the network. The backend management terminal module is connected to the backend service layer module through the network. The backend service layer module is respectively connected to the data storage layer module and the external system interface module. The mobile business mini-program module is used for business accounts to perform registration applications, invitation code generation and use, customer query and addition, first-time business information submission, product query, order placement on behalf of customers, base price payment calculation, order query, visit photo taking, visit route viewing, sales data query and invitation reward query; The mobile customer mini-program module is used for customer accounts to log in, view and edit customer information, manage shipping addresses, browse product lists, add products to favorites, manage shopping carts, place orders independently, make payments, apply for returns, apply for invoices, track logistics, and receive message notifications. The back-end management module is used by platform operators to perform business account management, business position management, customer file management, customer account management, product management, order management, payment transaction management, return management, invoicing management, commission snapshot management, visit record management, invitation configuration management, delivery configuration management, basic data management, and system permission management. The backend service layer module is used to provide a unified service interface to complete business rule verification, data conversion, order status flow, external system calls and transaction processing. The data storage layer module is used to store customer profiles, business accounts, business positions, product master data, order master data, order product details, payment records, commission snapshots, invitation relationships, invitation rewards, visit records, activity configurations, bundled products, delivery configurations, and system permission data. The external system interface module is used to interface with communication software mini-program interfaces, B2B payment interfaces, ERP system interfaces, map parsing interfaces, logistics query interfaces, object storage interfaces, OCR recognition interfaces, and communication software message interfaces.
2. The drug sales business management system as described in claim 1, characterized in that, The mobile business mini-program module includes a registration application unit, a customer management unit, a product query unit, a customer order placement unit, a visit record unit, and a sales data unit. The registration application unit is connected to the customer management unit and the backend service layer module respectively. The customer management unit is connected to the product query unit, the order placement unit, the visit record unit and the backend service layer module respectively. The product query unit is connected to the order placement unit and the backend service layer module respectively. The order placement unit is connected to the backend service layer module. The visit record unit is connected to the backend service layer module. The sales data unit is connected to the backend service layer module. The registration application unit is used to collect applicant information and submit registration for review, and bind an invitation code after the review is approved; The customer management unit is used to query the list of customers within the visible range based on the regional and product authorization of the business position, and to add new customers or submit initial business information; The product query unit is used to dynamically calculate and display available products for purchase based on customer identity, customer type, first-time customer status, activity rules, and additional sales authorization; The order placement unit is used to select customers and products, submit orders, and verify the business unit's regional permissions, product permissions, customer qualifications, inventory, first-order promotions, bundled products, and minimum price payment rules. The visit record unit is used to select a customer and submit the current location, visit photos, visit purpose and remarks, and select the target coordinate source for distance verification based on the customer information status, and generate a watermarked visit record and route data; The sales data unit is used to display sales data, task completion status, and leaderboards for different business positions.
3. The drug sales business management system as described in claim 2, characterized in that, The mobile client mini-program module includes a login account unit, a shipping address management unit, a product display unit, a shopping cart order placement unit, an order service unit, and a message notification unit; The login account unit is connected to the shipping address management unit, the product display unit, and the backend service layer module, respectively. The shipping address management unit is connected to the shopping cart ordering unit and the backend service layer module, respectively. The product display unit is connected to the shopping cart ordering unit and the backend service layer module, respectively. The shopping cart ordering unit is connected to the order service unit and the backend service layer module, respectively. The order service unit is connected to the message notification unit and the backend service layer module, respectively. The message notification unit is connected to the backend service layer module. The login account unit is used to support account and password login and quick login, and is associated with customer profiles and store information; The delivery address management unit is used to save and manage multiple delivery addresses and synchronize the enterprise's registered address as the default delivery address; The product display unit is used to filter and display purchasable products based on the customer's first-time customer status, customer type, and additional sales authorization, and hides the commission rate field from the client. The shopping cart ordering unit is used to temporarily store product selections and quantities, and to execute customer self-ordering and payment; The order service unit is used to query the order list and details, submit return requests and invoice requests, and view the logistics track; The message notification unit is used to display messages categorized by order, data, and platform notification, and supports marking messages as read individually or in batches.
4. The drug sales business management system as described in claim 3, characterized in that, The back-end management module includes a business account management unit, a business position authorization management unit, a customer file management unit, a product activity management unit, an order return management unit, a commission snapshot management unit, an invitation management unit, and a visit correction management unit; The business account management unit is connected to the business position authorization management unit. The business position authorization management unit is connected to the customer file management unit, the product activity management unit, and the backend service layer module. The customer file management unit is connected to the order return management unit and the backend service layer module. The product activity management unit is connected to the order return management unit and the backend service layer module. The order return management unit is connected to the commission snapshot management unit, the invitation management unit, and the backend service layer module. The commission snapshot management unit is connected to the backend service layer module. The invitation management unit is connected to the backend service layer module. The visit correction management unit is connected to the backend service layer module. The business account management unit is used to add, edit, and delete business accounts, bind or transfer business positions, and synchronize account information to position data; The business position authorization management unit is used to configure position levels, regional authorizations and product authorizations, perform authorization conflict checks, and set sales targets, customer targets and product sales targets. The customer file management unit is used to maintain customer unit information, licenses and certificates, initial business information, registered address, detailed address and coordinates, parse address coordinates through map interface, and push information status change messages to customer accounts; The product activity management unit is used to maintain product master data, listing status, specifications, commission rate, and to configure first-order activities, gift-with-purchase activities, bundled products, and additional sales authorizations. The order return management unit is used to query and edit orders, submit ERP push notifications, update logistics information, review return applications, and execute refunds, inventory restoration, and reverse processing of commission snapshots and referral rewards. The commission snapshot management unit is used to automatically generate commission snapshots based on customer region, product authorization, business position level and order amount, and provides query, statistics and export functions; The invitation management unit is used to maintain invitation code configuration, invitation code records, invitation relationships, usage logs and reward details, terminate invitation relationships and export data; The visit correction management unit is used to query visit records and route data, review location correction applications, and update customer coordinates.
5. The drug sales business management system as described in claim 4, characterized in that, The backend service layer module includes an order verification unit, an amount calculation unit, a payment callback processor unit, a combined product splitter unit, an invitation code binder unit, and a visitor verification unit; The order verification unit is connected to the amount calculation unit, the amount calculation unit is connected to the payment callback processor unit, the payment callback processor unit is connected to the combined product splitter unit, the invitation code binder unit and the data storage layer module respectively, the combined product splitter unit is connected to the data storage layer module, the invitation code binder unit is connected to the data storage layer module, and the visitor verification unit is connected to the data storage layer module; The order verification unit is used to uniformly perform customer qualification verification, customer type verification, regional authorization verification, product authorization verification, special product rule verification, first order activity verification, inventory verification, and base price payment verification when an order is submitted. The amount calculation unit is used to recalculate the total order price and the amount payable based on first-order promotions, gift-with-purchase promotions, bundled products, and minimum price payment rules. The payment callback processor unit is used to verify the payment signature, update the payment transaction and order status, and trigger the generation of commission snapshot, referral reward, gift record, customer message and ERP push after successful payment. The unique constraint prevents duplicate processing. The combined product splitter unit is used to split combined product orders into sub-product snapshots, and execute them by sub-product during inventory verification and ERP push. The invitation code binding unit is used to lock the invitation code and establish an invitation relationship after the registration review is approved and the business account is created, without deducting the invitation code during the registration submission stage; The visit verification unit is used to select target coordinates based on customer information status, calculate the spherical distance between the mobile terminal location and the target coordinates, and determine whether to allow the generation of visit records based on the configured threshold.
6. The drug sales business management system as described in claim 5, characterized in that, The data storage layer module includes a business master table unit, a product activity unit, an order transaction unit, a snapshot reward unit, and a configuration log unit; The business main table unit is connected to the backend service layer module, the product activity unit is connected to the backend service layer module, the order flow unit is connected to the product activity unit and the snapshot reward unit respectively, the snapshot reward unit is connected to the backend service layer module, and the configuration log unit is connected to the backend service layer module; The main business table unit is used to store customer accounts, customer files, delivery addresses, business accounts, and business position data; The product activity unit is used to store product master data, product specifications, activity configuration, combined products and sub-product association data; The order log unit is used to store the order master record, order product details, gift records, payment records, and logistics information; The snapshot reward unit is used to save commission snapshots, invitation relationships, invitation rewards, combined product snapshots, and visit records; The configuration log unit is used to store delivery configuration, invitation configuration, system permission configuration, invitation code usage logs, and operation logs.
7. The drug sales business management system as described in claim 6, characterized in that, The external system interface module includes a payment interface unit, an ERP interface unit, a map interface unit, a logistics interface unit, a storage interface unit, and a message interface unit; The payment interface unit is connected to the backend service layer module, the communication software mini-program interface, and the B2B payment interface, respectively. The ERP interface unit is connected to the backend service layer module and the ERP system interface, respectively. The map interface unit is connected to the backend service layer module and the map parsing interface, respectively. The logistics interface unit is connected to the backend service layer module and the logistics query interface, respectively. The storage interface unit is connected to the backend service layer module and the object storage interface, respectively. The message interface unit is connected to the backend service layer module, the communication software message interface, and the communication software mini-program interface, respectively. The payment interface unit is used to select the corresponding mini-program appid, merchant number and callback address according to the order entry type, initiate B2B payment and process payment callback; The ERP interface unit is used to push customer information, order items, gifts and bundled product items to the ERP system, and receive outbound and shipment information returned by the ERP. The map interface unit is used to parse the province, city, district, street, and latitude and longitude of the enterprise's registered address and generate the points of the visit route; The logistics interface unit is used to obtain logistics trajectory through the express delivery interface and display it on the mobile terminal and the backend. The storage interface unit is used to upload and store product images, certificate images, and visit photos; The message interface unit is used to send notifications to operations personnel via WeChat and push messages to customers via mini-programs.
8. The drug sales business management system as described in claim 7, characterized in that, The visit record unit includes a coordinate correction subunit, a watermark generation subunit, and a route calculation subunit; The coordinate correction subunit is connected to the customer management unit and the backend service layer module respectively; the watermark generation subunit is connected to the coordinate correction subunit and the backend service layer module respectively; and the route calculation subunit is connected to the watermark generation subunit and the backend service layer module respectively. The coordinate correction subunit is used to submit a correction record by the business account when the customer's coordinates are incorrect. After the background review and approval, the coordinate and address fields in the customer's file are updated. The watermark generation subunit is used to overlay the date, serial number, customer name, address and remarks on the visit photos, and save the watermarked photos to the visit record; The route calculation subunit is used to calculate the route distance between adjacent visit records according to business account and date range, and generate map points and connection data for backend display.
9. The pharmaceutical sales management system as described in claim 8, characterized in that, The commission snapshot management unit includes a job matching subunit, a hierarchical parsing subunit, a snapshot generation subunit, and an idempotent control subunit. The job matching subunit is connected to the hierarchical parsing subunit, the hierarchical parsing subunit is connected to the snapshot generation subunit, the snapshot generation subunit is connected to the idempotency control subunit, and the idempotency control subunit is connected to the backend service layer module. The job matching subunit is used to find business positions with matching regional and product authorizations based on the province, city, district / county where the order customer is located and the order product ID. The hierarchical parsing subunit is used to parse the upper-level links starting from the hit business position, including regional manager, provincial manager, regional manager, business unit head and academic promotion manager; The snapshot generation subunit is used to generate commission data for each level based on each order's product, order amount, quantity, product commission rate, and business position commission rate. It is associated with the base price deduction in the base price payment scenario and adds the promotion manager commission field when the academic promotion scope is hit. The idempotent control subunit is used to prevent duplicate commission snapshots from being generated during duplicate payment callbacks, using the order ID, product ID, and job ID as unique keys.
10. The drug sales business management system as described in claim 9, characterized in that, The invitation management unit includes a reward calculation subunit, a relationship termination subunit, and a unique constraint subunit; The reward calculation subunit is connected to the commission snapshot management unit and the unique constraint subunit, respectively; the relationship termination subunit is connected to the reward calculation subunit; and the unique constraint subunit is connected to the backend service layer module. The reward calculation subunit is used to read the commission snapshot sales amount of the invited business account after the order is paid, generate the invitation sales reward according to the ordinary reward ratio, and generate the regional reward according to the regional reward ratio after promotion. The relationship termination subunit is used to terminate the invitation relationship when the business account status changes to "left", the invitee becomes a subordinate, or the configured number of days without valid orders is exceeded, while retaining historical reward data. The unique constraint subunit is used to prevent the same order from generating duplicate invitation rewards by using the invitation relationship ID, order ID, and reward type as a joint unique constraint, and to archive and delete the corresponding reward when the return is approved.