|
@@ -1,16 +1,20 @@
|
|
|
package org.dromara.commodityManagement.controller;
|
|
|
-
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.dromara.commodityManagement.domain.bo.OemBo;
|
|
|
import org.dromara.commodityManagement.domain.vo.OemVo;
|
|
|
import org.dromara.commodityManagement.service.OemService;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
import org.dromara.common.web.core.BaseController;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
/**
|
|
|
* 花型号管理接口
|
|
|
*/
|
|
@@ -57,4 +61,22 @@ public class OemController extends BaseController {
|
|
|
public R<Void> deleteOemByIds(@PathVariable Long[] oemIds) {
|
|
|
return toAjax(oemService.deleteOemByIds(oemIds));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据花型号Ids导出Excel
|
|
|
+ * @param response 响应对象
|
|
|
+ */
|
|
|
+ @GetMapping("/exportExcelByIds")
|
|
|
+ public void exportOemExcel(@RequestParam("ids") Long[] oemIds, HttpServletResponse response) {
|
|
|
+ ExcelUtil.exportTemplate(CollUtil.newArrayList(new HashMap<>(),oemService.selectOemList(oemIds)),"花型号列表.xlsx","excel/花型号导出模板.xlsx",response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过Excel导出所有花型号数据
|
|
|
+ * @param response 响应对象
|
|
|
+ */
|
|
|
+ @GetMapping("/exportExcel")
|
|
|
+ public void exportOemExcel(HttpServletResponse response) {
|
|
|
+ ExcelUtil.exportTemplate(CollUtil.newArrayList(new HashMap<>(),oemService.selectList()),"花型号列表.xlsx","excel/花型号导出模板.xlsx",response);
|
|
|
+ }
|
|
|
}
|