QpSupplierCredentialsController.java 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package com.zd.airbottle.controller;
  2. import com.zd.airbottle.domain.QpSupplierCredentials;
  3. import com.zd.airbottle.service.IQpSupplierCredentialsService;
  4. import com.zd.common.core.domain.per.PerFun;
  5. import com.zd.common.core.domain.per.PerPrefix;
  6. import com.zd.common.core.utils.poi.ExcelUtil;
  7. import com.zd.common.core.web.controller.BaseController;
  8. import com.zd.common.core.web.page.TableDataInfo;
  9. import com.zd.common.log.annotation.Log;
  10. import com.zd.common.log.enums.BusinessType;
  11. import com.zd.common.response.ResultData;
  12. import com.zd.common.security.annotation.PreAuthorize;
  13. import io.swagger.annotations.Api;
  14. import io.swagger.annotations.ApiOperation;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.*;
  17. import javax.servlet.http.HttpServletResponse;
  18. import java.io.IOException;
  19. import java.util.List;
  20. /**
  21. * 供应商证件Controller
  22. *
  23. * @author zd
  24. * @date 2022-05-10
  25. */
  26. @RestController
  27. @Api(tags = "【供应商证件】")
  28. @RequestMapping("/supplierCredentials")
  29. public class QpSupplierCredentialsController extends BaseController<QpSupplierCredentials> {
  30. @Autowired
  31. private IQpSupplierCredentialsService qpSupplierCredentialsService;
  32. /**
  33. * 查询供应商证件列表
  34. */
  35. @PreAuthorize(hasPermi = "airbottle:supplier:list")
  36. @GetMapping("/list")
  37. @ApiOperation(value = "查询供应商证件列表", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER_CREDENTIALS + PerFun.LIST)
  38. public TableDataInfo<QpSupplierCredentials> list(QpSupplierCredentials qpSupplierCredentials) {
  39. startPage();
  40. List<QpSupplierCredentials> list = qpSupplierCredentialsService.selectQpSupplierCredentialsList(qpSupplierCredentials);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出供应商证件列表
  45. */
  46. @ApiOperation(value = "导出供应商证件列表", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER_CREDENTIALS + PerFun.EXPORT)
  47. @PreAuthorize(hasPermi = "airbottle:supplier:export")
  48. @Log(title = "供应商证件", businessType = BusinessType.EXPORT)
  49. @PostMapping("/export")
  50. public void export(HttpServletResponse response, QpSupplierCredentials qpSupplierCredentials) throws IOException {
  51. List<QpSupplierCredentials> list = qpSupplierCredentialsService.selectQpSupplierCredentialsList(qpSupplierCredentials);
  52. ExcelUtil<QpSupplierCredentials> util = new ExcelUtil<>(QpSupplierCredentials.class);
  53. util.exportExcel(response, list, "供应商证件数据");
  54. }
  55. /**
  56. * 获取供应商证件详细信息
  57. */
  58. @ApiOperation(value = "获取供应商证件详细信息", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER_CREDENTIALS + PerFun.QUERY)
  59. @PreAuthorize(hasPermi = "airbottle:supplier:query")
  60. @GetMapping(value = "/{id}")
  61. public ResultData<QpSupplierCredentials> getInfo(@PathVariable("id") Long id) {
  62. return ResultData.success(qpSupplierCredentialsService.selectQpSupplierCredentialsById(id));
  63. }
  64. /**
  65. * 新增供应商证件
  66. */
  67. @ApiOperation(value = "新增供应商证件", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER_CREDENTIALS + PerFun.ADD)
  68. @PreAuthorize(hasPermi = "airbottle:supplier:add")
  69. @Log(title = "供应商证件", businessType = BusinessType.INSERT)
  70. @PostMapping("add")
  71. public ResultData<Boolean> add(@RequestBody QpSupplierCredentials qpSupplierCredentials) {
  72. return ResultData.result(qpSupplierCredentialsService.insertQpSupplierCredentials(qpSupplierCredentials));
  73. }
  74. /**
  75. * 修改供应商证件
  76. */
  77. @ApiOperation(value = "修改供应商证件", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER_CREDENTIALS + PerFun.EDIT)
  78. @PreAuthorize(hasPermi = "airbottle:supplier:edit")
  79. @Log(title = "供应商证件", businessType = BusinessType.UPDATE)
  80. @PutMapping("edit")
  81. public ResultData<Boolean> edit(@RequestBody QpSupplierCredentials qpSupplierCredentials) {
  82. return ResultData.result(qpSupplierCredentialsService.updateQpSupplierCredentials(qpSupplierCredentials));
  83. }
  84. /**
  85. * 删除供应商证件
  86. */
  87. @ApiOperation(value = "删除供应商证件", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER_CREDENTIALS + PerFun.REMOVE)
  88. @PreAuthorize(hasPermi = "airbottle:supplier:remove")
  89. @Log(title = "供应商证件", businessType = BusinessType.DELETE)
  90. @DeleteMapping("/{ids}")
  91. public ResultData<Boolean> remove(@PathVariable Long[] ids) {
  92. return ResultData.result(qpSupplierCredentialsService.deleteQpSupplierCredentialsByIds(ids));
  93. }
  94. }