|
@@ -1,15 +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.CraftBo;
|
|
|
import org.dromara.commodityManagement.domain.vo.CraftVo;
|
|
|
import org.dromara.commodityManagement.service.CraftService;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
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 org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
/**
|
|
|
* 工艺管理接口
|
|
|
*/
|
|
@@ -56,4 +61,22 @@ public class CraftController extends BaseController {
|
|
|
public R<Void> deleteCraftByIds(@PathVariable Long[] craftIds) {
|
|
|
return toAjax(craftService.deleteCraftByIds(craftIds));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据工艺Ids导出Excel
|
|
|
+ * @param response 响应对象
|
|
|
+ */
|
|
|
+ @GetMapping("/exportExcelByIds")
|
|
|
+ public void exportCraftExcel(@RequestParam("ids") Long[] craftIds , HttpServletResponse response) {
|
|
|
+ ExcelUtil.exportTemplate(CollUtil.newArrayList(new HashMap<>(), craftService.selectCraftListByIds(craftIds)),"工艺列表.xlsx","excel/工艺导出模板.xlsx",response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过Excel导出工艺数据
|
|
|
+ * @param response 响应对象
|
|
|
+ */
|
|
|
+ @GetMapping("/exportExcel")
|
|
|
+ public void exportCraftExcel(HttpServletResponse response) {
|
|
|
+ ExcelUtil.exportTemplate(CollUtil.newArrayList(new HashMap<>(), craftService.selectCraftList()),"工艺列表.xlsx","excel/工艺导出模板.xlsx",response);
|
|
|
+ }
|
|
|
}
|