观察和删除月结执行结果数据
select sum(t.prod_weight),sum(t.lc_weight) from hot_production_mes_jg t where t.acct_period = '2026-02' and t.prod_type in ('在产品');
delete hot_production_mes_jg t where t.acct_period = '2026-02';
select count(1) from HOT_HEAT_PRODUCTION_MES_GX t where t.acct_period = '2026-02' and t.prod_type in ('在产品');
delete HOT_HEAT_PRODUCTION_MES_GX t where t.acct_period = '2026-02';
select * from HOT_PRODUCTION_MES_RZ t where t.acct_period = '2026-02' and t.prod_type in ('在产品');
delete HOT_PRODUCTION_MES_RZ t where t.acct_period = '2026-02' and t.prod_type in ('在产品') ;
select count(1) from CX_YDM_BC_INITIAL t where t.bal_year_month = '2026-02';
delete CX_YDM_BC_INITIAL t where t.bal_year_month = '2026-02';
select * from CX_YDM_BC_INLIST t where t.bal_year_month = '2026-02';
delete CX_YDM_BC_INLIST t where t.bal_year_month = '2026-02';
select count(1) from CX_YDM_BC_OUTLIST t where t.bal_year_month = '2026-02';
delete CX_YDM_BC_OUTLIST t where t.bal_year_month = '2026-02' ;
select count(1) from CX_YDM_ZC_INITIAL t where t.bal_year_month = '2026-02';
delete CX_YDM_ZC_INITIAL t where t.bal_year_month = '2026-02';
select count(1),sum(t.act_in_weight),sum(t.act_in_count) from CX_YDM_ZC_INLIST t where t.bal_year_month = '2026-02';
delete CX_YDM_ZC_INLIST t where t.bal_year_month = '2026-02' ;
select count(1),sum(t.act_out_weight),sum(t.act_out_count),sum(t.differential) from CX_YDM_ZC_OUTLIST t where t.bal_year_month = '2026-02';
delete CX_YDM_ZC_OUTLIST t where t.bal_year_month = '2026-02' ;
月份改为当月02和次月03 (需要重新确认一次) mes_cx_jg_zxnew_hand
-- mes_cx_jg_zxnew_hand 存储过程SQL占位符
-- 实际SQL内容将在后续更新
CREATE OR REPLACE PROCEDURE mes_cx_jg_zxnew_hand
IS
BEGIN
-- 处理逻辑
NULL;
END;
mes_cx_rcl_zxnew_hand mes_cx_rz_zxnew_hand MES_CX_YDM_BC_INITIAL_hand mes_cx_ydm_bc_inlist_csjg_hand
mes_cx_ydm_bc_inlist_new_hand mes_cx_ydm_bc_outlist_csjg
mes_cx_ydm_bc_outlist_new_hand
mes_cx_ydm_zc_initialnew_hand mes_cx_ydm_zc_inlist_new_hand mes_cx_ydm_zc_outlist_new_hand mes_cx_JG_zzpnew_hand mes_cx_rcl_zzpnew_hand mes_cx_rz_zzpnew_hand mes_cx_jg_CSJG_HAND
直接执行就好,这些存储过程里面开了事务
校验数据情况
BEGIN
usp_ValidateProductionData('2026-02');
END;
select problem, yearmonth, material_no, create_time, problem_type from DataValidationResult t where t.yearmonth = '2026-02';
成品台账不连续: TQ0218312001410B 支数: 本月期初=60支 ≠ 计算值=58支 (上月期初=33 + 入库=36 - 出库=11); 重量: 本月期初=81.561t ≠ 计算值=78.776t (上月期初=40.134 + 入库=55.258 - 出库=16.616) 2026-02 TQ0218312001410B 2026-02-24 13:50:51 台账期初差异 成品台账不连续: TQAA18212001411B重量: 本月期初=39.825t ≠ 计算值=39.411t (上月期初=46.446 + 入库=-7.035 - 出库=0) 2026-02 TQAA18212001411B 2026-02-24 13:50:51 台账期初差异 成品台账不连续: TQ8818312001410B重量: 本月期初=17.197t ≠ 计算值=17.152t (上月期初=409.454 + 入库=196.974 - 出库=589.276) 2026-02 TQ8818312001410B 2026-02-24 13:50:51 台账期初差异 成品台账不连续: TQ6400106600305A重量: 本月期初=1318.366t ≠ 计算值=1316.671t (上月期初=1448.088 + 入库=1849.375 - 出库=1980.792) 2026-02 TQ6400106600305A 2026-02-24 13:50:52 台账期初差异 成品台账不连续: TQ8818312001410A重量: 本月期初=9.414t ≠ 计算值=7.754t (上月期初=38.16 + 入库=-30.406 - 出库=0) 2026-02 TQ8818312001410A 2026-02-24 13:50:52 台账期初差异 成品台账不连续: TBAA18212000411C重量: 本月期初=6.616t ≠ 计算值=6.947t (上月期初=8.938 + 入库=-1.991 - 出库=0) 2026-02 TBAA18212000411C 2026-02-24 13:50:53 台账期初差异 成品台账不连续: TD4610704874412C重量: 本月期初=6131.27t ≠ 计算值=6132.876t (上月期初=0 + 入库=6132.876 - 出库=0) 2026-02 TD4610704874412C 2026-02-24 13:50:56 台账期初差异 成品台账不连续: TQ0218210501411B重量: 本月期初=34.002t ≠ 计算值=39.951t (上月期初=59.82 + 入库=-18.064 - 出库=1.805) 2026-02 TQ0218210501411B 2026-02-24 13:50:57 台账期初差异 成品台账不连续: TB0618312201412C 支数: 本月期初=8支 ≠ 计算值=0支 (上月期初=4 + 入库=0 - 出库=4); 重量: 本月期初=.502t ≠ 计算值=0t (上月期初=14.27 + 入库=0 - 出库=14.27) 2026-02 TB0618312201412C 2026-02-24 13:51:01 台账期初差异 成品台账不连续: TQ9618312007410B 支数: 本月期初=227支 ≠ 计算值=215支 (上月期初=0 + 入库=215 - 出库=0); 重量: 本月期初=360.956t ≠ 计算值=355.3t (上月期初=0 + 入库=355.3 - 出库=0) 2026-02 TQ9618312007410B 2026-02-24 13:51:01 台账期初差异 成品台账不连续: TQAD18212001410B 支数: 本月期初=3支 ≠ 计算值=5支 (上月期初=19 + 入库=96 - 出库=110); 重量: 本月期初=4.73t ≠ 计算值=7.648t (上月期初=31.688 + 入库=152.857 - 出库=176.897) 2026-02 TQAD18212001410B 2026-02-24 13:51:02 台账期初差异 成品台账不连续: TQAD18312001411B重量: 本月期初=203.707t ≠ 计算值=204.447t (上月期初=12.688 + 入库=1339.846 - 出库=1148.087) 2026-02 TQAD18312001411B 2026-02-24 13:51:05 台账期初差异 成品台账不连续: TQ0218312001410A重量: 本月期初=6.899t ≠ 计算值=125.741t (上月期初=224.988 + 入库=-99.247 - 出库=0) 2026-02 TQ0218312001410A 2026-02-24 13:51:10 台账期初差异 半成品台账不连续: TQAD18212001411B重量: 本月期初=3.618t ≠ 计算值=3.986t (上月期初=102.088 + 入库=102.996 - 出库=201.098) 2026-02 TQAD18212001411B 2026-02-24 13:51:11 台账期初差异 半成品台账不连续: TQ0218312001410B 支数: 本月期初=11支 ≠ 计算值=15支 (上月期初=14 + 入库=42 - 出库=41); 重量: 本月期初=16.117t ≠ 计算值=22.281t (上月期初=20.721 + 入库=65.11 - 出库=63.55) 2026-02 TQ0218312001410B 2026-02-24 13:51:11 台账期初差异 半成品台账不连续: TQAA18212001411B重量: 本月期初=13.089t ≠ 计算值=12.721t (上月期初=3.66 + 入库=21.802 - 出库=12.741) 2026-02 TQAA18212001411B 2026-02-24 13:51:11 台账期初差异 成品台账物料缺失: TQ0318312007410B 上月有业务但本月无期初 2026-02 TQ0318312007410B 2026-02-24 13:51:13 台账期初差异 成品台账物料缺失: TQAF18312007410B 上月有业务但本月无期初 2026-02 TQAF18312007410B 2026-02-24 13:51:13 台账期初差异 物料编码(MATE_CODE)为空 2026-02 2026-02-24 13:51:13 非空字段校验 物料编码(MATE_CODE)为空 2026-02 2026-02-24 13:51:13 非空字段校验 物料编码(MATE_CODE)为空 2026-02 2026-02-24 13:51:13 非空字段校验 物料编码(MATE_CODE)为空 2026-02 2026-02-24 13:51:13 非空字段校验 热轧生产月报物料不存在于收发存: 2026-02 2026-02-24 13:51:14 物料编码存在性 总问题数: 23 2026-02 2026-02-24 13:51:14 汇总结果