当前位置:网站首页>Scheme design of meal return process of performance system
Scheme design of meal return process of performance system
2022-07-22 09:08:00 【WannaRunning】
goods SKU Model
In our system , The product configuration is usually a SKU A dish label , This is usually the case SKU The ratio between the quantity and the quantity of the single item after the final split is 1:1, That's one SKU( A dish ), Generate a production order . But there are also some special product configurations N The number of dishes is N individual SKU As a SPU Sell , This situation sku The ratio to the production order is N:1, That is to say N individual SKU(N A dish ) Generate a corresponding production order .
Split design of performance production sheet
After receiving the order, the manufacturing order will be created by splitting each order , The design of making and splitting orders is based on sku Split into one production item for minimum granularity , The same sku O 'clock N Share corresponds to N Make items .
for example : Hot spring egg SPU Configure to 3 A dish label . Create an order as Hot spring egg * 5
After order splitting , Will generate 2 Make items
1. Hot spring egg * 3
2. Hot spring egg * 2
Based on this split order, create a production order , Products in each production line SKU The quantity is not necessarily one , But at least one , At most SPU Specified in the special configuration SKU Number . Therefore, in the production order, there are products included when the production order is created SKU Total quantity , The current refundable quantity is also recorded .
Single dish return function design
The return request includes the return order and the item to be returned sku And the number of dishes to be returned , The background completes the deduction of the specified dishes in the production order under the specified order according to the parameters .
- Press skuCode Group switching Map<skuCode,List<MakeOrderItem>> structure ,key Corresponding skuCode,value It is all the items in the current order skuCode The production item collection of corresponding commodities . There is at least one quantity of goods in each production line
- Press skuCode The grouping is converted to Map<skuCode,List<OrderReturnProductItem>>, Every skuCode Of List<OrderReturnProductItem> A collection of size That is, the skuCode The number of returned dishes .
- Traverse the set of returned dishes after grouping Map<skuCode,List<OrderReturnProductItem>> Take a skuCode The corresponding number of dishes to be returned needReturnNum( The quantity of current dishes to be returned in this request ).
- In the cycle of step three , From step one map Take out the corresponding skuCode A collection of production orders makeOrderItemList( This... In the current order sku The corresponding set of production orders that can be returned ).
- Traverse the production list makeOrderItemList aggregate , Take the quantity of returnable dishes of each production item in turn canReturnNum value , The number of returned dishes needReturnNum Do decrement , namely needReturnNum = needReturnNum - canReturnNum, When needReturnNum Decrement to 0 End the traversal of this step . As for why we need to take it here canReturnNum The value has been analyzed above , Because there are sku And the dishes may be 1:N Of , This situation sku The quantity is not equal to the quantity of returnable dishes .
- Continue with step 345 Move on to the next skuCode Deduction of the number of corresponding dishes .
Take the above example as an example
- The two production items in the original order go through skuCode After grouping, it corresponds to 1 in Map<skuCode,List<MakeOrderItem>> structure ;
- Before traversing to the first MakeOrderItem Time current MakeOrderItem Quantity deduction in , As the leg is a dish, only one quantity needs to be deducted , This one MakeOrderItem The quantity in is enough to deduct, so the deduction operation of returning vegetables is over .
Through the steps 345 The deduction operation of returning vegetables , The change of the final production sheet is shown in the figure below
边栏推荐
- js 判断数据是否为空
- How to build a smart park with 5g and mobile edge computing servers
- Conversion of JS time and timestamp
- SQL子查询
- C textbox password box setting
- leetCode-12: 整数转罗马数字
- Pipes, redirects, and regular expressions
- 三星6818芯片火焰报警器驱动的编写
- Cannot read property ‘type‘ of undefined Occurred while linting **\index.jsx:1
- Writing of ultrasonic ranging driver based on [Samsung 6818] chip
猜你喜欢
管正雄:基于预训练模型、智能运维的QA生成算法落地
Error: a connection was successfully established with the server, but
Rewrite dispatchtouchevent to realize the function of playing picture lock
A custom control for picture selection
Commonly used instructions in RT thread
线程池七大参数
Openlayers uses canvas to draw round avatar icons
openlayers 使用canvas绘制圆形头像图标
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
科创人·观远数据CEO苏春园:让业务用起来,是BI行业推倒渗透率之墙的关键
随机推荐
Using OpenGL texture array to realize high-precision real-time LUT filter
Must use destructuring props assignmenteslint
监督学习(回归、分类问题)与无监督学习(聚类问题)
Commonly used instructions in RT thread
js判断是否为整数
Rk3288 detailed explanation of LVDS signal configuration and 1080p video signal
Token
开户华泰证券安全吗,在哪开靠谱一些
三星6818基于uboot的流水灯程序
海思[Hi3531]onvif协议实现基于gsoap和openssl_代码篇
was安装器启动报错
openlayers 使用canvas绘制圆形头像图标
NodeJS使用Express框架进行POST请求报“BadRequestError:request aborted”
Login shell and non login shell
Is Huatai app safe to open an account, and is the Commission very high
Vscode configuration code automatic formatting and repair
JVM 简介
2.4. 特殊概要文件的属性
js 判断数据是否为空
cocoapod安装问题