From 2166b1661ca1e94fae6e4631799a9997418bff43 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期四, 26 六月 2025 11:40:37 +0800
Subject: [PATCH] 基础数据,产线,班次,班组

---
 src/main/java/org/jeecg/modules/base/controller/SupplierController.java |  302 +++++++++++++++++++++++++-------------------------
 1 files changed, 151 insertions(+), 151 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/base/controller/SupplierController.java b/src/main/java/org/jeecg/modules/base/controller/SupplierController.java
index 6ed75b9..32a2574 100644
--- a/src/main/java/org/jeecg/modules/base/controller/SupplierController.java
+++ b/src/main/java/org/jeecg/modules/base/controller/SupplierController.java
@@ -1,174 +1,174 @@
 package org.jeecg.modules.base.controller;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.base.entity.Supplier;
+import org.jeecg.modules.base.service.ISupplierService;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.base.entity.Supplier;
-import org.jeecg.modules.base.entity.SupplierCategory;
-import org.jeecg.modules.base.service.ISupplierCategoryService;
-import org.jeecg.modules.base.service.ISupplierService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Arrays;
-import java.util.List;
-
-/**
-* @Description: 渚涘簲鍟�
-* @Author: jeecg-boot
-* @Date:   2023-03-10
-* @Version: V1.0
-*/
-@Api(tags="渚涘簲鍟�")
+ /**
+ * @Description: 渚涘簲鍟嗙鐞�
+ * @Author: jeecg-boot
+ * @Date:   2025-06-24
+ * @Version: V1.0
+ */
+@Api(tags="渚涘簲鍟嗙鐞�")
 @RestController
-@RequestMapping("/eam/supplier")
+@RequestMapping("/base/supplier")
 @Slf4j
 public class SupplierController extends JeecgController<Supplier, ISupplierService> {
-    @Autowired
-    private ISupplierService inspectionProjectService;
-    @Autowired
-    private ISupplierCategoryService inspectionProjectCategoryService;
-
+	@Autowired
+	private ISupplierService supplierService;
+	
+	/**
+	 * 鍒嗛〉鍒楄〃鏌ヨ
+	 *
+	 * @param supplier
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "渚涘簲鍟嗙鐞�-鍒嗛〉鍒楄〃鏌ヨ")
+	@ApiOperation(value="渚涘簲鍟嗙鐞�-鍒嗛〉鍒楄〃鏌ヨ", notes="渚涘簲鍟嗙鐞�-鍒嗛〉鍒楄〃鏌ヨ")
+	@GetMapping(value = "/list")
+	public Result<IPage<Supplier>> queryPageList(Supplier supplier,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<Supplier> queryWrapper = QueryGenerator.initQueryWrapper(supplier, req.getParameterMap());
+		Page<Supplier> page = new Page<Supplier>(pageNo, pageSize);
+		IPage<Supplier> pageList = supplierService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   娣诲姞
+	 *
+	 * @param supplier
+	 * @return
+	 */
+	@AutoLog(value = "渚涘簲鍟嗙鐞�-娣诲姞")
+	@ApiOperation(value="渚涘簲鍟嗙鐞�-娣诲姞", notes="渚涘簲鍟嗙鐞�-娣诲姞")
+	//@RequiresPermissions("org.jeecg.modules:base_supplier:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody Supplier supplier) {
+		supplierService.save(supplier);
+		return Result.OK("娣诲姞鎴愬姛锛�");
+	}
+	
+	/**
+	 *  缂栬緫
+	 *
+	 * @param supplier
+	 * @return
+	 */
+	@AutoLog(value = "渚涘簲鍟嗙鐞�-缂栬緫")
+	@ApiOperation(value="渚涘簲鍟嗙鐞�-缂栬緫", notes="渚涘簲鍟嗙鐞�-缂栬緫")
+	//@RequiresPermissions("org.jeecg.modules:base_supplier:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody Supplier supplier) {
+		supplierService.updateById(supplier);
+		return Result.OK("缂栬緫鎴愬姛!");
+	}
+	
+	/**
+	 *   閫氳繃id鍒犻櫎
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "渚涘簲鍟嗙鐞�-閫氳繃id鍒犻櫎")
+	@ApiOperation(value="渚涘簲鍟嗙鐞�-閫氳繃id鍒犻櫎", notes="渚涘簲鍟嗙鐞�-閫氳繃id鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:base_supplier:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		supplierService.removeById(id);
+		return Result.OK("鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 *  鎵归噺鍒犻櫎
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "渚涘簲鍟嗙鐞�-鎵归噺鍒犻櫎")
+	@ApiOperation(value="渚涘簲鍟嗙鐞�-鎵归噺鍒犻櫎", notes="渚涘簲鍟嗙鐞�-鎵归噺鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:base_supplier:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.supplierService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("鎵归噺鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 * 閫氳繃id鏌ヨ
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "渚涘簲鍟嗙鐞�-閫氳繃id鏌ヨ")
+	@ApiOperation(value="渚涘簲鍟嗙鐞�-閫氳繃id鏌ヨ", notes="渚涘簲鍟嗙鐞�-閫氳繃id鏌ヨ")
+	@GetMapping(value = "/queryById")
+	public Result<Supplier> queryById(@RequestParam(name="id",required=true) String id) {
+		Supplier supplier = supplierService.getById(id);
+		if(supplier==null) {
+			return Result.error("鏈壘鍒板搴旀暟鎹�");
+		}
+		return Result.OK(supplier);
+	}
 
     /**
-     * 鍒嗛〉鍒楄〃鏌ヨ
-     *
-     * @param inspectionProject
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @ApiOperation(value="渚涘簲鍟�-鍒嗛〉鍒楄〃鏌ヨ", notes="渚涘簲鍟�-鍒嗛〉鍒楄〃鏌ヨ")
-    @GetMapping(value = "/list")
-    public Result<IPage<Supplier>> queryPageList(Supplier inspectionProject,
-                                                          @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-                                                          @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-                                                          HttpServletRequest req) {
-        QueryWrapper<Supplier> queryWrapper = QueryGenerator.initQueryWrapper(inspectionProject, req.getParameterMap());
-        Page<Supplier> page = new Page<Supplier>(pageNo, pageSize);
-        IPage<Supplier> pageList = inspectionProjectService.page(page, queryWrapper);
-        List<Supplier> records = pageList.getRecords();
-        for (Supplier record : records) {
-            String inspectionProjectTypeId = record.getSupplierCategoryId();
-            SupplierCategory inspectionProjectCategory = inspectionProjectCategoryService.getById(inspectionProjectTypeId);
-            if(inspectionProjectCategory != null ){
-                record.setSupplierCategoryNumName(inspectionProjectCategory.getNum()+"/"+ inspectionProjectCategory.getName());
-            }else{
-                record.setSupplierCategoryNumName("/");
-            }
-
-        }
-        return Result.OK(pageList);
-    }
-
-    /**
-     *   娣诲姞
-     *
-     * @param inspectionProject
-     * @return
-     */
-    @AutoLog(value = "渚涘簲鍟�-娣诲姞")
-    @ApiOperation(value="渚涘簲鍟�-娣诲姞", notes="渚涘簲鍟�-娣诲姞")
-    @PostMapping(value = "/add")
-    public Result<String> add(@RequestBody Supplier inspectionProject) {
-        inspectionProjectService.save(inspectionProject);
-        return Result.OK("娣诲姞鎴愬姛锛�");
-    }
-
-    /**
-     *  缂栬緫
-     *
-     * @param inspectionProject
-     * @return
-     */
-    @AutoLog(value = "渚涘簲鍟�-缂栬緫")
-    @ApiOperation(value="渚涘簲鍟�-缂栬緫", notes="渚涘簲鍟�-缂栬緫")
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-    public Result<String> edit(@RequestBody Supplier inspectionProject) {
-        inspectionProjectService.updateById(inspectionProject);
-        return Result.OK("缂栬緫鎴愬姛!");
-    }
-
-    /**
-     *   閫氳繃id鍒犻櫎
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "渚涘簲鍟�-閫氳繃id鍒犻櫎")
-    @ApiOperation(value="渚涘簲鍟�-閫氳繃id鍒犻櫎", notes="渚涘簲鍟�-閫氳繃id鍒犻櫎")
-    @DeleteMapping(value = "/delete")
-    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-        Supplier inspectionProject = inspectionProjectService.getById(id);
-        inspectionProject.setDelFlag(1);
-        inspectionProjectService.updateById(inspectionProject);
-        return Result.OK("鍒犻櫎鎴愬姛!");
-    }
-
-    /**
-     *  鎵归噺鍒犻櫎
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "渚涘簲鍟�-鎵归噺鍒犻櫎")
-    @ApiOperation(value="渚涘簲鍟�-鎵归噺鍒犻櫎", notes="渚涘簲鍟�-鎵归噺鍒犻櫎")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-        List<String> idList = Arrays.asList(ids.split(","));
-        for (String id : idList) {
-            Supplier inspectionProject = inspectionProjectService.getById(id);
-            inspectionProject.setDelFlag(1);
-            inspectionProjectService.updateById(inspectionProject);
-        }
-        return Result.OK("鎵归噺鍒犻櫎鎴愬姛!");
-    }
-
-    /**
-     * 閫氳繃id鏌ヨ
-     *
-     * @param id
-     * @return
-     */
-    @ApiOperation(value="渚涘簲鍟�-閫氳繃id鏌ヨ", notes="渚涘簲鍟�-閫氳繃id鏌ヨ")
-    @GetMapping(value = "/queryById")
-    public Result<Supplier> queryById(@RequestParam(name="id",required=true) String id) {
-        Supplier inspectionProject = inspectionProjectService.getById(id);
-        if(inspectionProject==null) {
-            return Result.error("鏈壘鍒板搴旀暟鎹�");
-        }
-        return Result.OK(inspectionProject);
-    }
-
-    /**
-     * 瀵煎嚭excel
-     *
-     * @param request
-     * @param inspectionProject
-     */
+    * 瀵煎嚭excel
+    *
+    * @param request
+    * @param supplier
+    */
+    //@RequiresPermissions("org.jeecg.modules:base_supplier:exportXls")
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, Supplier inspectionProject) {
-        return super.exportXls(request, inspectionProject, Supplier.class, "mom_base_supplier");
+    public ModelAndView exportXls(HttpServletRequest request, Supplier supplier) {
+        return super.exportXls(request, supplier, Supplier.class, "渚涘簲鍟嗙鐞�");
     }
 
     /**
-     * 閫氳繃excel瀵煎叆鏁版嵁
-     *
-     * @param request
-     * @param response
-     * @return
-     */
+      * 閫氳繃excel瀵煎叆鏁版嵁
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("base_supplier:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, Supplier.class);

--
Gitblit v1.9.3