耐受结果、变频器重新连接Socket调整

This commit is contained in:
caozehui
2026-04-15 09:45:53 +08:00
parent 2293d81b71
commit c5e77ee9b1
14 changed files with 147 additions and 62 deletions

View File

@@ -181,22 +181,22 @@ public class PreDetectionController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@GetMapping("/startFreqConverter") @GetMapping("/startFreqConverter")
@ApiOperation("开启变频器测试") @ApiOperation("开启变频器测试")
public HttpResult<String> startFreqConverter(@RequestParam("loginName") String loginName, @RequestParam("converterId") String converterId, @RequestParam("monitorId") String monitorId) { public HttpResult<String> startFreqConverter(@RequestParam("userId") String userId, @RequestParam("converterId") String converterId, @RequestParam("monitorId") String monitorId) {
String methodDescribe = getMethodDescribe("startFreqConverter"); String methodDescribe = getMethodDescribe("startFreqConverter");
LogUtil.njcnDebug(log, "{}", methodDescribe); LogUtil.njcnDebug(log, "{}", methodDescribe);
preDetectionService.startFreqConverter(loginName, converterId, monitorId); preDetectionService.startFreqConverter(userId, converterId, monitorId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@GetMapping("/stopFreqConverter") @GetMapping("/stopFreqConverter")
@ApiOperation("关闭变频器测试") @ApiOperation("关闭变频器测试")
public HttpResult<String> stopFreqConverter(@RequestParam("loginName") String loginName) { public HttpResult<String> stopFreqConverter(@RequestParam("userId") String userId) {
String methodDescribe = getMethodDescribe("stopFreqConverter"); String methodDescribe = getMethodDescribe("stopFreqConverter");
LogUtil.njcnDebug(log, "{}", methodDescribe); LogUtil.njcnDebug(log, "{}", methodDescribe);
preDetectionService.stopFreqConverter(loginName + CnSocketUtil.FREQ_CONVERTER_TAG, loginName + CnSocketUtil.DEV_TAG); preDetectionService.stopFreqConverter(userId + CnSocketUtil.FREQ_CONVERTER_TAG, userId + CnSocketUtil.DEV_TAG);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
} }

View File

@@ -19,11 +19,12 @@ import com.njcn.gather.detection.util.socket.SocketManager;
import com.njcn.gather.detection.util.socket.cilent.NettyClient; import com.njcn.gather.detection.util.socket.cilent.NettyClient;
import com.njcn.gather.detection.util.socket.cilent.NettyFreqConverterDevClientHandler; import com.njcn.gather.detection.util.socket.cilent.NettyFreqConverterDevClientHandler;
import com.njcn.gather.detection.util.socket.config.SocketConnectionConfig; import com.njcn.gather.detection.util.socket.config.SocketConnectionConfig;
import com.njcn.gather.detection.util.socket.websocket.WebServiceManager;
import com.njcn.gather.device.pojo.vo.PreDetection; import com.njcn.gather.device.pojo.vo.PreDetection;
import com.njcn.gather.device.service.IPqDevService; import com.njcn.gather.device.service.IPqDevService;
import com.njcn.gather.dip.pojo.po.PqDipData; import com.njcn.gather.dip.pojo.po.PqDipData;
import com.njcn.gather.dip.service.IPqDipDataService; import com.njcn.gather.dip.service.IPqDipDataService;
import com.njcn.gather.freqConverter.service.IPqFreqConverterConfigService; import com.njcn.gather.freqConverter.service.IPqFreqConverterTestResService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -41,8 +42,9 @@ public class SocketFreqConverterDevService {
private final SocketConnectionConfig socketConnectionConfig; private final SocketConnectionConfig socketConnectionConfig;
private final IPqDevService pqDevService; private final IPqDevService pqDevService;
private final IPqDipDataService pqDipDataService; private final IPqDipDataService pqDipDataService;
private final IPqFreqConverterConfigService pqFreqConverterConfigService; private final IPqFreqConverterTestResService pqFreqConverterTestResService;
private String monitorId; private String monitorId;
private String userId;
/** /**
* 连接设备Socket * 连接设备Socket
@@ -62,18 +64,21 @@ public class SocketFreqConverterDevService {
}); });
} }
private void init(String converterId, String monitorId) { private void init(String userId, String converterId, String monitorId) {
FormalTestManager.freqConverterDevStep = null; FormalTestManager.freqConverterDevStep = null;
FormalTestManager.stopFlag = false; FormalTestManager.stopFlag = false;
FormalTestManager.isRemoveSocket = false;
pqDipDataService.clearAllData(FormalTestManager.freqConverterTableSuffix); pqDipDataService.clearAllData(FormalTestManager.freqConverterTableSuffix);
pqFreqConverterTestResService.clearAllData(FormalTestManager.freqConverterTableSuffix);
this.userId = userId;
this.monitorId = monitorId; this.monitorId = monitorId;
} }
/** /**
* 连接设备 * 连接设备
*/ */
public void connectionDev(String devTag, String converterId, String monitorId) { public void connectionDev(String userId, String devTag, String converterId, String monitorId) {
this.init(converterId, monitorId); this.init(userId, converterId, monitorId);
String payload = buildSingleMonitorPayload(monitorId); String payload = buildSingleMonitorPayload(monitorId);
if (StrUtil.isBlank(payload)) { if (StrUtil.isBlank(payload)) {
@@ -107,6 +112,11 @@ public class SocketFreqConverterDevService {
private void handleYjcSbtxjy(String devTag, SocketDataMsg socketDataMsg) { private void handleYjcSbtxjy(String devTag, SocketDataMsg socketDataMsg) {
SourceResponseCodeEnum responseCodeEnum = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode()); SourceResponseCodeEnum responseCodeEnum = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode());
switch (Objects.requireNonNull(responseCodeEnum)) { switch (Objects.requireNonNull(responseCodeEnum)) {
case UNPROCESSED_BUSINESS:
break;
case RE_OPERATE:
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
break;
case SUCCESS: case SUCCESS:
this.sendGetDipDataMsg(devTag); this.sendGetDipDataMsg(devTag);
FormalTestManager.freqConverterDevStep = SourceOperateCodeEnum.FORMAL_REAL; FormalTestManager.freqConverterDevStep = SourceOperateCodeEnum.FORMAL_REAL;
@@ -147,7 +157,7 @@ public class SocketFreqConverterDevService {
switch (responseCodeEnum) { switch (responseCodeEnum) {
case SUCCESS: case SUCCESS:
cleanup(devTag, true); cleanup(devTag);
break; break;
default: default:
log.warn("设备关闭响应失败devTag={}, operateCode={}, code={}, data={}", devTag, socketDataMsg.getOperateCode(), socketDataMsg.getCode(), socketDataMsg.getData()); log.warn("设备关闭响应失败devTag={}, operateCode={}, code={}, data={}", devTag, socketDataMsg.getOperateCode(), socketDataMsg.getCode(), socketDataMsg.getData());
@@ -179,7 +189,7 @@ public class SocketFreqConverterDevService {
} }
List<PreDetection.MonitorListDTO> matchedMonitorList = monitorList.stream() List<PreDetection.MonitorListDTO> matchedMonitorList = monitorList.stream()
.filter(item -> split[1].equals(item.getLineId())) .filter(item -> split[1].equals(StrUtil.EMPTY + item.getLine()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (CollUtil.isEmpty(matchedMonitorList)) { if (CollUtil.isEmpty(matchedMonitorList)) {
return null; return null;
@@ -264,12 +274,9 @@ public class SocketFreqConverterDevService {
return listDTO.getT(); return listDTO.getT();
} }
public void cleanup(String devTag, boolean removeSocket) { public void cleanup(String devTag) {
FormalTestManager.freqConverterDevStep = null; FormalTestManager.freqConverterDevStep = null;
if (removeSocket) { FormalTestManager.isRemoveSocket = true;
SocketManager.removeUser(devTag); SocketManager.removeUser(devTag);
} else {
SocketManager.clearUser(devTag);
}
} }
} }

View File

@@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
import com.njcn.gather.detection.pojo.dto.FreqConverterRespDTO; import com.njcn.gather.detection.pojo.dto.FreqConverterRespDTO;
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum; import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
import com.njcn.gather.detection.pojo.vo.SocketMsg; import com.njcn.gather.detection.pojo.vo.SocketMsg;
@@ -42,6 +41,7 @@ public class SocketFreqConverterService {
private final SocketConnectionConfig socketConnectionConfig; private final SocketConnectionConfig socketConnectionConfig;
private final IPqFreqConverterConfigService pqFreqConverterConfigService; private final IPqFreqConverterConfigService pqFreqConverterConfigService;
private String userId;
/** /**
* 连接变频器Socket * 连接变频器Socket
@@ -98,19 +98,21 @@ public class SocketFreqConverterService {
} }
} }
private void init(String converterId, String monitorId) { private void init(String userId, String converterId, String monitorId) {
this.userId = userId;
FormalTestManager.freqConverterStep = null; FormalTestManager.freqConverterStep = null;
Integer suffix = pqFreqConverterConfigService.getSuffix(converterId); Integer suffix = pqFreqConverterConfigService.getSuffix(converterId);
freqConverterService.clearAllData(suffix); freqConverterService.clearAllData(suffix);
FormalTestManager.freqConverterTableSuffix = suffix; FormalTestManager.freqConverterTableSuffix = suffix;
FormalTestManager.isRemoveSocket = false;
clearScheduleTask(); clearScheduleTask();
} }
/** /**
* 连接变频器 * 连接变频器
*/ */
public void connectionFreqConverter(String freqConverterTag, String converterId, String monitorId) { public void connectionFreqConverter(String userId, String freqConverterTag, String converterId, String monitorId) {
this.init(converterId, monitorId); this.init(userId, converterId, monitorId);
SocketMsg<Map<String, Object>> socketMsg = new SocketMsg<>(); SocketMsg<Map<String, Object>> socketMsg = new SocketMsg<>();
socketMsg.setOperateCode(SourceOperateCodeEnum.CMD_INIT_SERIAL.getValue()); socketMsg.setOperateCode(SourceOperateCodeEnum.CMD_INIT_SERIAL.getValue());
@@ -154,19 +156,12 @@ public class SocketFreqConverterService {
this.sendClose(converterTag); this.sendClose(converterTag);
} }
public void cleanup(String converterChannelTag, boolean removeSocket) { public void cleanup(String converterChannelTag) {
clearScheduleTask(); clearScheduleTask();
FormalTestManager.freqConverterStep = null; FormalTestManager.freqConverterStep = null;
if (!removeSocket) { FormalTestManager.stopFlag = false;
FormalTestManager.stopFlag = true; FormalTestManager.isRemoveSocket = true;
} else { SocketManager.removeUser(converterChannelTag);
FormalTestManager.stopFlag = false;
}
if (removeSocket) {
SocketManager.removeUser(converterChannelTag);
} else {
SocketManager.clearUser(converterChannelTag);
}
} }
private void handleInitSerial(String converterChannelTag, FreqConverterRespDTO respDTO) { private void handleInitSerial(String converterChannelTag, FreqConverterRespDTO respDTO) {
@@ -177,7 +172,7 @@ public class SocketFreqConverterService {
FormalTestManager.scheduler = Executors.newScheduledThreadPool(1); FormalTestManager.scheduler = Executors.newScheduledThreadPool(1);
FormalTestManager.scheduledFuture = FormalTestManager.scheduler.scheduleAtFixedRate(() -> { FormalTestManager.scheduledFuture = FormalTestManager.scheduler.scheduleAtFixedRate(() -> {
this.sendGetDeviceStatusMsg(converterChannelTag); this.sendGetDeviceStatusMsg(converterChannelTag);
}, 0l, 200l, TimeUnit.MILLISECONDS); }, 0l, 200l, TimeUnit.SECONDS);
} }
} else { } else {
log.error("变频器初始化串口失败converterChannelTag={}, converterId={}, converterTag={}, msg={}", converterChannelTag, converterChannelTag, converterChannelTag, respDTO.getMessage()); log.error("变频器初始化串口失败converterChannelTag={}, converterId={}, converterTag={}, msg={}", converterChannelTag, converterChannelTag, converterChannelTag, respDTO.getMessage());
@@ -197,12 +192,12 @@ public class SocketFreqConverterService {
} else { } else {
FormalTestManager.stopFlag = false; FormalTestManager.stopFlag = false;
} }
freqConverterService.saveFreqConverterStatus(FormalTestManager.freqConverterTableSuffix,freqConverterStatus); freqConverterService.saveFreqConverterStatus(FormalTestManager.freqConverterTableSuffix, freqConverterStatus);
} }
private void handleCloseSerial(String converterChannelTag, FreqConverterRespDTO respDTO) { private void handleCloseSerial(String converterChannelTag, FreqConverterRespDTO respDTO) {
if (respDTO.getCode() == 0 && respDTO.getSuccess()) { if (respDTO.getCode() == 0 && respDTO.getSuccess()) {
cleanup(converterChannelTag, true); cleanup(converterChannelTag);
} else { } else {
this.sendClose(converterChannelTag); this.sendClose(converterChannelTag);
} }

View File

@@ -65,7 +65,7 @@ public interface PreDetectionService {
void startCoefficient(); void startCoefficient();
void startFreqConverter(String name, String converterId, String monitorId); void startFreqConverter(String userId, String converterId, String monitorId);
void stopFreqConverter(String converterId, String monitorId); void stopFreqConverter(String converterId, String monitorId);
} }

View File

@@ -394,19 +394,19 @@ public class PreDetectionServiceImpl implements PreDetectionService {
} }
@Override @Override
public void startFreqConverter(String loginName, String converterId, String monitorId) { public void startFreqConverter(String userId, String converterId, String monitorId) {
String freqConverterTag = loginName + CnSocketUtil.FREQ_CONVERTER_TAG; String freqConverterTag = userId + CnSocketUtil.FREQ_CONVERTER_TAG;
String devTag = loginName + CnSocketUtil.DEV_TAG; String devTag = userId + CnSocketUtil.DEV_TAG;
socketFreqConverterService.connectSocket(freqConverterTag); socketFreqConverterService.connectSocket(freqConverterTag);
//socketFreqConverterDevService.connectSocket(devTag); socketFreqConverterDevService.connectSocket(devTag);
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
long timeout = 3000; // 3秒超时时间 long timeout = 3000; // 3秒超时时间
while (true) { while (true) {
// if (SocketManager.isChannelActive(freqConverterTag) && SocketManager.isChannelActive(devTag)) { if (SocketManager.isChannelActive(freqConverterTag) && SocketManager.isChannelActive(devTag)) {
if (SocketManager.isChannelActive(freqConverterTag)) { // if (SocketManager.isChannelActive(freqConverterTag)) {
socketFreqConverterService.connectionFreqConverter(freqConverterTag, converterId, monitorId); socketFreqConverterService.connectionFreqConverter(userId, freqConverterTag, converterId, monitorId);
//socketFreqConverterDevService.connectionDev(devTag, converterId, monitorId); socketFreqConverterDevService.connectionDev(userId, devTag, converterId, monitorId);
break; break;
} }
@@ -421,7 +421,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
@Override @Override
public void stopFreqConverter(String converterTag, String devTag) { public void stopFreqConverter(String converterTag, String devTag) {
socketFreqConverterService.stopTest(converterTag, devTag); socketFreqConverterService.stopTest(converterTag, devTag);
socketFreqConverterDevService.stopTest(converterTag, converterTag); socketFreqConverterDevService.stopTest(converterTag, devTag);
} }
/** /**

View File

@@ -81,17 +81,6 @@ public class SocketManager {
socketGroup.remove(userId); socketGroup.remove(userId);
} }
public static void clearUser(String userId) {
Channel channel = socketSessions.remove(userId);
NioEventLoopGroup eventExecutors = socketGroup.remove(userId);
if (ObjectUtil.isNotNull(eventExecutors)) {
eventExecutors.shutdownGracefully();
}
if (ObjectUtil.isNotNull(channel)) {
log.info("{}__{}已清理客户端会话", userId, channel.id());
}
}
public static Channel getChannelByUserId(String userId) { public static Channel getChannelByUserId(String userId) {
return socketSessions.get(userId); return socketSessions.get(userId);
} }

View File

@@ -50,7 +50,7 @@ public class NettyFreqConverterClientHandler extends SimpleChannelInboundHandler
/** /**
* 构造方法 * 构造方法
* *
* @param converterChannelTag 变频器Chanel唯一标识符 * @param converterChannelTag 变频器Chanel唯一标识符
* @param socketFreqConverterService 变频器Socket响应服务 * @param socketFreqConverterService 变频器Socket响应服务
*/ */
public NettyFreqConverterClientHandler(String converterChannelTag, SocketFreqConverterService socketFreqConverterService) { public NettyFreqConverterClientHandler(String converterChannelTag, SocketFreqConverterService socketFreqConverterService) {
@@ -93,9 +93,9 @@ public class NettyFreqConverterClientHandler extends SimpleChannelInboundHandler
public void channelInactive(ChannelHandlerContext ctx) throws Exception { public void channelInactive(ChannelHandlerContext ctx) throws Exception {
log.warn("变频器连接已断开converterChannelTag={}", converterChannelTag); log.warn("变频器连接已断开converterChannelTag={}", converterChannelTag);
socketFreqConverterService.cleanup(converterChannelTag, false); socketFreqConverterService.cleanup(converterChannelTag);
if (!isReconnecting && reconnectAttempts < MAX_RECONNECT_ATTEMPTS) { if (!isReconnecting && reconnectAttempts < MAX_RECONNECT_ATTEMPTS && !FormalTestManager.isRemoveSocket) {
attemptReconnect(ctx); attemptReconnect(ctx);
} else if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) { } else if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
log.error("变频器重连失败,已达到最大重连次数{}次converterChannelTag={}", MAX_RECONNECT_ATTEMPTS, converterChannelTag); log.error("变频器重连失败,已达到最大重连次数{}次converterChannelTag={}", MAX_RECONNECT_ATTEMPTS, converterChannelTag);

View File

@@ -44,7 +44,7 @@ public class NettyFreqConverterDevClientHandler extends SimpleChannelInboundHand
@Override @Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception { public void channelInactive(ChannelHandlerContext ctx) throws Exception {
log.warn("设备连接已断开devChannelTag={}", devChannelTag); log.warn("设备连接已断开devChannelTag={}", devChannelTag);
socketFreqConverterDevService.cleanup(devChannelTag, false); socketFreqConverterDevService.cleanup(devChannelTag);
super.channelInactive(ctx); super.channelInactive(ctx);
} }

View File

@@ -0,0 +1,11 @@
package com.njcn.gather.freqConverter.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
/**
* @author caozehui
* @data 2026-04-14
*/
public interface PqFreqConverterTestResMapper extends MPJBaseMapper<PqFreqConverterTestRes> {
}

View File

@@ -0,0 +1,32 @@
package com.njcn.gather.freqConverter.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author caozehui
* @data 2026-04-14
*/
@Data
@TableName(value = "ad_harmonic_xx")
public class PqFreqConverterTestRes {
/**
* 主键ID
*/
private String id;
/**
* 装置暂降数据id
*/
private String dipId;
/**
* 变频器状态数据id
*/
private String statusId;
/**
* 0为不耐受1为耐受
*/
private Boolean tolerant;
}

View File

@@ -0,0 +1,18 @@
package com.njcn.gather.freqConverter.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
/**
* @author caozehui
* @data 2026-04-14
*/
public interface IPqFreqConverterTestResService extends IService<PqFreqConverterTestRes> {
/**
* 清空所有数据
*
* @param suffix 表后缀
* @return
*/
void clearAllData(Integer suffix);
}

View File

@@ -72,6 +72,15 @@ public class PqFreqConverterConfigServiceImpl extends ServiceImpl<PqFreqConverte
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='电压暂降数据表';"; ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='电压暂降数据表';";
tableGenMapper.genTable(tableSql); tableGenMapper.genTable(tableSql);
tableSql = "CREATE TABLE `pq_freq_converter_test_res_" + maxSuffix + "` (" +
" `id` char(32) NOT NULL COMMENT '主键ID'," +
" `dip_id` char(32) NOT NULL COMMENT '装置暂降数据id'," +
" `status_id` char(32) NOT NULL COMMENT '变频器状态数据id'," +
" `tolerant` tinyInt(1) NOT NULL COMMENT '0为不耐受1为耐受'," +
" PRIMARY KEY (`id`)" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='变频器耐受实验结果';";
tableGenMapper.genTable(tableSql);
PqFreqConverterConfig pqFreqConverterConfig = BeanUtil.copyProperties(param, PqFreqConverterConfig.class); PqFreqConverterConfig pqFreqConverterConfig = BeanUtil.copyProperties(param, PqFreqConverterConfig.class);
pqFreqConverterConfig.setSuffix(maxSuffix); pqFreqConverterConfig.setSuffix(maxSuffix);
pqFreqConverterConfig.setState(DataStateEnum.ENABLE.getCode()); pqFreqConverterConfig.setState(DataStateEnum.ENABLE.getCode());
@@ -94,7 +103,9 @@ public class PqFreqConverterConfigServiceImpl extends ServiceImpl<PqFreqConverte
List<PqFreqConverterConfig> pqFreqConverterConfigs = this.listByIds(ids); List<PqFreqConverterConfig> pqFreqConverterConfigs = this.listByIds(ids);
for (PqFreqConverterConfig pqFreqConverterConfig : pqFreqConverterConfigs) { for (PqFreqConverterConfig pqFreqConverterConfig : pqFreqConverterConfigs) {
Integer suffix = pqFreqConverterConfig.getSuffix(); Integer suffix = pqFreqConverterConfig.getSuffix();
sql.append("pq_freq_converter_status_" + suffix + ",").append("pq_dip_data_" + suffix + ","); sql.append("pq_freq_converter_status_" + suffix + ",")
.append("pq_dip_data_" + suffix + ",")
.append("pq_freq_converter_test_res_" + suffix + ",");
} }
sql.deleteCharAt(sql.length() - 1); sql.deleteCharAt(sql.length() - 1);

View File

@@ -0,0 +1,22 @@
package com.njcn.gather.freqConverter.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
import com.njcn.gather.freqConverter.mapper.PqFreqConverterTestResMapper;
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
import com.njcn.gather.freqConverter.service.IPqFreqConverterTestResService;
import org.springframework.stereotype.Service;
/**
* @author caozehui
* @data 2026-04-14
*/
@Service
public class PqFreqConverterTestResServiceImpl extends ServiceImpl<PqFreqConverterTestResMapper, PqFreqConverterTestRes> implements IPqFreqConverterTestResService {
@Override
public void clearAllData(Integer suffix) {
DynamicTableNameHandler.setTableName("pq_freq_converter_test_res_" + suffix);
this.remove(null);
DynamicTableNameHandler.remove();
}
}

View File

@@ -63,7 +63,7 @@ socket:
# port: 61000 # port: 61000
webSocket: webSocket:
port: 7777 port: 7778
#源参数下发,暂态数据默认值 #源参数下发,暂态数据默认值
Dip: Dip: