--事件定义
IF NOT EXISTS (SELECT 1 FROM t_evt_event WHERE FID = 1335488651035173888)
INSERT INTO t_evt_event(FID,FMODIFYDATE,FTYPE,FSCENE,FCREATEDATE,FOPERATION,FDESCRIPTION,FENTITY,FOPERNUMBER,FSTATUS,FNUMBER,FNAME,FMODIFIER,FSOURCE,FCREATER) VALUES (1335488651035173888,{ts'2022-01-17  00:00:00'},'cosmic','operate',{ts'2022-01-17  00:00:00'},'审核',' ','bd_materialmftinfo','audit','1','bd_materialmftinfo.audit',' ',8638558,'15IWD0BF6M6/',8638558); 

IF NOT EXISTS (SELECT 1 FROM t_evt_event_l WHERE FPKID = '2606=YXK2MZO')
INSERT INTO t_evt_event_l(FID,FPKID,FLOCALEID,FDESCRIPTION,FNAME) VALUES (1335488651035173888,'2606=YXK2MZO','zh_CN','物料生产信息审核后自动生成BOM版本','物料生产信息.审核'); 
IF NOT EXISTS (SELECT 1 FROM t_evt_event_l WHERE FPKID = '2606=YXK2MZP')
INSERT INTO t_evt_event_l(FID,FPKID,FLOCALEID,FDESCRIPTION,FNAME) VALUES (1335488651035173888,'2606=YXK2MZP','zh_TW','物料生產信息審核後自動生成BOM版本',' '); 
--事件参数
IF NOT EXISTS (SELECT 1 FROM t_evt_eventconfig WHERE FENTRYID = 1335488651035173889)
INSERT INTO t_evt_eventconfig(FID,FCONFIGDESCRIPTION,FCONFIGTYPE,FISTRANSFER,FENTRYID,FSEQ,FCONFIGNUMBER,FISCUSTOM,FCONFIGNAME) VALUES (1335488651035173888,'返回结果类型为:实体','{"description":"返回结果类型为:实体","entityid":"bos_org","type":"DynamicObject","ismulti":false}','1',1335488651035173889,1,'createorg','0','生产信息创建组织'); 
IF NOT EXISTS (SELECT 1 FROM t_evt_eventconfig WHERE FENTRYID = 1335488651035173890)
INSERT INTO t_evt_eventconfig(FID,FCONFIGDESCRIPTION,FCONFIGTYPE,FISTRANSFER,FENTRYID,FSEQ,FCONFIGNUMBER,FISCUSTOM,FCONFIGNAME) VALUES (1335488651035173888,'返回结果类型为:实体','{"description":"返回结果类型为:实体","entityid":"bd_bomversionrule_new","type":"DynamicObject","ismulti":false}','1',1335488651035173890,2,'bomversionrule','0','BOM版本规则'); 
IF NOT EXISTS (SELECT 1 FROM t_evt_eventconfig WHERE FENTRYID = 1335488651035173891)
INSERT INTO t_evt_eventconfig(FID,FCONFIGDESCRIPTION,FCONFIGTYPE,FISTRANSFER,FENTRYID,FSEQ,FCONFIGNUMBER,FISCUSTOM,FCONFIGNAME) VALUES (1335488651035173888,'返回结果类型为:实体','{"description":"返回结果类型为:实体","entityid":"bd_material","type":"DynamicObject","ismulti":false}','1',1335488651035173891,3,'masterid','0','物料编码'); 

--事件订阅 物料生产信息审核后同步修改BOM组件的物料属性
DELETE FROM t_evt_subscription WHERE FID = 1616797946873906176;
INSERT INTO t_evt_subscription(FID,FMODIFYDATE,FCONDITION,FSERVICENUMBER,FCREATEDATE,FSEQUENCE,FISCONCURRENT,FSTATUS,FNOTIFYTEXT,FSERVICE,FNUMBER,FNAME,FSERVICECONFIG,FEXPRESSION,FMODIFIER,FEVENT,FERRORNOTIFY,FEVENTNUMBER,FTIMINGSTRATEGY,FERRORSTRATEGY,FCREATER) VALUES (1616797946873906176,{ts'2023-02-09  00:00:00'},' ','executePlugin',{ts'2023-02-09  00:00:00'},0,'1','1',' ',904236026388547584,'bd_materialmftinfo.audit.executeSynBOMPlugin','物料生产信息.审核.执行插件','{"scriptid":"","type":"class","value":"{\"appid\":\"sbd\",\"class\":\"kd.bd.sbd.business.event.MaterialMFTInfoAuditSynBOM\"}"}',' ',1600618438999408640,1335488651035173888,' ','bd_materialmftinfo.audit',' ','ignore',1600618438999408640); 

-- 事件订阅-多语言：物料生产信息审核后同步修改BOM组件的物料属性
DELETE FROM t_evt_subscription_l WHERE FPKID = '31KXR+2TANX4';
INSERT INTO t_evt_subscription_l(FID,FPKID,FLOCALEID,FNAME) VALUES (1616797946873906176,'31KXR+2TANX4','zh_CN','物料生产信息.审核.执行插件'); 

