新项目信息界面-添加查询bug信息,封装dto

dev
wish 1 year ago
parent eadff8ce82
commit ab1732c5cf
  1. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/service/IBugxService.java
  2. 204
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/service/impl/BugxServiceImpl.java
  3. 94
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionxServiceImpl.java
  4. 41
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/BugDto.java
  5. 44
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/FunctionDto.java
  6. 36
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/ModuleDto.java
  7. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/ProjectDto.java
  8. 43
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/RuleDto.java
  9. 90
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
  10. 90
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java
  11. 26
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/service/impl/ProjectxServiceImpl.java

@ -1,20 +1,29 @@
package org.jeecg.modules.demo.bugx.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.bugx.entity.Bugx;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.newlayout.dto.BugDto;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import java.util.List;
/**
* @Description: BUG管理
* @Author: jeecg-boot
* @Date: 2023-04-11
* @Date: 2023-04-11
* @Version: V1.0
*/
public interface IBugxService extends IService<Bugx> {
String sort(String code);
String sort(String code);
Result<?> shenhe(String id);
Result<?> bohui(String id);
Result<?> shenhe(String id);
List<BugDto> queryBugDtoListByFunctionId(Functionx functionx);
Result<?> bohui(String id);
List<BugDto> queryBugDtoListByRuleId(Rulex rulex);
}

@ -1,57 +1,197 @@
package org.jeecg.modules.demo.bugx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.demo.bugx.entity.Bugx;
import org.jeecg.modules.demo.bugx.mapper.BugxMapper;
import org.jeecg.modules.demo.bugx.service.IBugxService;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.service.IFunctionxService;
import org.jeecg.modules.demo.newlayout.dto.BugDto;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.projectx.service.IProjectxService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Date;
import java.util.*;
/**
* @Description: BUG管理
* @Author: jeecg-boot
* @Date: 2023-04-11
* @Date: 2023-04-11
* @Version: V1.0
*/
@Service
public class BugxServiceImpl extends ServiceImpl<BugxMapper, Bugx> implements IBugxService {
@Autowired
BugxMapper bugxMapper;
@Override
public String sort(String code) {
return bugxMapper.sort(code);
@Autowired
BugxMapper bugxMapper;
@Autowired
private ISysDictService dictService;
@Autowired
private IProjectxService projectxService;
@Autowired
private IModulexService modulexService;
@Autowired
private IFunctionxService functionxService;
@Autowired
private IRulexService rulexService;
@Autowired
private ISysUserService sysUserService;
private static final String BUG_TYPE_DICT_CODE = "bug_type";
private static final String BUG_LEVEL_DICT_CODE = "work_level";
private static final String BUG_STATUS_DICT_CODE = "bug_status";
@Override
public String sort(String code) {
return bugxMapper.sort(code);
}
@Override
public Result<?> shenhe(String id) {
Bugx bugx = bugxMapper.selectById(id);
if (bugx.getBugStatus() == 4) {
if (bugx.getRuleId() != null) {
bugxMapper.upRstatus(bugx.getRuleId());
} else if (bugx.getFunctionId() != null) {
baseMapper.upFstatus(bugx.getFunctionId());
} else {
baseMapper.upMstatus(bugx.getModuleId());
}
bugxMapper.shenhe(id, new Date());
return Result.OK("审核通过!!");
} else if (bugx.getBugStatus() == 2) {
return Result.error("已审核过!!!");
} else {
return Result.error("请先提交!!");
}
@Override
public Result<?> shenhe(String id) {
Bugx bugx = bugxMapper.selectById(id);
if(bugx.getBugStatus()==4){
if(bugx.getRuleId()!=null){
bugxMapper.upRstatus(bugx.getRuleId());
}else if(bugx.getFunctionId()!=null){
baseMapper.upFstatus(bugx.getFunctionId());
}else {
baseMapper.upMstatus(bugx.getModuleId());
}
bugxMapper.shenhe(id,new Date());
return Result.OK("审核通过!!");
}else if(bugx.getBugStatus()==2){
return Result.error("已审核过!!!");
}
else{
return Result.error("请先提交!!");
}
}
@Override
public Result<?> bohui(String id) {
bugxMapper.bohui(id, new Date());
return Result.OK("驳回!!");
}
@Override
public List<BugDto> queryBugDtoListByFunctionId(Functionx functionx) {
LambdaQueryWrapper<Bugx> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Bugx::getFunctionId, functionx.getId());
List<Bugx> bugxList = this.list(wrapper);
List<BugDto> bugDtoList = new ArrayList<>();
// 将bug转为bugDto
for (Bugx bugx : bugxList) {
BugDto bugDto = new BugDto();
BeanUtils.copyProperties(bugx, bugDto);
// 设置功能
bugDto.setFunctionId_dictText(functionx.getFunctionName());
// 设置规则
if (!StringUtils.isEmpty(bugDto.getRuleId())) {
Rulex rulex = rulexService.getById(bugDto.getRuleId());
Optional.ofNullable(rulex).ifPresent(consumer -> {
bugDto.setRuleId_dictText(rulex.getRuleCode());
});
}
this.createBugDto(bugDto);
bugDtoList.add(bugDto);
}
return bugDtoList;
}
@Override
public Result<?> bohui(String id) {
bugxMapper.bohui(id,new Date());
return Result.OK("驳回!!");
@Override
public List<BugDto> queryBugDtoListByRuleId(Rulex rulex) {
LambdaQueryWrapper<Bugx> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Bugx::getRuleId, rulex.getId());
List<Bugx> bugxList = this.list(wrapper);
List<BugDto> bugDtoList = new ArrayList<>();
for (Bugx bugx : bugxList) {
BugDto bugDto = new BugDto();
BeanUtils.copyProperties(bugx, bugDto);
// 设置规则
bugDto.setRuleId_dictText(rulex.getRuleCode());
this.createBugDto(bugDto);
//设置功能
if (!StringUtils.isEmpty(bugDto.getFunctionId())) {
Functionx functionx = functionxService.getById(bugDto.getFunctionId());
Optional.ofNullable(functionx).ifPresent(consumer -> {
bugDto.setFunctionId_dictText(functionx.getFunctionName());
});
}
bugDtoList.add(bugDto);
}
return bugDtoList;
}
private void createBugDto(BugDto bugDto) {
// 设置bug类型
List<DictModel> bugTypeList =
dictService.getDictItems(BUG_TYPE_DICT_CODE);
bugTypeList.forEach(type -> {
if (type.getValue().equals(bugDto.getType().toString())) {
bugDto.setType_dictText(type.getText());
}
});
// 设置项目
if (!StringUtils.isEmpty(bugDto.getProjectId())) {
Projectx projectx = projectxService.getById(bugDto.getId());
Optional.ofNullable(projectx).ifPresent(consumer -> {
bugDto.setProjectId_dictText(projectx.getProjectName());
});
}
// 设置责任人
if (!StringUtils.isEmpty(bugDto.getManagerUsers())) {
String[] users = bugDto.getManagerUsers().split(",");
if (users.length > 0) {
List<SysUser> sysUsers =
sysUserService.listByIds(Arrays.asList(users));
StringBuilder sb = new StringBuilder();
sysUsers.forEach(user -> sb.append(user.getRealname()).append(","));
if (sb.length() > 0) {
bugDto.setManagerUsers_dictText(sb.substring(0, sb.length() - 1));
}
}
}
// 设置模块
if (!StringUtils.isEmpty(bugDto.getModuleId())) {
Modulex modulex = modulexService.getById(bugDto.getModuleId());
Optional.ofNullable(modulex).ifPresent(consumer -> {
bugDto.setModuleId_dictText(modulex.getModuleName());
});
}
//设置错误级别
List<DictModel> bugLevelList =
dictService.getDictItems(BUG_LEVEL_DICT_CODE);
bugLevelList.forEach(level -> {
if (level.getValue().equals(bugDto.getBugLevel().toString())) {
bugDto.setBugLevel_dictText(level.getText());
}
});
// 设置bug状态
List<DictModel> bugStatusList =
dictService.getDictItems(BUG_STATUS_DICT_CODE);
bugStatusList.forEach(status -> {
if (status.getValue().equals(bugDto.getBugStatus().toString())) {
bugDto.setBugStatus_dictText(status.getText());
}
});
}
}

@ -3,23 +3,32 @@ package org.jeecg.modules.demo.functionx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.demo.bugx.service.IBugxService;
import org.jeecg.modules.demo.functiontemplate.entity.FunctionTemplate;
import org.jeecg.modules.demo.functiontemplate.mapper.FunctionTemplateMapper;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper;
import org.jeecg.modules.demo.functionx.service.IFunctionxService;
import org.jeecg.modules.demo.newlayout.dto.BugDto;
import org.jeecg.modules.demo.newlayout.dto.FunctionDto;
import org.jeecg.modules.demo.newlayout.dto.RuleDto;
import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description: 功能管理
@ -37,6 +46,24 @@ public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx
@Autowired
private IRulexService rulexService;
@Autowired
private ISysDictService dictService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IBugxService bugxService;
private static final String WORK_STATUS_DICT_CODE = "work_status";
private static final String WORK_LEVEL_DICT_CODE = "work_level";
private static final String FUNCTION_TYPE_DICT_CODE = "function_type";
private static final String STATUS_DICT_CODE = "status";
private static final String VERSION_STATUS_CODE = "verison_status";
@Override
public String findModuleCode(String id) {
return functionxMapper.findModuleCode(id);
@ -189,17 +216,78 @@ public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx
@Override
public List<FunctionDto> queryFunctionDtoListByModuleId(Modulex modulex) {
LambdaQueryWrapper<Functionx> functionWrapper = new LambdaQueryWrapper<>();
functionWrapper.eq(Functionx::getModuleId, modulex.getId());
List<Functionx> functionxList = this.list(functionWrapper);
List<Functionx> functionxList = this.queryFunctionListByModuleId(modulex);
List<FunctionDto> functionDtoList = new ArrayList<>();
functionxList.forEach(functionx -> {
FunctionDto functionDto = new FunctionDto();
BeanUtils.copyProperties(functionx, functionDto);
// 查询对应模块
functionDto.setModuleId_dictText(modulex.getModuleName());
// 设置功能类型
List<DictModel> funTypeList =
dictService.getDictItems(FUNCTION_TYPE_DICT_CODE);
funTypeList.forEach(type -> {
if (type.getValue().equals(functionDto.getFunctionType().toString())) {
functionDto.setFunctionType_dictText(type.getText());
}
});
// 设置责任人
if (!StringUtils.isEmpty(functionDto.getManagerUsers())) {
String[] users = functionDto.getManagerUsers().split(",");
if (users.length > 0) {
List<SysUser> sysUsers =
sysUserService.listByIds(Arrays.asList(users));
StringBuilder sb = new StringBuilder();
sysUsers.forEach(user -> sb.append(user.getRealname()).append(","));
if (sb.length() > 0) {
functionDto.setManagerUsers_dictText(sb.substring(0, sb.length() - 1));
}
}
}
// 设置任务等级
List<DictModel> worlLevelList =
dictService.getDictItems(WORK_LEVEL_DICT_CODE);
worlLevelList.forEach(level -> {
if (level.getValue().equals(functionDto.getWorkLevel().toString())) {
functionDto.setWorkLevel_dictText(level.getText());
}
});
// 设置任务状态
List<DictModel> workStatusList =
dictService.getDictItems(WORK_STATUS_DICT_CODE);
workStatusList.forEach(status -> {
if (status.getValue().equals(functionDto.getWorkStatus().toString())) {
functionDto.setWorkStatus_dictText(status.getText());
}
});
// 设置功能状态
List<DictModel> statusList =
dictService.getDictItems(STATUS_DICT_CODE);
statusList.forEach(status -> {
if (status.getValue().equals(functionDto.getStatus().toString())) {
functionDto.setStatus_dictText(status.getText());
}
});
// 设置版本状态
List<DictModel> versionStatusList =
dictService.getDictItems(VERSION_STATUS_CODE);
versionStatusList.forEach(versionStatus -> {
if (versionStatus.getValue().equals(functionDto.getVerisonStatus().toString())) {
functionDto.setVersionStatus_dictText(versionStatus.getText());
}
});
// 查询该功能下所有的规则
List<RuleDto> ruleDtoList =
rulexService.queryRuleDtoListByFunctionId(functionx);
functionDto.setRuleDtoList(ruleDtoList);
// 查询该功能下所有的bug
List<BugDto> bugDtoList =
bugxService.queryBugDtoListByFunctionId(functionDto);
// 功能对应的bug_type为2
bugDtoList = bugDtoList.stream().filter(bugDto ->
bugDto.getType().equals(2)).collect(Collectors.toList());
functionDto.setBugDtoList(bugDtoList);
functionDtoList.add(functionDto);
});
return functionDtoList;

@ -0,0 +1,41 @@
package org.jeecg.modules.demo.newlayout.dto;
import lombok.Data;
import org.jeecg.modules.demo.bugx.entity.Bugx;
@Data
public class BugDto extends Bugx {
/**
* bug类型
*/
private String type_dictText;
/**
* 项目
*/
private String projectId_dictText;
/**
* 模块
*/
private String moduleId_dictText;
/**
* 功能
*/
private String functionId_dictText;
/**
* 规则
*/
private String ruleId_dictText;
/**
* 错误级别
*/
private String bugLevel_dictText;
/**
* bug状态
*/
private String bugStatus_dictText;
/**
* 责任人
*/
private String managerUsers_dictText;
}

@ -17,5 +17,47 @@ public class FunctionDto extends Functionx {
/**
* 规则dto列表
*/
List<RuleDto> ruleDtoList;
private List<RuleDto> ruleDtoList;
/**
* 对应模块
*/
private String moduleId_dictText;
/**
* 功能类型
*/
private String functionType_dictText;
/**
* 责任人
*/
private String managerUsers_dictText;
/**
* 任务等级
*/
private String workLevel_dictText;
/**
* 任务状态
*/
private String workStatus_dictText;
/**
* 功能状态
*/
private String status_dictText;
/**
* 版本状态
*/
private String versionStatus_dictText;
/**
* bug列表
*/
private List<BugDto> bugDtoList;
}

@ -18,4 +18,40 @@ public class ModuleDto extends Modulex {
* 功能dto列表
*/
List<FunctionDto> functionDtoList;
/**
* 上级模块
*/
private String pid_dictText;
/**
* 项目名称
*/
private String projectId_dictText;
/**
* 任务等级
*/
private String workLevel_dictText;
/**
* 任务状态
*/
private String workStatus_dictText;
/**
* 关联实体
*/
private String relatedBean_dictText;
/**
* 模块状态
*/
private String status_dictText;
/**
* 版本状态
*/
private String versionStatus_dictText;
}

@ -18,4 +18,14 @@ public class ProjectDto extends Projectx {
* 模块dto列表.
*/
List<ModuleDto> moduleDtoList;
/**
* 项目状态
*/
private String status_dictText;
/**
* 项目复制来源
*/
private String sourceProject_dictText;
}

@ -3,6 +3,49 @@ package org.jeecg.modules.demo.newlayout.dto;
import lombok.Data;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import java.util.List;
@Data
public class RuleDto extends Rulex {
/**
* 对应模块
*/
private String moduleId_dictText;
/**
* 对应功能
*/
private String functionId_dictText;
/**
* 对应字段
*/
private String tableId_dictText;
/**
* 任务等级
*/
private String workLevel_dictText;
/**
* 任务状态
*/
private String workStatus_dictText;
/**
* 规则状态
*/
private String status_dictText;
/**
* 版本状态
*/
private String versionStatus_dictText;
/**
* bug列表
*/
private List<BugDto> bugDtoList;
}

@ -1,20 +1,30 @@
package org.jeecg.modules.demo.rulex.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.demo.bugx.service.IBugxService;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.newlayout.dto.BugDto;
import org.jeecg.modules.demo.newlayout.dto.RuleDto;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.mapper.RulexMapper;
import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.service.ITablexService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @Description: 规则管理
@ -28,6 +38,23 @@ public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements
@Autowired
RulexMapper rulexMapper;
@Autowired
private IModulexService modulexService;
@Autowired
private ITablexService tablexService;
@Autowired
private ISysDictService dictService;
@Autowired
private IBugxService bugxService;
private static final String WORK_STATUS_DICT_CODE = "work_status";
private static final String WORK_LEVEL_DICT_CODE = "work_level";
private static final String VERSION_STATUS_CODE = "verison_status";
private static final String STATUS_DICT_CODE = "status";
@Override
public Result<?> sort(String id) {
String sort = rulexMapper.sort(id);
@ -60,14 +87,67 @@ public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements
@Override
public List<RuleDto> queryRuleDtoListByFunctionId(Functionx functionx) {
LambdaQueryWrapper<Rulex> ruleWrapper = new LambdaQueryWrapper<>();
ruleWrapper.eq(Rulex::getFunctionId, functionx.getId());
List<Rulex> rulexList = this.list(ruleWrapper);
List<Rulex> rulexList = this.queryRuleListByFunctionId(functionx);
// 将rule封装为ruleDto
List<RuleDto> ruleDtoList = new ArrayList<>();
for (Rulex rulex : rulexList) {
RuleDto ruleDto = new RuleDto();
BeanUtils.copyProperties(rulex, ruleDto);
// 设置对应模块
if (!StringUtils.isEmpty(ruleDto.getModuleId())) {
Modulex modulex = modulexService.getById(ruleDto.getModuleId());
Optional.ofNullable(modulex).ifPresent(consumer -> {
ruleDto.setModuleId_dictText(modulex.getModuleName());
});
}
// 设置对应功能
ruleDto.setFunctionId_dictText(functionx.getFunctionName());
// 设置对应字段
if (!StringUtils.isEmpty(ruleDto.getTableId())) {
Tablex tablex = tablexService.getById(ruleDto.getTableId());
Optional.ofNullable(tablex).ifPresent(consumer -> {
ruleDto.setTableId_dictText(tablex.getTableName());
});
}
// 设置任务等级
List<DictModel> worlLevelList =
dictService.getDictItems(WORK_LEVEL_DICT_CODE);
worlLevelList.forEach(level -> {
if (level.getValue().equals(ruleDto.getWorkLevel().toString())) {
ruleDto.setWorkLevel_dictText(level.getText());
}
});
// 设置任务状态
List<DictModel> workStatusList =
dictService.getDictItems(WORK_STATUS_DICT_CODE);
workStatusList.forEach(status -> {
if (status.getValue().equals(ruleDto.getWorkStatus().toString())) {
ruleDto.setWorkStatus_dictText(status.getText());
}
});
// 设置功能状态
List<DictModel> statusList =
dictService.getDictItems(STATUS_DICT_CODE);
statusList.forEach(status -> {
if (status.getValue().equals(ruleDto.getStatus().toString())) {
ruleDto.setStatus_dictText(status.getText());
}
});
// 设置版本状态
List<DictModel> versionStatusList =
dictService.getDictItems(VERSION_STATUS_CODE);
versionStatusList.forEach(versionStatus -> {
if (versionStatus.getValue().equals(ruleDto.getVerisonStatus().toString())) {
ruleDto.setVersionStatus_dictText(versionStatus.getText());
}
});
// 设置该规则下所有bug
List<BugDto> bugDtoList =
bugxService.queryBugDtoListByRuleId(ruleDto);
// 规则对应的bug_type为3
bugDtoList = bugDtoList.stream().filter(bugDto ->
bugDto.getType().equals(3)).collect(Collectors.toList());
ruleDto.setBugDtoList(bugDtoList);
ruleDtoList.add(ruleDto);
}
return ruleDtoList;

@ -3,6 +3,7 @@ package org.jeecg.modules.modulex.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper;
import org.jeecg.modules.demo.functionx.service.IFunctionxService;
@ -16,6 +17,9 @@ import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.mapper.ModulexMapper;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.service.ITablexService;
import org.springframework.beans.BeanUtils;
@ -23,12 +27,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
/**
* @Description: 模块管理
@ -57,6 +59,22 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
@Autowired
private IFieldxService iFieldxService;
@Autowired
private ISysDictService dictService;
@Autowired
private ITablexService tablexService;
@Autowired
private ISysUserService sysUserService;
private static final String WORK_STATUS_DICT_CODE = "work_status";
private static final String WORK_LEVEL_DICT_CODE = "work_level";
private static final String STATUS_DICT_CODE = "a_status";
private static final String VERSION_STATUS_CODE = "verison_status";
/**
* 得到最大的版本号
*/
@ -249,6 +267,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
List<Modulex> modulexList = this.list(moduleWrapper);
// 将模块转为dto
List<ModuleDto> moduleDtoList = new ArrayList<>();
// 开始封装dto中的信息
for (Modulex modulex : modulexList) {
ModuleDto moduleDto = new ModuleDto();
BeanUtils.copyProperties(modulex, moduleDto);
@ -256,6 +275,69 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
List<FunctionDto> functionDtoList =
iFunctionxService.queryFunctionDtoListByModuleId(modulex);
moduleDto.setFunctionDtoList(functionDtoList);
// 设置上级模块
if (!StringUtils.isEmpty(moduleDto.getPid())) {
Modulex pid = this.getById(moduleDto.getPid());
Optional.ofNullable(pid).ifPresent(consumer -> {
moduleDto.setPid_dictText(pid.getModuleName());
});
}
// 设置项目名称
moduleDto.setProjectId_dictText(projectx.getProjectName());
// 设置任务等级
List<DictModel> worlLevelList =
dictService.getDictItems(WORK_LEVEL_DICT_CODE);
worlLevelList.forEach(level -> {
if (level.getValue().equals(moduleDto.getWorkLevel().toString())) {
moduleDto.setWorkLevel_dictText(level.getText());
}
});
// 设置任务状态
List<DictModel> workStatusList =
dictService.getDictItems(WORK_STATUS_DICT_CODE);
workStatusList.forEach(status -> {
if (status.getValue().equals(moduleDto.getWorkStatus().toString())) {
moduleDto.setWorkStatus_dictText(status.getText());
}
});
// 设置关联实体
if (!StringUtils.isEmpty(moduleDto.getRelatedBean())) {
Tablex tablex = tablexService.getById(moduleDto.getRelatedBean());
Optional.ofNullable(tablex).ifPresent(consumer -> {
moduleDto.setRelatedBean_dictText(consumer.getTableName());
});
}
// 设置模块状态
List<DictModel> statusList =
dictService.getDictItems(STATUS_DICT_CODE);
statusList.forEach(status -> {
if (status.getValue().equals(moduleDto.getStatus().toString())) {
moduleDto.setStatus_dictText(status.getText());
}
});
// 设置版本状态
List<DictModel> versionStatusList =
dictService.getDictItems(VERSION_STATUS_CODE);
versionStatusList.forEach(versionStatus -> {
if (versionStatus.getValue().equals(moduleDto.getVerisonStatus().toString())) {
moduleDto.setVersionStatus_dictText(versionStatus.getText());
}
});
// 设置责任人
if (!StringUtils.isEmpty(moduleDto.getManagerUsers())) {
String[] users = moduleDto.getManagerUsers().split(",");
if (users.length > 0) {
List<SysUser> sysUsers =
sysUserService.listByIds(Arrays.asList(users));
StringBuilder sb = new StringBuilder();
sysUsers.forEach(user -> {
sb.append(user.getRealname()).append(",");
});
if (sb.length() > 0) {
moduleDto.setManagerUsers_dictText(sb.substring(0, sb.length() - 1));
}
}
}
moduleDtoList.add(moduleDto);
}
return moduleDtoList;

@ -3,12 +3,14 @@ package org.jeecg.modules.projectx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.demo.newlayout.dto.ModuleDto;
import org.jeecg.modules.demo.newlayout.dto.ProjectDto;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.projectx.mapper.ProjectxMapper;
import org.jeecg.modules.projectx.service.IProjectxService;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -16,6 +18,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* @Description: 项目管理 管理项目基本信息
@ -30,6 +33,11 @@ public class ProjectxServiceImpl extends ServiceImpl<ProjectxMapper, Projectx>
@Autowired
private IModulexService modulexService;
@Autowired
private ISysDictService dictService;
private static final String PROJECT_STATUS_DICT_CODE = "project_status";
@Override
public List<ProjectDto> listDto(QueryWrapper<Projectx> queryWrapper) {
List<Projectx> list = this.list(queryWrapper);
@ -49,10 +57,28 @@ public class ProjectxServiceImpl extends ServiceImpl<ProjectxMapper, Projectx>
Projectx project = this.getById(projectx.getId());
// 将当前项目封装为dto
ProjectDto projectDto = new ProjectDto();
// 开始封装dto中的信息
BeanUtils.copyProperties(project, projectDto);
// 查询当前项目的模块
List<ModuleDto> moduleDtoList = modulexService.queryDtoListByProId(project);
projectDto.setModuleDtoList(moduleDtoList);
// 获取字典内容列表--项目状态
List<DictModel> projectStatusList =
dictService.getDictItems(PROJECT_STATUS_DICT_CODE);
// 设置项目状态
projectStatusList.forEach(status -> {
if (status.getValue().equals(projectDto.getProjectStatus().toString())) {
projectDto.setStatus_dictText(status.getText());
}
});
// 设置复制来源
if (!StringUtils.isEmpty(projectDto.getSourceProjectId())) {
Projectx sourceProject = this.getById(projectDto.getSourceProjectId());
Optional.ofNullable(sourceProject).ifPresent(consumer -> {
projectDto.setSourceProject_dictText(consumer.getProjectName());
});
}
return projectDto;
}

Loading…
Cancel
Save