向前端推送暂降点
This commit is contained in:
@@ -54,6 +54,8 @@ public class SocketFreqConverterDevService {
|
|||||||
private String monitorId;
|
private String monitorId;
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
public static final String DIP_DATA_SUFFIX = "&&VOLTAGE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 连接设备Socket
|
* 连接设备Socket
|
||||||
*
|
*
|
||||||
@@ -224,7 +226,7 @@ public class SocketFreqConverterDevService {
|
|||||||
|
|
||||||
private void sendGetDipDataMsg(String devTag) {
|
private void sendGetDipDataMsg(String devTag) {
|
||||||
SocketMsg<String> socketMsg = new SocketMsg<>();
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + "&&VOLTAGE");
|
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + DIP_DATA_SUFFIX);
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
|
|
||||||
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
||||||
@@ -309,8 +311,7 @@ public class SocketFreqConverterDevService {
|
|||||||
testRes.setStartTime(lastStatusData.getTimestamp());
|
testRes.setStartTime(lastStatusData.getTimestamp());
|
||||||
|
|
||||||
FormalTestManager.pendingDipTaskMap.put(pqDipData.getId(), new FormalTestManager.PendingDipTask(
|
FormalTestManager.pendingDipTaskMap.put(pqDipData.getId(), new FormalTestManager.PendingDipTask(
|
||||||
pqDipData.getId(),
|
pqDipData,
|
||||||
pqDipData.getStartTime(),
|
|
||||||
targetEndTime,
|
targetEndTime,
|
||||||
originalTolerant
|
originalTolerant
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -7,16 +7,19 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
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.SocketDataMsg;
|
||||||
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
||||||
import com.njcn.gather.detection.util.socket.FormalTestManager;
|
import com.njcn.gather.detection.util.socket.FormalTestManager;
|
||||||
import com.njcn.gather.detection.util.socket.SocketManager;
|
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.NettyFreqConverterClientHandler;
|
import com.njcn.gather.detection.util.socket.cilent.NettyFreqConverterClientHandler;
|
||||||
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.freqConverter.config.FreqConverterConfig;
|
import com.njcn.gather.freqConverter.config.FreqConverterConfig;
|
||||||
import com.njcn.gather.freqConverter.pojo.po.FreqConverterStatus;
|
import com.njcn.gather.freqConverter.pojo.po.FreqConverterStatus;
|
||||||
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterConfig;
|
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterConfig;
|
||||||
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
|
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
|
||||||
|
import com.njcn.gather.freqConverter.pojo.vo.TolerantPointVO;
|
||||||
import com.njcn.gather.freqConverter.service.IFreqConverterService;
|
import com.njcn.gather.freqConverter.service.IFreqConverterService;
|
||||||
import com.njcn.gather.freqConverter.service.IPqFreqConverterConfigService;
|
import com.njcn.gather.freqConverter.service.IPqFreqConverterConfigService;
|
||||||
import com.njcn.gather.freqConverter.service.IPqFreqConverterTestResService;
|
import com.njcn.gather.freqConverter.service.IPqFreqConverterTestResService;
|
||||||
@@ -257,9 +260,9 @@ public class SocketFreqConverterService {
|
|||||||
List<String> finishedDipIdList = new ArrayList<>();
|
List<String> finishedDipIdList = new ArrayList<>();
|
||||||
List<PqFreqConverterTestRes> testResList = new ArrayList<>();
|
List<PqFreqConverterTestRes> testResList = new ArrayList<>();
|
||||||
for (FormalTestManager.PendingDipTask task : FormalTestManager.pendingDipTaskMap.values()) {
|
for (FormalTestManager.PendingDipTask task : FormalTestManager.pendingDipTaskMap.values()) {
|
||||||
PqFreqConverterTestRes testRes = pqFreqConverterTestResService.getByDipId(suffix, task.getDipId());
|
PqFreqConverterTestRes testRes = pqFreqConverterTestResService.getByDipId(suffix, task.getPqDipData().getId());
|
||||||
if (Objects.isNull(testRes)) {
|
if (Objects.isNull(testRes)) {
|
||||||
finishedDipIdList.add(task.getDipId());
|
finishedDipIdList.add(task.getPqDipData().getId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,9 +273,20 @@ public class SocketFreqConverterService {
|
|||||||
testResList.add(testRes);
|
testResList.add(testRes);
|
||||||
|
|
||||||
if (freqConverterStatus.getTimestamp().isAfter(task.getTargetEndTime())) {
|
if (freqConverterStatus.getTimestamp().isAfter(task.getTargetEndTime())) {
|
||||||
finishedDipIdList.add(task.getDipId());
|
finishedDipIdList.add(task.getPqDipData().getId());
|
||||||
|
|
||||||
|
SocketDataMsg socketDataMsg = new SocketDataMsg();
|
||||||
|
socketDataMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL + SocketFreqConverterDevService.DIP_DATA_SUFFIX);
|
||||||
|
|
||||||
|
TolerantPointVO tolerantPointVO = new TolerantPointVO();
|
||||||
|
tolerantPointVO.setResidualVoltage(task.getPqDipData().getResidualVoltage());
|
||||||
|
tolerantPointVO.setDurationMs(task.getPqDipData().getDurationMs());
|
||||||
|
tolerantPointVO.setTolerant(testRes.getTolerant());
|
||||||
|
socketDataMsg.setData(JSON.toJSONString(tolerantPointVO));
|
||||||
|
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pqFreqConverterTestResService.saveOrUpdateTestRes(suffix, testResList);
|
pqFreqConverterTestResService.saveOrUpdateTestRes(suffix, testResList);
|
||||||
|
|
||||||
for (String dipId : finishedDipIdList) {
|
for (String dipId : finishedDipIdList) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.gather.detection.pojo.po.DevData;
|
|||||||
import com.njcn.gather.detection.pojo.vo.DevLineTestResult;
|
import com.njcn.gather.detection.pojo.vo.DevLineTestResult;
|
||||||
import com.njcn.gather.device.pojo.enums.PatternEnum;
|
import com.njcn.gather.device.pojo.enums.PatternEnum;
|
||||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
|
import com.njcn.gather.dip.pojo.po.PqDipData;
|
||||||
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
|
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlanTestConfig;
|
import com.njcn.gather.plan.pojo.po.AdPlanTestConfig;
|
||||||
@@ -227,14 +228,13 @@ public class FormalTestManager {
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class PendingDipTask {
|
public static class PendingDipTask {
|
||||||
private final String dipId;
|
private PqDipData pqDipData;
|
||||||
private LocalDateTime startTime;
|
|
||||||
private LocalDateTime targetEndTime;
|
private LocalDateTime targetEndTime;
|
||||||
private Boolean originalTolerant;
|
private Boolean originalTolerant;
|
||||||
|
|
||||||
public PendingDipTask(String dipId, LocalDateTime startTime, LocalDateTime targetEndTime, Boolean originalTolerant) {
|
public PendingDipTask(PqDipData pqDipData, LocalDateTime targetEndTime, Boolean originalTolerant) {
|
||||||
this.dipId = dipId;
|
this.pqDipData = pqDipData;
|
||||||
this.startTime = startTime;
|
|
||||||
this.targetEndTime = targetEndTime;
|
this.targetEndTime = targetEndTime;
|
||||||
this.originalTolerant = originalTolerant;
|
this.originalTolerant = originalTolerant;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,12 +95,12 @@ public class FreqConverterController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/result")
|
@GetMapping("/result")
|
||||||
@ApiOperation("查询耐受实验结果")
|
@ApiOperation("查询变频器测试结果")
|
||||||
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||||
public HttpResult<List<TolerantPointVO>> result(@RequestParam("converterId") String converterId) {
|
public HttpResult<List<TolerantPointVO>> result(@RequestParam("converterId") String converterId) {
|
||||||
String methodDescribe = getMethodDescribe("result");
|
String methodDescribe = getMethodDescribe("result");
|
||||||
LogUtil.njcnDebug(log, "{},查询ID数据为:{}", methodDescribe, converterId);
|
LogUtil.njcnDebug(log, "{},查询ID数据为:{}", methodDescribe, converterId);
|
||||||
List<TolerantPointVO> tolerantPoints = freqConverterService.getTolerantPoints(converterId);
|
List<TolerantPointVO> tolerantPoints = freqConverterService.getDipPoints(converterId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tolerantPoints, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tolerantPoints, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public interface IFreqConverterService extends IService<FreqConverterStatus> {
|
|||||||
* @param converterId 变频器Id
|
* @param converterId 变频器Id
|
||||||
* @return 是否耐受
|
* @return 是否耐受
|
||||||
*/
|
*/
|
||||||
List<TolerantPointVO> getTolerantPoints(String converterId);
|
List<TolerantPointVO> getDipPoints(String converterId);
|
||||||
|
|
||||||
List<FreqConverterStatus> getDipDurationStatusData(Integer suffix, LocalDateTime startTime, LocalDateTime endTime);
|
List<FreqConverterStatus> getDipDurationStatusData(Integer suffix, LocalDateTime startTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -41,13 +39,14 @@ public class FreqConverterServiceImpl extends ServiceImpl<FreqConverterStatusMap
|
|||||||
private final IPqDipDataService dipDataService;
|
private final IPqDipDataService dipDataService;
|
||||||
private final IPqFreqConverterTestResService pqFreqConverterTestResService;
|
private final IPqFreqConverterTestResService pqFreqConverterTestResService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean saveFreqConverterStatus(Integer suffix, FreqConverterStatus status) {
|
public boolean saveFreqConverterStatus(Integer suffix, FreqConverterStatus status) {
|
||||||
if (status.getId() == null) {
|
if (status.getId() == null) {
|
||||||
status.setId(IdUtil.fastSimpleUUID());
|
status.setId(IdUtil.fastSimpleUUID());
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.setTableName("pq_freq_converter_status_" + suffix);
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + suffix);
|
||||||
boolean result = this.save(status);
|
boolean result = this.save(status);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return result;
|
return result;
|
||||||
@@ -57,7 +56,7 @@ public class FreqConverterServiceImpl extends ServiceImpl<FreqConverterStatusMap
|
|||||||
public List<FreqConverterStatus> listStatusData(String converterId) {
|
public List<FreqConverterStatus> listStatusData(String converterId) {
|
||||||
Integer suffix = pqFreqConverterConfigService.getSuffix(converterId);
|
Integer suffix = pqFreqConverterConfigService.getSuffix(converterId);
|
||||||
|
|
||||||
DynamicTableNameHandler.setTableName("pq_freq_converter_status_" + suffix);
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + suffix);
|
||||||
LambdaQueryChainWrapper<FreqConverterStatus> wrapper = this.lambdaQuery().orderByAsc(FreqConverterStatus::getTimestamp);
|
LambdaQueryChainWrapper<FreqConverterStatus> wrapper = this.lambdaQuery().orderByAsc(FreqConverterStatus::getTimestamp);
|
||||||
List<FreqConverterStatus> result = wrapper.list();
|
List<FreqConverterStatus> result = wrapper.list();
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
@@ -68,38 +67,33 @@ public class FreqConverterServiceImpl extends ServiceImpl<FreqConverterStatusMap
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void clearAllData(Integer suffix) {
|
public void clearAllData(Integer suffix) {
|
||||||
DynamicTableNameHandler.setTableName("pq_freq_converter_status_" + suffix);
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + suffix);
|
||||||
this.remove(null);
|
this.remove(null);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TolerantPointVO> getTolerantPoints(String converterId) {
|
public List<TolerantPointVO> getDipPoints(String converterId) {
|
||||||
Integer suffix = pqFreqConverterConfigService.getSuffix(converterId);
|
Integer suffix = pqFreqConverterConfigService.getSuffix(converterId);
|
||||||
List<PqDipData> dipDataList = dipDataService.listDipData(suffix);
|
|
||||||
List<PqFreqConverterTestRes> testResList = pqFreqConverterTestResService.listTestRes(suffix);
|
|
||||||
dipDataList.sort(Comparator.comparing(PqDipData::getDurationMs));
|
|
||||||
|
|
||||||
List<TolerantPointVO> res = new ArrayList<>();
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + suffix);
|
||||||
for (PqDipData dipData : dipDataList) {
|
List<PqFreqConverterTestRes> pqFreqConverterTestResList = pqFreqConverterTestResService.list();
|
||||||
|
List<TolerantPointVO> result = pqFreqConverterTestResList.stream().map(item -> {
|
||||||
|
PqDipData pqDipData = dipDataService.getById(item.getDipId());
|
||||||
TolerantPointVO tolerantPointVO = new TolerantPointVO();
|
TolerantPointVO tolerantPointVO = new TolerantPointVO();
|
||||||
tolerantPointVO.setDurationMs(dipData.getDurationMs());
|
tolerantPointVO.setDurationMs(pqDipData.getDurationMs());
|
||||||
tolerantPointVO.setResidualVoltage(dipData.getResidualVoltage());
|
tolerantPointVO.setResidualVoltage(pqDipData.getResidualVoltage());
|
||||||
List<PqFreqConverterTestRes> matchedResList = testResList.stream()
|
tolerantPointVO.setTolerant(item.getTolerant());
|
||||||
.filter(item -> dipData.getId().equals(item.getDipId()))
|
return tolerantPointVO;
|
||||||
.collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
DynamicTableNameHandler.remove();
|
||||||
|
|
||||||
boolean tolerant = matchedResList.stream().allMatch(PqFreqConverterTestRes::getTolerant);
|
return result;
|
||||||
tolerantPointVO.setTolerant(tolerant);
|
|
||||||
|
|
||||||
res.add(tolerantPointVO);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FreqConverterStatus> getDipDurationStatusData(Integer suffix, LocalDateTime startTime, LocalDateTime endTime) {
|
public List<FreqConverterStatus> getDipDurationStatusData(Integer suffix, LocalDateTime startTime, LocalDateTime endTime) {
|
||||||
DynamicTableNameHandler.setTableName("pq_freq_converter_status_" + suffix);
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + suffix);
|
||||||
List<FreqConverterStatus> result = this.lambdaQuery()
|
List<FreqConverterStatus> result = this.lambdaQuery()
|
||||||
.between(FreqConverterStatus::getTimestamp, startTime, endTime)
|
.between(FreqConverterStatus::getTimestamp, startTime, endTime)
|
||||||
.orderByAsc(FreqConverterStatus::getTimestamp)
|
.orderByAsc(FreqConverterStatus::getTimestamp)
|
||||||
@@ -110,7 +104,7 @@ public class FreqConverterServiceImpl extends ServiceImpl<FreqConverterStatusMap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FreqConverterStatus getLastStatusData(Integer suffix, LocalDateTime startTime) {
|
public FreqConverterStatus getLastStatusData(Integer suffix, LocalDateTime startTime) {
|
||||||
DynamicTableNameHandler.setTableName("pq_freq_converter_status_" + suffix);
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + suffix);
|
||||||
FreqConverterStatus one = this.lambdaQuery().le(FreqConverterStatus::getTimestamp, startTime)
|
FreqConverterStatus one = this.lambdaQuery().le(FreqConverterStatus::getTimestamp, startTime)
|
||||||
.orderByDesc(FreqConverterStatus::getTimestamp)
|
.orderByDesc(FreqConverterStatus::getTimestamp)
|
||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ import java.util.List;
|
|||||||
public class PqFreqConverterConfigServiceImpl extends ServiceImpl<PqFreqConverterConfigMapper, PqFreqConverterConfig> implements IPqFreqConverterConfigService {
|
public class PqFreqConverterConfigServiceImpl extends ServiceImpl<PqFreqConverterConfigMapper, PqFreqConverterConfig> implements IPqFreqConverterConfigService {
|
||||||
private final TableGenMapper tableGenMapper;
|
private final TableGenMapper tableGenMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表名前缀
|
||||||
|
*/
|
||||||
|
public static final String PQ_FREQ_CONVERTER_STATUS_TB_PREFIX = "pq_freq_converter_status_";
|
||||||
|
public static final String PQ_DIP_DATA_TB_PREFIX = "pq_diq_data_";
|
||||||
|
public static final String PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX = "pq_freq_converter_test_res_";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PqFreqConverterConfig> listPqFreqConverterConfigs(PqFreqConverterParam.QueryParam queryParam) {
|
public Page<PqFreqConverterConfig> listPqFreqConverterConfigs(PqFreqConverterParam.QueryParam queryParam) {
|
||||||
QueryWrapper wrapper = new QueryWrapper<>();
|
QueryWrapper wrapper = new QueryWrapper<>();
|
||||||
@@ -53,7 +60,7 @@ public class PqFreqConverterConfigServiceImpl extends ServiceImpl<PqFreqConverte
|
|||||||
maxSuffix = freqConverterConfig.getSuffix() + 1;
|
maxSuffix = freqConverterConfig.getSuffix() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
String tableSql = "CREATE TABLE `pq_freq_converter_status_" + maxSuffix + "` (" +
|
String tableSql = "CREATE TABLE `" + PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + maxSuffix + "`(" +
|
||||||
" `id` char(32) NOT NULL COMMENT '主键ID'," +
|
" `id` char(32) NOT NULL COMMENT '主键ID'," +
|
||||||
" `slave_address` int(11) DEFAULT NULL COMMENT '从机地址'," +
|
" `slave_address` int(11) DEFAULT NULL COMMENT '从机地址'," +
|
||||||
" `status_word1` int(11) DEFAULT NULL COMMENT '状态字1'," +
|
" `status_word1` int(11) DEFAULT NULL COMMENT '状态字1'," +
|
||||||
@@ -63,7 +70,7 @@ 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_dip_data_" + maxSuffix + "` (" +
|
tableSql = "CREATE TABLE `" + PQ_DIP_DATA_TB_PREFIX + maxSuffix + "` (" +
|
||||||
" `id` char(32) NOT NULL COMMENT '主键ID'," +
|
" `id` char(32) NOT NULL COMMENT '主键ID'," +
|
||||||
" `start_time` datetime(3) NOT NULL COMMENT '起始时间戳'," +
|
" `start_time` datetime(3) NOT NULL COMMENT '起始时间戳'," +
|
||||||
" `residual_voltage` decimal(6,2) NOT NULL COMMENT '残余电压(%Ur)'," +
|
" `residual_voltage` decimal(6,2) NOT NULL COMMENT '残余电压(%Ur)'," +
|
||||||
@@ -72,7 +79,7 @@ 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 + "` (" +
|
tableSql = "CREATE TABLE `" + PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + maxSuffix + "` (" +
|
||||||
" `id` char(32) NOT NULL COMMENT '主键ID'," +
|
" `id` char(32) NOT NULL COMMENT '主键ID'," +
|
||||||
" `dip_id` char(32) NOT NULL COMMENT '装置暂降数据id'," +
|
" `dip_id` char(32) NOT NULL COMMENT '装置暂降数据id'," +
|
||||||
" `start_time` datetime(3) DEFAULT NULL COMMENT '该暂降时期对应变频器的起始时间戳'," +
|
" `start_time` datetime(3) DEFAULT NULL COMMENT '该暂降时期对应变频器的起始时间戳'," +
|
||||||
@@ -105,9 +112,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 + ",")
|
sql.append(PQ_FREQ_CONVERTER_STATUS_TB_PREFIX + suffix + ",")
|
||||||
.append("pq_dip_data_" + suffix + ",")
|
.append(PQ_DIP_DATA_TB_PREFIX + suffix + ",")
|
||||||
.append("pq_freq_converter_test_res_" + suffix + ",");
|
.append(PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + suffix + ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.deleteCharAt(sql.length() - 1);
|
sql.deleteCharAt(sql.length() - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user