Commit be18f5c3 by 吕明尚

修改定时任务传参

parent 05bb962f
package share.quartz.task; package share.quartz.task;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import share.system.domain.DeviceGateway; import share.system.domain.DeviceGateway;
...@@ -19,6 +22,7 @@ import java.util.List; ...@@ -19,6 +22,7 @@ import java.util.List;
@Component @Component
public class DeviceTask { public class DeviceTask {
private static final Logger log = LoggerFactory.getLogger(DeviceTask.class);
@Autowired @Autowired
private DeviceStatusLogService deviceStatusLogService; private DeviceStatusLogService deviceStatusLogService;
@Autowired @Autowired
...@@ -49,12 +53,11 @@ public class DeviceTask { ...@@ -49,12 +53,11 @@ public class DeviceTask {
} }
} }
/**
* 定期修改门锁设备的开锁密码
* @param validTime 有效时长
*/
@XxlJob("updateDeviceDoorLockPassword") @XxlJob("updateDeviceDoorLockPassword")
public void updateDeviceDoorLockPassword(Integer validTime) { public void updateDeviceDoorLockPassword() {
String jobParam = XxlJobHelper.getJobParam();
Integer validTime = Integer.getInteger(jobParam);
log.debug("jobParam:" + jobParam);
if (validTime == null) { if (validTime == null) {
validTime = 15; validTime = 15;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</encoder> </encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter"> <filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 --> <!-- 过滤的级别 -->
<level>INFO</level> <level>DEBUG</level>
<!-- 匹配时的操作:接收(记录) --> <!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch> <onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) --> <!-- 不匹配时的操作:拒绝(不记录) -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment