| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- package com.jjt.biz.controller;
- import com.jjt.biz.domain.HouseConfig;
- import com.jjt.biz.service.IHouseConfigService;
- import com.jjt.common.annotation.Log;
- import com.jjt.common.core.controller.BaseController;
- import com.jjt.common.core.domain.AjaxResult;
- import com.jjt.common.core.page.TableDataInfo;
- import com.jjt.common.enums.BusinessType;
- import com.jjt.common.utils.SecurityUtils;
- import com.jjt.common.utils.poi.ExcelUtil;
- import com.jjt.system.service.ISysDeptService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletResponse;
- import java.util.List;
- /**
- * 仓库配置Controller
- *
- * @author wukai
- * @date 2025-10-11
- */
- @Api(tags = "仓库配置")
- @RestController
- @RequestMapping("/biz/houseConfig")
- public class HouseConfigController extends BaseController {
- @Resource
- private IHouseConfigService houseConfigService;
- @Resource
- private ISysDeptService deptService;
- /**
- * 查询仓库配置列表
- */
- @ApiOperation("查询仓库配置列表")
- //@PreAuthorize("@ss.hasPermi('biz:houseConfig:list')")
- @GetMapping("/list")
- public TableDataInfo list(HouseConfig houseConfig) {
- startPage();
- List<HouseConfig> list = houseConfigService.selectHouseConfigList(houseConfig);
- return getDataTable(list);
- }
- /**
- * 导出仓库配置列表
- */
- @ApiOperation("导出仓库配置列表")
- //@PreAuthorize("@ss.hasPermi('biz:houseConfig:export')")
- @Log(title = "仓库配置", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, HouseConfig houseConfig) {
- List<HouseConfig> list = houseConfigService.selectHouseConfigList(houseConfig);
- ExcelUtil<HouseConfig> util = new ExcelUtil<HouseConfig>(HouseConfig.class);
- util.exportExcel(response, list, "仓库配置数据");
- }
- /**
- * 获取仓库配置详细信息
- */
- @ApiOperation("获取仓库配置详细信息")
- //@PreAuthorize("@ss.hasPermi('biz:houseConfig:query')")
- @GetMapping(value = "/{houseId}")
- public AjaxResult getInfo(@PathVariable("houseId") Long houseId) {
- return success(houseConfigService.selectHouseConfigByHouseId(houseId));
- }
- /**
- * 新增仓库配置
- */
- @ApiOperation("新增仓库配置")
- //@PreAuthorize("@ss.hasPermi('biz:houseConfig:add')")
- @Log(title = "仓库配置", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody HouseConfig houseConfig) {
- return toAjax(houseConfigService.insertHouseConfig(houseConfig));
- }
- /**
- * 修改仓库配置
- */
- @ApiOperation("修改仓库配置")
- //@PreAuthorize("@ss.hasPermi('biz:houseConfig:edit')")
- @Log(title = "仓库配置", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody HouseConfig houseConfig) {
- return toAjax(houseConfigService.updateHouseConfig(houseConfig));
- }
- /**
- * 删除仓库配置
- */
- @ApiOperation("删除仓库配置")
- //@PreAuthorize("@ss.hasPermi('biz:houseConfig:remove')")
- @Log(title = "仓库配置", businessType = BusinessType.DELETE)
- @DeleteMapping("/{houseIds}")
- public AjaxResult remove(@PathVariable Long[] houseIds) {
- return toAjax(houseConfigService.deleteHouseConfigByHouseIds(houseIds));
- }
- @GetMapping("/deptTree")
- public AjaxResult deptTree() {
- Long deptId = SecurityUtils.getLoginUser().getDeptId();
- return success(deptService.selectDeptTreeList(deptId));
- }
- }
|