新ui项目信息查看

dev
wish 1 year ago
parent b900aa85a7
commit 2ea88ceb84
  1. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/IFunctionxService.java
  2. 25
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionxServiceImpl.java
  3. 86
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/controller/NewProjectController.java
  4. 21
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/FunctionDto.java
  5. 21
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/ModuleDto.java
  6. 21
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/ProjectDto.java
  7. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/newlayout/dto/RuleDto.java
  8. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
  9. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
  10. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java
  11. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java
  12. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/service/IProjectxService.java
  13. 59
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/service/impl/ProjectxServiceImpl.java

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.functionx.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.newlayout.dto.FunctionDto;
import org.jeecg.modules.modulex.entity.Modulex;
import java.util.List;
@ -39,4 +40,5 @@ public interface IFunctionxService extends IService<Functionx> {
*/
List<Functionx> queryFunctionListByModuleId(Modulex modulex);
List<FunctionDto> queryFunctionDtoListByModuleId(Modulex modulex);
}

@ -8,11 +8,16 @@ 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.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.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -29,6 +34,8 @@ public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx
FunctionxMapper functionxMapper;
@Autowired
FunctionTemplateMapper functionTemplateMapper;
@Autowired
private IRulexService rulexService;
@Override
public String findModuleCode(String id) {
@ -179,4 +186,22 @@ public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx
functionWrapper.eq(Functionx::getModuleId, modulex.getId());
return this.list(functionWrapper);
}
@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<FunctionDto> functionDtoList = new ArrayList<>();
functionxList.forEach(functionx -> {
FunctionDto functionDto = new FunctionDto();
BeanUtils.copyProperties(functionx, functionDto);
// 查询该功能下所有的规则
List<RuleDto> ruleDtoList =
rulexService.queryRuleDtoListByFunctionId(functionx);
functionDto.setRuleDtoList(ruleDtoList);
functionDtoList.add(functionDto);
});
return functionDtoList;
}
}

@ -0,0 +1,86 @@
package org.jeecg.modules.demo.newlayout.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.newlayout.dto.ProjectDto;
import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.projectx.service.IProjectxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* 新项目控制器.
*
* @author wish
* @version 1.0.0
* @date 2023/07/10
*/
@Slf4j
@RestController
@RequestMapping("/newprojectx/newprojectx")
public class NewProjectController {
@Autowired
private IProjectxService projectService;
/**
* 列表查询.
*
* @param projectx projectx
* @param request 请求
* @return {@link Result}<{@link ?}>
*/
@GetMapping("/list")
public Result<?> list(Projectx projectx, HttpServletRequest request) {
QueryWrapper<Projectx> queryWrapper = QueryGenerator.initQueryWrapper(
projectx, request.getParameterMap());
List<ProjectDto> list = projectService.listDto(queryWrapper);
return Result.OK(list);
}
/**
* 分页查询.
*
* @param page 页面
* @param pageSize 页面大小
* @param projectx projectx
* @param request 请求
* @return {@link Result}<{@link Page}<{@link ?}>>
*/
@GetMapping("/page")
public Result<Page<?>> page(@RequestParam(value = "page", defaultValue = "1")
Integer page,
@RequestParam(value = "pageSize", defaultValue = "5")
Integer pageSize,
Projectx projectx, HttpServletRequest request) {
if (page <= 0 || pageSize <= 0) {
page = 1;
pageSize = 5;
}
QueryWrapper<Projectx> queryWrapper = QueryGenerator.initQueryWrapper(
projectx, request.getParameterMap());
Page<Projectx> projectPage = new Page<>(page, pageSize);
Page<ProjectDto> projectDtoPage = projectService.pageDto(projectPage, queryWrapper);
return Result.OK(projectDtoPage);
}
/**
* 通过id获取项目dto.
*
* @param projectx projectx
* @return {@link Result}<{@link ProjectDto}>
*/
@GetMapping("/queryById")
public Result<ProjectDto> getProjectDtoById(Projectx projectx) {
ProjectDto projectDto = projectService.queryDtoById(projectx);
return Result.OK(projectDto);
}
}

@ -0,0 +1,21 @@
package org.jeecg.modules.demo.newlayout.dto;
import lombok.Data;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import java.util.List;
/**
* 功能dto
*
* @author wish
* @version 1.0.0
* @date 2023/07/10
*/
@Data
public class FunctionDto extends Functionx {
/**
* 规则dto列表
*/
List<RuleDto> ruleDtoList;
}

@ -0,0 +1,21 @@
package org.jeecg.modules.demo.newlayout.dto;
import lombok.Data;
import org.jeecg.modules.modulex.entity.Modulex;
import java.util.List;
/**
* 模块dto
*
* @author wish
* @version 1.0.0
* @date 2023/07/10
*/
@Data
public class ModuleDto extends Modulex {
/**
* 功能dto列表
*/
List<FunctionDto> functionDtoList;
}

@ -0,0 +1,21 @@
package org.jeecg.modules.demo.newlayout.dto;
import lombok.Data;
import org.jeecg.modules.projectx.entity.Projectx;
import java.util.List;
/**
* 项目dto.
*
* @author wish
* @version 1.0.0
* @date 2023/07/10
*/
@Data
public class ProjectDto extends Projectx {
/**
* 模块dto列表.
*/
List<ModuleDto> moduleDtoList;
}

@ -0,0 +1,8 @@
package org.jeecg.modules.demo.newlayout.dto;
import lombok.Data;
import org.jeecg.modules.demo.rulex.entity.Rulex;
@Data
public class RuleDto extends Rulex {
}

@ -2,6 +2,7 @@ package org.jeecg.modules.demo.rulex.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.newlayout.dto.RuleDto;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import com.baomidou.mybatisplus.extension.service.IService;
@ -18,4 +19,6 @@ public interface IRulexService extends IService<Rulex> {
Result<?> sort(String id);
List<Rulex> queryRuleListByFunctionId(Functionx functionx);
List<RuleDto> queryRuleDtoListByFunctionId(Functionx functionx);
}

@ -3,14 +3,17 @@ package org.jeecg.modules.demo.rulex.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
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.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
/**
@ -54,4 +57,19 @@ public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements
ruleWrapper.eq(Rulex::getFunctionId, functionx.getId());
return this.list(ruleWrapper);
}
@Override
public List<RuleDto> queryRuleDtoListByFunctionId(Functionx functionx) {
LambdaQueryWrapper<Rulex> ruleWrapper = new LambdaQueryWrapper<>();
ruleWrapper.eq(Rulex::getFunctionId, functionx.getId());
List<Rulex> rulexList = this.list(ruleWrapper);
// 将rule封装为ruleDto
List<RuleDto> ruleDtoList = new ArrayList<>();
for (Rulex rulex : rulexList) {
RuleDto ruleDto = new RuleDto();
BeanUtils.copyProperties(rulex, ruleDto);
ruleDtoList.add(ruleDto);
}
return ruleDtoList;
}
}

@ -3,7 +3,11 @@ package org.jeecg.modules.modulex.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.newlayout.dto.ModuleDto;
import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.projectx.entity.Projectx;
import java.util.List;
/**
* @Description: 模块管理
@ -31,4 +35,6 @@ public interface IModulexService extends IService<Modulex> {
void setmodule(String id, String moduleId);
void copy(Modulex modulex);
List<ModuleDto> queryDtoListByProId(Projectx project);
}

@ -6,6 +6,8 @@ import org.jeecg.common.api.vo.Result;
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.FunctionDto;
import org.jeecg.modules.demo.newlayout.dto.ModuleDto;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.fieldx.entity.Fieldx;
@ -13,6 +15,7 @@ import org.jeecg.modules.fieldx.service.IFieldxService;
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.tablex.entity.Tablex;
import org.jeecg.modules.tablex.service.ITablexService;
import org.springframework.beans.BeanUtils;
@ -22,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
@ -238,6 +242,25 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
}
@Override
public List<ModuleDto> queryDtoListByProId(Projectx projectx) {
LambdaQueryWrapper<Modulex> moduleWrapper = new LambdaQueryWrapper<>();
moduleWrapper.eq(Modulex::getProjectId, projectx.getId());
List<Modulex> modulexList = this.list(moduleWrapper);
// 将模块转为dto
List<ModuleDto> moduleDtoList = new ArrayList<>();
for (Modulex modulex : modulexList) {
ModuleDto moduleDto = new ModuleDto();
BeanUtils.copyProperties(modulex, moduleDto);
// 查询当前模块下所有的功能dto
List<FunctionDto> functionDtoList =
iFunctionxService.queryFunctionDtoListByModuleId(modulex);
moduleDto.setFunctionDtoList(functionDtoList);
moduleDtoList.add(moduleDto);
}
return moduleDtoList;
}
private void handleStatus(String id, Integer a) {
//先查字模块 先查询父id 等于 这个 id 的数据

@ -1,10 +1,14 @@
package org.jeecg.modules.projectx.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.newlayout.dto.ProjectDto;
import org.jeecg.modules.projectx.entity.Projectx;
import java.util.List;
/**
* @Description: 项目管理 管理项目基本信息
* @Author: jeecg-boot
@ -13,4 +17,9 @@ import org.jeecg.modules.projectx.entity.Projectx;
*/
public interface IProjectxService extends IService<Projectx> {
List<ProjectDto> listDto(QueryWrapper<Projectx> queryWrapper);
ProjectDto queryDtoById(Projectx projectx);
Page<ProjectDto> pageDto(Page<Projectx> projectPage, QueryWrapper<Projectx> queryWrapper);
}

@ -1,10 +1,21 @@
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.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.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @Description: 项目管理 管理项目基本信息
@ -13,6 +24,52 @@ import org.springframework.stereotype.Service;
* @Version: V1.0
*/
@Service
public class ProjectxServiceImpl extends ServiceImpl<ProjectxMapper, Projectx> implements IProjectxService {
public class ProjectxServiceImpl extends ServiceImpl<ProjectxMapper, Projectx>
implements IProjectxService {
@Autowired
private IModulexService modulexService;
@Override
public List<ProjectDto> listDto(QueryWrapper<Projectx> queryWrapper) {
List<Projectx> list = this.list(queryWrapper);
List<ProjectDto> projectDtoList = new ArrayList<>();
for (Projectx projectx : list) {
projectDtoList.add(this.queryDtoById(projectx));
}
return projectDtoList;
}
@Override
public ProjectDto queryDtoById(Projectx projectx) {
if (StringUtils.isEmpty(projectx.getId())) {
return new ProjectDto();
}
// 查询当前项目信息
Projectx project = this.getById(projectx.getId());
// 将当前项目封装为dto
ProjectDto projectDto = new ProjectDto();
BeanUtils.copyProperties(project, projectDto);
// 查询当前项目的模块
List<ModuleDto> moduleDtoList = modulexService.queryDtoListByProId(project);
projectDto.setModuleDtoList(moduleDtoList);
return projectDto;
}
@Override
public Page<ProjectDto> pageDto(Page<Projectx> projectPage,
QueryWrapper<Projectx> queryWrapper) {
Page<ProjectDto> projectDtoPage = new Page<>();
this.page(projectPage, queryWrapper);
List<ProjectDto> projectDtoList = new ArrayList<>();
List<Projectx> projectxList = projectPage.getRecords();
for (Projectx projectx : projectxList) {
projectDtoList.add(this.queryDtoById(projectx));
}
BeanUtils.copyProperties(projectPage, projectDtoPage);
projectDtoPage.setRecords(projectDtoList);
return projectDtoPage;
}
}

Loading…
Cancel
Save