-- 预警监控方案
-- t_warn_schedule
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule WHERE FID = '846108395168812032')
INSERT INTO t_warn_schedule(FMODIFYDATE,FTYPE,FEARLYWARNID,FISV,FDATA,FINHERITPATH,FMASTERID,FMONITORFREQUENCY,FPLANID,FMONITORRANGE,FENABLE,FJOBID,FMODELTYPE,FID,FVERSION,FISTEMPLATE,FSTARTDATE,FCREATEDATE,FLASTSYNCTIME,FPARENTID,FNUMBER,FPLANNUMBER,FMODIFIERID,FBIZAPPID,FENDDATE,FCREATORID) VALUES ({ts'2020-03-13  10:17:05'},'0','843227158695402496','kingdee',
'<?xml version="1.0" encoding="UTF-8"?>
<WarnScheduleMetadata>
  <DevType>0</DevType>
  <WarnSchedule>
    <WarnSchedule>
      <LastSyncTime>1584065825000</LastSyncTime>
      <RunCycle>
        <RunCycle>
          <RangeType>from_start_date</RangeType>
          <EndDate>2020-03-13</EndDate>
          <Description>从2020-03-13开始，每天 00:00:00执行</Description>
          <PeriodType>day</PeriodType>
          <StartDate>2020-03-13</StartDate>
        </RunCycle>
      </RunCycle>
      <WarnCondition>
        <WarnCondition>
          <CustomDataJson>{"customFilterString":""}</CustomDataJson>
        </WarnCondition>
      </WarnCondition>
      <BizAppId>=9Q86DR2P+Q</BizAppId>
      <JobId>846113247576098816</JobId>
      <Number>IM_SHELFWARN_SKDJ_S</Number>
      <MessageConfig>
        <WarnMessageConfig>
          <MergeContent></MergeContent>
          <Title>库存物料保质期预警内容</Title>
          <SendTypes>
            <WarnMessageSendType>
              <Name>消息中心</Name>
              <Value>message_center</Value>
            </WarnMessageSendType>
          </SendTypes>
          <SingleContent>库存组织为[{org.name}]，仓库为[{warehouse.name}]的物料[{material.number}/{material.name}]的保质期于[{expirydate}]到期</SingleContent>
        </WarnMessageConfig>
      </MessageConfig>
      <Name>库存保质期预警</Name>
      <PlanId>846123874189003776</PlanId>
      <Id>846108395168812032</Id>
      <EarlyWarnId>843227158695402496</EarlyWarnId>
    </WarnSchedule>
  </WarnSchedule>
  <ModelType>WarnScheduleModel</ModelType>
  <Isv>kingdee</Isv>
  <ParentId></ParentId>
  <MasterId>846108395168812032</MasterId>
  <Number>IM_SHELFWARN_EW_S</Number>
  <BizappId>=9Q86DR2P+Q</BizappId>
  <Id>846108395168812032</Id>
  <InheritPath>846108395168812032</InheritPath>
</WarnScheduleMetadata>','846108395168812032','846108395168812032','每天-00:00:00','846123874189003776','从2020-03-13开始','1','846113247576098816','WarnScheduleModel','846108395168812032',1584065825947,'0',{ts'2020-03-13  00:00:00'},{ts'2020-03-13  09:55:59'},{ts'2020-03-13  10:17:05'},' ','IM_SHELFWARN_EW_S',' ',843194178153232384,'=9Q86DR2P+Q',{ts'2020-03-13  00:00:00'},843194178153232384); 

-- 预警监控方案多语言
-- t_warn_schedule_l
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0MXOL679+PEY')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('846108395168812032','0MXOL679+PEY','zh_CN','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata/>
','库存保质期预警'); 
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0MXOL67929T/')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('846108395168812032','0MXOL67929T/','zh_TW','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata>
  <WarnSchedule>
    <WarnSchedule>
      <Name>庫存保質期預警</Name>
    </WarnSchedule>
  </WarnSchedule>
</WarnScheduleMetadata>
','庫存保質期預警'); 
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0MXOL67BM3MF')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('846108395168812032','0MXOL67BM3MF','en_US','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata/>
',' '); 

-- 调度作业  t_sch_job
IF NOT EXISTS (SELECT 1 FROM t_sch_job WHERE FID = '846113247576098816')
INSERT INTO t_sch_job(FID,FTASKCLASSNAME,FTASKDEFINEID,FRUNBYUSERID,FJOBTYPE,FTIMEOUT,FRUNBYLANG,FSTATUS,FPARAMS,FRUNBYORGID,FNUMBER,FCONCURRENT) VALUES ('846113247576098816','kd.bos.service.earlywarn.EarlyWarnScheduleTask','846123873811728384',1,'BIZ',0,'zh-CN','1','{"warnScheduleId":"846108395168812032"}',0,'IM_SHELFWARN_SKDJ_S','1'); 

-- 调度作业多语言  t_sch_job_l
IF NOT EXISTS (SELECT 1 FROM t_sch_job_l WHERE FPKID = '0MXOL6/+9R==')
INSERT INTO t_sch_job_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('846113247576098816','0MXOL6/+9R==','zh_CN','库存保质期预警'); 

-- 调度计划  t_sch_schedule
IF NOT EXISTS (SELECT 1 FROM t_sch_schedule WHERE FID = '846123874189003776')
INSERT INTO t_sch_schedule(FTWENTY,FFIVE,FELEVEN,FNINE,FNO,FSUN,FTWO,FEIGHT,FNOV,FPLAN,FWED,FHOST,FTWENTYTWO,FFOUR,FMAR,FSEP,FENDTIME,FSIX,FMAY,FREPEATMODE,FTHIRTYONE,FBYDAYORWEEK,FTWENTYSEVEN,FTWENTYSIX,FTHIRTEEN,FAUG,FDESC,FFIFTEEN,FTWENTYONE,FBYWEEK,FTUES,FSEVENTEEN,FSEVEN,FTWENTYFOUR,FMON,FTHIRTY,FTHREE,FFOURTEEN,FJAN,FNINETEEN,FTHUR,FTEN,FFRI,FJOBID,FSTARTTIME,FOCT,FAPR,FSIXTEEN,FID,FSAT,FONE,FTWENTYEIGHT,FTWENTYTHREE,FTWELVE,FNOWEEK,FSTATUS,FNUMBER,FTWENTYFIVE,FEIGHTEEN,FCYCLENUM,FTWENTYNINE,FJUL,FDEC,FJUN,FFEB) VALUES ('0','0','0','0',null,'0','0','0','0','0 0 0 ? * * *','0','172.19.90.143','0','0','0','0',{ts'2120-03-13  00:00:00'},'0','0','d','0',null,'0','0','0','0','事件将每1天重复','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','846113247576098816',{ts'2020-03-13  00:00:00'},'0','0','0','846123874189003776','0','0','0','0','0',null,'1','IM_SHELFWARN_SKDP_S','0','0',1,'0','0','0','0','0'); 

-- 调度计划多语言  t_sch_schedule_l
IF NOT EXISTS (SELECT 1 FROM t_sch_schedule_l WHERE FPKID = '846123874398930944')
INSERT INTO t_sch_schedule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('846123874189003776','846123874398930944','zh_CN','库存保质期预警');

-- 调度任务  t_sch_taskdefine
IF NOT EXISTS (SELECT 1 FROM T_SCH_TASKDEFINE WHERE FID = '846113562962593792')
INSERT INTO T_SCH_TASKDEFINE(FID,FCLASSNAME,FAPPID,FNUMBER) VALUES ('846113562962593792','kd.bos.service.earlywarn.EarlyWarnScheduleTask','im','IM_SHELFWARN_SKDP_S'); 
