16、查看是否有没有物品ID的编码存在(既没有物品的ID被导入临时表cux_bill_temp中)
select row_num
from cux_bill_temp
where assembly_item_id is null or component_item_id is null;
17、对其中导入的数据进行处理
update cux_bill_temp
set OPTIONAL=1
where upper(OPTIONAL_disp) like 'Y%';
update cux_bill_temp
set OPTIONAL=2
where OPTIONAL is null;
update cux_bill_temp
set MUTUALLY_EXCLUSIVE_OPTIONS=1
where upper(MUTUALLY_EXCLUSIVE_O_DISP) like 'Y%';
update cux_bill_temp
set MUTUALLY_EXCLUSIVE_OPTIONS=2
where MUTUALLY_EXCLUSIVE_O_DISP is null;
18、查看cux_bill_temp中的数据处理是否有漏
select count(*)
from cux_bill_temp
where OPTIONAL is null
or MUTUALLY_EXCLUSIVE_OPTIONS is null
or assembly_item_id is null
or component_item_id is null;
19、更新其内的WIP_SUPPLY_TYPE;
update cux_bill_temp
set WIP_SUPPLY_TYPE=6
where component_item like 'B%';
20、删除表中的包(cux_bill_temp中),其相对应于表bom_bill_of_materials(既在表中已经存在了些选项包,不必导入包头,只需导入包内容既可)
delete cux_bill_temp t
where exists (select null from bom_bill_of_materials where assembly_item_id=t.assembly_item_id and organization_id=2);
21、利用已经写好的包写入数据(既写入接口表bom_bill_of_mtls_interface)
exec cux_bom_temp.insert_bill_15(1);
select count(*) from cux_bill_temp temp
where exits (select null from bom_inventory_components b
where temp.bill_sequence_id=b.bill_sequence_id
and temp.component_item_id=b.component_item_id);
delete cux_bill_temp temp
where exists (select null from bom_inventory_components b
where b.bill_sequence_id=temp.bill_sequence_id
and b.component_item_id=temp.component_item_id);
exec cux_bom_temp.insert_bill_10(1);
22、对写入的数据在接口表中的情况进行查看
select count(*) from bom_bill_of_mtls_interface;
23、接着更新
exec cux_bom_temp.insert_bill_15(1);
select count(*) from cux_bill_temp where bill_sequence_id is null;
exec cux_bom_temp.insert_bill_20(1);
去提交请求
select count(*) from bom_inventory_comps_interface;
(导入成功后)对组件进行排序
exec cux_bom_temp.update_bill_item_num4;
select count(*) from bom_inventory_comps_interface;
24、对于接口表中的数据进行导入
delete bom_bill_of_mtls_interface;
insert into bom_bill_of_mtls_interface(
assembly_type,assembly_item_id,
organization_id,
process_flag,transaction_type)
select distinct 1,assembly_item_id,
1,
1,'CREATE'
from cux_bill_temp;
