去除供应商类型多余代码

This commit is contained in:
liuminghui
2026-10-28 17:14:42 +08:00
parent 2bd417b84e
commit 1e4711326c
19 changed files with 159 additions and 948 deletions
@@ -1,117 +0,0 @@
package com.bms.web.controller.data;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bms.common.annotation.Log;
import com.bms.common.core.controller.BaseController;
import com.bms.common.core.domain.AjaxResult;
import com.bms.common.core.page.TableDataInfo;
import com.bms.common.enums.BusinessType;
import com.bms.common.utils.poi.ExcelUtil;
import com.bms.system.domain.BmsSupplierType;
import com.bms.system.service.IBmsSupplierTypeService;
/**
* 数据管理:供应商类型
*
* @author bms
*/
@RestController
@RequestMapping("/data/supplierType")
public class BmsSupplierTypeController extends BaseController
{
@Autowired
private IBmsSupplierTypeService supplierTypeService;
/**
* 分页查询。名称模糊、状态精确。
*/
@PreAuthorize("@ss.hasPermi('data:supplierType:list')")
@GetMapping("/list")
public TableDataInfo list(BmsSupplierType query)
{
startPage();
List<BmsSupplierType> list = supplierTypeService.selectList(query);
return getDataTable(list);
}
/**
* 按当前查询条件导出
*/
@Log(title = "供应商类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('data:supplierType:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, BmsSupplierType query)
{
List<BmsSupplierType> list = supplierTypeService.selectList(query);
ExcelUtil<BmsSupplierType> util = new ExcelUtil<BmsSupplierType>(BmsSupplierType.class);
util.exportExcel(response, list, "供应商类型");
}
/**
* 查询详情
*/
@PreAuthorize("@ss.hasPermi('data:supplierType:query')")
@GetMapping("/{typeId}")
public AjaxResult getInfo(@PathVariable Long typeId)
{
return success(supplierTypeService.selectById(typeId));
}
/**
* 新增
*/
@PreAuthorize("@ss.hasPermi('data:supplierType:add')")
@Log(title = "供应商类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BmsSupplierType row)
{
row.setCreateBy(getUsername());
return toAjax(supplierTypeService.insert(row));
}
/**
* 修改
*/
@PreAuthorize("@ss.hasPermi('data:supplierType:edit')")
@Log(title = "供应商类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BmsSupplierType row)
{
row.setUpdateBy(getUsername());
return toAjax(supplierTypeService.update(row));
}
/**
* 启用或停用
*/
@PreAuthorize("@ss.hasPermi('data:supplierType:changeStatus')")
@Log(title = "供应商类型", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody BmsSupplierType row)
{
row.setUpdateBy(getUsername());
return toAjax(supplierTypeService.changeStatus(row));
}
/**
* 删除
*/
@PreAuthorize("@ss.hasPermi('data:supplierType:remove')")
@Log(title = "供应商类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{typeIds}")
public AjaxResult remove(@PathVariable Long[] typeIds)
{
return toAjax(supplierTypeService.deleteByIds(typeIds));
}
}