-- 最小库存预警监控方案
-- t_warn_schedule
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule WHERE FID = '854207324435580928')
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  15:02:59'},'0','854207235851880448','kingdee',
'<?xml version="1.0" encoding="UTF-8"?>
<WarnScheduleMetadata>
  <DevType>0</DevType>
  <WarnSchedule>
    <WarnSchedule>
      <LastSyncTime>1585119779000</LastSyncTime>
      <RunCycle>
        <RunCycle>
          <RangeType>from_start_date</RangeType>
          <EndDate>2020-03-24</EndDate>
          <Description>从2020-03-24开始，每天 00:00:00执行</Description>
          <PeriodType>day</PeriodType>
          <StartDate>2020-03-24</StartDate>
        </RunCycle>
      </RunCycle>
      <WarnCondition>
        <WarnCondition>
          <CustomDataJson>{"customFilterString":""}</CustomDataJson>
        </WarnCondition>
      </WarnCondition>
      <BizAppId>=9Q86DR2P+Q</BizAppId>
      <JobId>854210265775024128</JobId>
      <Number>IM_MININVWARN_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>854965079106736128</PlanId>
      <Id>854207324435580928</Id>
      <EarlyWarnId>854207235851880448</EarlyWarnId>
    </WarnSchedule>
  </WarnSchedule>
  <ModelType>WarnScheduleModel</ModelType>
  <Isv>kingdee</Isv>
  <ParentId></ParentId>
  <MasterId>854207324435580928</MasterId>
  <Number>IM_MININVWARN_EW_S</Number>
  <BizappId>=9Q86DR2P+Q</BizappId>
  <Id>854207324435580928</Id>
  <InheritPath>854207324435580928</InheritPath>
</WarnScheduleMetadata>','854207324435580928','854207324435580928','每天-00:00:00','854965079106736128','从2020-03-24开始','0','854210265775024128','WarnScheduleModel','854207324435580928',1585119779704,'0',{ts'2020-03-24  00:00:00'},{ts'2020-03-24  14:03:18'},{ts'2020-03-25  15:02:59'},' ','IM_MININVWARN_EW_S',' ',853353486505814016,'=9Q86DR2P+Q',{ts'2020-03-24  00:00:00'},853353486505814016); 



-- 最小库存预警监控方案多语言
-- t_warn_schedule_l
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0O/0IWVFELP4')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854207324435580928','0O/0IWVFELP4','en_US','<?xml version="1.0" encoding="UTF-8"?>

<WarnScheduleMetadata/>
',' '); 

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

<WarnScheduleMetadata/>
','最小库存预警'); 

IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0O/0IWVFAGSU')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854207324435580928','0O/0IWVFAGSU','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 = '854210265775024128')
INSERT INTO t_sch_job(FID,FTASKCLASSNAME,FTASKDEFINEID,FRUNBYUSERID,FJOBTYPE,FTIMEOUT,FRUNBYLANG,FSTATUS,FPARAMS,FRUNBYORGID,FNUMBER,FCONCURRENT) VALUES ('854210265775024128','kd.bos.service.earlywarn.EarlyWarnScheduleTask','854965078619952128',1,'BIZ',0,'zh-CN','0','{"warnScheduleId":"854207324435580928"}',0,'IM_MININVWARN_SKDJ_S','1'); 

-- 调度作业多语言  t_sch_job_l
IF NOT EXISTS (SELECT 1 FROM t_sch_job_l WHERE FPKID = '0O/0IWMB1XTV')
INSERT INTO t_sch_job_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('854210265775024128','0O/0IWMB1XTV','zh_CN','最小库存预警'); 

-- 调度计划  t_sch_schedule
IF NOT EXISTS (SELECT 1 FROM t_sch_schedule WHERE FID = '854965079106736128')
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-24  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','854210265775024128',{ts'2020-03-24  00:00:00'},'0','0','0','854965079106736128','0','0','0','0','0',null,'0','IM_MININVWARN_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 = '854965079299429376')
INSERT INTO t_sch_schedule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('854965079106736128','854965079299429376','zh_CN','最小库存预警'); 

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