fix: 调整提示

dev
huangfeng 8 months ago
parent ee41eaf575
commit 07e861c3ea

@ -155,6 +155,9 @@ public class IcdConfigController extends BasicController {
@PostMapping("startCollect") @PostMapping("startCollect")
@ApiOperation("开始实时采集转发") @ApiOperation("开始实时采集转发")
public Response<String> startCollect(@Validated @NotNull(message = "iedId不能为空!") Integer iedId) throws Exception { public Response<String> startCollect(@Validated @NotNull(message = "iedId不能为空!") Integer iedId) throws Exception {
if (iedId == null) {
throw new BusinessException("iedId不能为空!");
}
if (RealTimeDataService.inDoing) { if (RealTimeDataService.inDoing) {
throw new BusinessException("请稍后再操作"); throw new BusinessException("请稍后再操作");
} }
@ -165,6 +168,9 @@ public class IcdConfigController extends BasicController {
@PostMapping("stopCollect") @PostMapping("stopCollect")
@ApiOperation("停止实时采集转发") @ApiOperation("停止实时采集转发")
public Response<String> stopCollect(@Validated @NotNull(message = "iedId不能为空!") Integer iedId) throws Exception { public Response<String> stopCollect(@Validated @NotNull(message = "iedId不能为空!") Integer iedId) throws Exception {
if (iedId == null) {
throw new BusinessException("iedId不能为空!");
}
if (RealTimeDataService.inDoing) { if (RealTimeDataService.inDoing) {
throw new BusinessException("请稍后再操作"); throw new BusinessException("请稍后再操作");
} }

@ -45,7 +45,6 @@ public class RealTimeDataService {
} }
public void startCollect(Integer iedId) throws BusinessException { public void startCollect(Integer iedId) throws BusinessException {
inDoing = true;
Optional<IcdIed> optional = iedRepository.findById(iedId); Optional<IcdIed> optional = iedRepository.findById(iedId);
if (!optional.isPresent()) { if (!optional.isPresent()) {
throw new BusinessException("未找到该IED"); throw new BusinessException("未找到该IED");
@ -55,6 +54,7 @@ public class RealTimeDataService {
if (!optionalFile.isPresent()) { if (!optionalFile.isPresent()) {
throw new BusinessException("未找到该icd文件"); throw new BusinessException("未找到该icd文件");
} }
inDoing = true;
IcdFile icdFile = optionalFile.get(); IcdFile icdFile = optionalFile.get();
try { try {
IecClient iecClient = new IecClient(); IecClient iecClient = new IecClient();

Loading…
Cancel
Save