OrgController.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.dk.mdm.controller.mst;
  2. import com.dk.common.model.pojo.PageList;
  3. import com.dk.common.response.ResponseResultVO;
  4. import com.dk.mdm.model.pojo.mst.Org;
  5. import com.dk.common.controller.BaseController;
  6. import com.dk.common.service.BaseService;
  7. import com.dk.mdm.model.query.core.OrganizationQuery;
  8. import com.dk.mdm.model.query.mst.OrgQuery;
  9. import com.dk.mdm.model.response.core.OrganizationResponse;
  10. import com.dk.mdm.model.vo.core.OrganizationVO;
  11. import com.dk.mdm.model.vo.mst.OrgVO;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.transaction.annotation.Transactional;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.web.bind.annotation.RestController;
  19. import io.swagger.annotations.Api;
  20. import com.dk.mdm.service.mst.OrgService;
  21. @Api(tags = "组织机构API接口")
  22. @RestController
  23. @RequestMapping("/mst/org")
  24. public class OrgController{
  25. public BaseService<Org> getService() {
  26. return orgService;
  27. }
  28. @Autowired
  29. private OrgService orgService;
  30. /**
  31. * @desc : 条件查询
  32. * @author : 王英杰
  33. * @date : 2024/2/26 14:02
  34. */
  35. @ApiOperation( value = "分页、关联、条件查询", notes = "分页、关联、条件查询" )
  36. @PostMapping({"list_by"})
  37. public ResponseResultVO<PageList<Org>> selectByCond(@RequestBody OrgQuery orgQuery) {
  38. return orgService.selectByCond(orgQuery);
  39. }
  40. /**
  41. * @desc : 新建组织部门
  42. * @author : 王英杰
  43. * @date : 2024/2/27 9:13
  44. */
  45. @ApiOperation( value = "新建组织部门", notes = "新建组织部门" )
  46. @PostMapping({"insert"})
  47. @Transactional(rollbackFor = Exception.class)
  48. public ResponseResultVO<?> insert(@RequestBody OrgVO orgVO) {
  49. return orgService.insert(orgVO);
  50. }
  51. }