btyjj-inspection/src/main/java/com/cm/inspection/startup/StartUp.java

61 lines
2.0 KiB
Java
Raw Normal View History

2020-03-30 17:08:24 +08:00
package com.cm.inspection.startup;
import com.cm.common.config.properties.ApiPathProperties;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.plugin.oauth.service.user.IUserService;
import com.cm.common.plugin.pojo.bos.UserResourceBO;
import com.cm.common.plugin.utils.RestTemplateUtil;
import com.cm.inspection.InspectionApplication;
import com.cm.inspection.pojo.dtos.check.CheckDTO;
import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO;
import com.cm.inspection.service.check.ICheckService;
import com.cm.inspection.service.dingding.IDingDingMsgService;
import com.cm.inspection.service.gridpersonnel.IGridPersonnelService;
2020-03-30 17:08:24 +08:00
import com.cm.inspection.service.process.IProcessService;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
2020-03-30 17:08:24 +08:00
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.scheduling.annotation.Scheduled;
2020-03-30 17:08:24 +08:00
import org.springframework.stereotype.Component;
import java.util.*;
2020-03-30 17:08:24 +08:00
/**
* When you feel like quitting. Think about why you started
* 当你想要放弃的时候想想当初你为何开始
*
* @ClassName: StartUp
* @Description:
* @Author: WangGeng
* @Date: 2020/3/30 11:48
* @Version: 1.0
**/
@Component
public class StartUp implements ApplicationRunner {
@Autowired
private IProcessService processService;
@Autowired
private IDingDingMsgService dingDingMsgService;
2020-03-30 17:08:24 +08:00
@Override
public void run(ApplicationArguments args) throws Exception {
// 部署流程
processService.deployProcess("check-self", "网格员检查上报流程");
}
/**
* 天10点统计
*/
@Scheduled(cron = "0 0 10 * * ?")
public void sendDingDingTimeoutMessage() {
dingDingMsgService.sendDingDingTimeoutMessage();
}
2020-03-30 17:08:24 +08:00
}