From f292df51f02e04b4169af45cdd2cdbfda09a5e5a Mon Sep 17 00:00:00 2001 From: zjh <10930829+zheng-jinhao1209@user.noreply.gitee.com> Date: Mon, 24 Jul 2023 09:35:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=A7=84=E5=88=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rulex/controller/RulexController.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java index 04a6a59..90d4409 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java @@ -342,18 +342,21 @@ public class RulexController extends JeecgController { RuleVo ruleVo = ruleVoList.get(i); //对应字段 String fieldId = ruleVo.getFieldId(); - LambdaQueryWrapper rulexLambdaQueryWrapper = new LambdaQueryWrapper<>(); - rulexLambdaQueryWrapper.eq(Fieldx::getFieldName, fieldId); - Fieldx byId = iFieldxService.getOne(rulexLambdaQueryWrapper); - if (byId == null) { - iRuleVoService.remove(null); - message.put("isError", "true"); - message.put("closeable","true"); - message.put("status","第"+(i + 1) + "条数据,对应字段输入错误,请核对"); - webSocketUtils.sendMessage(loginUser.getId(), message); - return Result.error("第"+(i + 1) +"条数据,对应字段输入错误,请核对"); + if(fieldId!=null){ + LambdaQueryWrapper rulexLambdaQueryWrapper = new LambdaQueryWrapper<>(); + rulexLambdaQueryWrapper.eq(Fieldx::getFieldName, fieldId); + Fieldx byId = iFieldxService.getOne(rulexLambdaQueryWrapper); + if (byId == null) { + iRuleVoService.remove(null); + message.put("isError", "true"); + message.put("closeable","true"); + message.put("status","第"+(i + 1) + "条数据,对应字段输入错误,请核对"); + webSocketUtils.sendMessage(loginUser.getId(), message); + return Result.error("第"+(i + 1) +"条数据,对应字段输入错误,请核对"); + } + rulex.setFieldId(byId.getId()); } - rulex.setFieldId(byId.getId()); + //对应功能 String functionName = ruleVo.getFunctionId(); LambdaQueryWrapper functionxLambdaQueryWrapper = new LambdaQueryWrapper();