1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package com.kmall.admin.task;
- import com.kmall.admin.entity.PickUpCodeEntity;
- import com.kmall.admin.fromcomm.entity.SysUserEntity;
- import com.kmall.admin.fromcomm.service.SysUserService;
- import com.kmall.admin.service.PickUpCodeService;
- import com.kmall.admin.websocket.WebSocketServer;
- import org.apache.commons.lang.builder.ToStringBuilder;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.BeansException;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.ApplicationContext;
- import org.springframework.context.ApplicationContextAware;
- import org.springframework.scheduling.annotation.EnableScheduling;
- import org.springframework.scheduling.annotation.Scheduled;
- import org.springframework.stereotype.Component;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * 测试定时任务(演示Demo,可删除)
- * <p>
- * testTask为spring bean的名称
- *
- * @author Scott
- * @email
- * @date 2016年11月30日 下午1:34:24
- */
- @Component("testTask")
- @EnableScheduling
- public class TestTask {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private SysUserService sysUserService;
- @Scheduled(cron = "0/5 * * * * ?")
- public void flushPickUpCode() {
- logger.info("flushPickUpCode-----------------" );
- WebSocketServer.broadcastInfo("broadcast");
- }
- public void test2() {
- logger.info("我是不带参数的test2方法,正在被执行");
- }
- }
|