导入规则模板修改

dev^2
zjh 1 year ago
parent a15703d920
commit 710245f403
  1. 43
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java
  2. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/entity/RuleVo.java

@ -329,7 +329,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
if (ruleVoList.size() <= 0 || ruleVoList == null) { if (ruleVoList.size() <= 0 || ruleVoList == null) {
message.put("isVisible", "false"); message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("文件导入失败,模板不匹配"); return Result.error("文件导入失败,模板不匹配有空值");
} }
// 将总的记录数传递给前端 // 将总的记录数传递给前端
message.put("records", String.valueOf(ruleVoList.size())); message.put("records", String.valueOf(ruleVoList.size()));
@ -421,31 +421,44 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
} }
rulex.setWorkLevel(integer); rulex.setWorkLevel(integer);
String workStatus = ruleVo.getWorkStatus(); String workStatus = ruleVo.getWorkStatus();
LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysDictItemLambdaQueryWrapper.eq(SysDictItem::getItemText, workStatus).eq(SysDictItem::getDictId, "1645268542514421762"); // sysDictItemLambdaQueryWrapper.eq(SysDictItem::getItemText, workStatus).eq(SysDictItem::getDictId, "1645268542514421762");
SysDictItem sysDictItem = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper); // SysDictItem sysDictItem = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper);
if (sysDictItem == null) {
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); iRuleVoService.remove(null);
message.put("isVisible", "false"); message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("任务状态输入错误,请核对"); return Result.error("任务状态输入错误,请核对");
} }
rulex.setWorkStatus(Integer.valueOf(sysDictItem.getItemValue()));
String status = ruleVo.getStatus(); String status = ruleVo.getStatus();
LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper2 = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper2 = new LambdaQueryWrapper<>();
sysDictItemLambdaQueryWrapper2.eq(SysDictItem::getItemText, status).eq(SysDictItem::getDictId, "1645264493205491713"); // sysDictItemLambdaQueryWrapper2.eq(SysDictItem::getItemText, status).eq(SysDictItem::getDictId, "1645264493205491713");
SysDictItem sysDictItem2 = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper2); // SysDictItem sysDictItem2 = sysDictItemMapper.selectOne(sysDictItemLambdaQueryWrapper2);
if (sysDictItem2 == null) { if (status.equals("正常"))
rulex.setStatus(1);
else if (status.equals("停用"))
rulex.setStatus(0);
else if (status.equals("废弃"))
rulex.setStatus(9);
else {
iRuleVoService.remove(null); iRuleVoService.remove(null);
message.put("isVisible", "false"); message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("规则状态输入错误,请核对"); return Result.error("规则状态输入错误,请核对");
} }
rulex.setStatus(Integer.valueOf(sysDictItem2.getItemValue()));
String verisonStatus = ruleVo.getVerisonStatus(); String verisonStatus = ruleVo.getVerisonStatus();
LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper3 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper3 = new LambdaQueryWrapper<>();
sysDictItemLambdaQueryWrapper3.eq(SysDictItem::getItemText, verisonStatus); sysDictItemLambdaQueryWrapper3.eq(SysDictItem::getItemText, verisonStatus);

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
//import org.jeecg.common.aspect.annotation.Dict; //import org.jeecg.common.aspect.annotation.Dict;
@ -61,14 +62,14 @@ public class RuleVo implements Serializable {
/** /**
* 对应模块id * 对应模块id
*/ */
@Excel(name = "对应模块id", width = 15) @Excel(name = "对应模块", width = 15)
@ApiModelProperty(value = "对应模块") @ApiModelProperty(value = "对应模块")
// /*@Dict(dictTable = "modulex", dicCode = "id", dicText = "module_name")*/ @Dict(dictTable = "modulex", dicCode = "id", dicText = "module_name")
private java.lang.String moduleId; private java.lang.String moduleId;
/** /**
* 对应功能id * 对应功能id
*/ */
@Excel(name = "对应功能id", width = 15) @Excel(name = "对应功能", width = 15)
@ApiModelProperty(value = "对应功能") @ApiModelProperty(value = "对应功能")
// /*@Dict(dictTable = "functionx", dicCode = "id", dicText = "function_name")*/ // /*@Dict(dictTable = "functionx", dicCode = "id", dicText = "function_name")*/
private java.lang.String functionId; private java.lang.String functionId;
@ -99,7 +100,7 @@ public class RuleVo implements Serializable {
/** /**
* 对应实体id * 对应实体id
*/ */
@Excel(name = "对应实体id", width = 15) @Excel(name = "对应实体", width = 15)
@ApiModelProperty(value = "对应实体") @ApiModelProperty(value = "对应实体")
// @Dict(dictTable = "tablex", dicText = "table_name", dicCode = "id") // @Dict(dictTable = "tablex", dicText = "table_name", dicCode = "id")
private java.lang.String tableId; private java.lang.String tableId;

Loading…
Cancel
Save