|
|
@@ -0,0 +1,115 @@
|
|
|
+package com.xingxi.web.controller.master.product.controller;
|
|
|
+
|
|
|
+import com.xingxi.common.annotation.Log;
|
|
|
+import com.xingxi.common.core.controller.BaseController;
|
|
|
+import com.xingxi.common.core.domain.AjaxResult;
|
|
|
+import com.xingxi.common.core.page.TableDataInfo;
|
|
|
+import com.xingxi.common.enums.BusinessType;
|
|
|
+import com.xingxi.common.utils.poi.ExcelUtil;
|
|
|
+import com.xingxi.master.product.domain.ProdVendor;
|
|
|
+import com.xingxi.master.product.service.IProdVendorService;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 商品供应商Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2025-03-09
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping("/system/product/vendor")
|
|
|
+public class ProdVendorController extends BaseController {
|
|
|
+ private final String prefix = "system/product/vendor";
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProdVendorService prodVendorService;
|
|
|
+
|
|
|
+ @RequiresPermissions("system:product:vendor:view")
|
|
|
+ @GetMapping()
|
|
|
+ public String vendor() {
|
|
|
+ return prefix + "/vendor";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询商品供应商列表
|
|
|
+ */
|
|
|
+ @RequiresPermissions("system:product:vendor:list")
|
|
|
+ @PostMapping("/list")
|
|
|
+ @ResponseBody
|
|
|
+ public TableDataInfo list(ProdVendor prodVendor) {
|
|
|
+ startPage();
|
|
|
+ List<ProdVendor> list = prodVendorService.selectProdVendorList(prodVendor);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出商品供应商列表
|
|
|
+ */
|
|
|
+ @RequiresPermissions("system:product:vendor:export")
|
|
|
+ @Log(title = "商品供应商", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult export(ProdVendor prodVendor) {
|
|
|
+ List<ProdVendor> list = prodVendorService.selectProdVendorList(prodVendor);
|
|
|
+ ExcelUtil<ProdVendor> util = new ExcelUtil<>(ProdVendor.class);
|
|
|
+ return util.exportExcel(list, "商品供应商数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增商品供应商
|
|
|
+ */
|
|
|
+ @GetMapping("/add")
|
|
|
+ public String add() {
|
|
|
+ return prefix + "/add";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增保存商品供应商
|
|
|
+ */
|
|
|
+ @RequiresPermissions("system:product:vendor:add")
|
|
|
+ @Log(title = "商品供应商", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/add")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult addSave(ProdVendor prodVendor) {
|
|
|
+ return toAjax(prodVendorService.insertProdVendor(prodVendor));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改商品供应商
|
|
|
+ */
|
|
|
+ @RequiresPermissions("system:product:vendor:edit")
|
|
|
+ @GetMapping("/edit/{prodVendorId}")
|
|
|
+ public String edit(@PathVariable("prodVendorId") Long prodVendorId, ModelMap mMap) {
|
|
|
+ ProdVendor prodVendor = prodVendorService.selectProdVendorByProdVendorId(prodVendorId);
|
|
|
+ mMap.put("prodVendor", prodVendor);
|
|
|
+ return prefix + "/edit";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改保存商品供应商
|
|
|
+ */
|
|
|
+ @RequiresPermissions("system:product:vendor:edit")
|
|
|
+ @Log(title = "商品供应商", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/edit")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult editSave(ProdVendor prodVendor) {
|
|
|
+ return toAjax(prodVendorService.updateProdVendor(prodVendor));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除商品供应商
|
|
|
+ */
|
|
|
+ @RequiresPermissions("system:product:vendor:remove")
|
|
|
+ @Log(title = "商品供应商", businessType = BusinessType.DELETE)
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult remove(String ids) {
|
|
|
+ return toAjax(prodVendorService.deleteProdVendorByProdVendorIds(ids));
|
|
|
+ }
|
|
|
+}
|