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