|
@@ -65,12 +65,20 @@ public class SysPublicParamServiceImpl extends ServiceImpl<SysPublicParamMapper,
|
|
|
|
|
|
@Override
|
|
|
public Results<String> getWeekParam() {
|
|
|
- int i = LocalDateTime.now().getDayOfWeek().getValue();
|
|
|
- SysPublicParam publicParam = getOne(Wrappers.<SysPublicParam>lambdaQuery().eq(SysPublicParam::getPublicKey,CHAO_XIANG_PARAM_PRE+i));
|
|
|
- if (publicParam ==null){
|
|
|
- return Results.success();
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ LocalDateTime end = now.plusDays(1).plusNanos(-1);
|
|
|
+ LocalDateTime start = now.withHour(20).withMinute(0).withSecond(0).withNano(0);
|
|
|
+ if (now.isBefore(end)&&now.isAfter(start)){
|
|
|
+ int i = LocalDateTime.now().getDayOfWeek().getValue();
|
|
|
+ SysPublicParam publicParam = getOne(Wrappers.<SysPublicParam>lambdaQuery().eq(SysPublicParam::getPublicKey,CHAO_XIANG_PARAM_PRE+i));
|
|
|
+ if (publicParam ==null){
|
|
|
+ return Results.success();
|
|
|
+ }
|
|
|
+ return Results.success(publicParam.getPublicValue());
|
|
|
+ }else{
|
|
|
+ return Results.error(10,"活动20点准时开启.");
|
|
|
}
|
|
|
- return Results.success(publicParam.getPublicValue());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|