|
|
@ -3,23 +3,32 @@ package org.jeecg.modules.demo.functionx.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
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.entity.FunctionTemplate; |
|
|
|
import org.jeecg.modules.demo.functiontemplate.mapper.FunctionTemplateMapper; |
|
|
|
import org.jeecg.modules.demo.functiontemplate.mapper.FunctionTemplateMapper; |
|
|
|
import org.jeecg.modules.demo.functionx.entity.Functionx; |
|
|
|
import org.jeecg.modules.demo.functionx.entity.Functionx; |
|
|
|
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper; |
|
|
|
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper; |
|
|
|
import org.jeecg.modules.demo.functionx.service.IFunctionxService; |
|
|
|
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.FunctionDto; |
|
|
|
import org.jeecg.modules.demo.newlayout.dto.RuleDto; |
|
|
|
import org.jeecg.modules.demo.newlayout.dto.RuleDto; |
|
|
|
import org.jeecg.modules.demo.rulex.service.IRulexService; |
|
|
|
import org.jeecg.modules.demo.rulex.service.IRulexService; |
|
|
|
import org.jeecg.modules.modulex.entity.Modulex; |
|
|
|
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.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @Description: 功能管理 |
|
|
|
* @Description: 功能管理 |
|
|
@ -37,6 +46,24 @@ public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IRulexService rulexService; |
|
|
|
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 |
|
|
|
@Override |
|
|
|
public String findModuleCode(String id) { |
|
|
|
public String findModuleCode(String id) { |
|
|
|
return functionxMapper.findModuleCode(id); |
|
|
|
return functionxMapper.findModuleCode(id); |
|
|
@ -189,17 +216,78 @@ public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<FunctionDto> queryFunctionDtoListByModuleId(Modulex modulex) { |
|
|
|
public List<FunctionDto> queryFunctionDtoListByModuleId(Modulex modulex) { |
|
|
|
LambdaQueryWrapper<Functionx> functionWrapper = new LambdaQueryWrapper<>(); |
|
|
|
List<Functionx> functionxList = this.queryFunctionListByModuleId(modulex); |
|
|
|
functionWrapper.eq(Functionx::getModuleId, modulex.getId()); |
|
|
|
|
|
|
|
List<Functionx> functionxList = this.list(functionWrapper); |
|
|
|
|
|
|
|
List<FunctionDto> functionDtoList = new ArrayList<>(); |
|
|
|
List<FunctionDto> functionDtoList = new ArrayList<>(); |
|
|
|
functionxList.forEach(functionx -> { |
|
|
|
functionxList.forEach(functionx -> { |
|
|
|
FunctionDto functionDto = new FunctionDto(); |
|
|
|
FunctionDto functionDto = new FunctionDto(); |
|
|
|
BeanUtils.copyProperties(functionx, 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 = |
|
|
|
List<RuleDto> ruleDtoList = |
|
|
|
rulexService.queryRuleDtoListByFunctionId(functionx); |
|
|
|
rulexService.queryRuleDtoListByFunctionId(functionx); |
|
|
|
functionDto.setRuleDtoList(ruleDtoList); |
|
|
|
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); |
|
|
|
functionDtoList.add(functionDto); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return functionDtoList; |
|
|
|
return functionDtoList; |
|
|
|