-- 最大库存预警监控方案
-- t_warn_schedule
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule WHERE FID = '854806641948982272')
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:03:20'},'0','854360348466091008','kingdee',
'<?xml version="1.0" encoding="UTF-8"?>
<WarnScheduleMetadata>
  <DevType>0</DevType>
  <WarnSchedule>
    <WarnSchedule>
      <LastSyncTime>1585119800000</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>854807242489529344</JobId>
      <Number>IM_MAXINVWARN_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>854965253874995200</PlanId>
      <Id>854806641948982272</Id>
      <EarlyWarnId>854360348466091008</EarlyWarnId>
    </WarnSchedule>
  </WarnSchedule>
  <ModelType>WarnScheduleModel</ModelType>
  <Isv>kingdee</Isv>
  <ParentId></ParentId>
  <MasterId>854806641948982272</MasterId>
  <Number>IM_MAXINVWARN_EW_S</Number>
  <BizappId>=9Q86DR2P+Q</BizappId>
  <Id>854806641948982272</Id>
  <InheritPath>854806641948982272</InheritPath>
</WarnScheduleMetadata>','854806641948982272','854806641948982272','每天-00:00:00','854965253874995200','从2020-03-25开始','0','854807242489529344','WarnScheduleModel','854806641948982272',1585119800543,'0',{ts'2020-03-25  00:00:00'},{ts'2020-03-25  09:49:23'},{ts'2020-03-25  15:03:20'},' ','IM_MAXINVWARN_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/0K5JASITV')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854806641948982272','0O/0K5JASITV','en_US','<?xml version="1.0" encoding="UTF-8"?>

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

<WarnScheduleMetadata/>
','最大库存预警'); 
IF NOT EXISTS (SELECT 1 FROM t_warn_schedule_l WHERE FPKID = '0O/0K5JAODXJ')
INSERT INTO t_warn_schedule_l(FID,FPKID,FLOCALEID,FDATA,FNAME) VALUES ('854806641948982272','0O/0K5JAODXJ','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 = '854807242489529344')
INSERT INTO t_sch_job(FID,FTASKCLASSNAME,FTASKDEFINEID,FRUNBYUSERID,FJOBTYPE,FTIMEOUT,FRUNBYLANG,FSTATUS,FPARAMS,FRUNBYORGID,FNUMBER,FCONCURRENT) VALUES ('854807242489529344','kd.bos.service.earlywarn.EarlyWarnScheduleTask','854965253455320064',1,'BIZ',0,'zh-CN','0','{"warnScheduleId":"854806641948982272"}',0,'IM_MAXINVWARN_SKDJ_S','1'); 

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

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

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