From 710245f40354ee9b18ffecb2065766a0df913770 Mon Sep 17 00:00:00 2001 From: zjh <10930829+zheng-jinhao1209@user.noreply.gitee.com> Date: Wed, 19 Jul 2023 10:09:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=A7=84=E5=88=99=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rulex/controller/RulexController.java | 43 ++++++++++++------- .../modules/demo/rulex/entity/RuleVo.java | 9 ++-- 2 files changed, 33 insertions(+), 19 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 26646d4..a1ab599 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 @@ -329,7 +329,7 @@ public class RulexController extends JeecgController { if (ruleVoList.size() <= 0 || ruleVoList == null) { message.put("isVisible", "false"); webSocketUtils.sendMessage(loginUser.getId(), message); - return Result.error("文件导入失败,模板不匹配"); + return Result.error("文件导入失败,模板不匹配有空值"); } // 将总的记录数传递给前端 message.put("records", String.valueOf(ruleVoList.size())); @@ -421,31 +421,44 @@ public class RulexController extends JeecgController { } rulex.setWorkLevel(integer); String workStatus = ruleVo.getWorkStatus(); - LambdaQueryWrapper sysDictItemLambdaQueryWrapper = new LambdaQueryWrapper<>(); - sysDictItemLambdaQueryWrapper.eq(SysDictItem::getItemText, workStatus).eq(SysDictItem::getDictId, "1645268542514421762"); - SysDictItem sysDictItem = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper); - if (sysDictItem == null) { +// LambdaQueryWrapper sysDictItemLambdaQueryWrapper = new LambdaQueryWrapper<>(); +// sysDictItemLambdaQueryWrapper.eq(SysDictItem::getItemText, workStatus).eq(SysDictItem::getDictId, "1645268542514421762"); +// SysDictItem sysDictItem = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper); + + if (workStatus.equals("未发布")) + rulex.setWorkStatus(0); + else if (workStatus.equals("已发布")) + rulex.setWorkStatus(1); + else if (workStatus.equals("开发中")) + rulex.setWorkStatus(2); + else if(workStatus.equals("已完成")) + rulex.setWorkStatus(3); + else if(workStatus.equals("已撤回")) + rulex.setWorkStatus(4); + else if(workStatus.equals("DEBUG")) + rulex.setWorkStatus(9); + else { iRuleVoService.remove(null); message.put("isVisible", "false"); webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("任务状态输入错误,请核对"); } - - rulex.setWorkStatus(Integer.valueOf(sysDictItem.getItemValue())); - String status = ruleVo.getStatus(); - LambdaQueryWrapper sysDictItemLambdaQueryWrapper2 = new LambdaQueryWrapper<>(); - sysDictItemLambdaQueryWrapper2.eq(SysDictItem::getItemText, status).eq(SysDictItem::getDictId, "1645264493205491713"); - SysDictItem sysDictItem2 = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper2); - if (sysDictItem2 == null) { +// LambdaQueryWrapper sysDictItemLambdaQueryWrapper2 = new LambdaQueryWrapper<>(); +// sysDictItemLambdaQueryWrapper2.eq(SysDictItem::getItemText, status).eq(SysDictItem::getDictId, "1645264493205491713"); +// SysDictItem sysDictItem2 = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper2); + if (status.equals("正常")) + rulex.setStatus(1); + else if (status.equals("停用")) + rulex.setStatus(0); + else if (status.equals("废弃")) + rulex.setStatus(9); + else { iRuleVoService.remove(null); message.put("isVisible", "false"); webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("规则状态输入错误,请核对"); } - - - rulex.setStatus(Integer.valueOf(sysDictItem2.getItemValue())); String verisonStatus = ruleVo.getVerisonStatus(); LambdaQueryWrapper sysDictItemLambdaQueryWrapper3 = new LambdaQueryWrapper<>(); sysDictItemLambdaQueryWrapper3.eq(SysDictItem::getItemText, verisonStatus); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/entity/RuleVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/entity/RuleVo.java index cb3672f..a72aed4 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/entity/RuleVo.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/entity/RuleVo.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.common.aspect.annotation.Dict; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; //import org.jeecg.common.aspect.annotation.Dict; @@ -61,14 +62,14 @@ public class RuleVo implements Serializable { /** * 对应模块id */ - @Excel(name = "对应模块id", width = 15) + @Excel(name = "对应模块", width = 15) @ApiModelProperty(value = "对应模块") -// /*@Dict(dictTable = "modulex", dicCode = "id", dicText = "module_name")*/ + @Dict(dictTable = "modulex", dicCode = "id", dicText = "module_name") private java.lang.String moduleId; /** * 对应功能id */ - @Excel(name = "对应功能id", width = 15) + @Excel(name = "对应功能", width = 15) @ApiModelProperty(value = "对应功能") // /*@Dict(dictTable = "functionx", dicCode = "id", dicText = "function_name")*/ private java.lang.String functionId; @@ -99,7 +100,7 @@ public class RuleVo implements Serializable { /** * 对应实体id */ - @Excel(name = "对应实体id", width = 15) + @Excel(name = "对应实体", width = 15) @ApiModelProperty(value = "对应实体") // @Dict(dictTable = "tablex", dicText = "table_name", dicCode = "id") private java.lang.String tableId;