|
|
@ -1,7 +1,9 @@ |
|
|
|
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; |
|
|
@ -27,7 +29,7 @@ import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 动力主轴领导人 |
|
|
|
* 动力主轴领导人 |
|
|
|
* |
|
|
|
* @author generator generator@elink-cn.com |
|
|
|
* @since v1.0.0 2022-04-18 |
|
|
@ -46,21 +48,22 @@ public class PowerAxisLeaderController { |
|
|
|
private PowerAxisStructService powerAxisStructService; |
|
|
|
|
|
|
|
@RequestMapping("page") |
|
|
|
public Result<PageData<PowerAxisLeaderDTO>> page(@RequestParam Map<String, Object> params){ |
|
|
|
public Result<PageData<PowerAxisLeaderDTO>> page(@RequestParam Map<String, Object> params) { |
|
|
|
PageData<PowerAxisLeaderDTO> page = powerAxisLeaderService.page(params); |
|
|
|
return new Result<PageData<PowerAxisLeaderDTO>>().ok(page); |
|
|
|
} |
|
|
|
|
|
|
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|
|
|
public Result<PowerAxisLeaderDTO> get(@PathVariable("id") String id){ |
|
|
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|
|
|
public Result<PowerAxisLeaderDTO> get(@PathVariable("id") String id) { |
|
|
|
PowerAxisLeaderDTO data = powerAxisLeaderService.get(id); |
|
|
|
return new Result<PowerAxisLeaderDTO>().ok(data); |
|
|
|
} |
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
|
@PostMapping("save") |
|
|
|
public Result save(@RequestBody PowerAxisLeaderDTO dto){ |
|
|
|
public Result save(@RequestBody PowerAxisLeaderDTO dto, @LoginUser TokenDto tokenDto) { |
|
|
|
//效验数据
|
|
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
powerAxisLeaderService.save(dto); |
|
|
|
return new Result(); |
|
|
@ -68,7 +71,7 @@ public class PowerAxisLeaderController { |
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
|
@PostMapping("update") |
|
|
|
public Result update(@RequestBody PowerAxisLeaderDTO dto){ |
|
|
|
public Result update(@RequestBody PowerAxisLeaderDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
powerAxisLeaderService.update(dto); |
|
|
@ -76,7 +79,7 @@ public class PowerAxisLeaderController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("delete") |
|
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
|
//效验数据
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
|
powerAxisLeaderService.delete(ids); |
|
|
@ -93,7 +96,7 @@ public class PowerAxisLeaderController { |
|
|
|
* 查询节点负责人信息 |
|
|
|
*/ |
|
|
|
@PostMapping("/getLeaderDetail/{axisStructId}") |
|
|
|
public Result getLeaderDetail(@PathVariable String axisStructId){ |
|
|
|
public Result getLeaderDetail(@PathVariable String axisStructId) { |
|
|
|
PowerAxisSLeaderResultDTO dto = powerAxisStructLeaderService.queryLeaderDetailById(axisStructId); |
|
|
|
return new Result().ok(dto); |
|
|
|
} |
|
|
@ -102,7 +105,7 @@ public class PowerAxisLeaderController { |
|
|
|
* 查询节点负责人列表 |
|
|
|
*/ |
|
|
|
@PostMapping("/listSimpleByAgency") |
|
|
|
public Result getListSimpleByAgency(@RequestBody String agencyId){ |
|
|
|
public Result getListSimpleByAgency(@RequestBody String agencyId) { |
|
|
|
List<String> ids = powerAxisStructService.getIdByAgencyId(agencyId); |
|
|
|
List<PowerAxisSimpleListDTO> list = powerAxisLeaderService.getSimpleList(ids); |
|
|
|
return new Result().ok(list); |
|
|
|