|
|
@ -1,9 +1,10 @@ |
|
|
|
package com.epmet.plugin.power.modules.axis.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.AssertUtils; |
|
|
@ -30,7 +31,7 @@ import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 动力主轴结构 |
|
|
|
* 动力主轴结构 |
|
|
|
* |
|
|
|
* @author generator generator@elink-cn.com |
|
|
|
* @since v1.0.0 2022-04-18 |
|
|
@ -43,21 +44,22 @@ public class PowerAxisStructController { |
|
|
|
private PowerAxisStructService powerAxisStructService; |
|
|
|
|
|
|
|
@RequestMapping("page") |
|
|
|
public Result<PageData<PowerAxisStructDTO>> page(@RequestParam Map<String, Object> params){ |
|
|
|
public Result<PageData<PowerAxisStructDTO>> page(@RequestParam Map<String, Object> params) { |
|
|
|
PageData<PowerAxisStructDTO> page = powerAxisStructService.page(params); |
|
|
|
return new Result<PageData<PowerAxisStructDTO>>().ok(page); |
|
|
|
} |
|
|
|
|
|
|
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|
|
|
public Result<PowerAxisStructDTO> get(@PathVariable("id") String id){ |
|
|
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|
|
|
public Result<PowerAxisStructDTO> get(@PathVariable("id") String id) { |
|
|
|
PowerAxisStructDTO data = powerAxisStructService.get(id); |
|
|
|
return new Result<PowerAxisStructDTO>().ok(data); |
|
|
|
} |
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
|
@PostMapping("save") |
|
|
|
public Result save(@RequestBody PowerAxisStructDTO dto){ |
|
|
|
public Result save(@RequestBody PowerAxisStructDTO dto, @LoginUser TokenDto tokenDto) { |
|
|
|
//效验数据
|
|
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
powerAxisStructService.save(dto); |
|
|
|
return new Result(); |
|
|
@ -65,15 +67,16 @@ public class PowerAxisStructController { |
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
|
@PostMapping("update") |
|
|
|
public Result update(@RequestBody PowerAxisStructDTO dto){ |
|
|
|
public Result update(@RequestBody PowerAxisStructDTO dto, @LoginUser TokenDto tokenDto) { |
|
|
|
//效验数据
|
|
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
powerAxisStructService.update(dto); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("delete") |
|
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
|
//效验数据
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
|
powerAxisStructService.delete(ids); |
|
|
@ -98,46 +101,30 @@ public class PowerAxisStructController { |
|
|
|
public Result<List<PowerAxisStructLeaderResultDTO>> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { |
|
|
|
return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据名字查询 |
|
|
|
*/ |
|
|
|
@PostMapping("/queryDeptByName") |
|
|
|
public Result queryDeptByName(@RequestBody PowerAxisStructFormDTO form){ |
|
|
|
public Result queryDeptByName(@RequestBody PowerAxisStructFormDTO form) { |
|
|
|
List<PowerAxisStructResultDTO> result = powerAxisStructService.queryDeptByName(form); |
|
|
|
return new Result<List<PowerAxisStructResultDTO>>().ok(result); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 添加组织 |
|
|
|
*/ |
|
|
|
@PostMapping("/addOrg") |
|
|
|
public Result addOrg(@RequestBody PowerAxisStructEntity form){ |
|
|
|
powerAxisStructService.addOrg(form); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 修改组织 |
|
|
|
*/ |
|
|
|
@PostMapping("/modifyOrg") |
|
|
|
public Result modifyOrg(@RequestBody PowerAxisStructEntity form){ |
|
|
|
powerAxisStructService.modifyRog(form); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据id删除 |
|
|
|
*/ |
|
|
|
@PostMapping("/deleteById/{id}") |
|
|
|
public Result deleteById(@PathVariable String id){ |
|
|
|
public Result deleteById(@PathVariable String id) { |
|
|
|
powerAxisStructService.delete(id); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取上级网格党支部 |
|
|
|
*/ |
|
|
|
@PostMapping("/GridPartyBranchList") |
|
|
|
public Result<List<PowerAxisStructGridPartyBranchResultDTO>> getGridPartyBranchList(){ |
|
|
|
public Result<List<PowerAxisStructGridPartyBranchResultDTO>> getGridPartyBranchList() { |
|
|
|
List<PowerAxisStructGridPartyBranchResultDTO> list = powerAxisStructService.getGridPartyBranchList(); |
|
|
|
return new Result<List<PowerAxisStructGridPartyBranchResultDTO>>().ok(list); |
|
|
|
} |
|
|
@ -146,7 +133,7 @@ public class PowerAxisStructController { |
|
|
|
* 获取上级组织 |
|
|
|
*/ |
|
|
|
@PostMapping("/getPartyCommList") |
|
|
|
public Result<List<PowerAxisStructPartyCommResultDTO>> getPartyCommList(){ |
|
|
|
public Result<List<PowerAxisStructPartyCommResultDTO>> getPartyCommList() { |
|
|
|
List<PowerAxisStructPartyCommResultDTO> list = powerAxisStructService.getPartyCommList(); |
|
|
|
return new Result<List<PowerAxisStructPartyCommResultDTO>>().ok(list); |
|
|
|
} |
|
|
@ -155,15 +142,16 @@ public class PowerAxisStructController { |
|
|
|
* 查询父id |
|
|
|
*/ |
|
|
|
@PostMapping("/getPid") |
|
|
|
public Result<List<String>> getPid(){ |
|
|
|
public Result<List<String>> getPid() { |
|
|
|
List<String> pid = powerAxisStructService.getPid(); |
|
|
|
return new Result<List<String>>().ok(pid); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据id查询修改表单数据 |
|
|
|
*/ |
|
|
|
@PostMapping("/queryModifyById/{id}") |
|
|
|
public Result<PowerAxisStructEntity> queryModifyById(@PathVariable String id){ |
|
|
|
public Result<PowerAxisStructEntity> queryModifyById(@PathVariable String id) { |
|
|
|
PowerAxisStructEntity power = powerAxisStructService.queryModifyById(id); |
|
|
|
return new Result<PowerAxisStructEntity>().ok(power); |
|
|
|
} |
|
|
@ -172,7 +160,7 @@ public class PowerAxisStructController { |
|
|
|
* 按节点类型获取节点列表 |
|
|
|
*/ |
|
|
|
@PostMapping("/listByCategoryCode") |
|
|
|
public Result getListByCategoryCode(@RequestBody PowerAxisStructListByCategoryCodeFormDTO form){ |
|
|
|
public Result getListByCategoryCode(@RequestBody PowerAxisStructListByCategoryCodeFormDTO form) { |
|
|
|
List<PowerAixsStructListByCategoryResultDTO> dto = powerAxisStructService.getListByCategoryCode(form); |
|
|
|
return new Result().ok(dto); |
|
|
|
} |
|
|
|