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; 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; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.*; /** * 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; @Override public void run(ApplicationArguments args) throws Exception { // 部署流程 processService.deployProcess("check-self", "网格员检查上报流程"); } /** * 天10点统计 */ @Scheduled(cron = "0 0 10 * * ?") public void sendDingDingTimeoutMessage() { dingDingMsgService.sendDingDingTimeoutMessage(); } }