-- 再订货点库存预警监控方案
-- t_warn_schedule
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule WHERE FID = '854807900726721536')
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-25  10:44:40'},'0','854361659605521408','kingdee',
'<?xml version="1.0" encoding="UTF-8"?>
<WarnScheduleMetadata>
  <DevType>0</DevType>
  <WarnSchedule>
    <WarnSchedule>
      <LastSyncTime>1585104280000</LastSyncTime>
      <RunCycle>
        <RunCycle>
          <RangeType>from_start_date</RangeType>
          <EndDate>2020-03-25</EndDate>
          <Description>从2020-03-25开始，每天 00:00:00执行</Description>
          <PeriodType>day</PeriodType>
          <StartDate>2020-03-25</StartDate>
        </RunCycle>
      </RunCycle>
      <WarnCondition>
        <WarnCondition>
          <CustomDataJson>{"customFilterString":""}</CustomDataJson>
        </WarnCondition>
      </WarnCondition>
      <BizAppId>=9Q86DR2P+Q</BizAppId>
      <JobId>854808818180490240</JobId>
      <Number>IM_REORDERINVWARN_SKDJ_S</Number>
      <MessageConfig>
        <WarnMessageConfig>
          <MergeContent></MergeContent>
          <Title>物料再订货点预警消息</Title>
          <SendTypes>
            <WarnMessageSendType>
              <Name>消息中心</Name>
              <Value>message_center</Value>
            </WarnMessageSendType>
          </SendTypes>
          <SingleContent>库存组织[{org.name}]中的物料[{material.number}/{material.name}]现有库存基本数量为[{avbbaseqty}]，小于在订货点库存量[{warnqty}]。</SingleContent>
        </WarnMessageConfig>
      </MessageConfig>
      <Name>再订货点预警</Name>
      <PlanId>854835064146822144</PlanId>
      <Id>854807900726721536</Id>
      <EarlyWarnId>854361659605521408</EarlyWarnId>
    </WarnSchedule>
  </WarnSchedule>
  <ModelType>WarnScheduleModel</ModelType>
  <Isv>kingdee</Isv>
  <ParentId></ParentId>
  <MasterId>854807900726721536</MasterId>
  <Number>IM_REORDERINVWARN_EW_S</Number>
  <BizappId>=9Q86DR2P+Q</BizappId>
  <Id>854807900726721536</Id>
  <InheritPath>854807900726721536</InheritPath>
</WarnScheduleMetadata>','854807900726721536','854807900726721536','每天-00:00:00','854835064146822144','从2020-03-25开始','0','854808818180490240','WarnScheduleModel','854807900726721536',1585104280709,'0',{ts'2020-03-25  00:00:00'},{ts'2020-03-25  09:52:31'},{ts'2020-03-25  10:44:40'},' ','IM_REORDERINVWARN_EW_S',' ',853353486505814016,'=9Q86DR2P+Q',{ts'2020-03-25  00:00:00'},853353486505814016); 


-- 再订货点预警监控方案多语言
-- t_warn_schedule_l
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0O+E8GM5741A')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854807900726721536','0O+E8GM5741A','en_US','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata/>
',' '); 
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0O+E8GLLFMX8')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854807900726721536','0O+E8GLLFMX8','zh_CN','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata/>
','再订货点预警'); 
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0O+E8GLSNO9L')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854807900726721536','0O+E8GLSNO9L','zh_TW','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata>
  <WarnSchedule>
    <WarnSchedule>
      <Name>再訂貨點預警</Name>
    </WarnSchedule>
  </WarnSchedule>
</WarnScheduleMetadata>
','再訂貨點預警'); 


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

-- 调度作业多语言  t_sch_job_l
IF NOT EXISTS (SELECT 1 FROM t_sch_job_l WHERE FPKID = '0O+E8GA1U5/N')
INSERT INTO t_sch_job_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('854808818180490240','0O+E8GA1U5/N','zh_CN','再订货点预警'); 

-- 调度计划  t_sch_schedule
IF NOT EXISTS (SELECT 1 FROM t_sch_schedule WHERE FID = '854835064146822144')
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-25  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','854808818180490240',{ts'2020-03-25  00:00:00'},'0','0','0','854835064146822144','0','0','0','0','0',null,'0','IM_REORDERINVWARN_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 = '854835064331265024')
INSERT INTO t_sch_schedule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('854835064146822144','854835064331265024','zh_CN','再订货点预警'); 

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