SupplierController.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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.Supplier;
  5. import com.dk.common.service.BaseService;
  6. import com.dk.mdm.model.query.mst.SupplierQuery;
  7. import com.dk.mdm.model.vo.mst.SupplierVo;
  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.SupplierService;
  13. import java.util.List;
  14. @Api(tags = "供应商API接口")
  15. @RestController
  16. @RequestMapping("/mst/supplier")
  17. public class SupplierController{
  18. public BaseService<Supplier> getService() {
  19. return supplierService;
  20. }
  21. @Autowired
  22. private SupplierService supplierService;
  23. /**
  24. * @desc : 条件查询
  25. * @author : 王英杰
  26. * @date : 2024/2/26 14:02
  27. */
  28. @ApiOperation( value = "分页、关联、条件查询", notes = "分页、关联、条件查询" )
  29. @PostMapping({"list_by"})
  30. public ResponseResultVO<PageList<Supplier>> selectByCond(@RequestBody SupplierQuery supplierQuery) {
  31. return supplierService.selectByCond(supplierQuery);
  32. }
  33. /**
  34. * @desc : 新建供应商
  35. * @author : 王英杰
  36. * @date : 2023/1/9 10:48
  37. */
  38. @ApiOperation(value = "新建供应商", notes = "新建供应商")
  39. @PostMapping({"insert"})
  40. public ResponseResultVO<?> insert(@RequestBody SupplierVo supplierVo) {
  41. return supplierService.insert(supplierVo);
  42. }
  43. /**
  44. * @desc : 编辑供应商
  45. * @author : 王英杰
  46. * @date : 2023/1/9 10:48
  47. */
  48. @ApiOperation(value = "编辑员工", notes = "编辑员工")
  49. @PostMapping({"update"})
  50. public ResponseResultVO<?> update(@RequestBody SupplierVo supplierVo) {
  51. return supplierService.update(supplierVo);
  52. }
  53. /**
  54. * @desc : 停用供应商
  55. * @author : 王英杰
  56. * @date : 2023/1/9 10:48
  57. */
  58. @ApiOperation(value = "停用供应商", notes = "停用供应商")
  59. @PostMapping({"deactivate_data"})
  60. public ResponseResultVO<?> deactivateData(@RequestBody SupplierVo supplierVo) {
  61. return supplierService.deactivateData(supplierVo);
  62. }
  63. /**
  64. * @desc : 停用批量
  65. * @author : songy
  66. * @date : 2023/2/29 10:34
  67. */
  68. @ApiOperation(value = "批量停用", notes = "批量停用")
  69. @PostMapping("disable_batch")
  70. public ResponseResultVO<Boolean> disableBatch(@RequestBody List<String> ids) {
  71. return this.getService().disableBatch(ids);
  72. }
  73. /**
  74. * @desc : 启用批量
  75. * @author : songy
  76. * @date : 2023/2/29 10:34
  77. */
  78. @ApiOperation(value = "批量启用", notes = "批量启用")
  79. @PostMapping("enable_batch")
  80. public ResponseResultVO<Boolean> enableBatch(@RequestBody List<String> ids) {
  81. return this.getService().enableBatch(ids);
  82. }
  83. /**
  84. * @desc : 通过ID查询
  85. * @author : 王英杰
  86. * @date : 2023/1/9 10:41
  87. */
  88. @PostMapping({"/{id}"})
  89. public ResponseResultVO selectById(@PathVariable String id) {
  90. return supplierService.selectById(id);
  91. }
  92. }