HouseConfigController.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package com.jjt.biz.controller;
  2. import com.jjt.biz.domain.HouseConfig;
  3. import com.jjt.biz.service.IHouseConfigService;
  4. import com.jjt.common.annotation.Log;
  5. import com.jjt.common.core.controller.BaseController;
  6. import com.jjt.common.core.domain.AjaxResult;
  7. import com.jjt.common.core.page.TableDataInfo;
  8. import com.jjt.common.enums.BusinessType;
  9. import com.jjt.common.utils.SecurityUtils;
  10. import com.jjt.common.utils.poi.ExcelUtil;
  11. import com.jjt.system.service.ISysDeptService;
  12. import io.swagger.annotations.Api;
  13. import io.swagger.annotations.ApiOperation;
  14. import org.springframework.web.bind.annotation.*;
  15. import javax.annotation.Resource;
  16. import javax.servlet.http.HttpServletResponse;
  17. import java.util.List;
  18. /**
  19. * 仓库配置Controller
  20. *
  21. * @author wukai
  22. * @date 2025-10-11
  23. */
  24. @Api(tags = "仓库配置")
  25. @RestController
  26. @RequestMapping("/biz/houseConfig")
  27. public class HouseConfigController extends BaseController {
  28. @Resource
  29. private IHouseConfigService houseConfigService;
  30. @Resource
  31. private ISysDeptService deptService;
  32. /**
  33. * 查询仓库配置列表
  34. */
  35. @ApiOperation("查询仓库配置列表")
  36. //@PreAuthorize("@ss.hasPermi('biz:houseConfig:list')")
  37. @GetMapping("/list")
  38. public TableDataInfo list(HouseConfig houseConfig) {
  39. startPage();
  40. List<HouseConfig> list = houseConfigService.selectHouseConfigList(houseConfig);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出仓库配置列表
  45. */
  46. @ApiOperation("导出仓库配置列表")
  47. //@PreAuthorize("@ss.hasPermi('biz:houseConfig:export')")
  48. @Log(title = "仓库配置", businessType = BusinessType.EXPORT)
  49. @PostMapping("/export")
  50. public void export(HttpServletResponse response, HouseConfig houseConfig) {
  51. List<HouseConfig> list = houseConfigService.selectHouseConfigList(houseConfig);
  52. ExcelUtil<HouseConfig> util = new ExcelUtil<HouseConfig>(HouseConfig.class);
  53. util.exportExcel(response, list, "仓库配置数据");
  54. }
  55. /**
  56. * 获取仓库配置详细信息
  57. */
  58. @ApiOperation("获取仓库配置详细信息")
  59. //@PreAuthorize("@ss.hasPermi('biz:houseConfig:query')")
  60. @GetMapping(value = "/{houseId}")
  61. public AjaxResult getInfo(@PathVariable("houseId") Long houseId) {
  62. return success(houseConfigService.selectHouseConfigByHouseId(houseId));
  63. }
  64. /**
  65. * 新增仓库配置
  66. */
  67. @ApiOperation("新增仓库配置")
  68. //@PreAuthorize("@ss.hasPermi('biz:houseConfig:add')")
  69. @Log(title = "仓库配置", businessType = BusinessType.INSERT)
  70. @PostMapping
  71. public AjaxResult add(@RequestBody HouseConfig houseConfig) {
  72. return toAjax(houseConfigService.insertHouseConfig(houseConfig));
  73. }
  74. /**
  75. * 修改仓库配置
  76. */
  77. @ApiOperation("修改仓库配置")
  78. //@PreAuthorize("@ss.hasPermi('biz:houseConfig:edit')")
  79. @Log(title = "仓库配置", businessType = BusinessType.UPDATE)
  80. @PutMapping
  81. public AjaxResult edit(@RequestBody HouseConfig houseConfig) {
  82. return toAjax(houseConfigService.updateHouseConfig(houseConfig));
  83. }
  84. /**
  85. * 删除仓库配置
  86. */
  87. @ApiOperation("删除仓库配置")
  88. //@PreAuthorize("@ss.hasPermi('biz:houseConfig:remove')")
  89. @Log(title = "仓库配置", businessType = BusinessType.DELETE)
  90. @DeleteMapping("/{houseIds}")
  91. public AjaxResult remove(@PathVariable Long[] houseIds) {
  92. return toAjax(houseConfigService.deleteHouseConfigByHouseIds(houseIds));
  93. }
  94. @GetMapping("/deptTree")
  95. public AjaxResult deptTree() {
  96. Long deptId = SecurityUtils.getLoginUser().getDeptId();
  97. return success(deptService.selectDeptTreeList(deptId));
  98. }
  99. }