OrganizationStructureController.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.ims.eval.controller;
  2. import com.ims.eval.entity.OrganizationStructure;
  3. import com.ims.eval.entity.dto.result.R;
  4. import com.ims.eval.service.IOrganizationStructureService;
  5. import io.swagger.annotations.ApiOperation;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.*;
  8. import java.util.List;
  9. /**
  10. * <p>
  11. * 前端控制器
  12. * </p>
  13. *
  14. * @author wang
  15. * @since 2023-03-01
  16. */
  17. @RestController
  18. @RequestMapping("//organization-structure")
  19. public class OrganizationStructureController {
  20. @Autowired
  21. private IOrganizationStructureService organizationStructureService;
  22. /**
  23. * 添加
  24. *
  25. * @param evaluateRuleInfo
  26. * @return
  27. */
  28. //@ImsPreAuth("eval:dataDictionary:edit")
  29. @PostMapping(value = "/save")
  30. @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
  31. public R addAll(@RequestBody List<OrganizationStructure> evaluateRuleInfo) {
  32. boolean b = organizationStructureService.saveBatch(evaluateRuleInfo);
  33. if (b) {
  34. return R.ok().data(b);
  35. } else {
  36. return R.error().data("保存失败!");
  37. }
  38. }
  39. @GetMapping(value = "getTree")
  40. public R getTree(
  41. @RequestParam(value = "id", required = false) String id,
  42. @RequestParam(value = "num", required = false) Integer num,
  43. @RequestParam(value = "type", required = false) String type) {
  44. List<OrganizationStructure> list = organizationStructureService.getTree(id,num,type);
  45. return R.ok().data(list);
  46. }
  47. }