fix:复制模块名称加上区分
This commit is contained in:
parent
9d9ca6f137
commit
f2f9cb308b
@ -15,7 +15,6 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 应用_系统模块 前端控制器
|
* 应用_系统模块 前端控制器
|
||||||
@ -36,8 +35,8 @@ public class ModuleController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public ResponseResult page(@RequestParam String appId) {
|
public ResponseResult page(@RequestParam String appId) {
|
||||||
QueryWrapper<Module> wrapper = new QueryWrapper<>();
|
QueryWrapper<Module> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("app_id",appId);
|
wrapper.eq("app_id", appId);
|
||||||
wrapper.orderByAsc("pid","sort"); // 按编码倒序排列
|
wrapper.orderByAsc("pid", "sort"); // 按编码倒序排列
|
||||||
List<Map<String, Object>> list = moduleService.listMaps(wrapper);
|
List<Map<String, Object>> list = moduleService.listMaps(wrapper);
|
||||||
return ResponseResult.successData(list);
|
return ResponseResult.successData(list);
|
||||||
}
|
}
|
||||||
@ -64,6 +63,7 @@ public class ModuleController {
|
|||||||
try {
|
try {
|
||||||
Module module = BeanUtil.toBean(moduleMap, Module.class);
|
Module module = BeanUtil.toBean(moduleMap, Module.class);
|
||||||
module.setId(null);
|
module.setId(null);
|
||||||
|
module.setName(module.getName() + "(复制)");
|
||||||
module.setCreateTime(LocalDateTime.now());
|
module.setCreateTime(LocalDateTime.now());
|
||||||
module.setCreateBy(AuthUtils.getUser().getUserId().toString());
|
module.setCreateBy(AuthUtils.getUser().getUserId().toString());
|
||||||
|
|
||||||
@ -78,7 +78,6 @@ public class ModuleController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 修改模块
|
// 修改模块
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult update(@RequestBody Module module) {
|
public ResponseResult update(@RequestBody Module module) {
|
||||||
@ -94,7 +93,7 @@ public class ModuleController {
|
|||||||
// 获取模块详情
|
// 获取模块详情
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ResponseResult getById(@PathVariable String id) {
|
public ResponseResult getById(@PathVariable String id) {
|
||||||
Map<String, Object> moduleMap=null;
|
Map<String, Object> moduleMap = null;
|
||||||
try {
|
try {
|
||||||
LambdaQueryWrapper<Module> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Module> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(Module::getId, id);
|
wrapper.eq(Module::getId, id);
|
||||||
@ -107,8 +106,8 @@ public class ModuleController {
|
|||||||
|
|
||||||
// 新增:根据pid判断是否有子节点
|
// 新增:根据pid判断是否有子节点
|
||||||
@GetMapping("/checkHasChildren")
|
@GetMapping("/checkHasChildren")
|
||||||
public boolean checkHasChildren(@RequestParam String appId,@RequestParam String pid) {
|
public boolean checkHasChildren(@RequestParam String appId, @RequestParam String pid) {
|
||||||
boolean hasChildren = moduleService.existsChildrenByPid(appId,pid);
|
boolean hasChildren = moduleService.existsChildrenByPid(appId, pid);
|
||||||
return hasChildren;
|
return hasChildren;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user