fix: stat traffic
This commit is contained in:
@@ -40,7 +40,7 @@ public class JacksonConfig {
|
|||||||
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
|
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
|
||||||
builder.modules(javaTimeModule);
|
builder.modules(javaTimeModule);
|
||||||
builder.timeZone(TimeZone.getDefault());
|
builder.timeZone(TimeZone.getDefault());
|
||||||
log.info("初始化 jackson 配置");
|
log.info("init jackson config");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import org.wfc.common.core.web.controller.BaseController;
|
import org.wfc.common.core.web.controller.BaseController;
|
||||||
import org.wfc.common.core.web.domain.AjaxResult;
|
import org.wfc.common.core.web.domain.AjaxResult;
|
||||||
import org.wfc.common.core.web.page.TableDataInfo;
|
import org.wfc.common.core.web.page.TableDataInfo;
|
||||||
import org.wfc.common.security.utils.SecurityUtils;
|
|
||||||
import org.wfc.user.domain.UOrder;
|
import org.wfc.user.domain.UOrder;
|
||||||
import org.wfc.user.service.IUOrderService;
|
import org.wfc.user.service.IUOrderService;
|
||||||
|
|
||||||
@@ -54,7 +53,6 @@ public class UOrderController extends BaseController {
|
|||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody UOrder uOrder) {
|
public AjaxResult add(@RequestBody UOrder uOrder) {
|
||||||
uOrder.setUserId(SecurityUtils.getUserId());
|
|
||||||
return toAjax(uOrderService.saveOrder(uOrder));
|
return toAjax(uOrderService.saveOrder(uOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.wfc.user.service.impl;
|
package org.wfc.user.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -74,9 +75,11 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
|
|||||||
.map(UAccount::getUserId)
|
.map(UAccount::getUserId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
List<UClient> clients = clientMapper.selectList(Wrappers.<UClient>lambdaQuery().in(UClient::getUserId, userIds));
|
if (CollUtil.isNotEmpty(userIds)) {
|
||||||
for (UClient client : clients) {
|
List<UClient> clients = clientMapper.selectList(Wrappers.<UClient>lambdaQuery().in(UClient::getUserId, userIds));
|
||||||
omadaAuthorizedClientApi.cancelAuthClient(client.getSiteId(), client.getClientMac());
|
for (UClient client : clients) {
|
||||||
|
omadaAuthorizedClientApi.cancelAuthClient(client.getSiteId(), client.getClientMac());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.wfc.common.security.utils.SecurityUtils;
|
||||||
import org.wfc.omada.api.hotspot.OmadaAuthorizedClientApi;
|
import org.wfc.omada.api.hotspot.OmadaAuthorizedClientApi;
|
||||||
import org.wfc.user.domain.UAccount;
|
import org.wfc.user.domain.UAccount;
|
||||||
import org.wfc.user.domain.UClient;
|
import org.wfc.user.domain.UClient;
|
||||||
@@ -131,6 +132,7 @@ public class UOrderServiceImpl extends ServiceImpl<UOrderMapper, UOrder> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveOrder(UOrder order) {
|
public boolean saveOrder(UOrder order) {
|
||||||
|
order.setUserId(SecurityUtils.getUserId());
|
||||||
order.setStatus(OrderStatusEnum.UNPAID.getCode());
|
order.setStatus(OrderStatusEnum.UNPAID.getCode());
|
||||||
this.save(order);
|
this.save(order);
|
||||||
// 支付成功回调
|
// 支付成功回调
|
||||||
|
|||||||
@@ -26,17 +26,18 @@
|
|||||||
WHERE
|
WHERE
|
||||||
cdr.del_flag = 0
|
cdr.del_flag = 0
|
||||||
AND cdr.last_seen_time != ifnull( ch.end_time, 0 )
|
AND cdr.last_seen_time != ifnull( ch.end_time, 0 )
|
||||||
<if test="userId != null and userId != ''">AND cdr.user_id = #{userId}
|
<if test="userId != null and userId != ''">
|
||||||
|
AND cdr.user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
cdr.user_id
|
cdr.user_id
|
||||||
) t
|
) t
|
||||||
<where>
|
<where>
|
||||||
<if test="endTime != null">
|
<if test="endTime != null">
|
||||||
t.last_seen_time <= #{endTime}
|
AND t.end_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null">
|
<if test="startTime != null">
|
||||||
t.start_time >= #{startTime}
|
AND t.start_time >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user