重庆 二级库 配件管理 bug修改
This commit is contained in:
parent
484714a665
commit
65040c2767
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue