Prechádzať zdrojové kódy

修正文档

Signed-off-by: zhangguo <zhangguo@qq.com>
zhangguo 2 týždňov pred
rodič
commit
b9b198a033

+ 1 - 1
MES_FIN_MONTH/FinMES202602/mes_cx_ydm_bc_inlist_csjg_hand.md

@@ -1,4 +1,4 @@
-# mes_cx_rz_zxnew_hand 存储过程(什么什么热轧)
+# mes_cx_ydm_bc_inlist_CSJG_hand 存储过程(什么什么热轧)
 
 ## 模板下载
 

+ 45 - 21
MES_FIN_MONTH/FinMES202602/mes_cx_ydm_bc_inlist_new_hand.md

@@ -13,10 +13,10 @@
 ## 原始脚本内容
 
 ```sql
-CREATE OR REPLACE procedure mes_cx_ydm_bc_inlist_CSJG_hand is
+CREATE OR REPLACE procedure mes_cx_ydm_bc_inlist_new_hand is
   a                 number(4);
   b                 varchar(200);
-  cxdata            orderdetail_v@th_cx_link%rowtype;
+  cxdata            mvm_order_matno_info%rowtype;
   prod_name_cx      varchar(200);
   prod_code_cx      varchar(200);
   sg_grade_cx       varchar(200);
@@ -71,10 +71,27 @@ CREATE OR REPLACE procedure mes_cx_ydm_bc_inlist_CSJG_hand is
                       nvl(replace(pro_order_no, '/', ''),
                           replace(get_cp_order(t1.judge_stove_no), '/', ''))) is_lljg,
            --是否来料加工,
-           '加工' process_name,
+           (case process_desc
+              when '轧制' then
+               '热轧'
+              when '加工线' then
+               '加工'
+              else
+               process_desc
+            end) process_name,
            --工序,
-           '否' is_ckc,
+
+          -- '否' is_ckc,
            --是否出口材
+           (case
+           when nvl(mvm.if_export,'内贸') ='内贸' then
+            '否'
+           when nvl(mvm.if_export,'内贸') ='外贸' then
+            '是'
+           else
+            '否'
+           end) is_ckc,
+
            act_dimater dimater,
            --外径
            act_height height,
@@ -84,18 +101,25 @@ CREATE OR REPLACE procedure mes_cx_ydm_bc_inlist_CSJG_hand is
            --合同号
            model_desc,
            -- 扣型描述
+           instock_type_name,
+           --入库类型
            get_cp_buyer(get_cp_order(t1.judge_stove_no)) buyer,
            --客户名称
-           get_cp_pass(get_cp_order(t1.judge_stove_no)) pass --孔型
-      from ydm_zc_inlist t1
-     where instock_type_code in ('800701', '800702', '800706')--产出盘盈改判
-        and BAL_YEAR_MONTH = '202602'
-       and belong_code in ('100101', '100102', '100105')
-       and supply_unit_code = '120504'
+           substr(get_cp_pass(get_cp_order(t1.judge_stove_no)),0,3) pass --孔型
+
+      from ydm_bc_inlist t1,mvm_order_matno_info mvm--增加mvm
+
+     where nvl(replace(PRO_ORDER_NO, '/', ''),
+                replace(get_cp_order(t1.judge_stove_no), '/', '')) = mvm.CONTRACTNO_NUM
+
+       and t1.bal_year_month in ('202602')
+       and t1.belong_code = '002023005'
+       and instock_type_code in ('800704','800706','800709')--红冲改判产权
+       and t1.judge_stove_no in( 'C26020471')
        and nvl(replace(pro_order_no, '/', ''),
                replace(get_cp_order(t1.judge_stove_no), '/', '')) not like
            'ZZBY%'
-       AND T1.PLINE_CODE = 'C108'
+       --and t1.judge_stove_no like 'D25060024%'
      group by bal_year_month, spec_code,
               --产品规格代码,
               produccode,
@@ -109,7 +133,7 @@ CREATE OR REPLACE procedure mes_cx_ydm_bc_inlist_CSJG_hand is
               act_height,
               --壁厚
               model_desc, t1.pro_order_no, t1.order_no, t1.order_seq,
-              spec_code, spec_name;
+              spec_code, spec_name,mvm.if_export,t1.instock_type_name;
 
   curoporder oporder_cursor%rowtype;
 
@@ -123,7 +147,7 @@ begin
 
     select count(*)
       into a
-      from orderdetail_v@th_cx_link t
+      from mvm_order_matno_info t
      where t.contractno_num = curoporder.orderid
        and material_code is not null;
 
@@ -133,7 +157,7 @@ begin
         into prod_code_cx, prod_name_cx, sg_grade_cx, sg_gradename_cx,
              sg_sign_cx, sg_signname_cx, wall_thickness_cx, material_code_cx,
              material_name_cx
-        from orderdetail_v@th_cx_link t
+        from mvm_order_matno_info t
        where t.contractno_num = curoporder.orderid
          and material_code is not null
          and rownum = 1;
@@ -141,7 +165,7 @@ begin
     elsif substr(curoporder.orderid, 1, 2) in ('TH', 'XS') then
       select count(*)
         into a
-        from orderdetail_v@th_cx_link t
+        from mvm_order_matno_info t
        where substr(t.contractno_num, 3) = substr(curoporder.orderid, 3)
          and material_code is not null
          and rownum = 1;
@@ -151,7 +175,7 @@ begin
           into prod_code_cx, prod_name_cx, sg_grade_cx, sg_gradename_cx,
                sg_sign_cx, sg_signname_cx, wall_thickness_cx,
                material_code_cx, material_name_cx
-          from orderdetail_v@th_cx_link t
+          from mvm_order_matno_info t
          where substr(t.contractno_num, 3) = substr(curoporder.orderid, 3)
            and material_code is not null
            and rownum = 1;
@@ -165,7 +189,7 @@ begin
          gradename, steelcode, steelname, act_count, act_weight,
          act_in_count, act_in_weight, act_out_count, act_out_weight, is_lljg,
          process_name, is_ckc, dimater, height, pass, model_desc, buyer,
-         orderid, bc_type, judge_stove_no, instock_time,INSERT_TIME)
+         orderid, bc_type, judge_stove_no, instock_time,INSERT_TIME,bak1)
       values
         (curoporder.bal_year_month, curoporder.ckmc, material_code_cx,
          material_name_cx, curoporder.spec_code,
@@ -178,7 +202,7 @@ begin
          curoporder.process_name, curoporder.is_ckc, curoporder.dimater,
          curoporder.height, curoporder.pass, curoporder.model_desc,
          curoporder.buyer, curoporder.orderid, '半成品入库',
-         curoporder.judge_stove_no, curoporder.instock_time,sysdate);
+         curoporder.judge_stove_no, curoporder.instock_time,sysdate,curoporder.instock_type_name);
 
     else
       insert into cx_ydm_bc_inlist
@@ -187,7 +211,7 @@ begin
          gradename, steelcode, steelname, act_count, act_weight,
          act_in_count, act_in_weight, act_out_count, act_out_weight, is_lljg,
          process_name, is_ckc, dimater, height, pass, model_desc, buyer,
-         orderid, bc_type, judge_stove_no, instock_time)
+         orderid, bc_type, judge_stove_no, instock_time,bak1)
       values
         (curoporder.bal_year_month, curoporder.ckmc, null, null,
          curoporder.spec_code, null, curoporder.std_code,
@@ -198,7 +222,7 @@ begin
          curoporder.is_lljg, curoporder.process_name, curoporder.is_ckc,
          curoporder.dimater, curoporder.height, curoporder.pass,
          curoporder.model_desc, curoporder.buyer, curoporder.orderid,
-         '半成品入库', curoporder.judge_stove_no, curoporder.instock_time);
+         '半成品入库', curoporder.judge_stove_no, curoporder.instock_time,curoporder.instock_type_name);
     end if;
 
   end loop;
@@ -210,5 +234,5 @@ begin
   exception
     when others then
       null;*/
-end mes_cx_ydm_bc_inlist_CSJG_hand;
+end mes_cx_ydm_bc_inlist_new_hand;
 ```

+ 1 - 1
MES_FIN_MONTH/FinMES202602/mes_cx_ydm_bc_outlist_csjg.md

@@ -1,4 +1,4 @@
-# mes_cx_ydm_bc_outlist_csjg 存储过程(什么什么热轧)
+# mes_cx_ydm_bc_outlist_csjg 存储过程
 
 ## 模板下载
 

+ 6 - 6
MES_FIN_MONTH/FinMES202602/mes_cx_ydm_zc_initialnew_hand.md

@@ -46,7 +46,7 @@ begin
               else
                process_desc
             end) end as process_name, 
-
+            
             --'否' as is_ckc, 
              (case
              when nvl(t2.if_export,'内贸') ='内贸' then
@@ -56,7 +56,7 @@ begin
              else
               '否'
             end) is_ckc, 
-
+            
             dimater, height,
            get_cp_pass(nvl(t1.pro_order_no, get_cp_order(t1.judge_stove_no))) as pass,
            model_desc,
@@ -64,11 +64,11 @@ begin
                              get_cp_order(t1.judge_stove_no))) as buyer,
            nvl(replace(t1.pro_order_no, '/', ''),nvl(t1.order_no||t1.order_seq,replace(get_cp_order(t1.judge_stove_no), '/', ''))) as orderid,
            '成品期初库存' as bc_type, t1.judge_stove_no,T1.instock_time,SYSDATE
-
+           
       from cxuser.ydm_zc_initial t1, mvm_order_matno_info t2 --增加MVN
-
+      
      where nvl(replace(t1.pro_order_no, '/', ''),nvl(t1.order_no||t1.order_seq,replace(get_cp_order(t1.judge_stove_no), '/', ''))) =t2.contractno_num(+)
-
+           
        and t1.handle_log = '1'
        and t1.bal_year_month in ('202602')
        and belong_code in ('100101', '100102', '100105')
@@ -104,7 +104,7 @@ begin
   commit;
 
   /*
-
+  
   exception
     when others then
       null;*/