9af4a544
王彪总
新项目
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package com.zteits.park.configuration.schedule;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
/**
* 判断是否启用xxljob
* Copyright: Copyright (c) 2017 zteits
*
* @ClassName: GetExceptionMsgCondition.java
* @Description:
* @version: v1.0.0
* @author: zhaowg
* @date: 2017年4月24日 上午10:54:22
* Modification History:
* Date Author Version Description
*---------------------------------------------------------*
* 2017年9月15日 zhaowg v1.0.0 创建
*/
public class DealGeoInOutParkDataCondition implements Condition{
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
//判断当前环境开关是否开启
String isOnOff = context.getEnvironment().getProperty("switch.auto.DealGeoInOutParkDataCondition");
//当且仅当值为true时,返回true
if(!StringUtils.isBlank(isOnOff) && isOnOff.equalsIgnoreCase("true")){
return true;
}
return false;
}
}
|