|
@ -1,8 +1,8 @@ |
|
|
/** |
|
|
/** |
|
|
* Copyright (c) 2018 人人开源 All rights reserved. |
|
|
* Copyright (c) 2018 人人开源 All rights reserved. |
|
|
* |
|
|
* <p> |
|
|
* https://www.renren.io
|
|
|
* https://www.renren.io
|
|
|
* |
|
|
* <p> |
|
|
* 版权所有,侵权必究! |
|
|
* 版权所有,侵权必究! |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
@ -15,6 +15,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|
|
|
|
|
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
|
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
|
|
import com.elink.esua.epdc.dto.SysSimpleDeptDTO; |
|
|
import com.elink.esua.epdc.dto.SysSimpleDeptDTO; |
|
|
import com.elink.esua.epdc.service.SysDeptService; |
|
|
import com.elink.esua.epdc.service.SysDeptService; |
|
@ -35,14 +36,14 @@ import java.util.Map; |
|
|
*/ |
|
|
*/ |
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("dept") |
|
|
@RequestMapping("dept") |
|
|
@Api(tags="部门管理") |
|
|
@Api(tags = "部门管理") |
|
|
public class SysDeptController { |
|
|
public class SysDeptController { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysDeptService sysDeptService; |
|
|
private SysDeptService sysDeptService; |
|
|
|
|
|
|
|
|
@GetMapping("list") |
|
|
@GetMapping("list") |
|
|
@ApiOperation("列表") |
|
|
@ApiOperation("列表") |
|
|
public Result<List<SysDeptDTO>> list(){ |
|
|
public Result<List<SysDeptDTO>> list() { |
|
|
List<SysDeptDTO> list = sysDeptService.list(new HashMap<>(1)); |
|
|
List<SysDeptDTO> list = sysDeptService.list(new HashMap<>(1)); |
|
|
|
|
|
|
|
|
return new Result<List<SysDeptDTO>>().ok(list); |
|
|
return new Result<List<SysDeptDTO>>().ok(list); |
|
@ -50,14 +51,14 @@ public class SysDeptController { |
|
|
|
|
|
|
|
|
@GetMapping("sublist/{pid}") |
|
|
@GetMapping("sublist/{pid}") |
|
|
@ApiOperation("子列表") |
|
|
@ApiOperation("子列表") |
|
|
public Result<List<SysSimpleDeptDTO>> sublist(@PathVariable("pid") String pid){ |
|
|
public Result<List<SysSimpleDeptDTO>> sublist(@PathVariable("pid") String pid) { |
|
|
List<SysSimpleDeptDTO> list = sysDeptService.subList(pid); |
|
|
List<SysSimpleDeptDTO> list = sysDeptService.subList(pid); |
|
|
return new Result().ok(list); |
|
|
return new Result().ok(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("{id}") |
|
|
@GetMapping("{id}") |
|
|
@ApiOperation("信息") |
|
|
@ApiOperation("信息") |
|
|
public Result<SysDeptDTO> get(@PathVariable("id") Long id){ |
|
|
public Result<SysDeptDTO> get(@PathVariable("id") Long id) { |
|
|
SysDeptDTO data = sysDeptService.get(id); |
|
|
SysDeptDTO data = sysDeptService.get(id); |
|
|
|
|
|
|
|
|
return new Result<SysDeptDTO>().ok(data); |
|
|
return new Result<SysDeptDTO>().ok(data); |
|
@ -66,7 +67,7 @@ public class SysDeptController { |
|
|
@PostMapping |
|
|
@PostMapping |
|
|
@ApiOperation("保存") |
|
|
@ApiOperation("保存") |
|
|
@LogOperation("Save Dept") |
|
|
@LogOperation("Save Dept") |
|
|
public Result save(@RequestBody SysDeptDTO dto){ |
|
|
public Result save(@RequestBody SysDeptDTO dto) { |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
|
|
|
|
@ -78,7 +79,7 @@ public class SysDeptController { |
|
|
@PutMapping |
|
|
@PutMapping |
|
|
@ApiOperation("修改") |
|
|
@ApiOperation("修改") |
|
|
@LogOperation("Update Dept") |
|
|
@LogOperation("Update Dept") |
|
|
public Result update(@RequestBody SysDeptDTO dto){ |
|
|
public Result update(@RequestBody SysDeptDTO dto) { |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
|
|
|
|
@ -90,7 +91,7 @@ public class SysDeptController { |
|
|
@DeleteMapping("{id}") |
|
|
@DeleteMapping("{id}") |
|
|
@ApiOperation("删除") |
|
|
@ApiOperation("删除") |
|
|
@LogOperation("Delete Dept") |
|
|
@LogOperation("Delete Dept") |
|
|
public Result delete(@PathVariable("id") Long id){ |
|
|
public Result delete(@PathVariable("id") Long id) { |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
AssertUtils.isNull(id, "id"); |
|
|
AssertUtils.isNull(id, "id"); |
|
|
|
|
|
|
|
@ -101,7 +102,22 @@ public class SysDeptController { |
|
|
|
|
|
|
|
|
@GetMapping("listGridId/{pid}") |
|
|
@GetMapping("listGridId/{pid}") |
|
|
@ApiOperation("获取所有下属网格ID集合") |
|
|
@ApiOperation("获取所有下属网格ID集合") |
|
|
public Result<List<Long>> listGridIdByPid(@PathVariable("pid") Long pid){ |
|
|
public Result<List<Long>> listGridIdByPid(@PathVariable("pid") Long pid) { |
|
|
return sysDeptService.listGridIdByPid(pid); |
|
|
return sysDeptService.listGridIdByPid(pid); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 通过网格ID获取该网格所有上级机构 |
|
|
|
|
|
* |
|
|
|
|
|
* @param gridId |
|
|
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CompleteDeptDTO> |
|
|
|
|
|
* @author yujintao |
|
|
|
|
|
* @date 2019/9/7 09:12 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("getCompleteDept/{gridId}") |
|
|
|
|
|
public Result<CompleteDeptDTO> getCompleteDept(@PathVariable("gridId") Long gridId) { |
|
|
|
|
|
return sysDeptService.getCompleteDept(gridId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|