package com.idea.oa.apply.util; import com.idea.oa.apply.util.service.RunerLoadOneService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; /** * SpringBoot项目启动的时候执行一次数据库查询的功能 */ @Component public class RunnerLoadOne implements CommandLineRunner { @Autowired private RunerLoadOneService runerLoadOneService; @Override public void run(String... args) throws Exception { runerLoadOneService.refreshFlowNumber(); // FlowDefinitionExample example=new FlowDefinitionExample(); // example.createCriteria().andStatusEqualTo("1"); // List flowDefinitions = flowDefinitionService.selectByExample(example); // for (FlowDefinition flowDefinition : flowDefinitions) { // if (ConstantFlowType.USE_MONEY_PROCESSDEFINE.equals(flowDefinition.getFlowDef())) { // ConstantFlowType.USE_MONEY_DEPLOYMENTID=flowDefinition.getDeployId(); // } // if (ConstantFlowType.PAYMEN_PROCESSDEFINE.equals(flowDefinition.getFlowDef())) { // ConstantFlowType.PAYMEN_DEPLOYMENTID=flowDefinition.getDeployId(); // } // if (ConstantFlowType.OFF_WORK_PROCESSDEFINE.equals(flowDefinition.getFlowDef())) { // ConstantFlowType.OFF_WORK_DEPLOYMENTID=flowDefinition.getDeployId(); // } // } // System.out.println(ConstantFlowType.USE_MONEY_PROCESSDEFINE+"流程编号为:"+ConstantFlowType.USE_MONEY_DEPLOYMENTID); // System.out.println(ConstantFlowType.PAYMEN_PROCESSDEFINE+"流程编号为:"+ConstantFlowType.PAYMEN_DEPLOYMENTID); // System.out.println(ConstantFlowType.OFF_WORK_PROCESSDEFINE+"流程编号为:"+ConstantFlowType.OFF_WORK_DEPLOYMENTID); } }