PrintLayoutController.java 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package com.dk.mdm.controller.mst;
  2. import com.dk.common.infrastructure.constant.Constant;
  3. import com.dk.common.model.pojo.PageList;
  4. import com.dk.common.response.ResponseResultVO;
  5. import com.dk.mdm.model.pojo.mst.PrintLayout;
  6. import com.dk.common.service.BaseService;
  7. import com.dk.mdm.service.common.CommonService;
  8. import io.swagger.annotations.ApiOperation;
  9. import org.springframework.web.bind.annotation.*;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import io.swagger.annotations.Api;
  12. import com.dk.mdm.service.mst.PrintLayoutService;
  13. @Api(tags = "打印模版API接口")
  14. @RestController
  15. @RequestMapping("/mst/printLayout")
  16. public class PrintLayoutController{
  17. public BaseService<PrintLayout> getService() {
  18. return printLayoutService;
  19. }
  20. @Autowired
  21. private PrintLayoutService printLayoutService;
  22. @Autowired
  23. private CommonService commonService;
  24. /**
  25. * @desc : 条件查询
  26. * @author : 张潇木
  27. * @date : 2024/4/9 9:02
  28. */
  29. @ApiOperation( value = "分页、关联、条件查询", notes = "分页、关联、条件查询" )
  30. @PostMapping({"list_by"})
  31. public ResponseResultVO<PageList<PrintLayout>> selectByCond(@RequestBody PrintLayout printLayout) {
  32. return printLayoutService.selectByCond(printLayout);
  33. }
  34. /**
  35. * @desc : 新建
  36. * @author : 张潇木
  37. * @date : 2024/4/9 9:02
  38. */
  39. @ApiOperation( value = "新建", notes = "新建" )
  40. @PostMapping({"insert"})
  41. public ResponseResultVO<?> insert(@RequestBody PrintLayout printLayout) {
  42. printLayout.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.PRINT_LAYOUT));
  43. return this.getService().insert(printLayout);
  44. }
  45. /**
  46. * @desc : 编辑
  47. * @author : 张潇木
  48. * @date : 2024/4/9 9:02
  49. */
  50. @ApiOperation( value = "编辑", notes = "编辑" )
  51. @PostMapping({"update"})
  52. public ResponseResultVO<?> update(@RequestBody PrintLayout printLayout) {
  53. return this.getService().updateByUuid(printLayout);
  54. }
  55. /**
  56. * @desc : 明细查询
  57. * @author : 张潇木
  58. * @date : 2024/4/9 9:02
  59. */
  60. @PostMapping({"/{id}"})
  61. public ResponseResultVO<?> selectById(@PathVariable String id) {
  62. return this.getService().selectById(id);
  63. }
  64. /**
  65. * @desc : 停用
  66. * @author : 张潇木
  67. * @date : 2024/4/9 9:02
  68. */
  69. @PostMapping("disable/{id}")
  70. public ResponseResultVO<Boolean> disable(@PathVariable String id) {
  71. return this.getService().disable(id);
  72. }
  73. /**
  74. * @desc : 启用
  75. * @author : 张潇木
  76. * @date : 2024/4/9 9:02
  77. */
  78. @PostMapping("enable/{id}")
  79. public ResponseResultVO<Boolean> enable(@PathVariable String id) {
  80. return this.getService().enable(id);
  81. }
  82. }