From cc314e6b0e9d951e34aa08fe03b6c8d9e44e8599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Tue, 12 Oct 2021 23:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AF=BC=E5=87=BA=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86excel=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/SupplierController.java | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java index 1d9dc22b..24fa9c3c 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java @@ -208,57 +208,6 @@ public class SupplierController { return arr; } - /** - * 生成excel表格 - * @param supplier - * @param type - * @param phonenum - * @param telephone - * @param request - * @param response - * @return - */ - @GetMapping(value = "/exportExcel") - public void exportExcel(@RequestParam("supplier") String supplier, - @RequestParam("type") String type, - @RequestParam("phonenum") String phonenum, - @RequestParam("telephone") String telephone, - HttpServletRequest request, HttpServletResponse response) { - try { - List dataList = supplierService.findByAll(supplier, type, phonenum, telephone); - String[] names = {"名称", "类型", "联系人", "电话", "电子邮箱", "预收款", "期初应收", "期初应付", "备注", "传真", "手机", "地址", "纳税人识别号", "开户行", "账号", "税率", "状态"}; - String title = "信息报表"; - List objects = new ArrayList(); - if (null != dataList) { - for (Supplier s : dataList) { - String[] objs = new String[17]; - objs[0] = s.getSupplier(); - objs[1] = s.getType(); - objs[2] = s.getContacts(); - objs[3] = s.getPhoneNum(); - objs[4] = s.getEmail(); - objs[5] = s.getAdvanceIn() == null? "" : s.getAdvanceIn().toString(); - objs[6] = s.getBeginNeedGet() == null? "" : s.getBeginNeedGet().toString(); - objs[7] = s.getBeginNeedPay() == null? "" : s.getBeginNeedPay().toString(); - objs[8] = s.getDescription(); - objs[9] = s.getFax(); - objs[10] = s.getTelephone(); - objs[11] = s.getAddress(); - objs[12] = s.getTaxNum(); - objs[13] = s.getBankName(); - objs[14] = s.getAccountNumber(); - objs[15] = s.getTaxRate() == null? "" : s.getTaxRate().toString(); - objs[16] = s.getEnabled() ? "启用" : "禁用"; - objects.add(objs); - } - } - File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects); - ExportExecUtil.showExec(file, file.getName(), response); - } catch (Exception e) { - e.printStackTrace(); - } - } - /** * 导入excel表格 * @param file