清空所有客户端缓存
This commit is contained in:
@ -39,6 +39,7 @@ logging:
|
||||
org.springframework: warn
|
||||
org.mybatis.spring.mapper: error
|
||||
org.apache.fury: warn
|
||||
com.fuyuanshen.web.service.impl.ClientServiceImpl: debug
|
||||
config: classpath:logback-plus.xml
|
||||
|
||||
# 用户配置
|
||||
|
@ -39,8 +39,8 @@ public class EncryptUtilsTest {
|
||||
loginBody.setClientId("e5cd7e4891bf95d1d19206ce24a7b32e");
|
||||
loginBody.setGrantType("password");
|
||||
loginBody.setTenantId("894078");
|
||||
loginBody.setCode("10");
|
||||
loginBody.setUuid("390942eb87174dcc9c2c074b066b1b79");
|
||||
loginBody.setCode("0");
|
||||
loginBody.setUuid("1c285b27f516486f9535face77023aeb");
|
||||
// loginBody.setUsername("admin");
|
||||
// loginBody.setPassword("admin123");
|
||||
loginBody.setUsername("dyf");
|
||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -17,83 +18,76 @@ import lombok.Data;
|
||||
**/
|
||||
@Data
|
||||
@TableName("device")
|
||||
@JsonInclude(JsonInclude.Include.ALWAYS) // 关键注解
|
||||
@JsonInclude(JsonInclude.Include.ALWAYS) // 关键注解
|
||||
public class Device extends TenantEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
// @Schema(value = "ID")
|
||||
@Schema(name = "ID")
|
||||
private Long id;
|
||||
|
||||
// @Schema(value = "设备记录ID")
|
||||
@Schema(name = "设备记录ID")
|
||||
@TableField(exist = false)
|
||||
private Long assignId;
|
||||
|
||||
// @Schema(value = "设备类型")
|
||||
@Schema(name = "设备类型")
|
||||
private Long deviceType;
|
||||
|
||||
// @Schema(value = "设备类型名称")
|
||||
@Schema(name = "设备类型名称")
|
||||
private String typeName;
|
||||
|
||||
// @Schema(value = "客户号")
|
||||
@Schema(name = "客户号")
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 当前所有者
|
||||
* current_owner_id
|
||||
*/
|
||||
// @Schema(value = "当前所有者")
|
||||
@Schema(name = "当前所有者")
|
||||
private Long currentOwnerId;
|
||||
|
||||
/**
|
||||
* 原始所有者(创建者)
|
||||
* original_owner_id
|
||||
*/
|
||||
// @Schema(value = "原始所有者(创建者)")
|
||||
@Schema(name = "原始所有者(创建者)")
|
||||
private Long originalOwnerId;
|
||||
|
||||
// @Schema(value = "所属客户")
|
||||
@Schema(name = "所属客户")
|
||||
private String customerName;
|
||||
|
||||
/*@Schema(value = "设备编号")
|
||||
/*@Schema( name = "设备编号")
|
||||
private String deviceNo;*/
|
||||
|
||||
// @Schema(value = "设备名称")
|
||||
@Schema(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
// @Schema(value = "设备图片")
|
||||
@Schema(name = "设备图片")
|
||||
private String devicePic;
|
||||
|
||||
// @Schema(value = "设备MAC")
|
||||
@Schema(name = "设备MAC")
|
||||
private String deviceMac;
|
||||
|
||||
// @Schema(value = "设备IMEI")
|
||||
@Schema(name = "设备IMEI")
|
||||
private String deviceImei;
|
||||
|
||||
// @Schema(value = "设备SN")
|
||||
@Schema(name = "设备SN")
|
||||
private String deviceSn;
|
||||
|
||||
// @Schema(value = "经度")
|
||||
@Schema(name = "经度")
|
||||
private String longitude;
|
||||
|
||||
// @Schema(value = "纬度")
|
||||
@Schema(name = "纬度")
|
||||
private String latitude;
|
||||
|
||||
// @Schema(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
// @TableField(value = "tenant_id")
|
||||
// // @Schema(hidden = true)
|
||||
// private Long tenantId;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
* 0 失效
|
||||
* 1 正常
|
||||
*/
|
||||
// @Schema(value = "设备状态")
|
||||
@Schema(name = "设备状态")
|
||||
private Integer deviceStatus;
|
||||
|
||||
/**
|
||||
@ -101,12 +95,7 @@ public class Device extends TenantEntity {
|
||||
* 0 未绑定
|
||||
* 1 已绑定
|
||||
*/
|
||||
// @Schema(value = "绑定状态")
|
||||
@Schema(name = "绑定状态")
|
||||
private Integer bindingStatus;
|
||||
|
||||
|
||||
public void copy(Device source) {
|
||||
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.fuyuanshen.equipment.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -96,6 +95,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
// 获取当前登录用户信息
|
||||
// LoginUser user = LoginHelper.getLoginUser();
|
||||
|
||||
|
||||
// 保存图片并获取URL
|
||||
String imageUrl = saveDeviceImage(deviceForm.getFile(), deviceForm.getDeviceName());
|
||||
// 设置图片路径
|
||||
@ -110,6 +110,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新设备信息
|
||||
*
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuyuanshen.system.controller.system;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.fuyuanshen.common.core.constant.CacheNames;
|
||||
import com.fuyuanshen.common.core.domain.R;
|
||||
import com.fuyuanshen.common.excel.utils.ExcelUtil;
|
||||
import com.fuyuanshen.common.log.annotation.Log;
|
||||
@ -13,6 +14,7 @@ import com.fuyuanshen.system.domain.vo.SysConfigVo;
|
||||
import com.fuyuanshen.system.service.ISysConfigService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -134,4 +136,15 @@ public class SysConfigController extends BaseController {
|
||||
configService.resetConfigCache();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清空所有客户端缓存
|
||||
*/
|
||||
@GetMapping(value = "/clearAllClientCache")
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_CLIENT, allEntries = true)
|
||||
public void clearAllClientCache() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ public class SysClientServiceImpl implements ISysClientService {
|
||||
@Cacheable(cacheNames = CacheNames.SYS_CLIENT, key = "#clientId")
|
||||
@Override
|
||||
public SysClientVo queryByClientId(String clientId) {
|
||||
log.debug("【queryByClientId】缓存未命中,开始执行数据库查询,clientId={}", clientId);
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<SysClient>().eq(SysClient::getClientId, clientId));
|
||||
}
|
||||
|
||||
@ -125,16 +126,16 @@ public class SysClientServiceImpl implements ISysClientService {
|
||||
@Override
|
||||
public int updateClientStatus(String clientId, String status) {
|
||||
return baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysClient>()
|
||||
.set(SysClient::getStatus, status)
|
||||
.eq(SysClient::getClientId, clientId));
|
||||
new LambdaUpdateWrapper<SysClient>()
|
||||
.set(SysClient::getStatus, status)
|
||||
.eq(SysClient::getClientId, clientId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysClient entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +145,7 @@ public class SysClientServiceImpl implements ISysClientService {
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user