|
@ -1,6 +1,7 @@ |
|
|
package com.epmet.plugin.power.modules.axis.controller; |
|
|
package com.epmet.plugin.power.modules.axis.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
@ -15,8 +16,14 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; |
|
|
import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; |
|
|
import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; |
|
|
import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; |
|
|
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; |
|
|
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; |
|
|
|
|
|
import com.epmet.plugin.power.dto.axis.form.PowerAxisStructAddFormDTO; |
|
|
|
|
|
import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; |
|
|
|
|
|
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO; |
|
|
|
|
|
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; |
|
|
|
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; |
|
|
import com.epmet.plugin.power.modules.axis.excel.PowerAxisStructExcel; |
|
|
import com.epmet.plugin.power.modules.axis.excel.PowerAxisStructExcel; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; |
|
|
|
|
|
import oracle.jdbc.proxy.annotation.Post; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
@ -26,7 +33,7 @@ import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 动力主轴结构 |
|
|
* 动力主轴结构 |
|
|
* |
|
|
* |
|
|
* @author generator generator@elink-cn.com |
|
|
* @author generator generator@elink-cn.com |
|
|
* @since v1.0.0 2022-04-18 |
|
|
* @since v1.0.0 2022-04-18 |
|
@ -39,20 +46,20 @@ public class PowerAxisStructController { |
|
|
private PowerAxisStructService powerAxisStructService; |
|
|
private PowerAxisStructService powerAxisStructService; |
|
|
|
|
|
|
|
|
@RequestMapping("page") |
|
|
@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); |
|
|
PageData<PowerAxisStructDTO> page = powerAxisStructService.page(params); |
|
|
return new Result<PageData<PowerAxisStructDTO>>().ok(page); |
|
|
return new Result<PageData<PowerAxisStructDTO>>().ok(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|
|
public Result<PowerAxisStructDTO> get(@PathVariable("id") String id) { |
|
|
public Result<PowerAxisStructDTO> get(@PathVariable("id") String id){ |
|
|
PowerAxisStructDTO data = powerAxisStructService.get(id); |
|
|
PowerAxisStructDTO data = powerAxisStructService.get(id); |
|
|
return new Result<PowerAxisStructDTO>().ok(data); |
|
|
return new Result<PowerAxisStructDTO>().ok(data); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
@NoRepeatSubmit |
|
|
@PostMapping("save") |
|
|
@PostMapping("save") |
|
|
public Result save(@RequestBody PowerAxisStructDTO dto) { |
|
|
public Result save(@RequestBody PowerAxisStructDTO dto){ |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
powerAxisStructService.save(dto); |
|
|
powerAxisStructService.save(dto); |
|
@ -61,7 +68,7 @@ public class PowerAxisStructController { |
|
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
@NoRepeatSubmit |
|
|
@PostMapping("update") |
|
|
@PostMapping("update") |
|
|
public Result update(@RequestBody PowerAxisStructDTO dto) { |
|
|
public Result update(@RequestBody PowerAxisStructDTO dto){ |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
powerAxisStructService.update(dto); |
|
|
powerAxisStructService.update(dto); |
|
@ -69,7 +76,7 @@ public class PowerAxisStructController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PostMapping("delete") |
|
|
@PostMapping("delete") |
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
powerAxisStructService.delete(ids); |
|
|
powerAxisStructService.delete(ids); |
|
@ -94,5 +101,31 @@ public class PowerAxisStructController { |
|
|
public Result<List<PowerAxisStructLeaderResultDTO>> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { |
|
|
public Result<List<PowerAxisStructLeaderResultDTO>> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { |
|
|
return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); |
|
|
return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 根据名字查询 |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("/queryDeptByName") |
|
|
|
|
|
public Result queryDeptByName(@RequestBody PowerAxisStructFormDTO form){ |
|
|
|
|
|
List<PowerAxisStructResultDTO> result = powerAxisStructService.queryDeptByName(form); |
|
|
|
|
|
return new Result<List<PowerAxisStructResultDTO>>().ok(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取树状列表 |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("/getTreeList") |
|
|
|
|
|
public Result queryList(){ |
|
|
|
|
|
List<PowerAxisStructListResultDTO> list = powerAxisStructService.queryList(); |
|
|
|
|
|
return new Result<List<PowerAxisStructListResultDTO>>().ok(list); |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 添加组织 |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("/addOrg") |
|
|
|
|
|
public Result addOrg(@RequestBody PowerAxisStructAddFormDTO form){ |
|
|
|
|
|
int i = powerAxisStructService.addOrg(form); |
|
|
|
|
|
System.out.println("1111111111"); |
|
|
|
|
|
return new Result(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|