导入规则修改

dev^2
zjh 1 year ago
parent f542e537e7
commit f292df51f0
  1. 25
      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<Rulex, IRulexService> {
RuleVo ruleVo = ruleVoList.get(i); RuleVo ruleVo = ruleVoList.get(i);
//对应字段 //对应字段
String fieldId = ruleVo.getFieldId(); String fieldId = ruleVo.getFieldId();
LambdaQueryWrapper<Fieldx> rulexLambdaQueryWrapper = new LambdaQueryWrapper<>(); if(fieldId!=null){
rulexLambdaQueryWrapper.eq(Fieldx::getFieldName, fieldId); LambdaQueryWrapper<Fieldx> rulexLambdaQueryWrapper = new LambdaQueryWrapper<>();
Fieldx byId = iFieldxService.getOne(rulexLambdaQueryWrapper); rulexLambdaQueryWrapper.eq(Fieldx::getFieldName, fieldId);
if (byId == null) { Fieldx byId = iFieldxService.getOne(rulexLambdaQueryWrapper);
iRuleVoService.remove(null); if (byId == null) {
message.put("isError", "true"); iRuleVoService.remove(null);
message.put("closeable","true"); message.put("isError", "true");
message.put("status","第"+(i + 1) + "条数据,对应字段输入错误,请核对"); message.put("closeable","true");
webSocketUtils.sendMessage(loginUser.getId(), message); message.put("status","第"+(i + 1) + "条数据,对应字段输入错误,请核对");
return Result.error("第"+(i + 1) +"条数据,对应字段输入错误,请核对"); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第"+(i + 1) +"条数据,对应字段输入错误,请核对");
}
rulex.setFieldId(byId.getId());
} }
rulex.setFieldId(byId.getId());
//对应功能 //对应功能
String functionName = ruleVo.getFunctionId(); String functionName = ruleVo.getFunctionId();
LambdaQueryWrapper<Functionx> functionxLambdaQueryWrapper = new LambdaQueryWrapper<Functionx>(); LambdaQueryWrapper<Functionx> functionxLambdaQueryWrapper = new LambdaQueryWrapper<Functionx>();

Loading…
Cancel
Save