perf: 优化生成rptparamindex的正确和错误提示

dev
huangfeng 1 year ago
parent 4d6cf728e0
commit 5487bdb333

@ -71,8 +71,8 @@ public class ParamBindController extends BasicController {
@PostMapping("generateParamindex") @PostMapping("generateParamindex")
@ApiOperation("生成rptparamindex表的相关绑定数据") @ApiOperation("生成rptparamindex表的相关绑定数据")
public Response<String> generateParamindex() throws Exception { public Response<String> generateParamindex() throws Exception {
bindService.generateParamindex(); String msg = bindService.generateParamindex();
return Response.success("OK"); return Response.success(msg);
} }
@PostMapping("clearAll") @PostMapping("clearAll")

@ -22,7 +22,7 @@ public interface ParamBindService {
BindDetail getBind(Integer eqmid) throws Exception; BindDetail getBind(Integer eqmid) throws Exception;
void generateParamindex() throws Exception; String generateParamindex() throws Exception;
void clearAll(); void clearAll();
} }

@ -237,12 +237,15 @@ public class ParamBindServiceImpl implements ParamBindService {
} }
@Override @Override
public void generateParamindex() throws Exception { public String generateParamindex() throws Exception {
List<Modev> modevList = modevRepository.findByIcdidIsNotNull(); List<Modev> modevList = modevRepository.findByIcdidIsNotNull();
if (!CollectionUtils.isEmpty(modevList)) { if (!CollectionUtils.isEmpty(modevList)) {
for (Modev item : modevList) { for (Modev item : modevList) {
generateOne(item); generateOne(item);
} }
return "已对" + modevList.size() + "条绑定数据生成对应的61850参引数据";
} else {
throw new BusinessException("无任何绑定数据");
} }
} }

Loading…
Cancel
Save