/*  creator：IERP
请将脚本交给基础服务组的同事放到预插数据目录中,切勿自行预置权限项，多谢配合！
平台版本更新到3.005及以上后，业务部门可自行添加的业务权限项，权限项编码请不要使用QXX开头，务必选择业务操作及适用应用。脚本dbkey用basedata。
*********************************************************************
*/

/*权限管理-数据、成员权限配置-系统调度预置*/

/*调度任务类名*/
DELETE FROM T_SCH_TASKDEFINE WHERE FID = '3DCZK66V6FSL';
INSERT INTO T_SCH_TASKDEFINE (FID, FCLASSNAME, FAPPID, FNUMBER) VALUES ('3DCZK66V6FSL', 'kd.fi.bcm.task.DeletedOutEntityMainCleanTaskPlugin', 'cm', 'cm_bcm_DeletedOutEntityMainCleanTaskPlugin');


DELETE FROM T_SCH_TASKDEFINE_L WHERE FPKID = '3DCZK66V6/9Y';
INSERT INTO T_SCH_TASKDEFINE_L (FID, FPKID, FLOCALEID, FNAME) VALUES ('3DCZK66V6FSL', '3DCZK66V6/9Y', 'zh_CN', '合并当外键表实体删除，清除主表内容');



/*调度作业*/
DELETE FROM T_SCH_JOB WHERE FID = '3DKH//8OTRQJ';
INSERT INTO T_SCH_JOB (FID, FTASKCLASSNAME, FRUNMODE, FRUNBYUSERID, FJOBTYPE, FSTATUS, FNUMBER, FCONCURRENT, FSTRATEGY, FTIMEOUT, FTASKDEFINEID, FRETRYTIME, FRUNBYLANG, FPARAMS, FRUNBYORGID) VALUES ('3DKH//8OTRQJ', 'kd.fi.bcm.task.DeletedOutEntityMainCleanTaskPlugin', '0', 13466739, 'BIZ', '1', 'cm_bcm_BaseDataAuthDeletedGrpCleanTask_SKDJ_S', '0', '1', 0, '3DCZK66V6FSL', 0, 'zh_CN', '{"mainTableName":"bcm_auth_info"}', 0);
DELETE FROM T_SCH_JOB WHERE FID = '3DKH274R5UN1';
INSERT INTO T_SCH_JOB (FID, FTASKCLASSNAME, FRUNMODE, FRUNBYUSERID, FJOBTYPE, FSTATUS, FNUMBER, FCONCURRENT, FSTRATEGY, FTIMEOUT, FTASKDEFINEID, FRETRYTIME, FRUNBYLANG, FPARAMS, FRUNBYORGID) VALUES ('3DKH274R5UN1', 'kd.fi.bcm.task.DeletedOutEntityMainCleanTaskPlugin', '0', 13466739, 'BIZ', '1', 'cm_bcm_BaseMemPermDeletedGrpCleanTask_SKDJ_S', '0', '1', 0, '3DCZK66V6FSL', 0, 'zh_CN', '{"mainTableName":"bcm_memberperm"}', 0);


DELETE FROM T_SCH_JOB_L WHERE FPKID = '3DKH274R6=4Q';
INSERT INTO T_SCH_JOB_L (FID, FPKID, FLOCALEID, FNAME) VALUES ('3DKH274R5UN1', '3DKH274R6=4Q', 'zh_CN', '基础成员权限删除组数据清除任务作业');
DELETE FROM T_SCH_JOB_L WHERE FPKID = '3DKH//8OTA7W';
INSERT INTO T_SCH_JOB_L (FID, FPKID, FLOCALEID, FNAME) VALUES ('3DKH//8OTRQJ', '3DKH//8OTA7W', 'zh_CN', '基础数据权限删除组数据清除任务作业');



/*调度计划*/
DELETE FROM T_SCH_SCHEDULE WHERE FID = '3DKHS8X=ODYA';
INSERT INTO T_SCH_SCHEDULE (FTWENTY, FFIVE, FELEVEN, FNINE, FNO, FSUN, FTWO, FFIFTEEN, FDESC, FEIGHT, FNOV, FPLAN, FWED, FHOST, FFOUR, FMAR, FENDTIME, FSIX, FMAY, FREPEATMODE, FTHIRTYONE, FBYDAYORWEEK, FTWENTYSIX, FTHIRTEEN, FAUG, FTWENTYONE, FBYWEEK, FTUES, FSEVENTEEN, FTWENTYFOUR, FTHIRTY, FTHREE, FFOURTEEN, FJAN, FSEVEN, FNINETEEN, FTHUR, FTEN, FFRI, FJOBID, FSTARTTIME, FOCT, FMON, FAPR, FSIXTEEN, FID, FSAT, FONE, FTWENTYEIGHT, FTWENTYTHREE, FTWELVE, FNOWEEK, FSTATUS, FNUMBER, FTWENTYTWO, FSEP, FTWENTYFIVE, FEIGHTEEN, FCYCLENUM, FTWENTYNINE, FJUL, FTWENTYSEVEN, FDEC, FJUN, FFEB) VALUES ('0', '0', '0', '0', ' ', '1', '0', '0', '事件将于2023-07-16 00:00:00起，每1周的星期日重复。
预计最近十次执行时间：
2023-07-16 00:00:00,
2023-07-23 00:00:00,
2023-07-30 00:00:00,
2023-08-06 00:00:00,
2023-08-13 00:00:00,
2023-08-20 00:00:00,
2023-08-27 00:00:00,
2023-09-03 00:00:00,
2023-09-10 00:00:00,
2023-09-17 00:00:00', '0', '0', '0 0 0 ? * 1', '0', '172.17.8.106', '0', '0', {ts'2999-12-31 12:59:59'}, '0', '0', 'w', '0', 'd', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '3DKH274R5UN1', {ts'2023-07-16 00:00:00'}, '0', '0', '0', '0', '3DKHS8X=ODYA', '0', '0', '0', '0', '0', ' ', '1', 'cm_bcm_BaseMemPermDeletedGrpCleanTask_SKDP_S', '0', '0', '0', '0', 1, '0', '0', '0', '0', '0', '0');
DELETE FROM T_SCH_SCHEDULE WHERE FID = '3DKHGEO3NOH1';
INSERT INTO T_SCH_SCHEDULE (FTWENTY, FFIVE, FELEVEN, FNINE, FNO, FSUN, FTWO, FFIFTEEN, FDESC, FEIGHT, FNOV, FPLAN, FWED, FHOST, FFOUR, FMAR, FENDTIME, FSIX, FMAY, FREPEATMODE, FTHIRTYONE, FBYDAYORWEEK, FTWENTYSIX, FTHIRTEEN, FAUG, FTWENTYONE, FBYWEEK, FTUES, FSEVENTEEN, FTWENTYFOUR, FTHIRTY, FTHREE, FFOURTEEN, FJAN, FSEVEN, FNINETEEN, FTHUR, FTEN, FFRI, FJOBID, FSTARTTIME, FOCT, FMON, FAPR, FSIXTEEN, FID, FSAT, FONE, FTWENTYEIGHT, FTWENTYTHREE, FTWELVE, FNOWEEK, FSTATUS, FNUMBER, FTWENTYTWO, FSEP, FTWENTYFIVE, FEIGHTEEN, FCYCLENUM, FTWENTYNINE, FJUL, FTWENTYSEVEN, FDEC, FJUN, FFEB) VALUES ('0', '0', '0', '0', ' ', '1', '0', '0', '事件将于2023-07-16 00:00:00起，每1周的星期日0时重复。
预计最近十次执行时间：
2023-07-16 00:00:00,
2023-07-23 00:00:00,
2023-07-30 00:00:00,
2023-08-06 00:00:00,
2023-08-13 00:00:00,
2023-08-20 00:00:00,
2023-08-27 00:00:00,
2023-09-03 00:00:00,
2023-09-10 00:00:00,
2023-09-17 00:00:00', '0', '0', '0 0 0 ? * 1', '0', '172.17.8.106', '0', '0', {ts'2999-12-31 12:59:59'}, '0', '0', 'w', '0', 'd', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '3DKH//8OTRQJ', {ts'2023-07-16 00:00:00'}, '0', '0', '0', '0', '3DKHGEO3NOH1', '0', '0', '0', '0', '0', ' ', '1', 'cm_bcm_BaseDataAuthDeletedGrpCleanTask_SKDP_S', '0', '0', '0', '0', 1, '0', '0', '0', '0', '0', '0');


DELETE FROM t_sch_schedule_l WHERE FPKID = '3DKHGEO3N8+D';
INSERT INTO T_SCH_SCHEDULE_L (FID, FPKID, FLOCALEID, FNAME) VALUES ('3DKHGEO3NOH1', '3DKHGEO3N8+D', 'zh_CN', '基础数据权限删除组数据清除任务计划');
DELETE FROM t_sch_schedule_l WHERE FPKID = '3DKHS8X=OVF+';
INSERT INTO T_SCH_SCHEDULE_L (FID, FPKID, FLOCALEID, FNAME) VALUES ('3DKHS8X=ODYA', '3DKHS8X=OVF+', 'zh_CN', '基础成员权限删除组数据清除任务计划');


/*调度计划分录*/
DELETE FROM T_SCH_SCHEDULE_ENTRY WHERE FENTRYID = '3DKHGEO3NOH2';
INSERT INTO T_SCH_SCHEDULE_ENTRY (FID, FJOBNUMBER, FENTRYID, FSEQ) VALUES ('3DKHGEO3NOH1', '3DKH//8OTRQJ', '3DKHGEO3NOH2', 1);
DELETE FROM T_SCH_SCHEDULE_ENTRY WHERE FENTRYID = '3DKHS8XD=U3U';
INSERT INTO T_SCH_SCHEDULE_ENTRY (FID, FJOBNUMBER, FENTRYID, FSEQ) VALUES ('3DKHS8X=ODYA', '3DKH274R5UN1', '3DKHS8XD=U3U', 1);