zoukankan      html  css  js  c++  java
  • ERP系统里的BOM展开函数

     

    ERP系统里的BOM展开函数:

    l_grp_id                      NUMBER                  ;
    l_session_id                    NUMBER                  ;
    l_org_id                        NUMBER           ;
    l_levels_to_explode             NUMBER  :=  10              ;
    l_module                        NUMBER  DEFAULT 2       ; -- BOM = 2
    l_cst_type_id                   NUMBER  DEFAULT -1      ; -- All cost = -1 else 0
    l_item_id                       NUMBER                  ;
    l_bom_or_eng                    NUMBER                  ;
    l_using_req_quantity            NUMBER                  ;
    l_using_ass_dem_date    DATE                    ;
    l_rev_date                      VARCHAR2(20):=  to_char(bom_dt,'DD-MON-YY HH24:MI');
    l_err_msg                       VARCHAR2(250)           ;
    l_error_code                    NUMBER                  ;

    BEGIN
                    -- 首先要有一个Group id
                    SELECT  bom_explosion_temp_s.NEXTVAL
                    INTO       l_grp_id               
                    FROM    dual    ;

                    -- 其次要得到一个Session id
                    SELECT  bom_explosion_temp_session_s.NEXTVAL
                    INTO       l_session_id
                    FROM    dual    ;

                    bompexpl.exploder_userexit(
                            verify_flag                    =>0,
                            org_id                          =>l_org_id,
                            order_by                      =>1,
                            grp_id                          =>l_grp_id,
                            session_id                    =>l_session_id,
                            levels_to_explode        =>l_levels_to_explode,
                            bom_or_eng                 =>l_bom_or_eng,
                            impl_flag                     =>1,
                            plan_factor_flag          =>2,
                            explode_option           =>2, -- 2,
                            module                        =>l_module,
                            cst_type_id                =>l_cst_type_id,
                            std_comp_flag           =>2,
                            expl_qty                    =>1,
                            item_id                      =>l_item_id,
                            alt_desg                     =>'',
                            comp_code                =>'',
                            rev_date                    =>l_rev_date,
                            err_msg                     =>l_err_msg,
                            error_code                 =>l_error_code
                            );

              END ;

    运行结束后用以下语句得到结果.
    SELECT *  FROM  bom_explosion_temp bet
      WHERE      bet.group_id         = l_grp_id

  • 相关阅读:
    Spring基于注解整合Redis实现内容缓存
    配置Mybatis二级缓存为Redis来实现内容缓存
    Spring整合Redis
    Java连接redis
    机器学习之 KNN近邻算法(一)入门
    matplotlib 之 快速入门
    Pandas 之入门
    Hadoop 之 环形缓冲区原理
    numpy 之 rollaxis的理解
    python 之 遇到SyntaxError: Non-UTF-8 code starting with 'xb8' in file
  • 原文地址:https://www.cnblogs.com/keim/p/2372965.html
Copyright © 2011-2022 走看看