Commit fb78df23 by 周晓航

增加一个 发版日开关

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 32ab7162
......@@ -131,6 +131,8 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
@Value("${avoid.version.upgrade.config:}")
private String avoidVersionUpgradeConfig;
@Value("${version.upgrade.weekDay:}")
private List<Integer> weekDay;
@Override
public CreateOrderResponse createOrderFlow(CreateOrderRequest config) {
......@@ -671,14 +673,25 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
}
cal.setTime(datet);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (CommonConstant.weekDay.contains(w)) {
// 校验时间 是否是 23:00 之后
int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
if (hourOfDay >= 23){
// 表示 设置时间为23点之后
return true;
// 增加一个发版开关
if (CollectionUtils.isNotEmpty(weekDay)) {
if (weekDay.contains(w)) {
// 校验时间 是否是 23:00 之后
int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
if (hourOfDay >= 23){
// 表示 设置时间为23点之后
return true;
}
}
}else {
if (CommonConstant.weekDay.contains(w)) {
// 校验时间 是否是 23:00 之后
int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
if (hourOfDay >= 23){
// 表示 设置时间为23点之后
return true;
}
}
}
return false;
}
......
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