From 65040c2767c69aa7215c01e0fdb91ea6e69f667f Mon Sep 17 00:00:00 2001 From: 76164 <761646706@qq.com> Date: Tue, 6 Aug 2024 11:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=BA=86=20=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=E5=BA=93=20=E9=85=8D=E4=BB=B6=E7=AE=A1=E7=90=86=20bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/MaPartTypeServiceImpl.java | 17 +++++++++++------ .../claimAndRefund/secondStore/secondStore.vue | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java index fbf5648d..4c63c045 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java @@ -5,6 +5,7 @@ import com.bonus.sgzb.base.mapper.MaPartTypeMapper; import com.bonus.sgzb.base.service.IPartTypeService; import com.bonus.sgzb.common.core.constant.UserConstants; import com.bonus.sgzb.common.core.utils.StringUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; @@ -26,6 +27,7 @@ import java.util.*; * @author makejava * @since 2023-11-27 16:44:20 */ +@Slf4j @Service("maPartTypeService") public class MaPartTypeServiceImpl implements IPartTypeService { @@ -118,15 +120,17 @@ public class MaPartTypeServiceImpl implements IPartTypeService { @Override public void downLoadTemplate(HttpServletResponse response) throws IOException { //模板名称 + String templateName = "template.xlsx"; OutputStream out = null; InputStream input =null; try { - ApplicationHome h = new ApplicationHome(getClass()); - String dirPath = h.getSource().toString(); - String fileName = dirPath+"/template/"+templateName; - File outFile = new File(fileName); - input = new BufferedInputStream(new FileInputStream(outFile)); +// ApplicationHome h = new ApplicationHome(getClass()); +// String dirPath = h.getSource().toString(); +// String fileName = dirPath+"/template/"+templateName; +// File outFile = new File(fileName); +// input = new BufferedInputStream(new FileInputStream(outFile)); + input = this.getClass().getClassLoader().getResourceAsStream("template/template.xlsx"); response.setCharacterEncoding("UTF-8"); response.setHeader("content-Type", "application/vnd.ms-excel"); response.setHeader("Content-Disposition", @@ -140,7 +144,8 @@ public class MaPartTypeServiceImpl implements IPartTypeService { out.write(buffer, 0, bytesToRead); } } catch (IOException e) { - throw new IOException("模板下载失败"); + log.error(e.getMessage()); +// throw new IOException("模板下载失败"); } finally { IOUtils.closeQuietly(input); IOUtils.closeQuietly(out); diff --git a/sgzb-ui/src/views/claimAndRefund/secondStore/secondStore.vue b/sgzb-ui/src/views/claimAndRefund/secondStore/secondStore.vue index 4b0cc22a..4890ef0e 100644 --- a/sgzb-ui/src/views/claimAndRefund/secondStore/secondStore.vue +++ b/sgzb-ui/src/views/claimAndRefund/secondStore/secondStore.vue @@ -827,7 +827,7 @@ export default { operate(param).then((response) => { this.$modal.msgSuccess('操作成功') this.openOut = false - this.getList() + this.getList(this.leaseType) }) } }) @@ -848,7 +848,7 @@ export default { operate(param).then((response) => { this.$modal.msgSuccess('操作成功') this.openIn = false - this.getList() + this.getList(this.leaseType) }) } })