|
|
|
@@ -100,16 +100,17 @@ public class PushLimitServiceImpl implements PushLimitService { |
|
|
|
return true; |
|
|
|
} |
|
|
|
// 1.2 疲劳度时间是否启用 |
|
|
|
if(pushLimit.getTimeEnable().equals(EnumEnableType.Disable.getCode())) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
// 2. check time |
|
|
|
boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); |
|
|
|
if (!isInDate) { |
|
|
|
logger.error("不在疲劳度允许的时间段"); |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_NOT_INRANG); |
|
|
|
if(pushLimit.getTimeEnable().equals(EnumEnableType.Enable.getCode())) { |
|
|
|
// 2. check time |
|
|
|
boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); |
|
|
|
if (!isInDate) { |
|
|
|
logger.error("不在疲劳度允许的时间段"); |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_NOT_INRANG); |
|
|
|
} |
|
|
|
return isInDate; |
|
|
|
} |
|
|
|
return isInDate; |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -123,14 +124,14 @@ public class PushLimitServiceImpl implements PushLimitService { |
|
|
|
} |
|
|
|
// 2. check time |
|
|
|
// 2.1 疲劳度时间是否启用 |
|
|
|
if(pushLimit.getTimeEnable().equals(EnumEnableType.Disable.getCode())) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); |
|
|
|
if (!isInDate) { |
|
|
|
logger.error("不在疲劳度允许的时间段"); |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_NOT_INRANG); |
|
|
|
if(pushLimit.getTimeEnable().equals(EnumEnableType.Enable.getCode())) { |
|
|
|
boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); |
|
|
|
if (!isInDate) { |
|
|
|
logger.error("不在疲劳度允许的时间段"); |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_NOT_INRANG); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// TODO 3. check phone had up to limit |
|
|
|
return true; |
|
|
|
} |
|
|
|
@@ -146,13 +147,13 @@ public class PushLimitServiceImpl implements PushLimitService { |
|
|
|
} |
|
|
|
// 2. check time 是否在给定的时间段内 |
|
|
|
// 2.1 疲劳度时间是否启用 |
|
|
|
if(pushLimit.getTimeEnable().equals(EnumEnableType.Disable.getCode())) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); |
|
|
|
if (!isInDate) { |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_NOT_INRANG); |
|
|
|
if(pushLimit.getTimeEnable().equals(EnumEnableType.Enable.getCode())) { |
|
|
|
boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); |
|
|
|
if (!isInDate) { |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_NOT_INRANG); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 3. check 每人每天多少张券 |
|
|
|
Map params = new HashMap<String, Object>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
|