12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package com.ims.eval.controller;
- import com.ims.eval.entity.OrganizationStructure;
- import com.ims.eval.entity.dto.result.R;
- import com.ims.eval.service.IOrganizationStructureService;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author wang
- * @since 2023-03-01
- */
- @RestController
- @RequestMapping("//organization-structure")
- public class OrganizationStructureController {
- @Autowired
- private IOrganizationStructureService organizationStructureService;
- /**
- * 添加
- *
- * @param evaluateRuleInfo
- * @return
- */
- //@ImsPreAuth("eval:dataDictionary:edit")
- @PostMapping(value = "/save")
- @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
- public R addAll(@RequestBody List<OrganizationStructure> evaluateRuleInfo) {
- boolean b = organizationStructureService.saveBatch(evaluateRuleInfo);
- if (b) {
- return R.ok().data(b);
- } else {
- return R.error().data("保存失败!");
- }
- }
- @GetMapping(value = "getTree")
- public R getTree(
- @RequestParam(value = "id", required = false) String id,
- @RequestParam(value = "num", required = false) Integer num,
- @RequestParam(value = "type", required = false) String type) {
- List<OrganizationStructure> list = organizationStructureService.getTree(id,num,type);
- return R.ok().data(list);
- }
- }
|